text-classification · 125.86 MB WASM q8 · RoBERTa-base (125M) · RAID Benchmark · MIT

TMR AI-Text Detector — Client-Side AI vs Human Prose Stylometry

Oxidane/tmr-ai-text-detector (served via onnx-community/tmr-ai-text-detector-ONNX , MIT) is a 12-layer RoBERTa-base classifier (125M params, 125.86 MB q8 WASM, 512 max BPE tokens) trained on 50k RAID benchmark samples with Focal Loss and Self-Hard-Negative mining to estimate synthetic vs human stylometric probability in your browser.

Upstream Model Oxidane/tmr-ai-text-detector
ONNX Artifact onnx-community/tmr-ai-text-detector-ONNX
Pipeline Task text-classification
Size & Quant 125.86 MB · WASM q8
Classes (id2label) 0: human · 1: ai
License & Context MIT · 512 BPE tokens
Honest Provenance Caveat: Automated AI text detectors measure statistical stylometry learned from English RAID domains (news, books, abstracts, reviews, recipes, Wikipedia, poetry, Reddit) — NEVER proof of authorship or misconduct. Short snippets (<64 words), non-native (ESL) formal writing, and legal boilerplate carry elevated false-positive risk, while heavily edited or casually prompted outputs can evade detection.

1. Live Client-Side AI vs Human Stylometry Desk

Choose a curated prose preset, drag & drop or paste (Ctrl/Cmd+V) text, or type your own passage:

Drop a .txt, .md, .csv, or .json file here, or press Ctrl/Cmd+V anywhere outside editable fields. All inference runs locally in a Web Worker.
Inference latency–
AI Margin P(AI)−P(Hum)–
Shannon entropy–
BPE tokens / words–
Burstiness (CV) / TTR–
NaN score check–
Backend / dtypeWASM · q8

2-Class Provenance Probability

Awaiting inference
Initialize the model above to compute live probabilities.

Logit Margin & Stylometric Breakdown

Shows live log-odds margin ln(P(AI)/P(Human)), binary Shannon entropy (0.000 = confident, 1.000 = 50/50 split), sentence-length burstiness CV, and lexical type-token ratio (TTR).

2. How TMR (Target Mining RoBERTa) Works in Browser

Oxidane/tmr-ai-text-detector fine-tunes 12-layer roberta-base with Focal Loss (gamma=2.0, alpha=[0.85, 0.15]) and iterative Self-Hard-Negative mining — repeatedly retraining on human samples that the previous checkpoint misflagged as AI to suppress false positives on the RAID benchmark.

import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";

const detector = await pipeline(
  "text-classification",
  "onnx-community/tmr-ai-text-detector-ONNX",
  { device: "wasm", dtype: "q8" }
);
const scores = await detector("Your prose passage here...", { top_k: 2 });
Show the code · worker.js — classify() (125.86 MB q8 WASM worker)
Show the code · tmr-detector-core.mjs — normalizeScores() (margin, entropy & NaN check)