Breaking Memorization Barriers in LLM Code Fine-Tuning via Information Bottleneck for Improved Generalization
Changsheng Wang, Xin Chen, Sijia Liu, Ke Ding
TL;DR
The paper identifies a memorization barrier in LLM code fine-tuning, where pre-memorized downstream data in the base model hampers effective adaptation. It proposes IB-regularized fine-tuning (IB-FT), which uses an information bottleneck to compress spurious memorized features while preserving task-relevant information, formulated via $I(X;Z)$ and $I(Z;Y)$ terms and implemented with a variational encoder. Across OriGen and Evol-CodeAlpaca-V1, IB-FT yields stronger and more stable generalization than conventional fine-tuning, with large gains at Pass@$1$ and improved robustness under strict multi-sample criteria such as Pass@$k^{(m)}$ and varying decoding temperatures. The work provides a practical, principled approach to breaking memorization-driven limits in code generation, with implications for safer, more reliable code synthesis and broader applicability to domain-adaptive LLM fine-tuning.
Abstract
Adapting pretrained large language models (LLMs) to code domains via supervised fine-tuning (FT) has been commonly used for code generation. However, we identify a previously underappreciated failure mode, the memorization barrier, where strong memorization of downstream code data in the base model could trap optimization and prevent the standard FT from effectively acquiring new, generalizable code knowledge. To overcome this barrier, we propose the information bottleneck (IB)-guided fine-tuning, termed IB-FT, which applies an IB penalty on hidden representations of the code data to compress spurious, memorized features while preserving task-relevant information. Extensive experiments on two code benchmarks (OriGen and Evol-CodeAlpaca-V1) show that IB-FT substantially alleviates the memorization barrier, improves top-1 performance (Pass@$1$), and yields far more stable gains under the stricter multi-sample metric Pass@$k^{(m)}$ (a problem counts as solved only if at least $m$ of $k$ samples pass unit tests) compared with conventional FT.
