arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2604.17814cs.CRcs.AI
收藏

理解代码大语言模型中的秘密泄露风险:从分词角度出发

Understanding Secret Leakage Risks in Code LLMs: A Tokenization Perspective

The Chinese University of Hong Kong(香港中文大学);Nanyang Technological University(南洋理工大学);University of Southern California(南加州大学);Fudan University(复旦大学)

Meifang Chen, Zhe Yang, Huang Nianchen, Yizhan Huang, Yichen Li, Zihan Li, Michael R. Lyu

AI总结:

研究揭示代码大语言模型中因分词方式导致的秘密泄露问题,指出BPE分词引发的'垃圾话偏差'现象,并探讨其成因及缓解策略。

摘要:

代码秘密是软件开发者敏感资产,其泄露带来重大网络安全风险。尽管AI代码助手快速发展,但Code Large Language Models (CLLMs) 会因著名的记忆现象意外泄露此类秘密。本研究首次揭示Byte-Pair Encoding (BPE) 分词导致秘密记忆的意外行为,称为'垃圾话偏差'。具体而言,发现某些秘密是CLLMs最容易记忆的,这些秘密具有高字符级熵但低分词级熵。本文通过数值数据支持这一偏见主张。研究发现偏差根源在于CLLM训练数据与秘密数据之间的分词分布偏移。进一步讨论了在'更大词汇量'趋势下垃圾话偏差的表现。最后,本文讨论了潜在的缓解策略及对当前分词器设计的广泛影响。

英文摘要:

Code secrets are sensitive assets for software developers, and their leakage poses significant cybersecurity risks. While the rapid development of AI code assistants powered by Code Large Language Models (CLLMs), CLLMs are shown to inadvertently leak such secrets due to a notorious memorization phenomenon. This study first reveals that Byte-Pair Encoding (BPE) tokenization leads to unexpected behavior of secret memorization, which we term as \textit{gibberish bias}. Specifically, we identified that some secrets are among the easiest for CLLMs to memorize. These secrets yield high character-level entropy, but low token-level entropy. Then, this paper supports the biased claim with numerical data. We identified that the roots of the bias are the token distribution shift between the CLLM training data and the secret data. We further discuss how gibberish bias manifests under the ``larger vocabulary'' trend. To conclude the paper, we discuss potential mitigation strategies and the broader implications on current tokenizer design.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑