NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Code-enabled language models can outperform reasoning models on diverse tasks

Cedegao E. Zhang, Cédric Colas, Gabriel Poesia, Joshua B. Tenenbaum, Jacob Andreas

TL;DR

Standard instruction-tuned language models can match or outperform expensive, reinforcement-learning-trained reasoning models (like DeepSeek-R1) without any weight fine-tuning. By equipping standard LMs with CodeAdapt—a framework combining iterative code execution with a novel, 5-shot bootstrap learning strategy—models achieve superior reasoning capabilities while being up to 81% more token-efficient.

What Problem Does This Paper Address?

Large-scale Reinforcement Learning (RL) has given rise to powerful "Reasoning Models" (RMs) like OpenAI's o1 and DeepSeek-R1, which generate long, natural-language chains of thought. However, training these models requires massive compute and data, and running them is slow and expensive due to massive token generation.

The authors ask a fundamental question: Must we spend these immense resources to achieve advanced reasoning, or can standard language models be prompted to reason just as well at a fraction of the cost?

Methods

The authors introduce CodeAdapt, a training-free hybrid reasoning system that combines two key components:

  1. Iterative Code Execution (CodeAct): Instead of forcing the model to internalize all reasoning patterns, CodeAdapt lets the LM write and execute Python code in a multi-turn conversation loop. The code interpreter acts as an external workspace where the model can offload precise calculations, verify constraints, and systematically debug its own errors.
  2. Generalization-guided Few-shot Learning (GFL): A lightweight, automated prompt optimization method. Using just 5 training problems per task, the model generates multiple solution attempts. GFL evaluates these attempts not just on whether they got the right answer, but on how well they generalize as a one-shot example to help the model solve the other training problems. The best-generalizing traces are selected as the final few-shot context.
Figure 1: CodeAdapt architecture and performance. (a) We combine an iterative code-execution LM reasoning framework inspired by CodeAct (Wang et al., 2024a) with (b) a novel lightweight in-context learning procedure, and (c) show that this simple combination can help a set of LMs from different providers outperform corresponding reasoning models evaluated on eight diverse tasks.

Datasets

The framework was evaluated across 8 diverse tasks spanning three domains:

  • Instruction Following: IFBench (verifiable instruction following) and Collie (highly constrained paragraph generation).
  • Language Processing: MuSR (complex reading comprehension/object placement), Creativity (a novel word generation task based on psychology's Divergent Association Task), and Typos (fixing misspellings from LiveBench).
  • Formal Reasoning: Countdown (a novel arithmetic task inspired by the 24 game), AIME (US High School Math Olympiad problems from 2023-2025), and Zebra (Einstein logic puzzles from LiveBench).

Key Insights and Ideas

  • Modular Cognition: CodeAdapt effectively splits the cognitive workload. Natural language handles high-level planning, intuitive reasoning, and contextual understanding, while the Python environment takes care of precise calculations, control flow, and verification.
  • RL is Not a One-Size-Fits-All: Interestingly, large-scale RL post-training can sometimes degrade an RM's performance on linguistic and creative tasks (e.g., DeepSeek-V3 outperforming R1 on the Typos task). CodeAdapt, however, consistently provides positive gains across both formal and linguistic domains.
  • Inference-Time Scaling: Standard LMs naturally scale their performance with more computational budget. When allowed up to 10 interaction turns instead of 2, CodeAdapt performance jumps significantly.
Figure 2: CodeAdapts performs better with more budget. Aver- age over all tasks ± SEM.

Key Results

  • Outperforming RMs: Averaged across eight tasks, CodeAdapt enabled three out of four standard LMs (DeepSeek V3, Gemini 2.0 Flash, Qwen 2.5 Coder) to outperform their heavily RL-trained reasoning counterparts (DeepSeek R1, Gemini 2.5 Flash Lite Thinking, QwQ 32B).
  • Token & Time Efficiency: CodeAdapt achieved these gains while being 10% to 81% more token-efficient and running 16% to 47% faster than the corresponding reasoning models.
  • Low Cost: While training a model like DeepSeek-R1 costs hundreds of thousands of dollars, CodeAdapt's GFL optimization phase costs less than $25 per model for all tasks combined.

Limitations and Future Work

  • Complex Math Limits: While CodeAdapt dominates in instruction following and logic puzzles, expensively trained reasoning models still hold an edge in highly advanced formal mathematics benchmarks like AIME.
  • Tool Constraints: Currently, CodeAdapt is restricted to a basic Python interpreter environment. The authors note that expanding the toolset to include web search, specialized data analysis libraries, or allowing code to call other models would be a promising next step.
  • The Ultimate Hybrid: The authors suggest that CodeAdapt and RL are not mutually exclusive; combining lightweight code-enabled architectures with RL post-training could yield even more versatile and powerful reasoning systems.

Summary updated

BibTeX
@inproceedings{zhang2026code,
  author = {Cedegao E. Zhang and Cédric Colas and Gabriel Poesia and Joshua B. Tenenbaum and Jacob Andreas},
  title = {{Code-enabled language models can outperform reasoning models on diverse tasks}},
  booktitle = {CompLearn @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=oRK55epMT5},
}
Figure