Reproduce “MathCoder2: Better Math Reasoning from Continued Pretraining on Model-translated Mathematical Code” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Zimu Lu, Aojun Zhou, Ke Wang, Houxing Ren, Weikang Shi, Junting Pan, Mingjie Zhan, Hongsheng Li

The Chinese University of Hong Kong's Multimedia Laboratory (MMLab) developed MathCoder2, a family of large language models enhanced by continued pretraining on MathCode-Pile, a 19.2 billion-token dataset. This dataset includes novel model-translated mathematical code paired with natural language reasoning steps, consistently improving mathematical reasoning performance across multiple benchmarks for various base LLMs.

Key insights

  • The inclusion of model-translated mathematical code paired with natural language reasoning steps, despite being a smaller portion of the total data, significantly enhances LLM mathematical reasoning performance across all benchmarks.
  • Concatenating both natural language reasoning steps and translated code snippets (
  • Reasoning-Step&Code
  • ) yields superior performance compared to using either component in isolation, highlighting the synergistic benefit of integrated natural language and code.
  • Meticulously curated and filtered mathematical pretraining corpora, such as MathCode-Pile, outperform other open-source mathematical datasets, demonstrating the value of high-quality, targeted data for improving LLM capabilities.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.