Skip to content

Distilling large language models for code generation via ranking supervision.

Jul 2026 · Neural Networks · Vol 205 Pt B, pp. 109437 · 0 citations · 22 references
Medicine

TL;DR

This work proposes a distillation approach based on ranking supervision that consistently outperforms supervised fine-tuning as well as FKL and RKL baselines in Python code generation, multilingual generation, and data-science scenarios and offers guidance for future research in model compression.

Abstract

In recent years, large language models (LLMs) have achieved remarkable advances in code generation. However, their massive parameter scales hinder deployment in resource-constrained environments. Knowledge distillation has emerged as an effective compression technique that transfers knowledge from a large teacher model to a smaller student model, thereby reducing computational cost while retaining strong generative capability. However, traditional distillation methods usually depend on forward and reverse Kullback-Leibler (KL) divergence, aligning the probability distribution over the entire vocabulary. This process makes them susceptible to long-tail noise and often leads to weaker performance than supervised fine-tuning with labeled data. To address this issue, we propose a distillation approach based on ranking supervision. At each step, the method selects the candidate tokens with the highest probabilities from the teacher's output and applies a ListNet-based loss. This loss encourages the student to learn the teacher's ranking preferences. Unlike conventional KL distillation, ranking distillation avoids exhaustive alignment of low-confidence tokens, achieving comparable training time while significantly reducing GPU memory consumption. We conduct systematic evaluations on four public benchmarks (HumanEval, MBPP, DS-1000, and MultiPL-E). Experimental results demonstrate that the proposed method consistently outperforms supervised fine-tuning as well as FKL and RKL baselines in Python code generation, multilingual generation, and data-science scenarios. Moreover, it maintains stable performance gains across different model scales, including both the Qwen2.5-Coder and DeepSeek-Coder families. Our method provides an effective solution for distilling large language models in code generation and offers guidance for future research in model compression.

View source

Similar papers

Jul 2026

The Case Against Generation for Retrieval: Discriminative Language Models as Effective Retrievers

Large Language Models (LLMs) have emerged as powerful assets for recommender systems. However, deploying them as generative recommenders or zero-shot rankers at web-scale remains bottlenecked by prohibitive computational overhead and grounding challenges. In this paper, we revitalize the classic, highly efficient two-t...

Zhe Xu, Prachi Agrawal, Kavosh Asadi et al. · 0 citations
Jul 2026

Score-Only Distillation for Compact Dense Retrieval

Externally-transfer performance after distillation remains mixed, so the evidence supports compression of teacher rankings under matched retrieval protocols.

K. Dubovikov, Martin Takác, S. Lahlou · 0 citations
Preprint Aug 2026

Efficient Knowledge Distillation for LLMs: Offline Top-K Logits and a Fused Chunked KL Loss

A practitioner's study of how to make distillation training efficient is presented, organised around two systems contributions, and a fused, chunked KL loss is introduced, making peak memory linear in the sequence length.

Bakbergen Ryskulov, Iker García-Ferrero, David Montero et al. · 0 citations
Conference Open access 2026

Distilling LLM Reasoning into Dense Encoders: Bridging the Accuracy-Efficiency Gap in Recommendation

Reasoning-to-Encoder Distilla-tion (R2END), a framework that establishes a text encoder as the optimal student architecture for scalable recommendation, and compresses the teacher’s reasoning into a dense vector space via a semantic alignment objec-tive, effectively capturing user-item dynamics.

D. Han, Daeyoung Roh, A. Y. Kim et al. · 0 citations
Aug 2026

GLA-LoRA: Parameter-efficient LLM fine-tuning with global-local knowledge alignment.

GLA-LoRA establishes a unified learning strategy that synergistically integrates multi-granular contrastive learning with knowledge distillation and establishes that explicit global-local knowledge alignment is essential for achieving high-fidelity, parameter-efficient fine-tuning across diverse language tasks.

Hao Wu, Jian-Qi Gao, Xiangfeng Luo · 0 citations
Preprint Aug 2026

MLLMCLIP: Feature-Level Distillation of MLLM for Robust Vision-Language Representations

Compared to prior CLIP-enhancement methods, MLLMCLIP achieves state-of-the-art compositional accuracy while delivering consistent gains on standard zero-shot classification and image-text retrieval, showing that feature-level distillation strengthens both compositional and general vision-language representation capabil...

Jongsuk Kim, Qi-Yu Wu, Zhuoyuan Mao et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.