Ranking Human and LLM Texts Using Locality Statistics
Paper · 2026 · Yiyang Wang, Chen Ding and Hangfeng He
Summary
Most detectors of machine-generated text rely on large transformer models, which are costly to run and hard to interpret. This paper offers a lightweight, transparent alternative drawn from computer-memory analysis. It uses locality statistics, which measure how far apart repeated tokens occur rather than how often they appear. The authors adapt Data Movement Distance (DMD), a sum of square-rooted Reuse Distances, into a normalized text metric called nDMD. The key addition assigns "imaginary" reuse distances to the first occurrence of each token. This lets rarely repeated words contribute and makes documents of different lengths comparable. A per-token variant, T-nDMD, serves as classifier input.
The method was tested on the English part of M4 (five domains, six LLMs) and on GenAIDetect shared task 1a. Human writing consistently shows higher and more variable nDMD than LLM output. With logistic regression, T-nDMD matches or beats bag-of-words features, and combining the two works best. The approach runs on ordinary CPUs and can also expose generation collapse, which makes it a useful interpretable complement to neural detectors.
Key points
-
Effect size: Human text has significantly higher nDMD than LLM text in every English M4 subset (p < 0.001). The only exception is the ArXiv–BLOOMz pair, which is explained by short abstracts and BLOOMz degenerating into repetitive output.
-
Design choice: Of six reuse-distance variants, square-root distances with imaginary RDs for first occurrences separated the classes best. They reached 88.6% mean accuracy, versus 85.3–87.8% for the alternatives.
-
Controlled setting (single model, single domain, 7:3 split, 20 seeds, Llama 3 tokenizer):
- Bag-of-words (BoW): 98.6% accuracy
- T-nDMD: 98.9%
- Combined: 99.3%
- Subword tokenizers (Llama 3, GPT-2) beat word-level ones (SpaCy, NLTK).
-
Open-domain setting (GenAIDetect task 1a):
Features Macro-F1 Accuracy BoW 63.1 66.3 T-nDMD 65.1 67.8 Combined 66.8 69.0 -
Code: Released on GitHub (YYWmus/locality-metrics-for-text). Fixed-window analysis also shows that nDMD can diagnose degenerate repetitive LLM generation.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works
🧭 Topics 1Research subjects and languages the work is about.Language models & pretraining · 3,320 works
Cite
Cite as Yiyang Wang, Chen Ding and Hangfeng He. 2026. Ranking Human and LLM Texts Using Locality Statistics. Findings of the Association for Computational Linguistics: EACL 2026.
@inproceedings{wang2026ranking,
title = {{Ranking Human and LLM Texts Using Locality Statistics}},
author = {Yiyang Wang, Chen Ding and Hangfeng He},
booktitle = {Findings of the Association for Computational Linguistics: EACL 2026},
year = {2026},
doi = {10.18653/v1/2026.findings-eacl.283},
url = {https://doi.org/10.18653/v1/2026.findings-eacl.283}
}References
- The first author was supported in part by the CS department, the Hajim school, and a GIDS-AI Seed Fund. Boyang Wang participated in the early stages of the project, contributing preliminary measurements on multiple datasets and developing analytical scripts, including efficient Python implementation… find
- Sameer Badaskar, Sachin Agarwal, and Shilpa Arora. 2008. Identifying real or fake articles: Towards better language modeling. In Proceedings of the Third International Joint Conference on Natural Language Processing: Volume-II. find
- Amrita Bhattacharjee and Huan Liu. 2024. Fighting fire with fire: Can chatgpt detect ai-generated text? SIGKDD Explor. Newsl., 25(2):14–21. find
- Steven Bird and Edward Loper. 2004. NLTK: The natural language toolkit. In Proceedings of the ACL Interactive Poster and Demonstration Sessions, pages 214–217, Barcelona, Spain. Association for Computational Linguistics.
- Cohere. 2023. Cohere large language models. https://cohere.com. Model documentation available at https://docs.cohere.com/. Accessed: 2026-01-24. ↗
- Mike Conover, Ben Kuester, Luke Miller, and 1 others. 2023. Free dolly: Introducing the world’s first truly open instruction-tuned llm. https://www.databr icks.com/blog/2023/04/12/dolly-first-ope n-commercially-viable-instruction-tuned-l lm. Databricks technical report. ↗
- Chen Ding, Christopher Kanan, Dylan McKellips, Toranosuke Ozawa, Arian Shahmirza, and Wesley Smith. 2023. Dmc4ml: Data movement complexity for machine learning. Preprint, arXiv:2312.14441. — [arXiv:2312.14441](https://arxiv.org/abs/2312.14441) find
- Chen Ding and Yutao Zhong. 2003. Predicting whole-program locality with reuse distance analysis. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, San Diego, CA. find
- Sebastian Gehrmann, Hendrik Strobelt, and Alexander Rush. 2019. GLTR: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 111–116, Florence, Italy. Association for Computat…
- Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshorn, Aobo Yang, Archi Mitra, Archie Sravankumar, Artem Korenev, Arthur Hinsvark, and 542 o… — The Llama 3 Herd of Models
- Matthew Honnibal, Ines Montani, Sofie Van Lan-deghem, and Adriane Boyd. 2020. spaCy: Industrial-strength Natural Language Processing in Python. find
- Daphne Ippolito, Daniel Duckworth, Chris Callison-Burch, and Douglas Eck. 2020. Automatic detection of generated text is easiest when humans are fooled. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 1808–1822, Online. Association for Computational…
- Ryuto Koike, Masahiro Kaneko, and Naoaki Okazaki. 2024. OUTFOX: LLM-Generated Essay Detection Through In-Context Learning with Adversarially Generated Examples. Proceedings of the AAAI Conference on Artificial Intelligence, 38(19):21258– 21266. find
- Thomas Lavergne, Tanguy Urvoy, and François Yvon. 2008. Detecting fake content with relative entropy scoring. Pan, 8(27-31):4. find
- R. L. Mattson, J. Gecsei, D. Slutz, and I. L. Traiger. 1970. Evaluation techniques for storage hierarchies. IBM System Journal, 9(2):78–117. find
- Hope Elizabeth McGovern, Rickard Stureborg, Yoshi Suhara, and Dimitris Alikaniotis. 2025. Your large language models are leaving fingerprints. In Proceedings of the 1stWorkshop on GenAI Content Detection (GenAIDetect), pages 85–95, Abu Dhabi, UAE. International Conference on Computational Linguistic… find
- Lorenz Mindner, Tim Schlippe, and Kristina Schaaff. 2023. Classification of Human- and AI-Generated Texts: Investigating Features for ChatGPT, page 152–170. Springer Nature Singapore. find
- Eric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D. Manning, and Chelsea Finn. 2023. Detectgpt: zero-shot machine-generated text detection using probability curvature. In Proceedings of the 40th International Conference on Machine Learning, ICML’23. JMLR.org.
- Niklas Muennighoff, Thomas Wang, Lintang Sutawika, and 1 others. 2022. Crosslingual generalization through multitask finetuning. arXiv preprint arXiv:2211.01786.
- Frank Olken. 1981. Efficient methods for calculating the success function of fixed space replacement policies. Technical Report LBL-12370, Lawrence Berkeley Laboratory. find
- OpenAI. 2022. Chatgpt: Optimizing language models for dialogue. https://openai.com/index/chatg pt/. Accessed: 2026-01-24. ↗
- OpenAI. 2023. Gpt-3.5 model documentation. https://platform.openai.com/docs/models/gpt-3-5. Accessed: 2026-01-24. ↗
- OpenAI, Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, Red Avila, Igor Babuschkin, Suchir Balaji, Valerie Balcom, Paul Baltescu, Haiming Bao, Mohammad Bavarian, Jeff Belgum, and 262 others.… — GPT-4 Technical Report
- Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. find
- Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL), pages 1715–1725.
- Wesley Smith, Aidan Goldfarb, and Chen Ding. 2022. Beyond time complexity: data movement complexity analysis for matrix multiplication. In Proceedings of the International Conference on Supercomputing, pages 32:1–32:12. ACM. find
- Yuxia Wang, Jonibek Mansurov, Petar Ivanov, Jinyan Su, Artem Shelmanov, Akim Tsvigun, Chenxi Whitehouse, Osama Mohammed Afzal, Tarek Mahmoud, Toru Sasaki, Thomas Arnold, Alham Fikri Aji, Nizar Habash, Iryna Gurevych, and Preslav Nakov. 2024. M4: Multi-generator, multi-domain, and multilingual black-… find
- Yuxia Wang, Artem Shelmanov, Jonibek Mansurov, Akim Tsvigun, Vladislav Mikhailov, Rui Xing, Zhuohan Xie, Jiahui Geng, Giovanni Puccetti, Ekaterina Artemova, Jinyan Su, Minh Ngoc Ta, Mervat Abassy, Kareem Ashraf Elozeiri, Saad El Dine Ahmed El Etter, Maiya Goloburda, Tarek Mahmoud, Raj Vardhan Tomar,… find
- Debora Weber-Wulff, Alla Anohina-Naumeca, Sonja Bjelobaba, Tomáš Foltýnek, Jean Guerrero-Dib, Olumide Popoola, Petr Šigut, and Lorna Waddington. 2023. Testing of detection tools for AI-generated text. International Journal for Educational Integrity, 19(1):1–39. Publisher: BioMed Central. find
- Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Yu, Brian Lester, Nan Du, Andrew Dai, and Quoc Le. 2022. Finetuned language models are zero-shot learners. In International Conference on Learning Representations (ICLR).
- Jake Wires, Stephen Ingram, Zachary Drudi, Nicholas JA Harvey, Andrew Warfield, and Coho Data. 2014. Characterizing storage workloads with counter stacks. In Proceedings of the Symposium on Operating Systems Design and Implementation, pages 335–349. USENIX Association. find
- Junchao Wu, Shu Yang, Runzhe Zhan, Yulin Yuan, Lidia Sam Chao, and Derek Fai Wong. 2025. A survey on LLM-generated text detection: Necessity, methods, and future directions. Computational Linguistics, 51(1):275–338.
- Liang Yuan, Chen Ding, Wesley Smith, Peter J. Denning, and Yunquan Zhang. 2019. A relational theory of locality. ACM Transactions on Architecture and Code Optimization, 16(3):33:1–33:26. find
- Yutao Zhong, Xipeng Shen, and Chen Ding. 2009. Program locality analysis using reuse distance. ACM Transactions on Programming Languages and Systems, 31(6):20:1–20:39. find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/wang-2026-ranking-human-llm-texts-locality/