Detecting Functional Memorization in Code Language Models
Researchers have found that large language models (LLMs) can 'remember' and reproduce specific code logic from their training data in ways that traditional text-based audits cannot detect. This phenomenon is called functional memorization. The study used AI coding agents to generate test inputs for 4 open-source LLMs, testing whether they could produce the same outputs as the original code. The results showed that around 0.3-3.4% of functions in the training data were counter
Researchers have found that large language models (LLMs) can 'remember' and reproduce specific code logic from their training data in ways that traditional text-based audits cannot detect. This phenomenon is called functional memorization. The study used AI coding agents to generate test inputs for 4 open-source LLMs, testing whether they could produce the same outputs as the original code. The results showed that around 0.3-3.4% of functions in the training data were counterfactually functionally memorized, meaning their behavior was preserved even when the code was rewritten. This raises concerns about the security and trustworthiness of LLM-generated code.
---
Why it matters: This study matters to AI researchers because it highlights a potential vulnerability in large language models used for generating code at scale. Functional memorization could allow attackers to recover sensitive information from model outputs, compromising the security of software development pipelines.
Source: https://arxiv.org/abs/2606.12764
This article was originally published at: https://arxiv.org/abs/2606.12764