How Does LLM Reasoning Work for Code? A Survey and a Call to Action

Ira Ceka, Saurabh Pujar, Irene Manotas, Gail E. Kaiser, Baishakhi Ray, Shyam Ramji · OpenReview

Abstract

The rise of large language models (LLMs) has led to dramatic improvements across a wide range of natural language tasks. Their performance on certain tasks can be further enhanced by incorporating test-time reasoning techniques. These inference-time advances have been adopted into the code domain, enabling complex software engineering (SWE) tasks such as code generation, test generation and issue resolution. However, the impact of different reasoning techniques on code-centric SWE tasks has not been systematically explored. In this work, we survey code reasoning techniques that underpin these capabilities, with a focus on test-time compute and inference-time reasoning paradigms. We examine a variety of code-specific reasoning methods and progressively build up to SWE agents, which combine planning, tool use, and multi-step interaction. We also compare the impact of different techniques on coding tasks, highlighting their relative importance and outlining open challenges and future research directions. Our contributions are: (1) to the best of our knowledge, the first dedicated survey of code reasoning for SWE tasks, highlighting overarching reasoning strategies, hybrid methods, and agentic approaches; (2) a taxonomy of inference-time techniques used to drive code reasoning, accompanied by a curated set of under-explored benchmarks with high potential for SWE evaluation; (3) a comparative analysis of reasoning design patterns across commonly used models and benchmarks; and (4) a synthesis of gaps in current methods and evaluation practices, identifying under-explored areas and concrete opportunities for future research.

Introduction

While Large Language Models (LLMs) have revolutionized natural language processing, code is a distinct domain: it is formal, highly structured, and executable. General reasoning techniques like Chain-of-Thought (CoT) have boosted performance in math and logic, but their application to Software Engineering (SWE) has been fragmented across various research efforts. This paper addresses this gap by creating a unified taxonomy of code reasoning, aiming to identify which patterns effectively scale from simple snippets to complex, real-world GitHub issues.

A Unified Taxonomy of Code Reasoning

The authors categorize the landscape of code reasoning into two primary branches: techniques and tasks. This taxonomy provides a structured framework for understanding how different inference-time strategies—ranging from basic CoT to sophisticated agentic workflows—address specific software engineering challenges.

Taxonomy of Code Reasoning techniques and tasks.

The survey identifies four primary "test-time compute" paradigms:

  1. Code Chain-of-Thought (CoT): Eliciting step-by-step logic, distinguishing between Plan-based CoT (natural language steps) and Code-structure CoT (using programming constructs like loops or branches to organize "thoughts").
  2. Self-Refinement: An iterative process where a model generates code, receives feedback (ideally from a compiler or test suite), and revises its output.
  3. Inference Scaling: Spending more compute at test-time by generating multiple candidate solutions (sampling) and using search algorithms (like Tree-of-Thought) to find the best path.
  4. SWE Agents: High-level frameworks that provide "scaffolding" for LLMs, managing planning, tool use (e.g., grep, debuggers), and environment interaction.

Test-Time Compute and Agent Scaffolding

A central theme of the survey is the shift toward "test-time compute," where models spend more effort during inference to arrive at a better solution. This is often implemented through agent scaffolding, which wraps the LLM in a loop of execution and reflection.

The workflow of code reasoning via test-time compute and agent scaffolding.

As illustrated in Figure 1, the agent scaffolding manages the interaction between the user query, the LLM, and the execution environment. Key components include CoT inducers, execution feedback for self-reflection, and search heuristics to select the optimal sample from multiple generated candidates.

Key Insights and Results

The survey highlights several critical findings:

  • Structure > Planning: Code-structure CoT consistently outperforms Plan-based CoT. Code's inherent logic is better captured by its own formal structures than by natural language prose.
  • Execution is the Ultimate Verifier: Self-refinement techniques using actual execution feedback (unit tests, runtime errors) are far more effective than "self-reflection" where the model merely reviews its own code. Execution provides a deterministic "ground truth."
  • The "System 2" Boost: Inference scaling allows smaller models to rival much larger models that use simple greedy decoding.
  • State-of-the-Art Performance: On benchmarks like SWE-bench Verified, agentic frameworks using models like Claude-3.5-Sonnet or DeepSeek-R1 are now resolving over 40-50% of real-world issues, a massive leap from the <5% resolution rates seen just a year ago.

Benchmarks and Evaluation

The authors synthesize results across several benchmark categories, from code generation (HumanEval, MBPP) to issue resolution (SWE-bench). They advocate for moving beyond "toy" problems toward "under-explored" benchmarks like SWT-Bench (test generation) and CRUXEval (input/output prediction) that better reflect diverse SWE workflows.

Future Research Directions

The paper identifies several critical gaps:

  • Benchmark Saturation: A need for benchmarks focusing on essential SWE tasks like refactoring, documentation, and library migration.
  • Deterministic Check Mystery: Investigating whether execution feedback serves primarily as a variance reducer or helps models overcome training data rigidity.
  • Error Recovery: Developing benchmarks to evaluate how well agents can pivot when an initial plan fails, avoiding repetitive loops.
  • Tool-Use Evaluation: Creating specific tests for complex SWE tools like profilers or version control systems beyond simple file editing.

Summary updated

BibTeX
@article{ceka2026how,
  author = {Ira Ceka and Saurabh Pujar and Irene Manotas and Gail E. Kaiser and Baishakhi Ray and Shyam Ramji},
  title = {{How Does LLM Reasoning Work for Code? A Survey and a Call to Action}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure