Detecting LLM-Generated Text with Trigram–Cosine Stylometric Delta: An Unsupervised and Interpretable Approach

Аннотация

Background: Contemporary methods for detecting synthetic text, including model-specific detectors and transformer-based classifiers, often rely on intensive training or on features tied to particular language models, which restricts their generalizability to unfamiliar LLMs and diverse domains.

Purpose: This study aims to advance text attribution research by introducing a stylometry-based approach that utilizes trigram-based cosine delta as a lightweight and interpretable metric for distinguishing LLM-generated texts from human-written texts, irrespective of the underlying generation strategy.

Method: A corpus of Russian diary entries was compiled, encompassing both authentic human-written texts and synthetic counterparts generated through few-shot prompting and finetuned LoRA models. To evaluate the effectiveness of the proposed approach, multiple stylometric-delta variations were examined, integrating uni-, bi-, and trigram features with Manhattan and cosine distance metrics.

Results: The evaluation demonstrated that the trigram–cosine delta consistently achieved the highest performance across experimental conditions, reaching an Adjusted Rand Index of approximately 0.70. This markedly surpassed both the finetuned RuModernBERT baseline (ARI ≈ 0.28) and the classic unigram-based delta (ARI ≈ 0.53). Importantly, the method proved effective not only within the Russian diary corpus but also when applied to the RuATD benchmark, where it successfully separated human-authored and machine-generated texts and produced coherent clustering of related model families.

Conclusion: The findings confirm that trigram–cosine stylometric delta offers a robust, interpretable, and computationally efficient strategy for detecting LLM-generated texts across diverse generation strategies, including few-shot prompting and finetuning. By capturing discourse-level stylistic cohesion, the method advances beyond surface fluency and provides a scalable, unsupervised alternative to classifier-based detectors. While current validation is limited to Russian diaries and selected generation models, the approach demonstrates clear potential for broader application across domains, languages, and emerging state-of-the-art LLMs.

Скачивания

Данные скачивания пока не доступны.

Литература

Aich, A., Bhattacharya, S., & Parde, N. (2022). Demystifying neural fake news via linguistic feature-based interpretation. In Proceedings of the 29th International Conference on Computational Linguistics (pp. 6586-6599). International Committee on Computational Linguistics

Antoun, W., Mouilleron, V., Sagot, B., & Seddah, D. (2023). Towards a robust detection of Language Model generated text: Is ChatGPT that easy to detect? In Actes de CORIA-TALN 2023 (vol. 1, pp. 14–27). ATALA.

Argamon, S. (2008). Interpreting Burrows’s delta: Geometric and probabilistic foundations. Literary and Linguistic Computing, 23(2), 131-147. https://doi.org/10.1093/llc/fqn003

Bakhtin, A., Gross, S., Ott, M., Deng, Y., Ranzato, M. A., & Szlam, A. (2019). Real or fake? Learning to discriminate machine from human generated text. arXiv:1906.03351. https://doi.org/10.48550/arXiv.1906.03351

Bender, E. M., Gebru, T., McMillan-Major, A., & Shmitchell, S. (2021). On the dangers of stochastic parrots: Can language models be too big?. In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency (pp. 610-623). ACM. https://doi.org/10.1145/3442188.344592

Bethany, M., Wherry, B., Bethany, E., Vishwamitra, N., & Najafirad, P. (2024). Deciphering textual authenticity: A generalized strategy through the Lens of Large Language Semantics for detecting human vs. machine-generated text. arXiv:2401.09407. https://doi.org/10.48550/arXiv.2401.09407

Bogdanova, E. (2008). Language features of diary genre. Philological Sciences, 1(1), 28-33. https://doi.org/10.30853/filnauki

Vorobeva, V., Bonch-Osmolovskaya, A., Kryukov, A., & Podriadchikova, M. (2025). Distant reading of Soviet diaries. Digital Scholarship in the Humanities, 40(3), 956–968, https://doi.org/10.1093/llc/fqaf038

Burrows, J. (2002). ‘Delta’: A measure of stylistic difference and a guide to likely authorship. Literary and Linguistic Computing, 17(3), 267-287. https://doi.org/10.1093/llc/17.3.267

Chhatwal, G. S., & Zhao, J. (2025). Multitask learning for authenticity and authorship detection. Electronics, 14(6), 1113. https://doi.org/10.3390/electronics14061113

Craig, H., & Kinney, A. F. (2009). Shakespeare, computers, and the mystery of authorship. Cambridge University Press.

Dong, Q., Li, L., Dai, D., Zheng, C., Wu, Z., Chang, B., Sun, X., Li, L., & Sui, Z. (2022). A survey on in-context learning. arXiv:2301.00234. https://doi.org/10.48550/arXiv.2301.00234

Eder M., Rybicki J., Kestemont M. (2016). Stylometry with R: A package for computational text analysis. The R Journal, 8(1), 107-121. https://doi.org/10.32614/rj-2016-007

Eder, M., Kestemont, M., & Rybicki, J. (2013). Stylometry with R: A suite of tools. Digital Humanities 2013: Conference Abstracts (pp. 487–489). University of Nebraska.

Emi, B., & Spero, M. (2024). Technical report on the pangram ai-generated text classifier. arXiv:2402.14873. https://doi.org/10.48550/arXiv.2402.14873

Crothers, E., Japkowicz, N., & Herna, L. (20023). Machine-generated text: A comprehensive survey of threat models and detection methods. IEEE Access (vol. 11, pp. 70977-71002). IEEE. https://doi.org/10.1109/ACCESS.2023.3294090

Evert, S., Proisl, T., Jannidis, F., Reger, I., Pielström, S., Schöch, C., & Vitt, T. (2017). Understanding and explaining Delta measures for authorship attribution. Digital Scholarship in the Humanities, 32(suppl_2), ii4-ii16. https://doi.org/10.1093/llc/fqx023

Fraser, K. C., Dawkins, H., & Kiritchenko, S. (2025). Detecting AI-generated text: Factors influencing detectability with current methods. Journal of Artificial Intelligence Research, 82, 2233-2278. https://doi.org/10.1613/jair.1.16665

Fröhling, L., & Zubiaga, A. (2021). Feature-based detection of automated language models: Tackling GPT-2, GPT-3 and Grover. PeerJ Computer Science, 7, e443. https://doi.org/10.7717/peerj-cs.443

Gehrmann, S., Strobelt, H., & Rush, A. M. (2019). Gltr: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations (pp. 111–116). Association for Computational Linguistics. https://doi.org/10.18653/v1/p19-3019

Gressel, G., Pankajakshan, R., & Mirsky, Y. (2024). Exploiting LLMs for scam automation: A looming threat. In Proceedings of the 3rd ACM Workshop on the Security Implications of Deepfakes and Cheapfakes (pp. 20-24). ACM. https://doi.org/10.1145/3660354.3660356

Guo, B., Zhang, X., Wang, Z., Jiang, M., Nie, J., Ding, Y., Yue, J., & Wu, Y. (2023). How close is Chatgpt to human experts? Comparison corpus, evaluation, and detection. arXiv:2301.07597.

Gurioli, A., Gabbrielli, M., & Zacchiroli, S. (2025). Is this you, LLM? Recognizing AI-written programs with multilingual code stylometry. In 2025 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) (pp. 394-405). IEEE. https://doi.org/10.48550/arXiv.2412.14611

Hoover, D. L. (2004). Testing Burrows’s delta. Literary and Linguistic Computing, 19(4), 453-475. https://doi.org/10.1093/llc/19.4.453

Huang, L., Yu, W., Ma, W., Zhong, W., Feng, Z., Wang, H., Chen, Q., Peng, W., Feng X., Qin, B., & Liu, T. (2023). A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions. ACM Transactions on Information Systems. https://doi.org/10.1145/3703155

Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2021). Lora: Low-rank adaptation of large language models. arXiv:2106.09685. https://doi.org/10.48550/arXiv.2106.09685

Hu, X., Ou, W., Acharya, S., Ding, S. H., D’Gama, R., & Yu, H. (2023). TDRLM: Stylometric learning for authorship verification by topic-debiasing. Expert Systems with Applications, 233, 120745. https://doi.org/10.1016/j.eswa.2023.1207

Jiang, A. Q., Sablayrolles, A., Mensch, A., Bamford, C., Chaplot, D. S., Casas, D. D. L., Bressand, F., Lengyel, G., Lample, G., Saulnier, L., Lavaud, L. R., Lachaux, M., Stock, P., Le Scao, T., Lavril, T., Wang, T., Lacroix, T., & Sayed, W. E. (2023). Mistral 7B. arXiv:2310.06825. https://doi.org/10.48550/arXiv.2310.06825

Kirchenbauer, J., Geiping, J., Wen, Y., Katz, J., Miers, I., & Goldstein, T. (2023). A watermark for large language models. In International Conference on Machine Learning (PMLR) (pp. 17061-17084). ML Research Press.

Knox, W. B., & Stone, P. (2011). Augmenting reinforcement learning with human feedback. In ICML 2011 Workshop on New Developments in Imitation Learning (vol. 855, No. 3). ACM. https://doi.org/10.1007/978-0-387-30164-8_714

Kumarage, T., Garland, J., Bhattacharjee, A., Trapeznikov, K., Ruston, S., & Liu, H. (2023). Stylometric detection of AI-generated text in Twitter timelines. arXiv:2303.03697. https://doi.org/10.48550/arXiv.2303.03697

Kumarage, T., & Liu, H. (2023). Neural authorship attribution: Stylometric analysis on large language models. In 2023 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery (pp. 51-54). IEEE. https://doi.org/10.1109/cyberc58899.2023.00019

Li, Y., Li, Q., Cui, L., Bi, W., Wang, L., Yang, L., Shi, S., & Zhang, Y. (2023). Deepfake text detection in the wild. arXiv:2305.13242. https://doi.org/10.48550/arXiv.2305.13242

Ma, Y., Liu, J., Yi, F., Cheng, Q., Huang, Y., Lu, W., & Liu, X. (2023). Is this abstract generated by ai? A research for the gap between ai-generated scientific text and human-written scientific text. arXiv:2301. 10416, https://doi.org/10.48550/arXiv.2301.10416

Maisto, A. (2025). Collaborative storytelling and LLM: A linguistic analysis of automatically-generated role-playing game sessions. arXiv:2503.20623. https://doi.org/10.48550/arXiv.2503.20623

Mitchell, E., Lee, Y., Khazatsky, A., Manning, C. D., & Finn, C. (2023). Detectgpt: Zero-shot machine-generated text detection using probability curvature. In International Conference on Machine Learning (PMLR) (pp. 24950-24962). ML Research Press. https://doi.org/10.48550/arXiv.2301.11305

Muñoz-Ortiz, A., Gómez-Rodríguez, C., & Vilares, D. (2024). Contrasting linguistic patterns in human and llm-generated text. Artificial Intelligence Review, 57, article number 265. https://doi.org/10.1007/s10462-024-10903-2

Opara, C. (2024). StyloAI: Distinguishing AI-generated content with stylometric analysis. In A.M. Olney, IA. Chounta, Z. Liu, O.C. Santos, & I.I. Bittencourt (Eds.), Communications in Computer and Information Science, 2151. Springer. https://doi.org/10.1007/978-3-031-64312-5_13

Przystalski, K., Argasiński, J. K., Grabska-Gradzińska, I., & Ochab, J. (2025). Stylometry recognizes human and LLM-generated texts in short samples. Expert Systems with Applications, 129001. https://doi.org/10.1016/j.eswa.2025.129001

Rafailov, R., Sharma, A., Mitchell, E., Manning, C. D., Ermon, S., & Finn, C. (2024). Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36, 53728-53741, https://doi.org/10.48550/arXiv.2305.18290.

Rebora, S. (2023). GPT-3 vs. Delta. Applying Stylometry to Large Language Models. In La memoria digitale: Forme del testo e organizzazione della conoscenza. Atti del XII Convegno Annuale AIUCD (pp. 292-297). AlmaDL. https://doi.org/10.6092/unibo/amsacta/7721

Roy, S. S., Thota, P., Naragam, K. V., & Nilizadeh, S. (2024, May). From chatbots to Phishbots?: Phishing scam generation in commercial Large Language Models. In 2024 IEEE Symposium on Security and Privacy (pp. 221-221). IEEE Computer Society. https://doi.org/10.1109/SP54263.2024.00182

Rybicki, J., & Eder, M. (2011). Deeper Delta across genres and languages: Do we really need the most frequent words? Literary and Linguistic Computing, 26(3), 315-321, https://doi.org/10.1093/llc/fqr031

Sadasivan, V. S., Kumar, A., Balasubramanian, S., Wang, W., & Feizi, S. (2023). Can AI-generated text be reliably detected? arXiv:2303.11156, https://doi.org/10.48550/arXiv.2303.11156

Sahoo, P., Meharia, P., Ghosh, A., Saha, S., Jain, V., & Chadha, A. (2024). A comprehensive survey of hallucination in large language, image, Video and audio foundation models. Findings of the Association for Computational Linguistics (EMNLP) (pp. 11709-11724). Association for Computational Linguistics. https://doi.org/10.18653/v1/2024.findings-emnlp.685

Salnikov, E., & Bonch-Osmolovskaya, A. (2023). Using stylometry to detect generated content. In Proceedings of the DH Russia 2023 Conference (pp. 176-182). Siberian Federal University.

Schuster, T., Schuster, R., Shah, D. J., & Barzilay, R. (2020). The limitations of stylometry for detecting machine-generated fake news. Computational Linguistics, 46(2), 499-510, https://doi.org/10.1162/coli_a_00380

Shamardina, T., Mikhailov, V., Chernianskii, D., Fenogenova, A., Saidov, M., Valeeva, A., Shavrina, T., Smurov, I., Tutubalina, E., & Artemova, E. (2022). Findings of the the ruatd shared task 2022 on artificial text detection in Russian. arXiv:2206.01583. https://doi.org/10.48550/arXiv.2206.01583

Smith, P. & Aldridge, W. (2011). Improving authorship attribution: Optimizing Burrows’ delta method. Journal of Quantitative Linguistics, 18(1), 63–88, https://doi.org/10.1080/09296174.2011.533591

Stamatatos, E. (2009). A survey of modern authorship attribution methods. Journal of the American Society for Information Science and Technology, 60(3), 538-556. https://doi.org/10.1002/asi.21001

Tang, R., Chuang, Y. N., & Hu, X. (2024). The science of detecting LLM-generated text. Communications of the ACM, 67(4), 50-59. https://doi.org/10.1145/3624725

Wang, S., Cristianini, N., & Hood, B. (2024). Stylometric comparison between ChatGPT and Human Essays. In Workshop Proceedings of the 18th International AAAI Conference on Web and Social Media, Workshop: REAL-Info 2024: First Workshop on Reliable Evaluation of LLMs for Factual Information. AAAI. https://doi.org/10.36190/2024.24

Wang, Y., Mansurov, J., Ivanov, P., Su, J., Shelmanov, A., Tsvigun, A., Whitehouse, C., Afzal, O. M., Mahmoud, T., Sasaki, T., Arnold, T., Aji, A. F., Habash, N., Gurevych, I., & Nakov, P. (2023). M4: Multi-generator, multi-domain, and multi-lingual black-box machine-generated text detection. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Vol. 1: Long Papers, pp. 1369–1407). Association for Computational Linguistics. https://doi.org/10.18653/v1/2024.eacl-long.83

Wang, Y., Pan, Y., Yan, M., Su, Z., & Luan, T. H. (2023). A survey on ChatGPT: AI-generated contents, challenges, and solutions. IEEE Open Journal of the Computer Society, 4, 1-20. IEEE Computer Society. https://doi.org/10.1109/OJCS.2023.3300321

Weerasinghe, J., Seepersaud, O., Smothers, G., Jose, J., & Greenstadt, R. (2025). Be sure to use the same writing style: Applying authorship verification on Large-Language-Model-generated texts. Applied Sciences, 15(5), 2467. https://doi.org/10.3390/app15052467

Wu, J., Yang, S., Zhan, R., Yuan, Y., Chao, L. S., & Wong, D. F. (2025). A survey on LLM-generated text detection: Necessity, methods, and future directions. Computational Linguistics, 51(1), 275-338. MIT Press. https://doi.org/10.1162/coli_a_00549

Zaitsu, W., & Jin, M. (2023). Distinguishing ChatGPT (-3.5,-4)-generated and human-written papers through Japanese stylometric analysis. PLoS One, 18(8), e0288453. https://doi.org/10.1371/journal.pone.0288453

Zhang, B., Liu, Z., Cherry, C., & Firat, O. (2024). When scaling meets LLM finetuning: The effect of data, model and finetuning method. arXiv:2402.17193. https://doi.org/10.48550/arXiv.2402.17193

Zhao, X., Li, L., & Wang, Y. X. (2022). Distillation-resistant watermarking for model protection in NLP. arXiv:2210.03312. https://doi.org/10.48550/arXiv.2210.03312h

Опубликован
2025-09-30
Как цитировать
SalnikovE., & Bonch-OsmolovskayaA. (2025). Detecting LLM-Generated Text with Trigram–Cosine Stylometric Delta: An Unsupervised and Interpretable Approach. Journal of Language and Education, 11(3), 138-151. https://doi.org/10.17323/jle.2025.22211
Раздел
Оригинальное исследование