基于嵌入空间差异学习生成文本检测方法研究
Research on a Generated-Text Detection Method Based on Embedding-Space Difference Learning
摘要: 随着大语言模型生成能力的持续增强,机器生成文本检测成为保障信息可靠性的关键技术。现有研究普遍采用因果语言模型在概率空间中建模,存在判别力与计算成本紧密均衡的问题,且对输入形态变化的鲁棒性仍有待增强。本文提出一种基于嵌入空间差异学习的生成文本检测方法,将差异学习的边际约束由概率空间迁移至嵌入空间,以人类文本嵌入质心为参照点、采用欧氏距离构造差异函数,有效区分人机文本;同时辅以双态训练机制以增强模型对不同输入的检测鲁棒性。在MIRAGE-DIG与自建DeepSeek-Bench数据集上实验结果表明,仅使用约12.4%骨干参数量,取得与因果语言模型评分方法相当的检测精度。研究结果为生成文本检测提供了一条新技术路径。
Abstract: With the continuous improvement of the generative capabilities of large language models, detecting machine-generated text has become a key technology for ensuring information reliability. Existing studies typically model text in the probability space using causal language models, which tightly couples discriminative power with computational cost and offers limited robustness to changes in input form. This paper proposes a generated-text detection method based on embedding-space difference learning, transferring the margin constraint of difference learning from the probability space to the embedding space. Using the centroid of human-text embeddings as the reference point and the Euclidean distance to construct the difference function, the method enables a bidirectional encoder to effectively distinguish between human- and machine-generated text; a dual-state training mechanism is further introduced to improve robustness to different inputs. Experiments on the MIRAGE-DIG benchmark and a self-built DeepSeek-Bench dataset show that, using only about 12.4% of the backbone parameters, the method achieves detection accuracy comparable to causal-language-model scoring methods. These results indicate that the discriminative mechanism of difference learning can be effectively established in the embedding space, providing a new technical approach for generated-text detection.
文章引用:裴超凡, 张娟, 李子臣. 基于嵌入空间差异学习生成文本检测方法研究[J]. 计算机科学与应用, 2026, 16(8): 149-159. https://doi.org/10.12677/csa.2026.168270

参考文献

[1] Achiam, J., Adler, S., Agarwal, S., et al. (2023) GPT-4 Technical Report. arXiv:2303.08774.
[2] Guo, D., Yang, D., Zhang, H., et al. (2025) DeepSeek-R1 Incentivizes Reasoning in LLMs through Reinforcement Learning. Nature, 645, 633-638.
[3] Qwen Team (2025) QwQ-32B: Embracing the Power of Reinforcement Learning. Qwen.
https://qwen.ai/blog?id=qwq-32b
[4] Fu, J., Guo, C. and Li, C. (2025) DetectAnyLLM: Towards Generalizable and Robust Detection of Machine-Generated Text across Domains and Models. Proceedings of the 33rd ACM International Conference on Multimedia, Dublin, 27-31 October 2025, 11229-11238.
https://doi.org/10.1145/3746027.3754862
[5] Fariello, S., Fenza, G., Forte, F., Gallo, M. and Marotta, M. (2025) Distinguishing Human from Machine: A Review of Advances and Challenges in AI-Generated Text Detection. International Journal of Interactive Multimedia and Artificial Intelligence, 9, 6-18.
https://doi.org/10.9781/ijimai.2024.12.002
[6] Mitchell, E., Lee, Y., Khazatsky, A., et al. (2023) DetectGPT: Zero-Shot Machine-Generated Text Detection Using Probability Curvature. International Conference on Machine Learning, Honolulu, 23-29 July 2023, 24950-24962.
[7] Bao, G., Zhao, Y., Teng, Z., et al. (2023) Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvature. arXiv:2310.05130.
[8] La Cava, L., Costa, D. and Tagarelli, A. (2024) Is Contrasting All You Need? Contrastive Learning for the Detection and Attribution of AI-Generated Text. In: Frontiers in Artificial Intelligence and Applications, IOS Press, 3179-3186.
https://doi.org/10.3233/faia240862
[9] Devlin, J., Chang, M.-W., Lee, K., et al. (2019) BERT: Pre-Training of Deep Bidirectional Transformers for Language Understanding. Proceedings of NAACL-HLT 2019, Minneapolis, June 2-June 7 2019, 4171-4186.
https://doi.org/10.18653/v1/n19-1423
[10] Verma, V., Fleisig, E., Tomlin, N. and Klein, D. (2024) Ghostbuster: Detecting Text Ghostwritten by Large Language Models. Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), Mexico City, 16-21 June 2024, 1702-1717.
https://doi.org/10.18653/v1/2024.naacl-long.95
[11] Gehrmann, S., Strobelt, H. and Rush, A. (2019) GLTR: Statistical Detection and Visualization of Generated Text. Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, Florence, 28 July-2 August 2019, 111-116.
https://doi.org/10.18653/v1/p19-3019
[12] Su, J., Zhuo, T., Wang, D. and Nakov, P. (2023) DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Text. Findings of the Association for Computational Linguistics: EMNLP 2023, Singapore, 6-10 December 2023, 12395-12412.
https://doi.org/10.18653/v1/2023.findings-emnlp.827
[13] Venkatraman, S., Uchendu, A. and Lee, D. (2024) GPT-Who: An Information Density-Based Machine-Generated Text Detector. Findings of the Association for Computational Linguistics: NAACL 2024, Mexico City, 16-21 June 2024, 103-115.
https://doi.org/10.18653/v1/2024.findings-naacl.8
[14] 陈鹏飞, 孙更新, 宾晟. 融合自一致性与对数秩的大语言模型生成文本检测[J/OL]. 计算机工程与应用: 1-15.
https://link.cnki.net/urlid/11.2127.TP.20251230.1417.002, 2026-04-27.
[15] Hans, A., Schwarzschild, A., Cherepanova, V., et al. (2024) Spotting LLMs with Binoculars: Zero-Shot Detection of Machine-Generated Text. Proceedings of the 41st International Conference on Machine Learning (ICML), Vienna, 21-27 July 2024, 17519-17537.
[16] Chen, J., Zhu, X., Liu, T., Chen, Y., Xinhui, C., Yuan, Y., et al. (2025) Imitate before Detect: Aligning Machine Stylistic Preference for Machine-Revised Text Detection. Proceedings of the AAAI Conference on Artificial Intelligence, 39, 23559-23567.
https://doi.org/10.1609/aaai.v39i22.34525
[17] Hu, E.J., Shen, Y., Wallis, P., et al. (2022) LoRA: Low-Rank Adaptation of Large Language Models. International Conference on Learning Representations (ICLR), Virtual Conference, 25-29 April 2022.
https://openreview.net/forum?id=nZeVKeeFYf9