NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Iterative Knowledge Distillation through Feedback-Driven Learning Cycles

Yujia Chen, Yang Ye, Zhongqi Li, Yuchi Ma, Cuiyun GaoarXiv 2024 · OpenReview

Abstract

Large code models (LCMs) have remarkably advanced the field of code intelligence. Despite their impressive capabilities, they still face practical employment challenges, such as high costs, limited accessibility of proprietary LCMs, and adaptability issues of ultra-large LCMs. These challenges highlight the critical need for more accessible, lightweight yet effective LCMs. In this paper, we propose IterKD (also referred to as SODA), an Iterative Knowledge Distillation framework, which aims at continually transferring the programming capabilities of larger, advanced LCMs (Teacher) to smaller, less powerful LCMs (Student). IterKD consists of three stages in one cycle: (1) Correct-and-Fault Knowledge Delivery, (2) Multi-view Feedback, and (3) Feedback-based Knowledge Update. By performing the training cycle iteratively, the student model is continuously refined. Based on this framework, we develop SodaCoder-DS-6.7B, which achieves a Pass@1 score of 65.2 on the HumanEval benchmark, outperforming models five times its size.

Introduction

Large Code Models like GPT-4 are incredibly capable but come with high costs, latency, and accessibility barriers. While the goal is to "distill" the intelligence of these giants into smaller, local models, current methods face two major flaws. First, the "Perfect Student" fallacy: most distillation only shows the student correct code, whereas humans learn best by understanding why a mistake is a mistake. Second, the static curriculum: most training uses a fixed dataset that doesn't adapt to the student's actual progress. The SODA (Self-Paced knOwledge DistillAtion) framework addresses these by treating distillation as an adaptive, iterative cycle.

The SODA Framework

The SODA framework treats distillation as a three-stage cyclical process designed to evolve alongside the student model's capabilities.

The three-stage SODA framework: Correct-and-Fault Knowledge Delivery, Multi-View Feedback, and Feedback-based Knowledge Update.
  1. Correct-and-Fault Knowledge Delivery: The Teacher (e.g., Llama3-70B) generates both correct solutions and "faulty" ones. The Student learns via Correctness-aware Supervised Learning (to do things right) and Fault-aware Contrastive Learning (to distinguish right from wrong).
  2. Multi-View Feedback: The Student’s performance is evaluated via Static Execution (testing if the code runs) and Model-based Scoring (a specialized judge model scoring readability and best practices).
  3. Feedback-based Knowledge Update: Questions are categorized as Easy, Medium, or Hard based on student performance. The Teacher then generates new seed questions tailored to the Student's weaknesses, ensuring the curriculum evolves.

Learning from Error: Fault-Aware Distillation

A key innovation of SODA is the inclusion of faulty examples. By showing a model a correct snippet and a slightly broken one side-by-side, contrastive learning forces the model to understand the "boundaries" of correct logic. The framework specifically targets five common error types: syntax, logic, type, name, and timeout errors.

Examples of faulty solutions generated by the teacher model to help the student recognize common programming errors like logical flaws and syntax mistakes.

Experimental Results

The authors evaluated SODA using industry-standard benchmarks including HumanEval, MBPP, and MultiPL-E. The results are striking for a model with only ~7 billion parameters:

  • Beating the Giants: SodaCoder-DS-6.7B achieved an average Pass@1 score of 66.4% across seven languages, surpassing ChatGPT (61.3%).
  • Massive Gains: SODA improved the base student model's performance by 65.96% on average.
  • State-of-the-Art: It outperformed other leading distillation methods like PERsD and OSS-INSTRUCT by nearly 30%.
  • Efficiency: Despite its size, SodaCoder-DS-6.7B reaches roughly 90% of the performance of GPT-4 Turbo while being significantly faster and cheaper to run locally.

Conclusion

The SODA framework demonstrates that how a model is taught matters as much as its size. By incorporating faulty examples and an iterative feedback loop, lightweight models can achieve performance previously reserved for massive, proprietary systems. Future work will look to expand the "fault domain" to include complex issues like concurrency bugs and architectural flaws, as well as applying self-paced learning to multi-file software repositories.

Summary updated

BibTeX
@misc{chen2024iterative,
  author = {Yujia Chen and Yang Ye and Zhongqi Li and Yuchi Ma and Cuiyun Gao},
  title = {{Iterative Knowledge Distillation through Feedback-Driven Learning Cycles}},
  year = {2024},
  eprint = {2408.03680},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.03680},
}
Figure