Reasoning Distillation and Structural Alignment for Improved Code Generation

Amir Jalilifard, Anderson de Rezende Rocha, Marcos Medeiros Raimundo
10/20/2025
cs.AIcs.CLcs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Effective code generation with language models hinges on two critical factors: accurately understanding the intent of the prompt and generating code that applies algorithmic reasoning to produce correct solutions capable of passing diverse test cases while adhering to the syntax of the target programming language. Unlike other language tasks, code generation requires more than accurate token prediction; it demands comprehension of solution-level and structural relationships rather than merely generating the most likely tokens. very large language model (VLLM) are capable of generating detailed steps toward the correct solution of complex tasks where reasoning is crucial in solving the problem. Such reasoning capabilities may be absent in smaller language models. Therefore, in this work, we distill the reasoning capabilities of a VLLM into a smaller, more efficient model that is faster and cheaper to deploy. Our approach trains the model to emulate the reasoning and problem-solving abilities of the VLLM by learning to identify correct solution pathways and establishing a structural correspondence between problem definitions and potential solutions through a novel method of structure-aware loss optimization. This enables the model to transcend token-level generation and to deeply grasp the overarching structure of solutions for given problems. Experimental results show that our fine-tuned model, developed through a cheap and simple to implement process, significantly outperforms our baseline model in terms of pass@1, average data flow, and average syntax match metrics across the MBPP, MBPP Plus, and HumanEval benchmarks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jalilifard2025reasoning,
  title  = {Reasoning Distillation and Structural Alignment for Improved Code Generation},
  author = {Amir Jalilifard and Anderson de Rezende Rocha and Marcos Medeiros Raimundo},
  year   = {2025},
  eprint = {2510.17598},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.17598v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.17598.svg)](https://codeofpaper.com/paper/2510.17598)

Discussion