TL;DR
Traditional methods for detecting code memorization in large language models (LLMs)—such as synonym fuzzing or log-probability checks—fail when applied to large-scale models because their massive capacity easily absorbs these minor prompt perturbations. By introducing mathematically guaranteed "I/O isomorphisms," this paper untangles genuine algorithmic understanding from formatting overhead, revealing that frontier models retain core logic even when performance drops due to output-side compliance constraints.
What Problem Does This Paper Address?
The AI community heavily debates whether code LLMs truly understand programming logic or simply memorize their training data. To investigate this, researchers typically use "probes"—either encoder-side prompt perturbations (like renaming variables or swapping synonyms) or decoder-side token log-likelihood checks (like the CoDeC framework).
However, these diagnostics were primarily validated on smaller model families. This paper demonstrates that as models scale, standard memorization probes saturate and lose their discriminative power. Furthermore, existing probes quietly conflate memorization with representational load—the extra cognitive effort required for an LLM to parse and generate code under unfamiliar interface constraints. Without separating these two factors, a drop in benchmark accuracy might be falsely attributed to a lack of reasoning or a failure of memorized retrieval.
Methods
The authors evaluate traditional encoder-side probes (synonym fuzzing at 20% and 40% rates) and decoder-side probes (CoDeC log-probability shifts) across a wide scale axis of dense model architectures.
To isolate memorization from representational load under a strict mathematical guarantee, they introduce I/O Isomorphisms. Instead of altering the natural language text, they apply an invertible, bijective transformation to the integer inputs and outputs of a programming task (e.g., an affine transform like $x' = 2x - 94$, base conversions, or cubic polynomials) and append an explicit encoding/decoding contract to the prompt. The underlying algorithmic task remains identical, but the model cannot rely on verbatim memorization to pass.
To analyze how the models fail under this load, they introduce Opcode Entropy Analysis. They compile the generated Python code into bytecode and measure the Shannon entropy of the opcode frequencies. This acts as a structural proxy for the underlying algorithmic strategy, allowing them to see if a model changes its approach or keeps the same logic when the prompt interface changes.
Datasets
The authors evaluate their approach on three Python benchmarks selected to span a clear contamination axis:
- MBPP: An older, widely used benchmark that is highly likely to be contaminated (seen during training) across all tested models.
- EffiBench & BigOBench: Newer benchmarks (released in 2024 and 2025) that postdate the training cutoffs for almost all models, serving as clean, unseen baselines.
For the decoder-side CoDeC evaluation, they utilize GPQA Diamond and LiveCodeBench v5 as guaranteed unseen datasets, alongside Wikipedia and HackerNews corpora as seen datasets.
Key Insights and Ideas
- Probe Saturation at Scale: Frontier models are robust enough to completely absorb lexical drift. Synonym fuzzing barely registers a performance drop on large models, rendering it useless as a memorization diagnostic at scale.
- Compliance vs. Competence: When faced with heavy representational load (I/O isomorphisms), smaller models suffer from competence failure (they completely abandon the correct algorithmic strategy). Frontier models, however, experience compliance failure—their internal logic remains perfectly intact (as proven by near-identical bytecode signatures), but they fumble the final token-by-token serialization required by the formatting contract.
- The Decoder Bottleneck: The performance drop under representational load is heavily concentrated on the decoder side. Models are excellent at parsing transformed inputs (encoder), but struggle to maintain an implicit mathematical state over sequential generation steps while outputting code.
Key Results
- Synonym Fuzzing Fails at Frontier: While synonym fuzzing caused up to a 37-point drop in pass@1 for small models, frontier models like Gemini-2.5-Flash lost at most 2.1 points, showing complete absorption of the perturbation.
- CoDeC Signal Degradation: The seen-vs-unseen dataset separation AUC for CoDeC dropped from a perfect 100% on smaller Pythia models down to 75% on Llama-3.1-405B, and even inverted to 25% on Llama-3.1-70B.
- Isomorphism Impact: The full I/O isomorphism contract dropped frontier model pass@1 by 14 to 30 absolute points. However, decomposing the contract showed that input decoding alone cost Gemini-2.0-Flash only 9.7 points on MBPP, whereas output encoding token-by-token cost a massive 21.8 points.
Limitations and Future Work
- Numeric Constraints: The metamorphic testing framework relies strictly on bijective value transformations over integers. Constructing similar provable bijections for non-numeric spaces (like string formatting, alternate data layouts, or project-local API conventions) remains an open problem.
- Architecture Scope: The study exclusively evaluated dense architectures and explicitly noted that how these diagnostics behave on Mixture-of-Experts (MoE) models—where routing decisions interact with memorization patterns—is still unknown.
- Task Scale: The benchmarks favor self-contained, function-level algorithmic tasks rather than repository-scale or multi-file agentic coding environments.
Summary updated