Research Article
AIDetx2: Lightweight and Explainable Detection of AI-Generated Text
Synthesis: Silva, Pinho and Pratas built AIDetx2, an AI-text detection framework that handles three tasks at once: telling human from AI writing, attributing AI text to the model that produced it, and locating the boundaries of hybrid documents that mix human and machine segments. Using a dataset of 923,162 samples generated by five open-weight large language models, they compared lightweight machine-learning classifiers over handcrafted features with a fine-tuned BERT model, both wrapped in a sliding window. BERT was stronger on binary detection (AUPRC 0.948 versus 0.931) but far more expensive, while the two approaches were close on attribution (0.929 versus 0.907), so the authors argue for the lightweight models when cost and explainability matter. The work matters for academic integrity because every prediction can be traced to a small set of human-readable features, but the dataset is English-only and drawn from five open-weight models, so it does not establish performance on newer or closed systems.
Key Findings
- BERT led on binary detection, at a cost. Fine-tuned BERT reached AUPRC 0.948 for human-versus-AI detection, against 0.931 for the lightweight machine-learning models.
- Attribution was nearly a tie. BERT scored 0.929 and the machine-learning models 0.907 at identifying which LLM produced a text, a gap the authors judge too small to justify the deep model's compute.
- The dataset is large but synthetic in origin. 923,162 samples spanned multiple themes and types, but all AI text came from five open-weight LLMs rather than closed commercial systems.
- Compression and lexical cues did most of the work. The handcrafted features that separated human from AI text were mainly compression-based and lexical, which is what makes the lightweight models interpretable.
- Hybrid localization depends on the transition. A sliding window caught changes of origin within documents, with reliability varying by classifier and by the type of human-to-AI or AI-to-human boundary.
- The framework covers three tasks, not one. Binary detection, model attribution and hybrid-segment localization are handled in a single pipeline rather than as separate tools.
- Era is a confound the authors name. Human and AI texts differ in when they were written, so part of what the models learn may be era rather than authorship.
The detection problem it targets
As generative AI output became fluent, the integrity question shifted from "is this text AI-generated?" to a set of harder questions: which model wrote it, and where inside a longer document does the machine text begin and end? Most existing detectors answer only the binary question, and the strongest deep-learning approaches are computationally expensive and hard to interpret, while lightweight alternatives tend to degrade on newer generators. AIDetx2 is a substantial extension of the compression-based AIDetx tool, built to keep predictions traceable while still handling attribution and hybrid localization. The stated audience is anyone running assessment or publication workflows that need an auditable signal rather than a black-box score.
How AIDetx2 works
The framework builds a diverse dataset of human and AI English text and trains two families of classifier on it. One family uses handcrafted, human-readable features — compression statistics and lexical measures prominent among them — and standard machine-learning models. The other is a fine-tuned BERT model as the deep-learning alternative. Both are combined with a sliding-window procedure that scores local segments of a document, which is what allows the system to flag a machine-written paragraph inside otherwise human prose. The authors describe explainability narrowly and usefully: a prediction is explainable when it can be traced to the values of a small set of named features, not when a model merely reports a confidence score. That definition is what makes the lightweight path attractive for an integrity workflow, where a reviewer needs a reason they can inspect and contest. The authors publish a public interface at https://aidetx2.github.io.
What the comparison showed
On the authors' dataset, BERT won binary detection at 0.948 AUPRC against 0.931 for the machine-learning models, and the same ordering held for attribution at 0.929 versus 0.907. The margin on binary detection is real but bought with substantially higher computational cost; the margin on attribution is small enough that the authors preferred the machine-learning models for their low cost and inspectable features. In the sliding-window analysis, the lightweight models localized transitions between human and AI text, but reliability depended on the classifier and on whether the boundary was human-to-AI or AI-to-human. Compression-based and lexical features were the main cues separating the two classes, which is both the strength (they can be explained) and the weakness (they may track surface form and era rather than authorship).
Why this matters for integrity workflows
For academic integrity and editorial review, the practical value of a detector is not a single accuracy number but whether a reviewer can act on its output. A tool that says "84% AI" invites either over-trust or dismissal; a tool that says "this segment shows compression and lexical patterns characteristic of model output, in these features" gives a human something to check against the draft, the revision history and the student's own account. AIDetx2 does not solve the deeper validity problem — detection remains probabilistic and generation-era-dependent — but it makes the evidence inspectable, which is the precondition for using it as one signal among several rather than as a verdict. The hybrid-localization task is the most relevant to real submissions, where a student may write the argument and use a model for a section.
What this means for practice
- Instructors and integrity officers. Treat detector output as a prompt to look at process evidence, not as proof; ask for drafts, revision history or an oral check before acting on a flag.
- Software developers. Prefer the lightweight, feature-based path when you need to explain a flag to a student or editor; reserve the deep model for cases where binary accuracy outweighs cost and opacity.
- Institutions. Do not adopt a detector as policy without local validation on your own students' writing and the models they actually use; this study's AI text came from five open-weight LLMs, not the closed systems students most often use.
- Researchers. Report the generator set and the era of the human corpus alongside accuracy, because both bound what a detector's result can mean.
Limitations
- English only. The dataset is English text, so performance in other languages is untested.
- Five open-weight generators. All AI text came from five open-weight LLMs, which may not represent newer or closed commercial models.
- Era confound. Human and AI texts differ in era, so the models may partly capture when a text was written rather than whether a machine wrote it.
- Single dataset. The comparison rests on one constructed corpus; generalization to other domains, genres and student populations is not established.
- Qualitative localization. Hybrid-segment reliability depended on the classifier and transition type, so boundary detection is not a solved problem.
Citation
Silva, D. M., Pinho, A. J., & Pratas, D. (2026). AIDetx2: Lightweight and Explainable Detection of AI-Generated Text. arXiv preprint arXiv:2612.00404.