Large Language Models for Mathematicians

Simon Frieder, Julius Berner, Philipp Petersen, Thomas LukasiewiczarXiv 2023 · DOI · arXiv

Introduction

The rapid advancement of Artificial Intelligence has sparked significant interest within the mathematical community. However, much of the discourse remains speculative or focused on elementary mathematics. The paper "Large Language Models for Mathematicians" bridges this gap by providing a rigorous mathematical formalization of the Transformer architecture and evaluating state-of-the-art models against the high-level reasoning required for professional research.

Mathematical Formalization

To demystify the "black box" of AI, the authors treat the Transformer as a high-dimensional dynamical system. They define the model as a sequence of functions $(\mathcal{T}, \mathcal{H}, \mathcal{S})$ acting on sequences of embeddings. This framework includes explicit formulas for tokenization, positional encoding, and the self-attention mechanism.

Architectural diagram of a Transformer model, illustrating the flow from tokenization to sampling.

By formalizing these components, mathematicians can analyze the model's behavior through the lens of functional analysis and dynamical systems, rather than viewing it merely as a heuristic chatbot.

The GHOSTS Benchmark

The core empirical contribution is the GHOSTS dataset, a benchmark designed for graduate-level mathematics. Unlike standard datasets that focus on high school math, GHOSTS comprises 709 prompts across six specialized domains:

  • Grad-Text: Exercises from advanced texts like Rudin’s Functional Analysis.
  • Holes-in-Proofs: Tasks requiring the model to fill missing logical steps.
  • Olympiad-Problem-Solving: High-level competition problems.
  • Symbolic-Integration: Purely computational challenges.
  • Search-Engine-Aspects: Requests for specific definitions and theorem names.

Evaluation was performed manually by mathematicians on a 1-to-5 scale, allowing for a nuanced assessment of "almost correct" logic that automated metrics often miss.

Insights into Mathematical Reasoning

The study reveals several fundamental limitations in how LLMs approach mathematics:

  • The Autoregressive Trap: LLMs predict tokens sequentially without internal "backtracking." A single logical error early in a proof often cascades into a hallucinated sequence of nonsense.
  • Exponential Decay of Correctness: Mathematical proofs require absolute precision. If a model has a 95% success rate per step, the probability of a 20-step proof being entirely correct drops to approximately 36%.
  • Search vs. Reasoning: Models excel as "mathematical search engines," effectively retrieving definitions or naming theorems. However, they struggle to apply these theorems to novel, complex problems—a phenomenon the authors call the "Rudin Wall."

Key Results

The evaluation shows a clear upward trend in performance as models evolve. GPT-4 represents a significant leap over its predecessors, often achieving a "passing grade" (3.5/5) on several subdatasets.

Timeline and scale of prominent Large Language Models, showing the progression toward the models evaluated in the GHOSTS benchmark.

While GPT-4 is highly effective for literature searches and providing definitions, it still struggles with arithmetic and symbolic integration without external tools. The transition from earlier ChatGPT versions to GPT-4 shows a distinct migration toward higher qualitative scores, though the "reasoning gap" remains a significant hurdle for research-level tasks.

Conclusion and Future Directions

Current LLMs are powerful collaborators but fall short of being autonomous mathematicians. Their primary weaknesses—hallucinations, lack of self-revision, and arithmetic errors—suggest that the next frontier lies in integration. The authors propose combining the creative, suggestive power of LLMs with the rigorous verification of Formal Proof Assistants (like Lean or Coq) to bridge the gap between statistical prediction and logical proof.

Summary updated

Abstract

Large language models (LLMs) such as ChatGPT have received immense interest for their general-purpose language understanding and, in particular, their ability to generate high-quality text or computer code. For many professions, LLMs represent an invaluable tool that can speed up and improve the quality of work. In this note, we discuss to what extent they can aid professional mathematicians. We first provide a mathematical description of the transformer model used in all modern language models. Based on recent studies, we then outline best practices and potential issues and report on the mathematical abilities of language models. Finally, we shed light on the potential of LLMs to change how mathematicians work.
BibTeX
@misc{frieder2023large,
  author = {Simon Frieder and Julius Berner and Philipp Petersen and Thomas Lukasiewicz},
  title = {{Large Language Models for Mathematicians}},
  year = {2023},
  eprint = {2312.04556},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.04556},
}
Figure