TL;DR
Proving mathematical theorems with AI is getting easier, which leaves us with a new bottleneck: coming up with good conjectures to prove in the first place. PatternMiner bridges this gap by putting an LLM agent in charge of a miniature scientific lab—generating mathematical data, training small specialist ML models on it, and peering inside their "brains" to extract patterns. By iterating between mechanistic interpretability and hunting for counterexamples, PatternMiner autonomously formulated and proved genuinely new theorems in pure mathematics.
What Problem Does This Paper Address?
As mathematics shifts from "proof scarcity" toward "proof abundance" thanks to capable reasoning models, we face a looming "conjecture scarcity." Human mathematicians don't just deduce things from thin air; they play around with examples, spot weird patterns, guess a rule, try to break it, and refine their intuition.
Current AI approaches split this workflow in half. Large Language Models (LLMs) are great at text-based theoretical reasoning, while small, narrow ML models are great at spotting empirical patterns in massive datasets—provided a human painstakingly interprets what those small models learned. Neither paradigm handles open-ended exploration well on its own. PatternMiner asks: what happens if we let an LLM act as the human-in-the-loop, guiding the training and reverse-engineering of small models to discover new math at scale?
Methods
PatternMiner is an autonomous, iterative research loop compatible with standard coding agents, orchestrated through markdown templates that keep the process legible to human overseers (allowing humans to nudge the agent if it gets stuck in a rut).
Starting from a broad mathematical question, the LLM agent executes a continuous cycle:
- Task Design & Data Generation: The agent invents a narrow predictive surrogate task and uses math software (like SageMath) to generate verified training examples.
- Small Model Training: It trains a lightweight model—anything from logistic regression and gradient-boosted trees to a small 6-layer transformer.
- Mechanistic Interpretability: Instead of treating the small model as an oracle, the agent dissects it. It checks decision thresholds and feature importances for trees, or runs linear probes and activation patching (swapping internal neuron activations between inputs to see what causally changes the output) on neural networks.
- Conjecture & Counterexample Mining: Translating these internal mechanisms into a crisp mathematical statement, the agent checks existing literature and writes code to hunt for counterexamples. Any rule-breakers get folded back into the next round's training set ("hard-negative mining"), sharpening the conjecture until the agent is ready to attempt a formal proof (which undergoes an adversarial review).
Datasets
Rather than relying on static, pre-packaged benchmarks, PatternMiner dynamically generates its own datasets on the fly using mathematical software like SageMath.
The system was evaluated on five famous open "positivity problems" in algebraic combinatorics—a field that translates abstract algebra into problems of counting concrete objects—drawn from Richard Stanley's classic 2000 survey: Kronecker coefficients, Schubert structure constants, character-table row sums, Kazhdan–Lusztig polynomials, and monomial immanants. During exploration, datasets continuously evolve as uniform samples are mixed with newly mined counterexamples and edge cases.
Key Insights and Ideas
- Peering inside the black box actually yields better math: In a clever ablation study on Schubert calculus, two agents were given the exact same predictions from a trained transformer. One agent also saw activation-patching data showing how internal attention heads behaved. When asked to write an explicit mathematical rule, the interpretability-informed rule generalized significantly better than the prediction-only rule (succeeding on 214 vs. 174 out of 249 unseen test pairs).
- Grounding builds "research taste": When compared against standalone LLMs (without the PatternMiner harness), direct LLMs tended to find narrow formulas for special cases. PatternMiner's cycle of counterexample feedback pushed the agent toward broader, structural theorems—frequently exhibiting human-like strategies such as question shifting (17 observed instances) when an initial angle proved unfruitful.
- Hard-negative mining drives generality: Without feeding counterexamples back into training, the Schubert investigation only found six isolated edge-case examples; with the full loop, it uncovered an infinite, recursive construction valid across all dimensions $n \ge 5$.
Key Results
Across four of the five open problems, PatternMiner discovered and proved novel mathematical results with no known counterparts in the literature:
- Schubert Structure Constants: Proved a new equivariant positivity inequality—resolving two open conjectures from recent literature (Conjectures A and B of Chen et al.)—and proved that projection tests retaining any fixed number of dimensions will inevitably miss certain vanishing coefficients.
- Character-Table Row Sums: Derived a generating-function formula and an exact algorithm that evaluates specific families of row sums in polynomial time when $k = O((\log n)^2)$, exponentially faster than naive summation over $\exp(\Theta(\sqrt{n}))$ conjugacy classes.
- Monomial Immanants: Extended known nonnegativity results from simple "hook" shapes to a much broader infinite family of partitions (where rows below the first have length $\le 2$), backed by computational verification of 776,891 decomposition coefficients.
- Kazhdan–Lusztig Polynomials: Proved strict structural bottlenecks on any potential counterexamples to the combinatorial invariance conjecture at interval length 13.
Limitations and Future Work
PatternMiner relies on computing lots of examples, restricting it to mathematical domains where objects are computationally accessible (like algebraic combinatorics). Agents also hit recognizable failure modes: getting stuck in repetitive loops collecting ever-larger counterexamples (which required human redirection once in the Schubert study), misapplying theorems from papers by missing subtle section-header conventions, or extracting model interpretations that merely re-confirmed known facts. Future work includes conducting compute-matched comparisons against evolutionary program-search systems like FunSearch and AlphaEvolve, and expanding beyond combinatorics.
Summary updated