Code-SeC: A Decoding-time Probing Method for Characterizing Secret Memorization in Code LLM

Code Large Language Models (Code LLMs) have demonstrated exceptional capabilities in code generation and completion. While these models are known to memorize portions of their training data, existing approaches to evaluate credential memorization rely on output-level inspection or adversarial prompt crafting, leaving the internal decoding behaviors that underlie secret leakage unexplored. In this paper, we conduct a token-level investigation of hard-coded credential memorization in Code LLMs during routine code completion. We report two findings: (1) traces of memorized secrets persist in the token candidate space, indicating that standard output-level evaluation underestimates the true extent of memorization; (2) the generation of real secrets exhibits statistically distinct uncertainty dynamics compared to hallucinated strings, providing a reliable intrinsic signal for memorization detection. Based on these findings, we propose Code-SeC (Code Secret Characterization), a decoding-time diagnostic framework that monitors uncertainty signals along the decoding trajectory and performs targeted distribution adjustments to uncover latent credential memorization. Experimental results show that Code-SeC effectively detects memorized code secrets across representative Code LLMs and secret types, providing comprehensive empirical evidence that hard-coded credential memorization is prevalent in current code completion models.

Link
https://www.semanticscholar.org/paper/d7dd0bb4a8ec9bcf6f0f5de7c306cf57cac2b06b
Found by
Semantic Scholar
Authors
Yan-Yuan Chen, Rui-Ze Hui, Cheng-Xuan Hou, Mei-Kang Qiu
Categories
evaluation, dataset
Published
2026-11-14
Last seen by the radar
2026-11-15
Citations
0
Influential citations
0
Radar score
40.35 / 100 (how it is scored)
Why it scored so
Matched: evaluat, training data; Primary record: Semantic Scholar
Related links
https://doi.org/10.1145/3830454.3846643
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar