paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Decoding Secret Memorization in Code LLMs Through Token-Level Characterization

基于 token 级特征刻画代码 LLM 中的秘密记忆
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 2/10 · 论文聚焦代码 LLM 的秘密记忆与隐私泄露,通过 token 概率特征改进解码以提取真实秘密,属于 LLM 安全/隐私方向;与用户关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析及其与 LLM 的交叉无直接关系,且研究目标本身是 LLM 行为而非程序分析或验证工具。引用 2 inbox
Yuqing Nie, Chong Wang, Kailong Wang, Guoai Xu, Guosheng Xu, Haoyu Wang
crossref: 2026-09-12

AI 速览

一句话:提出四种 token 概率特征区分代码 LLM 的真实与幻觉秘密,并设计两阶段解码方法 DeSec 提升真实秘密提取。

代码大语言模型在训练中会记忆敏感信息,带来严重隐私风险;现有基于提示工程的记忆研究易产生幻觉且提取效率低。本文从 token 概率出发刻画真实秘密与幻觉秘密,识别出四种区分性特征,并提出两阶段方法 DeSec:先利用代理代码 LLM 构建离线 token 打分模型,再用该模型重新分配 token 似然以引导解码过程。在四个先进代码 LLM 与多样化数据集上的实验表明,DeSec 相比现有基线取得更高的合理率并提取出更多真实秘密,说明 token 级方法能有效评估代码 LLM 的隐私泄露风险。

问题
代码大语言模型在训练中会记忆敏感信息(如密钥),而现有基于提示工程的记忆提取方法易产生幻觉且提取真实秘密的效率较低。
方法
基于 token 概率识别真实与幻觉秘密的四种关键特征,并设计两阶段方法 DeSec:先用代理代码 LLM 训练离线 token 打分模型,再据此重分配 token 似然以引导解码。
评估
在四个先进代码 LLM 和多样化数据集上与现有基线对比,DeSec 获得更高的合理率并提取出更多真实秘密。
原文摘要(Abstract)

Code Large Language Models (LLMs) have demonstrated remarkable capabilities in generating, understanding, and manipulating programming code. However, their training process inadvertently leads to the memorization of sensitive information, posing severe privacy risks. Existing studies on memorization in LLMs primarily rely on prompt engineering techniques, which suffer from limitations such as widespread hallucination and inefficient extraction of the target sensitive information. In this paper, we present a novel approach to characterize real and fake secrets generated by Code LLMs based on token probabilities. We identify four key characteristics that differentiate genuine secrets from hallucinated ones, providing insights into distinguishing real and fake secrets. To overcome the limitations of existing works, we propose DeSec,a two-stage method that leverages token-level features derived from the identified characteristics to guide the token decoding process. DeSec consists of constructing an offline token scoring model using a proxy Code LLM and employing the scoring model to guide the decoding process by reassigning token likelihoods. Through extensive experiments on four state-of-the-art Code LLMs using a diverse dataset, we demonstrate the superior performance of DeSec in achieving a higher plausible rate and extracting more real secrets compared to existing baselines. Our findings highlight the effectiveness of our token-level approach in enabling an extensive assessment of the privacy leakage risks associated with Code LLMs.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8920,
  title = {Decoding Secret Memorization in Code LLMs Through Token-Level Characterization},
  author = {Yuqing Nie and Chong Wang and Kailong Wang and Guoai Xu and Guosheng Xu and Haoyu Wang},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00229}
}