Detecting Functional Memorization in Code Language Models

Matthieu Meeus, Anil Ramakrishna, Matthew Grange, Zheng Xu, Luca Melis
6/11/2026
cs.LGcs.CLcs.CR

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large language models (LLMs) are increasingly used to generate code at scale. Meanwhile, prior work has investigated whether training data may be recoverable from model outputs, by auditing the textual overlap between training examples and model generations. Code, however, can be functionally equivalent while textually dissimilar. In this work, we study functional memorization: extraction of functional logic beyond what verbatim metrics detect. We construct a counterfactual setup for Olmo-3-32B, comparing a midtrained model (exposed to target code) against a pretrained reference (not exposed). We prompt both models with Python function signatures and measure both textual and functional similarity (i.e., LLM-as-a-judge, execution-based). Our results show clear evidence of functional memorization, highlighting the need for auditing metrics that go beyond textual overlap.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{meeus2026detecting,
  title  = {Detecting Functional Memorization in Code Language Models},
  author = {Matthieu Meeus and Anil Ramakrishna and Matthew Grange and Zheng Xu and Luca Melis},
  year   = {2026},
  eprint = {2606.12764},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.12764v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.12764.svg)](https://codeofpaper.com/paper/2606.12764)

Discussion