mlsanityData to 7 Oct 2026

Steering Large Language Models between Code Execution and Textual Reasoning

arXiv 2410.03524 ↗First posted 4 Oct 2024cs.CLcited by 24

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

While a lot of recent research focuses on enhancing the textual reasoning capabilities of Large Language Models (LLMs) by optimizing the multi-agent framework or reasoning chains, several benchmark tasks can be solved with 100% success through direct coding, which is more scalable and avoids the computational overhead associated with textual iterating and searching. Textual reasoning has inherent limitations in solving tasks with challenges in math, logics, optimization, and searching, which is unlikely to be solved by simply scaling up the model and data size. The recently released OpenAI GPT Code Interpreter and multi-agent frameworks such as AutoGen have demonstrated remarkable proficiency of integrating code generation and execution to solve complex tasks using LLMs. However, based on our experiments on 7 existing popular methods for steering code/text generation in both single- and multi-turn settings with 14 tasks and 6 types of LLMs (including the new O1-preview), currently there is no optimal method to correctly steer LLMs to write code when needed. We discover some interesting patterns on when models use code vs. textual reasoning with the evolution to task complexity and model sizes, which even result in an astonishingly inverse scaling behavior. We also discover that results from LLM written code are not always better than using textual reasoning, even if the task could be solved through code. To mitigate the above issues, we propose three methods to better steer LLM code/text generation and achieve a notable improvement. The costs of token lengths and runtime are thoroughly discussed for all the methods. We believe the problem of steering LLM code/text generation is critical for future research and has much space for further improvement. Project Page, Datasets, and Codes are available at https://yongchao98.github.io/CodeSteer/.

Key facts. Cited by 24 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 44 of its 64 references that are in the map. First posted on arXiv 4 Oct 2024.

Builds on

44 of 64 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024Mixture-of-Agents Enhances Large Language Model Capabilities7 Jun
  2. 2024Learning to Reason via Program Generation, Emulation, and Search25 May
  3. 2024LLMs Can't Plan, But Can Help Planning in LLM-Modulo Frameworks2 Feb
  4. 2023Chain of Code: Reasoning with a Language Model-Augmented Code Emulator7 Dec
  5. 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models6 Oct
  6. 2023ReConcile: Round-Table Conference Improves Reasoning via Consensus among Diverse LLMs22 Sep

Other references · 38

  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. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  5. 2020Scaling Laws for Neural Language Modelscited by 6,411
  6. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  7. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  8. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  9. 2022Do As I Can, Not As I Say: Grounding Language in Robotic Affordancescited by 2,302
  10. 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 1,908
  11. 2023AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversationcited by 1,906
  12. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
26 more
  1. 2024Mixtral of Expertscited by 1,785
  2. 2022Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Themcited by 1,767
  3. 2022Code as Policies: Language Model Programs for Embodied Controlcited by 1,172
  4. 2022Inner Monologue: Embodied Reasoning through Planning with Language Modelscited by 1,057
  5. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
  6. 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 965
  7. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 956
  8. 2023CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquingcited by 751
  9. 2023Eureka: Human-Level Reward Design via Coding Large Language Modelscited by 542
  10. 2023LLM+P: Empowering Large Language Models with Optimal Planning Proficiencycited by 496
  11. 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 400
  12. 2024RoboPoint: A Vision-Language Model for Spatial Affordance Prediction for Roboticscited by 242
  13. 2023PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimizationcited by 226
  14. 2023Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verificationcited by 166
  15. 2022Language Models of Code are Few-Shot Commonsense Learnerscited by 160
  16. 2024Fine-Tuning Large Vision-Language Models as Decision-Making Agents via Reinforcement Learningcited by 158
  17. 2023MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoningcited by 155
  18. 2023Large Language Model Cascades with Mixture of Thoughts Representations for Cost-efficient Reasoningcited by 140
  19. 2023Generalized Planning in PDDL Domains with Pretrained Large Language Modelscited by 139
  20. 2023Solving Math Word Problems by Combining Language Models With Symbolic Solverscited by 124
  21. 2023Black-Box Prompt Optimization: Aligning Large Language Models without Model Trainingcited by 122
  22. 2024Meta-Prompting: Enhancing Language Models with Task-Agnostic Scaffoldingcited by 115
  23. 2024Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language Modelscited by 90
  24. 2024Large Language Models Can Solve Real-World Planning Rigorously with Formal Verification Toolscited by 47
  25. 2023Errors are Useful Prompts: Instruction Guided Task Programming with Verifier-Assisted Iterative Promptingcited by 45
  26. 2024CRAB: Cross-environment Agent Benchmark for Multimodal Language Model Agentscited by 38

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 17; 2026: 6.

24 papers.

Sort:

By area:

  1. 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMscited by 47
  2. 2025Learning When to Plan: Efficiently Allocating Test-Time Compute for LLM Agentscited by 18
  3. 2025More Documents, Same Length: Isolating the Challenge of Multiple Documents in RAGcited by 16
  4. 2025R1-Code-Interpreter: LLMs Reason with Code via Supervised and Multi-stage Reinforcement Learningcited by 15
  5. 2025TUMIX: Multi-Agent Test-Time Scaling with Tool-Use Mixturecited by 13
  6. 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
  7. 2025CodeSteer: Symbolic-Augmented Language Models via Code/Text Guidancecited by 11
  8. 2025Code-as-Symbolic-Planner: Foundation Model-Based Robot Planning via Symbolic Code Generationcited by 10
  9. 2025Aurelia: Test-time Reasoning Distillation in Audio-Visual LLMscited by 9
  10. 2025OWL: Geometry-Aware Spatial Reasoning for Audio Large Language Modelscited by 9
  11. 2025The Hitchhiker's Guide to Program Analysis, Part II: Deep Thoughts by LLMscited by 4
  12. 2025Code-enabled language models can outperform reasoning models on diverse taskscited by 4
12 more
  1. 2026DeonticBench: A Benchmark for Reasoning over Rulescited by 4
  2. 2025ML-Tool-Bench: Tool-Augmented Planning for ML Taskscited by 3
  3. 2024Neuron-Level Differentiation of Memorization and Generalization in Large Language Modelscited by 2
  4. 2025Utilizing Training Data to Improve LLM Reasoning for Tabular Understandingcited by 2
  5. 2026Exploring Diverse Generation Paths via Inference-time Stiefel Activation Steeringcited by 2
  6. 2025A Reality Check of Language Models as Formalizers on Constraint Satisfaction Problemscited by 1
  7. 2025Reinforcement Learning-Guided Chain-of-Draft for Token-Efficient Code Generationcited by 1
  8. 2026Knowledge Model Prompting Increases LLM Performance on Planning Taskscited by 1
  9. 2026ShallowJail: Steering Jailbreaks against Large Language Modelscited by 1
  10. 2026Confidence Should Be Calibrated More Than One Turn Deepcited by 1
  11. 2025Plan-and-Refine: Diverse and Comprehensive Retrieval-Augmented Generationcited by 0
  12. 2026EAPO: Entropy-Driven Adaptive Positive-Negative Sample Weighting for Policy Optimization in Open-Ended QAcited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025MapCoder-Lite: Distilling Multi-Agent Coding into a Single Small LLM
  2. 2024If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents
  3. 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks
  4. 2025Cross-Task Benchmarking and Evaluation of General-Purpose and Code-Specific Large Language Models ↗
  5. 2024Large Language Model Evaluation Via Multi AI Agents: Preliminary results
  6. 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
  7. 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs
  8. 2025LMR-BENCH: Evaluating LLM Agent's Ability on Reproducing Language Modeling Research