Skip to main content
QUICK REVIEW

[Paper Review] Llemma: An Open Language Model For Mathematics

Zhangir Azerbayev, Hailey Schoelkopf|arXiv (Cornell University)|Oct 16, 2023
Mathematics, Computing, and Information ProcessingComputer Science13 citations
TL;DR

Llemma is an open-domain math-specific language model (7B and 34B) obtained by continued pretraining Code Llama on Proof-Pile-2, achieving state-of-the-art open-base performance on MATH and enabling tool use and formal theorem proving without fine-tuning.

ABSTRACT

We present Llemma, a large language model for mathematics. We continue pretraining Code Llama on the Proof-Pile-2, a mixture of scientific papers, web data containing mathematics, and mathematical code, yielding Llemma. On the MATH benchmark Llemma outperforms all known open base models, as well as the unreleased Minerva model suite on an equi-parameter basis. Moreover, Llemma is capable of tool use and formal theorem proving without any further finetuning. We openly release all artifacts, including 7 billion and 34 billion parameter models, the Proof-Pile-2, and code to replicate our experiments.

Motivation & Objective

  • Motivate domain adaptation of LMs to mathematics to leverage specialized prior knowledge and reasoning.
  • Develop a mathematics-specialized base model by continued pretraining on a math-rich mixture of text, code, and proofs.
  • Evaluate Llemma on standard math reasoning benchmarks and tool-assisted tasks to establish open-base baselines.
  • Provide open access to models, training data, and code to foster future research in mathematical reasoning.

Proposed method

  • Continue pretraining Code Llama on Proof-Pile-2 to create Llemma-7B and Llemma-34B.
  • Assemble Proof-Pile-2 a 55B-token mixture of math papers, web math data, and math code including the AlgebraicStack dataset.
  • Train 7B for 200B tokens and 34B for 50B tokens using bfloat16 on 256 A100 GPUs with tensor parallelism and ZeRO optimization.
  • Use a standard autoregressive LM objective and mixed-precision training with Flash Attention 2 for efficiency.
  • Evaluate with few-shot chain-of-thought prompting on MATH, GSM8k, OCWCourses, MMLU-STEM, and SAT, and assess tool use and formal mathematics capabilities.
  • Release 7B and 34B models and the Proof-Pile-2 corpus, code, and the AlgebraicStack dataset publicly.

Experimental results

Research questions

  • RQ1Can continued pretraining on a math-focused data mix improve open-base language models for mathematical reasoning?
  • RQ2What is the impact of including code data and formal mathematics data on performance and memorization in open math models?
  • RQ3To what extent can an open-base model perform tool-assisted mathematics and interact with formal proof systems without task-specific finetuning?
  • RQ4How does data mixture (arXiv, web, code) affect performance on mathematical benchmarks and problem solving?
  • RQ5What are the memorization risks and data overlap implications for open math models?

Key findings

  • Llemma-34B outperforms Code Llama on GSM8k by 20 percentage points and on MATH by 13 percentage points.
  • Llemma-7B outperforms the proprietary Minerva model on the benchmarks reported.
  • Llemma shows capability to use computational tools (Python interpreter and formal theorem provers) without additional fine-tuning.
  • Llemma achieves state-of-the-art results for open-weight models on the MATH benchmark.
  • Open access release includes 7B and 34B base models, Proof-Pile-2, AlgebraicStack, and replication code.
  • Continued pretraining on Proof-Pile-2 improves few-shot mathematical problem solving across multiple benchmarks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.