Reasoning Distillation and Structural Alignment for Improved Code Generation
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 32 of its 45 references that are in the map. First posted on arXiv 20 Oct 2025.
Builds on
32 of 45 references.
Closest ancestors · 1
Same direction, newest first
Other references · 31
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023A Survey of Large Language Modelscited by 2,537
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
19 more
- 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,116
- 2022Editing Models with Task Arithmeticcited by 1,076
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023StarCoder: may the source be with you!cited by 790
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023Textbooks Are All You Needcited by 561
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022Teaching Small Language Models to Reasoncited by 279
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2023SantaCoder: don't reach for the stars!cited by 169
- 2019To Tune or Not to Tune? Adapting Pretrained Representations to Diverse Taskscited by 167
- 2023TACO: Topics in Algorithmic COde generation datasetcited by 150
- 2021Reordering Examples Helps during Priming-based Few-Shot Learningcited by 50
- 2024The Larger the Better? Improved LLM Code-Generation via Budget Reallocationcited by 41
- 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisationcited by 31
- 2023LLM-Assisted Code Cleaning For Training Accurate Code Generatorscited by 27
- 2024Code Less, Align More: Efficient LLM Fine-tuning for Code Generation with Data Pruningcited by 19
- 2024CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agentscited by 11
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs
- 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
- 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks
- 2024Distilling Algorithmic Reasoning from LLMs via Explaining Solution Programs
- 2023Small Language Models Fine-tuned to Coordinate Larger Language Models improve Complex Reasoning
- 2023Guiding Language Model Reasoning with Planning Tokens
- 2025CRANE: Reasoning with constrained LLM generation
- 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluation