Skip to content
Preprint

Memorization Diagnostics for Code LLMs Should be Scale-Aware

Aug 2026 · 0 citations · 52 references
Computer Science

TL;DR

It is revealed that scaled encoders successfully absorb substantial representation load while still converging on the correct family of solutions, and this ability to adapt to varying surface forms is what truly matters for usability and generalizability in LLM and agentic applications.

Abstract

The extent to which large language models for code rely on memorization over genuine understanding remains highly debated. While current literature frequently reports widespread memorization, evaluating the underlying probing techniques across dense architectures reveals a severe breakdown in their utility at scale. Traditional encoder-style probes using perturbations such as synonym fuzzing or dead-code insertion struggle to expose memorization in scaled models, even on known-contaminated benchmarks, and decoder-style probes that rely on log probabilities show similar performance degradation. The specific mode of failure for these probes, particularly why such techniques disrupt smaller models but fail to impact larger ones, motivates us to untangle representation load from memorization rather than treating them as a single phenomenon. By applying invertible mathematical transforms to numeric problems, we isolate these two factors and reveal that scaled encoders successfully absorb substantial representation load while still converging on the correct family of solutions. In practical software engineering, this ability to adapt to varying surface forms is what truly matters for usability and generalizability in LLM and agentic applications. Whether a specific solution was seen during training becomes a much less pressing question because although memorization inflates scores on contaminated benchmarks, factoring out representation load makes it debatable how much we should truly care if a functional answer was originally memorized. Future evaluations must therefore be built around separating these phenomena rather than relying on methodologies that quietly entangle them.

View source

Similar papers

Book Open access Jul 2026

When AI Coding Assistants Leak Training Data: A Study of LLM Memorization in Code Generation

It is confirmed that memorization persists in modern LLMs and is influenced more by a complex interplay of training domain, dataset composition, architectural choices, and content characteristics, rather than parameter count alone.

Xiaoyu Cheng, Kundi Yao, Pengyu Nie et al. · 0 citations
Preprint Aug 2026

Lexical Perturbations Disrupt LLM Reasoning: An Empirical Study of Attention Diversion

Attention Diversion explains why inference-time strategies, including chain-of-thought prompting, spell-checking, self-repair, and stronger repair models, fail to consistently recover performance: each addresses one channel at a time.

Jiaqi Zhu, Yang Zhang, Junhua Ding et al. · 0 citations
Preprint Aug 2026

Execution-Anchored Hallucination Calibration Reranking for Verilog Code Generation

EAHC is proposed, an Execution-Anchored Hallucination Calibration reranking framework that anchors reasoning judgments to execution behavior so that execution-equivalent candidates receive consistent scores, which implements a dual-channel architecture.

Guang Yang, Xing Hu, Xiang Chen et al. · 0 citations
Preprint Jul 2026

Mitigating LLM Sycophancy in Code Smell Detection Using Evidence-Guided Reasoning Prompts

Large Language Models (LLMs) are increasingly used for code smell detection tasks due to their ability to interpret program semantics. However, their reliability in this context remains poorly explored, particularly under varying prompt conditions where model predictions may be influenced by external cues rather than code characteristics. One such limitation is sycophancy bias, where models tend to align their outputs with user-provided assumptions instead of performing objective analysis. In this paper, we present the first systematic empirical study of sycophancy bias in LLM-based code smell detection. Using the MLCQ dataset, we evaluate how different prompt framings like confirmation bias, contradictory hints, and false premises affect model predictions. Our results show that LLMs are highly sensitive to prompt variations, with Decision Flip Rates reaching up to 72% and False Alignment Rates exceeding 90%, indicating substantial instability and agreement with misleading prompts. To address this issue, we propose Evidence-Guided Debiasing Prompting (EGDP), a structured prompting strategy that enforces evidence-first reasoning. EGDP reduces decision instability and improves robustness, lowering Decision Flip Rates to as low as 12% and False Alignment Rates to as low as 21%, while increasing reliance on structurally grounded evidence. Our findings demonstrate that sycophancy bias poses a critical threat to the reliability of LLM-based code smell detection, and that evidence-guided reasoning provides an effective and generalizable mitigation approach.

Istiaq Ahmed Fahad, K. Asif, Mohammad A. Tawhid · 0 citations
Book Open access Jul 2026

Context-Aware Feedback Compression in Online Judge Programming with LLMs

This work instantiates budgeted oracle-to-hint compression in online judge (OJ) style algorithmic programming as a modular interactive agent that couples an LLM core with a sandboxed judger, a feedback-to-hint prompt constructor, and trajectory memory.

Jialiang Gu, Keren Zhou, Daming Li et al. · 2 citations