Accepted at COLM 2026

Breaking Memorization Barriers in LLM Code Fine‑Tuning

An information bottleneck turns memorized, spurious features into room for real, generalizable code knowledge.

Changsheng Wang1, Xin Chen2, Sijia Liu1,3, Ke Ding2
1 Michigan State University  ·  2 Intel Corporation  ·  3 IBM Research
The code fine-tuning race: FT takes a winding memorization shortcut while IB-FT runs a straight track to the finish.
The code fine‑tuning race. FT looks ahead early by leaning on memorization, but follows a winding, less‑generalizable route. IB‑FT starts later yet runs straight to the finish.

At a glance

One regularizer, consistently stronger and more stable code models.

DeepSeek‑Coder‑7B‑Instruct‑v1.5 fine‑tuned on OriGen. IB‑FT beats standard fine‑tuning (FT) on top‑1 accuracy and, crucially, on the stricter multi‑sample metric Pass@k(m) — where a problem counts as solved only if at least m of k samples pass the unit tests.

Eval‑Human · Pass@1
42.652.0
+9.4 pts
vs. standard FT
Eval‑Machine · Pass@1
67.875.7
+7.8 pts
vs. standard FT
Eval‑Human · Pass@10(10)
27.648.1
+20.5 pts
all 10 samples must pass
Eval‑Machine · Pass@10(10)
49.769.2
+19.6 pts
all 10 samples must pass
Scatter plot: IB-FT occupies the high-performance zone on Eval-Human vs Eval-Machine, ahead of FT.
Figure 1a
IB‑FT reaches the high‑performance zone. Higher and more stable than FT under the strict Pass@k(m) (m = k).

Problem

The memorization barrier.

Practitioners adapt pretrained LLMs to code by supervised fine‑tuning. We find this is often brittle — and trace the cause to something the base model already did before you ever started.

Fine‑tuned code models can show a large gap between greedy decoding (Pass@1) and sampling‑based metrics: a correct program often appears somewhere among k samples, while the one‑time generation stays wrong. That exposes how little standard fine‑tuning actually acquires, and motivates our central question:

The central question

What causes the ineffectiveness of LLM code fine‑tuning, and how can fine‑tuning be improved to achieve stronger generalization?

Examining the interaction between fine‑tuning data and the pretrained model through the lens of memorization, we find the base model already strongly memorizes the downstream code databefore any adaptation. This traps optimization in a region the standard objective cannot escape.

Memorization barrier

The phenomenon where LLM code fine‑tuning starts from a base model that already strongly memorizes the fine‑tuning set, placing optimization in a state the conventional objective struggles to escape — leading to poor generalization on downstream code tasks.

KDE of Min-K% memorization scores on OriGen showing the base model already overlaps the fine-tuned model.
Figure 3a · OriGen
Already memorized during pretraining. Min‑K% Prob scores. The base‑model distribution (blue) overlaps heavily with the fine‑tuned one (yellow) and sits far from the weak‑memorization TOFU reference (purple).
Line plot: removing the most-memorized 10% of data improves Pass@1 on Eval-Human.
Figure 4 · Eval‑Human
Removing memorized data helps. Pruning as little as the most‑memorized 10% of examples improves Pass@1 — direct evidence that memorized points cap what fine‑tuning can learn.

Pruning works, but it is impractical: it needs example‑wise memorization attribution (expensive) and a search over how much to prune (multiple fine‑tuning runs). We want a remedy that needs no attribution and no pruning.

Method

Information Bottleneck–guided fine‑tuning (IB‑FT).

Instead of deleting memorized examples, compress their representations. An IB penalty on the hidden states discards input‑specific, spurious detail while keeping what predicts the target — so heavily and lightly memorized points get treated more equally.

Given input X, target Y, and a hidden representation Z, the information bottleneck seeks a Z that preserves task‑relevant information about Y while discarding redundant details of X:

minp(z|x)   I(X; Z) − β I(Z; Y) (2)

Direct computation is intractable in LLMs, so we follow the variational IB framework. On a designated hidden layer hθ(x) (e.g. layer 20), a variational encoder qφ produces Z, and the objective splits into two terms. The compression loss upper‑bounds I(X; Z) with a KL to a simple prior p(z) — discouraging Z from encoding exact input patterns:

IBcompress(θ,φ) = 𝔼x∼𝒟code  [  DKL ( qφ(z | hθ(x)) ‖ p(z) )  ] (4)

The prediction term keeps Z informative for the target, preventing over‑compression — the log‑likelihood of generating Y from Z:

IBpredict(θ,φ) = 𝔼(x,y)∼𝒟code  [  log pθ(y | z)  ] (5)

Together these give the IB regularizer, with β balancing compression against prediction:

IB(θ,φ) = ℓIBcompress(θ,φ) − β ℓIBpredict(θ,φ) (6)

Finally, adding the IB regularizer to the standard cross‑entropy fine‑tuning loss FT yields IB‑regularized fine‑tuning (IB‑FT), where α controls the IB strength:

minθ,φ   ℓFT(θ)  +  α ℓIB(θ,φ) (IB‑FT)

No data attribution. No pruning. No prior knowledge of which examples form the barrier — just one penalty on the hidden representations.

Why it works: the barrier shows up in representation geometry.

Partition the data into most‑memorized and least‑memorized groups and measure their hidden representations at layer 20. Standard FT exaggerates the separation between the two groups — building the very barrier that forces the model to treat them differently. IB‑FT compresses that gap, cutting both distance and angular disparity by more than half.

KDE of L2 distance between memorized and non-memorized representations; IB-FT is far more compressed than FT.
Figure 5 · ℓ2 distance
Distance collapses. FT (orange) pushes the two groups apart; IB‑FT (green) pulls them back toward the base model.
KDE of angular disparity between memorized and non-memorized representations; IB-FT far more compressed.
Figure 5 · Angle
Angles align. Same story for angular disparity — IB‑FT yields more coherent, task‑relevant representations across data groups.

Experiments

Consistent, reproducible gains — especially where it is hard.

Two benchmarks (OriGen, Evol‑CodeAlpaca‑V1), multiple base models, and comparisons against regularization baselines (Dropout, Gaussian noise, label smoothing) and data‑selection baselines (Min‑K%, GRAND). Below: the headline OriGen table.

Table 1 (excerpt). DeepSeek‑Coder‑7B‑Instruct‑v1.5 on OriGen. Pass@1 and the strict Pass@10(m) (all‑m‑pass, m = 10). Best in each column in bold.
Method Human · Pass@1 Human · Pass@10(10) Machine · Pass@1 Machine · Pass@10(10)
Base (no FT)34.6244.76
Standard FT42.6327.5667.8349.65
FT w/ Dropout43.6433.5572.9751.41
FT w/ GN45.9134.3672.2151.66
FT w/ Min‑K%50.8942.9573.7868.52
IB‑FT (ours)51.9948.0775.6769.23

The pattern is sharpest under the strictest setting (m = 10, all ten samples must pass): IB‑FT improves over FT by roughly 20 points on both Eval‑Human and Eval‑Machine. FT’s successes are often isolated single samples; IB‑FT’s are consistently reproducible.

OriGen · Verilog DeepSeek & CodeLlama 7B VerilogEval

Robust across decoding temperature.

Varying T ∈ {0.2, 0.6, 1.0} stresses sampling stochasticity. IB‑FT sustains superior accuracy across all temperatures, while FT collapses as T grows — e.g. on Eval‑Machine at T = 1.0, IB‑FT reaches 50.3% (Pass@10(10)) while FT falls to 2.1%.

Bar chart of Pass@10(10) on Eval-Human across temperatures 0.2/0.6/1.0 for base, FT, IB-FT.
Figure 6 · Eval‑Human
Pass@10(10) across T. IB‑FT stays highest at every temperature.
Bar chart of Pass@10(10) on Eval-Machine across temperatures for base, FT, IB-FT.
Figure 6 · Eval‑Machine
FT collapses at T = 1.0; IB‑FT holds.
Beyond code · HellaSwag · OpenBookQA · MNLI Llama‑2‑7B & Llama‑3‑8B

Generalizes to other domains and models.

The memorization barrier is not code‑specific. Extending both the probing protocol and IB‑FT to three non‑code tasks — commonsense reasoning (HellaSwag), science QA (OpenBookQA), and natural‑language inference (MNLI) — reproduces the same three‑way memorization separation, and IB‑FT again beats FT. Together with the code results, IB‑FT is now validated across five task categories and four model families (DeepSeek‑Coder, CodeLlama, Llama‑2, Llama‑3).

Table A2. Zero‑shot accuracy for Llama‑2‑7B / Llama‑3‑8B fine‑tuned on three non‑code datasets. Best in bold.
Method HellaSwag (Llama‑2‑7B) OpenBookQA (Llama‑3‑8B) MNLI (Llama‑3‑8B)
Base0.570.360.48
+ FT0.810.670.84
+ IB‑FT0.840.710.87

What is left open

A phenomenon worth theory.

IB‑FT is a practical fix; the memorization barrier is a deeper question. Directions we think matter:

Cite this work

BibTeX.

Accepted at the Conference on Language Modeling (COLM) 2026. If you find this work useful, please cite:

@article{wang2025breaking,
  title   = {Breaking Memorization Barriers in LLM Code Fine-Tuning
             via Information Bottleneck for Improved Generalization},
  author  = {Wang, Changsheng and Chen, Xin and Liu, Sijia and Ding, Ke},
  journal = {arXiv preprint arXiv:2510.16022},
  year    = {2025}
}