mlsanityData to 14 Oct 2026

Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoning

arXiv 2601.21894 ↗First posted 29 Jan 2026cs.LGcited by 1

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

Abstract (arXiv)

Large Language Models (LLMs) increasingly exhibit strong reasoning abilities, often attributed to their capacity to generate chain-of-thought-style intermediate reasoning. Recent work suggests that exposure to code can further enhance these skills, but existing studies largely treat code as a generic training signal, leaving open the question of which properties of code actually contribute to improved reasoning. To address this gap, we study the structural complexity of code, which captures control flow and compositional structure that may shape how models internalise multi-step reasoning during fine-tuning. We examine two complementary settings: solution-driven complexity, where complexity varies across multiple solutions to the same problem, and problem-driven complexity, where complexity reflects variation in the underlying tasks. Using cyclomatic complexity and logical lines of code to construct controlled fine-tuning datasets, we evaluate a range of open-weight LLMs on diverse reasoning benchmarks. Our findings show that although code can improve reasoning, structural properties strongly determine its usefulness. In 83% of experiments, restricting fine-tuning data to a specific structural complexity range outperforms training on structurally diverse code, pointing to a data-centric path for improving reasoning beyond scaling.

Key facts. Cited by 1 paper 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 33 of its 50 references that are in the map. First posted on arXiv 29 Jan 2026.

Builds on

33 of 50 references.

Closest ancestors · 2

Same direction, newest first

  1. 2025On Code-Induced Reasoning in LLMs25 Sep
  2. 2025Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs26 Feb

Other references · 31

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  4. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
  5. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  6. 2023Let's Verify Step by Stepcited by 3,789
  7. 2023GPQA: A Graduate-Level Google-Proof Q&A Benchmarkcited by 2,879
  8. 2022Emergent Abilities of Large Language Modelscited by 2,512
  9. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  10. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  11. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
  12. 2023An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuningcited by 639
19 more
  1. 2022Towards Reasoning in Large Language Models: A Surveycited by 596
  2. 2025Reinforcement Learning for Reasoning in Large Language Models with One Training Examplecited by 295
  3. 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 294
  4. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 256
  5. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
  6. 2025ARC-AGI-2: A New Challenge for Frontier AI Reasoning Systemscited by 190
  7. 2023A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, & Toxicitycited by 182
  8. 2023How well do Large Language Models perform in Arithmetic tasks?cited by 130
  9. 2025BIG-Bench Extra Hardcited by 125
  10. 2023At Which Training Stage Does Code Data Help LLMs Reasoning?cited by 82
  11. 2024Datasets for Large Language Models: A Comprehensive Surveycited by 71
  12. 2024Unveiling the Impact of Coding Data Instruction Fine-Tuning on Large Language Models Reasoningcited by 31
  13. 2025Enhancing LLM-Based Code Generation with Complexity Metrics: A Feedback-Driven Approachcited by 10
  14. 2025Scaling Code-Assisted Chain-of-Thoughts and Instructions for Model Reasoningcited by 10
  15. 2024Evaluation of large language models for assessing code maintainabilitycited by 5
  16. 2024Mastering the Craft of Data Synthesis for CodeLLMscited by 3
  17. 2025Increasing LLM Coding Capabilities through Diverse Synthetic Coding Taskscited by 3
  18. 2024Assessing Vulnerability in Smart Contracts: The Role of Code Complexity Metrics in Security Analysiscited by 2
  19. 2025Unveiling Hybrid Cyclomatic Complexity: A Comprehensive Analysis and Evaluation as an Integral Feature in Automatic Defect Prediction Modelscited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025Unveiling the Magic of Code Reasoning through Hypothesis Decomposition and Amendment
  2. 2025The Valley of Code Reasoning: Scaling Knowledge Distillation of Large Language Models
  3. 2025The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity
  4. 2025An Empirical Study of Reasoning Steps in Thinking Code LLMs
  5. 2025Evaluating Code Reasoning Abilities of Large Language Models Under Real-World Settings
  6. 2025Reasoning Effort and Problem Complexity: A Scaling Analysis in LLMs
  7. 2026Exploring Extrinsic and Intrinsic Properties for Effective Reasoning with Code Interpreter
  8. 2026What Really Improves Mathematical Reasoning: Structured Reasoning Signals Beyond Pure Code