TruthLens 檢測模型

供 TruthLens 使用的端上推論模型。 全部推論在瀏覽器內完成(onnxruntime-web,WASM/WebGPU),文件內容不上傳。

托管於此而非 GitHub Releases 的原因:GitHub Releases 的資產不回 access-control-allow-origin,瀏覽器 fetch() 會被 CORS 阻擋。

mbert_detector_int8.onnx(129 MiB)

多語言 AI 內容偵測器。底座 distilbert-base-multilingual-cased(104 語言, WordPiece),以 HC3 英文 + 中文微調,INT8 量化。

語言 真人均值 AI 均值 AUC 命中率 誤傷率
中文 0.076 1.000 1.000 100.0% 7.5%
英文 0.040 1.000 1.000 100.0% 3.3%

分布外(非 HC3 手寫樣本)4 題對 3:中文真人 ✓、中文 AI 制式文 0.994 ✓、 英文真人 ✓、英文 AI 論說文 0.004 ✗(HC3 英文為問答體,論說文屬體裁外推)。

  • tokenizer:bert-wordpiece(mbert_detector_tokenizer.json)
  • AI 類別索引:1(id2label = {0: human, 1: ai})
  • 輸入:input_ids、attention_mask
  • 驗證集:accuracy 0.984 / precision 0.969 / recall 0.999 / F1 0.983

分布內的 AUC 1.000 是同分布的樂觀值,不是上線後的預期表現。 訓練語料為 HC3(2022 年 ChatGPT 世代),對 2026 年的模型輸出未經驗證。

qwen05b_ppl_int8.onnx(488 MiB)

多語言困惑度模型,取代 DistilGPT2。轉檔來源 onnx-community/Qwen2.5-0.5B 的 onnx/model_int8.onnx。

DistilGPT2 只在英文語料上訓練,對中文量到的是 UTF-8 位元組的可預測性, 不是語言的可預測性:

模型 中文 AUC 英文 AUC
DistilGPT2 0.50(毫無鑑別力) 0.996
Qwen2.5-0.5B 0.965 0.988

門檻以本 INT8 產物量測(量化會位移困惑度尺度,fp32 的值不能沿用), 偽陽性預算 5%:

語言 真人中位數 AI 中位數 aiCut humanCut 命中率 誤傷率
中文 56.3 9.2 11.19 18.67 75.0% 5.0%
英文 30.6 4.9 11.45 11.45 100% 2.5%

執行需求(transformers.js 建置會把 KV cache 攤成獨立輸入):

  • position_ids:需要
  • past_key_values.{0..23}.key / .value:24 層、kv_heads 2、head_dim 64
  • 空張量形狀 [batch, 2, 0, 64],dtype float32

重現方式

cd training
.venv/bin/python evaluate_detector.py                    # 偵測器逐語言評測
.venv/bin/python calibrate_perplexity.py                 # DistilGPT2 門檻
.venv/bin/python calibrate_multilingual_ppl.py --onnx ... # 多語模型門檻

授權與資料來源

模型權重 Apache-2.0。微調資料為 HC3(Hello-SimpleAI),研究用途。

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support