Distilling Algorithmic Reasoning from LLMs via Explaining Solution Programs
On the map: LLM reasoning → Reasoning benchmarks and evaluation
Abstract (arXiv)
Distilling explicit chain-of-thought reasoning paths has emerged as an effective method for improving the reasoning abilities of large language models (LLMs) across various tasks. However, when tackling complex tasks that pose significant challenges for state-of-the-art models, this technique often struggles to produce effective chains of thought that lead to correct answers. In this work, we propose a novel approach to distill reasoning abilities from LLMs by leveraging their capacity to explain solutions. We apply our method to solving competitive-level programming challenges. More specifically, we employ an LLM to generate explanations for a set of <problem, solution-program> pairs, then use <problem, explanation> pairs to fine-tune a smaller language model, which we refer to as the Reasoner, to learn algorithmic reasoning that can generate "how-to-solve" hints for unseen problems. Our experiments demonstrate that learning from explanations enables the Reasoner to more effectively guide program implementation by a Coder, resulting in higher solve rates than strong chain-of-thought baselines on competitive-level programming problems. It also outperforms models that learn directly from <problem, solution-program> pairs. We curated an additional test set in the CodeContests format, which includes 246 more recent problems posted after the models' knowledge cutoff.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 3 of its 30 references that are in the map. First posted on arXiv 11 Apr 2024.
Builds on
3 of 30 references.
References · 3
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2018Neural Program Search: Solving Programming Tasks from Description and Examplescited by 10
Built on by
Citing papers per year: 2025: 2; 2026: 1.
3 papers.
- 2025Antidistillation Samplingcited by 24
- 2025AutoSDT: Scaling Data-Driven Discovery Tasks Toward Open Co-Scientistscited by 11
- 2026Aggressive Compression Enables LLM Weight Theftcited by 1
- 2026Aggressive Compression Enables LLM Weight Theft3 Jan 2026
- 2025AutoSDT: Scaling Data-Driven Discovery Tasks Toward Open Co-Scientists9 Jun 2025
- 2025Antidistillation Sampling17 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2024Divide-or-Conquer? Which Part Should You Distill Your LLM?
- 2024LLM Reasoners: New Evaluation, Library, and Analysis of Step-by-Step Reasoning with Large Language Models
- 2026The Periodic Table of LLM Reasoning: A Structured Survey of Reasoning Paradigms, Methods, and Failure Modes
- 2023Small Language Models Fine-tuned to Coordinate Larger Language Models improve Complex Reasoning
- 2024textttLM^texttt2: A Simple Society of Language Models Solves Complex Reasoning
- 2025Teaching LLM to Reason: Reinforcement Learning from Algorithmic Problems without Code
- 2025The Valley of Code Reasoning: Scaling Knowledge Distillation of Large Language Models
- 2024Multi-Step Reasoning with Large Language Models, a Survey