Breaking Memorization Barriers in LLM Code Fine-Tuning via Information Bottleneck for Improved Generalization

Changsheng Wang, Xin Chen, Sijia Liu, Ke Ding

TL;DR

LLM code fine-tuning often suffers from a "memorization barrier," where the model’s existing knowledge of the training data traps it in a suboptimal state, hindering its ability to learn generalizable logic. This paper introduces IB-FT, a fine-tuning method that uses the Information Bottleneck principle to compress memorized features, resulting in significantly more robust, reliable, and generalizable code generation.

What Problem Does This Paper Address?

Adapting Large Language Models (LLMs) to specific coding tasks via supervised fine-tuning (FT) is standard practice. However, the authors identify a hidden failure mode: the memorization barrier.

Because pre-training corpora are so vast, base models often already "know" (memorize) large portions of the downstream fine-tuning datasets. During standard fine-tuning, this pre-existing memorization acts as an optimization trap. The model settles into a "bad local optimum" characterized by high memorization but poor generalization.

This leads to an "illusion of effectiveness." A model might show decent results on sampling-based metrics (like Pass@10, where you get 10 tries to get one right), but its greedy decoding (Pass@1) often drops significantly. In short, the model isn't learning to code; it's struggling to move past what it has already memorized.

Methods

The authors propose IB-FT (Information Bottleneck-guided Fine-Tuning). The core idea is based on the Information Bottleneck (IB) principle, which suggests that an optimal representation should retain only the information from the input ($X$) that is necessary to predict the output ($Y$), discarding everything else as "spurious" or redundant.

Key technical components include:

  • Variational Bottleneck: The researchers insert a stochastic module at an intermediate layer of the LLM (e.g., layer 20).
  • Compression Penalty: They apply a Kullback–Leibler (KL) divergence penalty to the hidden representations. This forces the model to "compress" the information it passes through the network.
  • Joint Optimization: The final loss function combines the standard cross-entropy loss with the IB regularizer, balanced by hyperparameters $\alpha$ and $\beta$.
  • LoRA Integration: IB-FT is designed to work seamlessly with Low-Rank Adaptation (LoRA), making it computationally efficient.

By forcing this compression, IB-FT discourages the model from relying on specific, memorized patterns (spurious features) and encourages it to learn the underlying, task-relevant logic that generalizes to new problems.

Datasets

The study evaluates IB-FT across several benchmarks:

  • Code Training: OriGen (Verilog code generation) and Evol-CodeAlpaca-V1 (multi-language Python, C++, Java, etc.).
  • Code Evaluation: VerilogEval (subdivided into Eval-Human and Eval-Machine) and the classic HumanEval for Python.
  • Non-Code Validation: To prove the "memorization barrier" isn't unique to code, they also tested on HellaSwag (commonsense reasoning), OpenBookQA (science questions), and MNLI (natural language inference).

Key Insights and Ideas

  • The "Race" Analogy: The authors compare fine-tuning to a race (see Figure 1b). Standard FT starts fast because of memorization but takes a winding, inefficient path. IB-FT starts "later" due to the compression constraint but follows a straight line to the finish—true generalization.
  • Stricter Metrics Matter: The authors introduce Pass@$k^{(m)}$, a metric where a problem is only "solved" if at least $m$ out of $k$ generated samples pass unit tests. This exposes the fragility of standard fine-tuning, which often produces "lucky" single successes that aren't reproducible.
  • Representation Geometry: Analysis shows that standard FT actually increases the gap in the hidden space between memorized and non-memorized samples. IB-FT does the opposite, compressing this gap and forcing the model to treat different data points with more coherent, logic-based representations.
A performance comparison and a schematic "race" analogy between FT and IB-FT.

Key Results

IB-FT consistently outperformed standard fine-tuning and other regularization techniques (like Dropout or Label Smoothing) across all models (DeepSeek-Coder, CodeLlama, Llama-3).

  • Pass@1 Gains: On the OriGen dataset, IB-FT achieved a Pass@1 of 51.99% compared to 42.63% for standard FT.
  • Robustness to Sampling: Under the strict Pass@10(10) metric—where all 10 samples must be correct—IB-FT outperformed FT by a massive margin: 48.07% vs 27.56% on Eval-Human.
  • Temperature Stability: As shown in Figure 6, standard FT performance collapses as the sampling temperature ($T$) increases (becoming more stochastic). IB-FT remains remarkably stable, indicating it has learned a more robust internal logic.
Performance of IB-FT vs FT across different decoding temperatures, showing IB-FT's superior stability.

Limitations and Future Work

  • Hyperparameter Tuning: The effectiveness of IB-FT depends on the balance between compression and prediction ($\alpha$ and $\beta$). While the authors provide a sensitivity analysis, finding the "sweet spot" for a new dataset still requires some effort.
  • Theoretical Depth: While the empirical results are strong, the authors note that a more formal, mathematical characterization of the "memorization barrier" through the lens of optimization theory is a key direction for future research.
  • Broader Application: The paper hints that this barrier likely exists in other specialized domains (like law or medicine) where pre-trained models have already seen much of the available data. Testing IB-FT in these fields is a logical next step.

Summary updated

BibTeX
@inproceedings{wang2026breaking,
  author = {Changsheng Wang and Xin Chen and Sijia Liu and Ke Ding},
  title = {{Breaking Memorization Barriers in LLM Code Fine-Tuning via Information Bottleneck for Improved Generalization}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=eKVxQu0m0d},
}
Figure