← Latest papers
🤖 AI

What Really Improves Mathematical Reasoning: Structured Reasoning Signals Beyond Pure Code

This paper challenges the notion that executable code inherently boosts general reasoning, demonstrating instead that structured reasoning signals within mixed code-text and math-text data, rather than code alone, drive improvements in mathematical reasoning while offering a strategy to mitigate cross-domain trade-offs.

Original authors: Yuze Zhao, Junpeng Fang, Lu Yu, Zhenya Huang, Kai Zhang, Qing Cui, Qi Liu, Jun Zhou, Enhong Chen

Published 2026-05-20
📖 4 min read☕ Coffee break read

Original authors: Yuze Zhao, Junpeng Fang, Lu Yu, Zhenya Huang, Kai Zhang, Qing Cui, Qi Liu, Jun Zhou, Enhong Chen

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are training a giant, super-smart student (a Large Language Model) to be good at everything: writing stories, solving math problems, and writing computer code. For a long time, researchers believed that feeding this student a lot of computer code was like giving them a secret superpower that made them better at everything, including math and logic.

This paper says, "Hold on a minute. Let's look closer."

The researchers built a massive library of 10 trillion words (tokens) and ran a series of experiments to see exactly what happens when you change the mix of books in that library. Here is what they found, explained simply:

1. The "Code" Misunderstanding

The Old Idea: People thought, "If we teach the student to write code, they will get smarter at math and logic because code is logical."
The New Finding: The researchers found that pure code (just the executable instructions, without any explanations) is actually very specific. It's like teaching the student to play chess perfectly. It makes them a chess grandmaster, but it doesn't necessarily make them better at writing poetry or solving algebra.

In fact, when they forced the student to spend too much time on pure code, their math skills actually dropped. It's as if the student's brain got so focused on chess rules that it forgot how to do long division. The code data was "competing" with the math data for the student's attention.

2. The Real Hero: "Structured Reasoning" (The Scaffold)

So, if pure code isn't the magic bullet, what is? The researchers found that the real magic comes from structured reasoning traces.

Think of this like a scaffold used by construction workers.

  • Pure Code is just the finished building.
  • Structured Reasoning is the scaffolding, the blueprints, and the step-by-step instructions showing how to build it.

The researchers discovered that data which shows step-by-step logic (like a math proof that breaks a problem into small, clear steps, or a code snippet mixed with a clear explanation of why it works) is what actually boosts reasoning.

They call this "Cognitive Scaffolding."

  • When they fed the student more of these "step-by-step" math problems (even if they replaced some regular math problems with them), the student got much better at hard math problems.
  • Crucially, this didn't hurt their coding skills. It was like giving the student better study guides without taking away their textbooks.

3. The "Budget" Problem

Imagine the student has a fixed amount of time to study (a "token budget").

  • If you fill that time with Code, they get great at coding but lose time for Math and General Knowledge.
  • If you fill that time with Math, they get great at Math but might lose time for General Reasoning.
  • The Solution: Instead of just adding more "stuff," the researchers found that changing the type of math they studied to be more "structured" (more scaffolding) allowed the student to get better at hard math without sacrificing their coding skills.

4. Inside the Brain: The "Specialist" Team

The model they used is like a team of 64 different specialists (called "Experts"). When the student reads a sentence, a "router" decides which specialist handles it.

  • When they removed code, the specialists who usually handle code stopped getting work, and the team's balance shifted.
  • When they added the "Cognitive Scaffolding" (the structured reasoning), the team didn't get confused. The specialists kept doing their jobs, but the quality of the reasoning improved. This proves that structured data helps the whole team work better together without causing chaos.

The Bottom Line

The paper concludes that code itself isn't the magic ingredient that makes AI smarter at reasoning. Instead, the magic comes from structured, step-by-step thinking patterns (like those found in good math proofs or well-explained code).

If you want an AI to be a better thinker, don't just throw more raw code at it. Instead, give it more "scaffolding"—data that clearly shows the logical steps of how to solve a problem. This helps the AI tackle hard math problems without losing its ability to write code.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →