Language Models Can Easily Learn to Reason from Demonstrations

Dacheng Li, Shiyi Cao, Tyler Griggs, Shu Liu, Xiangxi Mo, Eric Tang, Sumanth Hegde, Kourosh Hakhamaneshi, Shishir G Patil, Matei Zaharia, Joseph E. Gonzalez, Ion StoicaACL 2025

Abstract

Large reasoning models (LRMs) tackle complex problems by following long chain-of-thoughts (Long CoT) that incorporate reflection, backtracking, and self-validation. However, the training techniques and data requirements to elicit Long CoT remain poorly understood. In this work, we find that language models can effectively learn Long CoT reasoning through data-efficient supervised fine-tuning (SFT) and further parameter-efficient low-rank adaptation (LoRA). Crucially, we find that the structure of Long CoT is critical to the learning process in this data-efficient fine-tuning process. Training on content-incorrect examples, e.g. those lead to incorrect answers or corrupted digits, still leads to significant performance gains. In contrast, training on structurally incorrect examples, e.g., with shuffled or deleted reasoning steps, yield smaller improvements or even degrade performance.

Introduction

The emergence of models like OpenAI’s o1 and DeepSeek-R1 has demonstrated that "thinking out loud"—using extended reasoning traces—is a powerful paradigm for solving complex mathematical and coding tasks. Despite their success, the underlying mechanisms for teaching these models to reason are often shrouded in complex, large-scale Reinforcement Learning (RL) pipelines. This study investigates whether these capabilities can be distilled into standard models using simpler, more efficient methods. Specifically, we explore the efficacy of Supervised Fine-Tuning (SFT) and Low-Rank Adaptation (LoRA) on small, high-quality datasets to determine if reasoning is a learnable structural pattern.

Methodology

We developed Sky-T1, a reasoning model based on the Qwen2.5-32B-Instruct architecture. Our training pipeline utilized a curated dataset of 17,000 Long Chain-of-Thought (CoT) samples. These samples were reject-sampled from DeepSeek-R1 and supplemented with 12,000 math and 5,000 coding problems from QwQ-32B-Preview.

To isolate the factors contributing to reasoning performance, we compared full-parameter SFT against LoRA (r=256), which updates less than 5% of the model's parameters. Furthermore, we conducted a series of perturbation experiments on the training data to distinguish between the importance of content (the accuracy of facts and digits) and structure (the logical flow and sequence of steps).

Results and Performance

Our findings indicate that reasoning capabilities can be distilled with remarkable efficiency. Sky-T1-32B achieved significant performance gains across five rigorous benchmarks, often rivaling much larger closed-source models.

Comparative performance of Sky-T1 variants against base and frontier models.

On the AIME 2024 benchmark, accuracy surged from 16.7% in the base model to 56.7% after fine-tuning, matching the performance of o1-preview. Similar improvements were observed in Math-500 (90.8% accuracy) and LiveCodeBench, where the model showed an 8.1% improvement, suggesting that math-centric reasoning training generalizes effectively to programming tasks. Notably, the LoRA-tuned model performed nearly as well as the full SFT version, suggesting that reasoning is a "style" or "template" that does not require deep architectural updates.

The Structural Nature of Reasoning

The most significant insight from our study is that the logical structure of a reasoning trace is more vital than its content correctness. In our perturbation tests, we found that models trained on traces with incorrect final answers or corrupted digits still showed substantial performance improvements. However, when the structural integrity of the reasoning was compromised—by shuffling steps or deleting intermediate logic—performance dropped sharply.

Impact of structural vs. content perturbations on model accuracy.

This suggests that LLMs primarily learn the "syntax of thought." By observing patterns of reflection (e.g., using keywords like "Wait" or "Actually"), models learn to trigger their own backtracking and self-correction mechanisms. This structural learning allows the model to navigate complex problem spaces even when the individual training demonstrations are imperfect.

Conclusion

Our research demonstrates that complex reasoning is a pattern that can be learned from a relatively small number of high-quality demonstrations. By focusing on the structural consistency of Chain-of-Thought data, researchers can develop highly capable reasoning models using fractionally less compute than traditional RL-heavy approaches. While RL remains a tool for reaching the absolute performance frontier, data-efficient SFT and LoRA provide a robust foundation for the next generation of open-source reasoning models.

Summary updated

BibTeX
@inproceedings{li2025language,
  author = {Dacheng Li and Shiyi Cao and Tyler Griggs and Shu Liu and Xiangxi Mo and Eric Tang and Sumanth Hegde and Kourosh Hakhamaneshi and Shishir G Patil and Matei Zaharia and Joseph E. Gonzalez and Ion Stoica},
  title = {{Language Models Can Easily Learn to Reason from Demonstrations}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=76EGyNLL7r},
}
Figure