mlsanityData to 7 Oct 2026

Reasoning Distillation and Structural Alignment for Improved Code Generation

arXiv 2510.17598 ↗First posted 20 Oct 2025cs.AI cs.CL cs.LGcited by 0

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

  1. 2023Bridging Code Semantic and LLMs: Semantic Chain-of-Thought Prompting for Code Generation16 Oct

Other references · 31

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023GPT-4 Technical Reportcited by 18,132
  3. 2024The Llama 3 Herd of Modelscited by 14,192
  4. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2020Scaling Laws for Neural Language Modelscited by 6,411
  7. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
  8. 2021Program Synthesis with Large Language Modelscited by 3,509
  9. 2023A Survey of Large Language Modelscited by 2,537
  10. 2022Emergent Abilities of Large Language Modelscited by 2,483
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  12. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
19 more
  1. 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,116
  2. 2022Editing Models with Task Arithmeticcited by 1,076
  3. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  4. 2023StarCoder: may the source be with you!cited by 790
  5. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
  6. 2024A Survey on Large Language Models for Code Generationcited by 646
  7. 2023Textbooks Are All You Needcited by 561
  8. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  9. 2022Teaching Small Language Models to Reasoncited by 279
  10. 2022Efficient Training of Language Models to Fill in the Middlecited by 248
  11. 2023SantaCoder: don't reach for the stars!cited by 169
  12. 2019To Tune or Not to Tune? Adapting Pretrained Representations to Diverse Taskscited by 167
  13. 2023TACO: Topics in Algorithmic COde generation datasetcited by 150
  14. 2021Reordering Examples Helps during Priming-based Few-Shot Learningcited by 50
  15. 2024The Larger the Better? Improved LLM Code-Generation via Budget Reallocationcited by 41
  16. 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisationcited by 31
  17. 2023LLM-Assisted Code Cleaning For Training Accurate Code Generatorscited by 27
  18. 2024Code Less, Align More: Efficient LLM Fine-tuning for Code Generation with Data Pruningcited by 19
  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

  1. 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs
  2. 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
  3. 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks
  4. 2024Distilling Algorithmic Reasoning from LLMs via Explaining Solution Programs
  5. 2023Small Language Models Fine-tuned to Coordinate Larger Language Models improve Complex Reasoning
  6. 2023Guiding Language Model Reasoning with Planning Tokens
  7. 2025CRANE: Reasoning with constrained LLM generation
  8. 2025CODE-DITING: A Reasoning-Based Metric for Functional Alignment in Code Evaluation