Learning Beyond Pattern Matching? Assaying Mathematical Understanding in LLMs
Siyuan Guo, Aniket Didolkar, Nan Rosemary Ke, Anirudh Goyal, Ferenc Huszár, Bernhard Schölkopf
TL;DR
The paper investigates whether LLMs truly understand mathematics beyond pattern-matching by evaluating learning-to-learn behavior. It introduces NTKEval, an NTK-inspired protocol that measures changes in the output distribution $p_ heta( ext{correct}| ext{prompt})$ as models are trained on skill-focused data, using a kernel $k(s,s')$ over math skills. Results show that in-context learning differentiates deep mathematical structures from surface formats, indicating domain understanding, whereas instruction-tuning often yields uniform, format-driven improvements. With synthetic datasets and KhanSkill across Codellama, Llemma, and Mistral models, NTKEval demonstrates sample-efficient detection of learning effects and reveals qualitative differences between ICL and IT in exploiting structure. These findings inform the design of transparent, learning-to-learn capable scientific assistants and clarify when LLMs genuinely grasp mathematical structure versus relying on surface cues.
Abstract
We are beginning to see progress in language model assisted scientific discovery. Motivated by the use of LLMs as a general scientific assistant, this paper assesses the domain knowledge of LLMs through its understanding of different mathematical skills required to solve problems. In particular, we look at not just what the pre-trained model already knows, but how it learned to learn from information during in-context learning or instruction-tuning through exploiting the complex knowledge structure within mathematics. Motivated by the Neural Tangent Kernel (NTK), we propose \textit{NTKEval} to assess changes in LLM's probability distribution via training on different kinds of math data. Our systematic analysis finds evidence of domain understanding during in-context learning. By contrast, certain instruction-tuning leads to similar performance changes irrespective of training on different data, suggesting a lack of domain understanding across different skills.
