{"slug": "detectorscope-ai-text-detectors-that-show-their-work", "title": "DetectorScope: AI text detectors that show their work", "summary": "Google DeepMind researchers released DetectorScope, an open-source Python package that converts black-box AI text detectors into auditable models whose predictions are a sum of named, validated features, installable via `pip install detectorscope`. In an example run, the detector labeled a sample text 'ai' with p_ai=0.88, attributing +0.23 importance to 'the word about used as a preposition' and +0.14 to 'repeated phrases or sequences in text'. The pipeline uses sparse autoencoders on the detector's residual stream with a sparse linear head over validated features, and the authors report on the COLING F1 and RAID TPR-at-5%-FPR benchmarks that the auditable detectors stay close to the fine-tuned black-box classifiers they are built on; the work will appear at EMNLP 2026 in Budapest, Hungary.", "body_md": "**AI text detectors that show their work.**\n\nDetectorScope turns a black-box AI text detector into one whose every prediction is a sum of named, validated features. It can tell you which properties of a text made it predict \"AI\" and where in the text they are located.\n\n  Try our demo! **🤗 https://huggingface.co/spaces/liamdugan/detector-scope-demo**\n\n| **Installation** \n\n```\npip install detectorscope\n```\n\n | \n| Example Usage | \n|---|\n| \n\n``` python\nfrom detectorscope import AuditableDetector\n\n# Load the AI detector\ndetector = AuditableDetector.from_pretrained(\n  \"liamdugan/detector-scope\"\n)\n\n# Run the AI detector on some input\noutput = detector(\n  \"Like I said, this is about accuracy, about speed, and about cost.\"\n)\n\n# Print the results\nprint(output)\n```\n\n  | \n| Output | \n| \n\n```\nDetection(label='ai', p_ai=0.88, features=[\n  Feature(importance=+0.23, description='the word about used as a preposition'),\n  Feature(importance=+0.14, description='repeated phrases or sequences in text'),\n  Feature(importance=-0.05, description='conversational filler phrase like i said'),\n  ...])\n```\n\n  | \n\nUsing DetectorScope you can:\n\n- 🔍 **Query a strong AI detector** that is transparent about the features it uses\n- 🖱️ **Hover over the text** to see the specific \"AI Phrases\" the detector is using\n- 🔁 **Convert your own black-box detector** into an auditable one by using our pipeline\n- 🎓 **Analyze LLM Outputs** so that you understand which models have which tendencies\n\n- **[25 Oct 2026]** DetectorScope will appear at EMNLP 2026 in Budapest, Hungary!\n\n*The pipeline: SAEs on the detector's residual stream, a description and validation score per feature, a threshold on that score, and a sparse head over the features that pass.*\n\nA DetectorScope detector is a concept bottleneck over interpretable sparse-autoencoder features: the language model's residual stream is encoded by SAEs, each feature gets a natural-language description that is validated against its own activations, and a sparse linear head over the validated features makes the decision. The prediction is therefore a sum of per-feature contributions, and every contribution has a description and a location in the text.\n\n*F1 (COLING) and TPR at 5% FPR (RAID) against the interpretability threshold, in domain (grey) and out of domain (white). FT-Model+SAE matches the underlying neural detector even at thresholds of 0.7 and above.*\n\nAcross both benchmarks applying our auditable pipeline has minimal adverse effects on performance. The auditable detectors stay close to the fine-tuned\nblack-box classifier they are built on. The full tables are in the\n[paper](https://arxiv.org/abs/2610.30006).\n\nFrom PyPI, in a fresh environment:\n\n```\npython -m venv .venv && source .venv/bin/activate\npip install detectorscope\n```\n\nFrom source, with the extras for the pipeline, the experiments and the demo:\n\n```\ngit clone https://github.com/google-deepmind/detectorscope && cd detectorscope\npip install -e \".[all]\"\n```\n\nAny released detector loads by its Hub id; the other settings of a repo are its branches.\n\n``` python\nfrom detectorscope import AuditableDetector\n\ndetector = AuditableDetector.from_pretrained(\"liamdugan/detector-scope-peer-review-gpt4o\")\ndetector = AuditableDetector.from_pretrained(\"liamdugan/detector-scope\", revision=\"base-sae\")\n```\n\n`detector(text)` returns a `Detection` with `label`, `p_ai`, `logit`, `bias` and\n`features`, every feature active in the text with a non-zero effect, largest\nfirst. `importance` is how much the logit falls if the feature is silenced,\nand `logit == bias + sum(importances)`. A list of texts returns a list.\n\nSet `return_highlights=True` to see where each feature is localized within the text:\n\n```\noutput = detector(text, return_highlights=True)\noutput.tokens                   # the text as tokens\noutput.features[0].highlights   # [(token index, activation), ...]\n```\n\nYou can use the `tau` parameter to control the tradeoff between\ninterpretability and accuracy. Every feature has an auto-interpretation score,\nhow well its description predicts where it fires, and `tau` is the score a\nfeature must reach before the head is allowed to use it. A higher `tau` gives\nthe head fewer, better-described features, so every item of evidence it reports\nis one you can read and check, at some cost in accuracy. A lower `tau` admits\nmore features, including ones whose descriptions are loose, and the detector\ngets more accurate and less legible. The default is 0.85.\n\n```\ndetector = AuditableDetector.from_pretrained(\"liamdugan/detector-scope\", tau=0.95)\n```\n\n`tau` runs from 0.00 (every feature) to 0.95 in steps of 0.05, and each branch\ncarries a head at every step, so changing it downloads nothing. It can also be\nset per call, which is the easiest way to compare the same text at several\nsettings:\n\n```\noutput = detector(text, tau=0.50)   # more features, higher accuracy\noutput = detector(text, tau=0.95)   # the few best-described features\ndetector.heads                      # every (head, tau) pair the repo holds\n```\n\n`head=\"xgboost\"`, on `from_pretrained` or on the call, selects the gradient-boosted\nhead at the same `tau` instead of the logistic-regression one.\n\nWe provide the following model collections for download via [Huggingface](https://huggingface.co/collections/liamdugan/detector-scope-6ad9ea7de8657f7da766b2b5):\n\n| Repo | Domain and data | \n|---|---|\n| [`detector-scope`](https://huggingface.co/liamdugan/detector-scope) | open domain: the COLING 2025 GenAI Detection shared task (news, essays, reviews and more; 40 generators) | \n| [`detector-scope-peer-review-gpt4o`](https://huggingface.co/liamdugan/detector-scope-peer-review-gpt4o) | closed domain: machine-learning peer reviews, human vs. GPT-4o (the AI Peer Review Detection Benchmark) | \n| [`detector-scope-peer-review-llama`](https://huggingface.co/liamdugan/detector-scope-peer-review-llama) | closed domain: the same reviews, human vs. Llama | \n\nEach repo holds the paper's three settings as branches. `ft-model-sae` fine-tunes\nGemma-2-2b as a classifier and fine-tunes the SAEs on it; `ft-sae` keeps the\nunmodified Gemma-2-2b and fine-tunes only the SAEs; `base-sae` keeps both the\nunmodified Gemma-2-2b and the unmodified Gemma Scope SAEs. `main` is the setting\nthat performed best on each domain: `ft-sae` for the open domain, `ft-model-sae`\nfor peer reviews. Every branch bundles its language model, so nothing else is\ndownloaded and no licence gate is involved.\n\nThe defaults are set by hand: the logistic-regression head over features whose auto-interpretation score is at least 0.85, with the decision threshold fixed on the development split. Each branch also carries the XGBoost head and both heads at every other threshold.\n\nThe pipeline that builds a detector is the package's stages, run as\n`python -m detectorscope.<stage>`: `finetune` (the classifier), `train_sae`\n(SAEs on its residual stream), `data.extract` and `data.process` (per-token\nactivations, per-document caches, log-odds ratios, feature statistics),\n`autointerpret` (descriptions and their validation, through Gemini; set\n`GEMINI_API_KEY`), `model.detectors.heads.training.train_logreg` /\n`train_xgboost` (the heads) and `evaluate`. Stages 0 to 2 need a GPU; the rest\nruns on CPUs.\n\nThe experiments are four scripts under `scripts/`: `hparam_sweep.py` (the SGD +\nL1 grid search), `counterfactual_ablation.py` (zero-ablation vs. targeted\nparaphrase of single features), `paraphrase_ablation.py` (the feature-guided\nparaphrase attack) and `regex_recall_ablation.py` (regex recall of the\ndescriptions). Every figure and table of the paper comes from\n`scripts/visualization/analysis.ipynb`, and `--help` on any script lists its\narguments.\n\n`demo/` is the Gradio app, which runs locally with `python demo/app.py` and as\nthe Hugging Face Space; `scripts/huggingface_hub/` exports the detectors to the Hub and\npublishes the Space.\n\n```\n@inproceedings{dugan-etal-2026-building,\n    title = \"Building Auditable {AI} Text Detectors with Sparse Autoencoders\",\n    author = \"Dugan, Liam  and\n      McDougall, Callum Stuart  and\n      Denton, Matthew  and\n      Pham, Philip  and\n      Kaeser-Chen, Christine  and\n      Callison-Burch, Chris\",\n    booktitle = \"Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing\",\n    month = oct,\n    year = \"2026\",\n    address = \"Budapest, Hungary\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2026.emnlp-main.762/\",\n    pages = \"17640--17689\",\n    ISBN = \"979-8-89176-459-0\",\n}\n```\n\nThis research was developed with funding from the Defense Advanced Research Projects Agency's (DARPA) SciFy program (Agreement No. HR00112520300) and is based upon work supported in part by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via 56000026C0019 (the BENGAL program). The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies, either expressed or implied, of DARPA, ODNI, IARPA, the Department of Defense, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright annotation therein.\n\nThe detectors are research artifacts released to support the paper. They make mistakes, including on text written by people, and their accuracy outside the domains and generators they were trained on is not established. They must not be used as the basis for decisions about individuals, such as academic integrity, hiring or publication decisions, and the authors and Google accept no liability for any use of them. This is not an official Google product.\n\nCopyright 2026 Google LLC. The software is licensed under the Apache License, Version 2.0; all other materials under the Creative Commons Attribution 4.0 International License (CC-BY). Both are distributed on an \"AS IS\" basis, without warranties or conditions of any kind; see the licenses for the governing language. Adapted third-party code carries its licence in the header of the module that contains it.", "url": "https://wpnews.pro/news/detectorscope-ai-text-detectors-that-show-their-work", "canonical_source": "https://github.com/google-deepmind/detectorscope", "published_at": "2026-10-24 15:13:07+00:00", "updated_at": "2026-10-24 15:41:51.429318+00:00", "lang": "en", "topics": ["ai-safety", "ai-research", "ai-tools", "large-language-models", "developer-tools"], "entities": ["Google DeepMind", "DetectorScope", "EMNLP 2026", "Hugging Face", "PyPI", "COLING", "RAID"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/detectorscope-ai-text-detectors-that-show-their-work", "markdown": "https://wpnews.pro/news/detectorscope-ai-text-detectors-that-show-their-work.md", "text": "https://wpnews.pro/news/detectorscope-ai-text-detectors-that-show-their-work.txt", "jsonld": "https://wpnews.pro/news/detectorscope-ai-text-detectors-that-show-their-work.jsonld"}}