Downloads · 30 days
38
18% of all-time downloads
DarrenJiaImbue/gemma-4-e2b-ai-text-detector-v2
gemma-4-e2b-ai-text-detector-v2 is a machine learning model from DarrenJiaImbue. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as cc-by-nc-sa-4.0.
QAT-LoRA + linear-probe classifier on google/gemma-4-E2B-it-qat-mobile-transformers for AI-text detection. Quantization-aware trained (int8 activations + int8 KV cache) so runtime accuracy matches the unquantized model.
Downloads · 30 days
38
18% of all-time downloads
All-time downloads
212
Public
Repo size
2.2 GB
Likes
0
Public
Click a slice to open those files.
.litertlm2.2 GB · 100%
From the Hugging Face model README
QAT-LoRA + linear-probe classifier on google/gemma-4-E2B-it-qat-mobile-transformers
for AI-text detection. Quantization-aware trained (int8 activations + int8 KV cache)
so runtime accuracy matches the unquantized model.
v2 change: the int8 KV-cache fake-quant during training is now applied to the
post-RoPE, post-norm K/V — the exact tensors the runtime caches (v1 quantized the
pre-RoPE k_proj output, the wrong tensor). This fixes score calibration on short text:
v1 could over-flag short inputs on-device; v2 restores clean separation
(human mean score ≈0.05, AI mean ≈0.99). The base model.litertlm platform is
unchanged and byte-identical to v1 — only lora_adapter.tflite and head.tflite
differ.
model.litertlm (2.2 GB) — base bundle: quantized weights equivalent to
litert-community/gemma-4-E2B-it-litert-lm, int8 composite KV cache, static int8
activations, 200 LoRA input sockets, activations decode output.lora_adapter.tflite (11 MB) — trained detector LoRA (attention q/k/v/o, r=8).head.tflite (41 KB) — linear-probe classifier: [1,1536] activations -> 4 bucket logits.ARCHITECTURE.md — signature/socket spec + runtime integration notes.Measured with the training-time fake-quant proxy that mirrors the runtime's int8 arithmetic (static int8 activations on 275 FC modules + post-RoPE int8 K/V on all layers), which matches observed on-device behavior.
activations -> head.tflite -> softmax ->
score = p·[0,1,2,3]/3. score ≥ 0.596 → AI. Calibrate the threshold on your own
runtime scores if your preprocessing differs.Four sample texts, scored with the post-RoPE proxy (compare directly against device):
| text | score | label |
|---|---|---|
| "This is a brutal but clear bet on an AI-first operating model…" | 0.9997 | AI |
| "Every decision carries consequences, whether positive or negative…" | 0.9947 | AI |
| "This is the canary. You're one of the first CEOs to say…" | 0.2879 | human-leaning |
| "Hard to ignore the shift here. Most CEOs wait until the numbers…" | 0.9807 | AI |
CC BY-NC-SA 4.0. Non-commercial research use only.