Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
We assess how the code reasoning abilities of large language models (LLMs) generalize to different kinds of programs. We present techniques for obtaining in- and out-of-distribution programs with different characteristics: code sampled from a domain-specific language, code automatically generated by an LLM, code collected from competitive programming contests, and mutated versions of these programs. We also present an experimental methodology for evaluating LLM generalization by comparing their performance on these programs. We perform an extensive evaluation across 10 state-of-the-art models from the past year, obtaining insights into their generalization capabilities over time and across different classes of programs. Our results highlight that while earlier models exhibit behavior consistent with pattern matching, the latest models exhibit strong generalization abilities on code reasoning.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 11 of its 46 references that are in the map. First posted on arXiv 7 Apr 2025.
Builds on
11 of 46 references.
Closest ancestors · 2
Same direction, newest first
- 2025CodeI/O: Condensing Reasoning Patterns via Code Input-Output Prediction11 Feb
- 2024CodeMind: Evaluating Large Language Models for Code Reasoning15 Feb
Other references · 9
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2024GPT-4o System Cardcited by 4,588
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2024Robustness, Security, Privacy, Explainability, Efficiency, and Usability of Large Language Models for Codecited by 28
- 2024Assessing, Exploiting, and Mitigating Syntactic Robustness Failures in LLM-Based Code Generationcited by 6
Built on by
Citing papers per year: 2025: 6; 2026: 1.
7 papers.
- 2025LLMs Lean on Priors, Not Programming Language Semanticscited by 6
- 2025Mitigating Spurious Correlations in LLMs via Causality-Aware Post-Trainingcited by 5
- 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulationcited by 5
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settingscited by 3
- 2025Sense and Sensitivity: Examining the Influence of Semantic Recall on Long Context Code Understandingcited by 2
- 2026Diagnosing CFG Interpretation in LLMscited by 1
- 2025Do Generalisation Results Generalise?cited by 0
- 2026Diagnosing CFG Interpretation in LLMs22 Apr 2026
- 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings16 Dec 2025
- 2025Do Generalisation Results Generalise?8 Dec 2025
- 2025Demystifying Errors in LLM Reasoning Traces: An Empirical Study of Code Execution Simulation28 Nov 2025
- 2025LLMs Lean on Priors, Not Programming Language Semantics3 Oct 2025
- 2025Mitigating Spurious Correlations in LLMs via Causality-Aware Post-Training11 Jun 2025
- 2025Sense and Sensitivity: Examining the Influence of Semantic Recall on Long Context Code Understanding19 May 2025
Similar, not cited
Close in wording, no citation either way
- 2023Competition-Level Problems are Effective LLM Evaluators
- 2025Cross-Task Benchmarking and Evaluation of General-Purpose and Code-Specific Large Language Models ↗
- 2025rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset
- 2026Evaluating LLMs Code Reasoning Under Real-World Context
- 2025Evaluating and Improving Large Language Models for Competitive Program Generation
- 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
- 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks
- 2025OJBench: A Competition Level Code Benchmark For Large Language Models