On Compositional Learning Behaviours in Formal Mathematics

Kevin Yandoka DenamganaiAI4Math @ ICML 2026

TL;DR

High-level mathematical reasoning requires more than just memorizing formulas; it requires Compositional Learning Behaviours (CLBs)—the ability to pick up new symbolic rules in-context and apply them immediately. This paper demonstrates that CLB competency is a "structural gatekeeper": it is strictly necessary for solving Olympiad-level math problems, and suppressing the specific neural "direction" associated with CLB causes model performance to collapse.

What Problem Does This Paper Address?

Current AI theorem provers are getting better at solving math, but we don't fully understand how. Are they just really good at "shallow statistical pattern matching" (recombining things they saw during training), or are they performing "genuine systematic abstraction"?

The authors focus on a specific skill called Compositional Learning Behaviours (CLBs). Unlike standard composition—where a model might combine a known sorted() function with a known list—CLB requires an agent to encounter a brand-new symbol or rule (like a custom mathematical relation defined for the first time in a prompt), "ground" its meaning from a few examples, and then use it to solve a novel problem within the same session. The authors argue that while basic math can be done by recombining old knowledge, the "hard tail" of mathematics (Olympiad-level problems) is impossible without this in-context symbolic acquisition.

Methods

The researchers developed a two-pronged approach to test their hypothesis:

  1. S2B-LM (The Diagnostic): They adapted the "Symbolic Behaviour Benchmark" into S2B-LM. To make it fair for Language Models, they replaced numerical inputs (which LMs struggle with) with categorical words (e.g., "potato," "blue," "circle"). They also added a "rule-based verbalizer" that provides Chain-of-Thought (CoT) scaffolding, ensuring they were measuring the model's actual capability rather than just its ability to follow a confusing prompt.
  2. Causal Intervention (The "Smoking Gun"): Using a technique called Contrastive Activation Addition (CAA), they identified a specific mathematical vector (a "direction") in the internal activations of the DeepSeek-Prover-V2-7B model that corresponds to CLB reasoning. They then "steered" the model during actual math exams by either amplifying or suppressing this specific neural direction to see if it directly controlled problem-solving success.

Datasets

  • S2B-LM: A newly introduced diagnostic benchmark designed to isolate receptivity to novel symbolic conventions.
  • miniF2F: A standard benchmark for formal theorem proving in the Lean 4 language.
  • AIME Subset: A collection of 15 high-difficulty problems from the American Invitational Mathematics Examination, representing the "Olympiad-level" hard tail.

Key Insights and Ideas

  • The "Necessary but Not Sufficient" Rule: The study found that every single model that performed well on Olympiad-level math also scored high on the CLB diagnostic. However, scoring high on the diagnostic didn't guarantee a model would be an elite math solver. CLB is the ticket to enter the stadium, but it doesn't win you the game.
  • Scale Isn't the Driver: Interestingly, model size (parameter count) was ruled out as the primary factor. A relatively small 7B model (DeepSeek-Prover-V2) cleared the Olympiad threshold, proving that "smart" architecture and reasoning capabilities matter more than just being "big."
  • Coherent Collapse: When the researchers suppressed the "CLB direction" in the model's brain, the model didn't start outputting gibberish. It still produced valid, well-formatted Lean code; it just couldn't solve the logic. This proves that CLB is a specific reasoning module, distinct from general linguistic fluency.

Key Results

  • The Quadrant Test: A statistical analysis ($p=0.004$) showed a "forbidden zone": no model exists that is good at Olympiad math but bad at CLBs.
  • Causal Impact: On the AIME dataset, suppressing the CLB activation direction caused the solve rate to plummet from 32.3% to a measly 2.9%.
  • Specificity: Suppressing a random direction of the same magnitude had almost no effect (solve rate stayed at 31.9%), proving they had found the specific "lever" for mathematical reasoning.
  • Ablation Success: The 10-shot CoT scaffolding was vital; without it, even capable models appeared to fail the diagnostic, highlighting the "competence-performance distinction."

Limitations and Future Work

  • Sample Size: The study evaluated 10 state-of-the-art models. While statistically significant for their methods, a larger pool would provide even more robust data.
  • The Amplification Mystery: While suppressing the CLB direction killed performance, amplifying it didn't significantly boost it. The authors suspect the models might already be "saturated" or at their ceiling for this capability.
  • Future Directions: The authors suggest using the S2B-LM benchmark to generate synthetic training data. If we can identify the "reasoning traces" that lead to CLB success, we can explicitly train future models to be better at this "in-context" symbolic learning, potentially breaking through the current ceiling of automated theorem proving.

Summary updated

Abstract

Self-evolving scientific agents capable of conquering the hard tail of formal mathematics require Compositional Learning Behaviours (CLBs)---the capacity to ground and recombine novel symbolic structures in context, beyond mere recombination of prelearned atoms. We propose S2B-LM, an adaptation of the CLB-evaluating Symbolic Behaviour Benchmark that removes numerical processing as a confound and adds chain-of-thought scaffolding to elicit rather than merely probe latent CLB competency. Cross-evaluating ten Lean~4 theorem provers on CLB competency in S2B-LM and miniF2F whole-proof performance, we find correlational and causal evidence of our claim: First, a necessary-condition analysis via quadrant test yields $p=0.004$, with model scale being ruled out as a confound. Second, extracting a CLB-encoding activation direction from *DeepSeek-Prover-V2-7B* using S2B-LM traces via Contrastive Activation Addition and applying it during miniF2F whole-proof generation on the AIME subset, CLB suppression collapses solve rate from $32.3\%$ to $2.9\%$, without loss of coherence, while suppressing a random activation direction of equal magnitude leaves it at $31.9\%$. Together, these results show that CLB competency is **necessary but not sufficient** for the hard tail of formal mathematical verification.
BibTeX
@inproceedings{denamganai2026compositional,
  author = {Kevin Yandoka Denamganai},
  title = {{On Compositional Learning Behaviours in Formal Mathematics}},
  booktitle = {AI4Math @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=M3kKajgMpY},
}
Figure