TL;DR
This paper introduces AIC (Algorithmic Abstraction, Implementation, and Contextualization), a novel method for generating verifiable mathematical problems to train large language models (LLMs). By abstracting problems into algorithms, implementing them as code, and then contextualizing them into new problems that are verified by code, AIC produces high-quality, accurate synthetic data that significantly boosts LLM math capabilities.
What Problem Does This Paper Address?
Large language models (LLMs) have shown impressive capabilities, but their mathematical prowess is often limited by the availability of high-quality training data. Existing methods for generating synthetic math problems fall into two camps: those that reuse existing problems, limiting diversity, and those that use advanced LLMs to generate new problems but lack a robust verification mechanism, risking incorrectness. This creates a need for a method that can generate diverse, logically consistent, and verifiably correct mathematical problems to effectively train LLMs.
Methods
The core of the paper is the AIC (Algorithmic Abstraction, Implementation, and Contextualization) framework. It operates in two stages:
- Stage 1: Algorithm Abstraction and Implementation:
- Abstraction: LLMs are used to analyze existing mathematical problems (question, rationale, answer) and abstract them into a "natural language algorithm." This algorithm breaks down the problem into its objective, process steps, identifies placeholder variables, and defines constraints.
- Implementation & Verification: The natural language algorithm is then translated into a Python code function by the LLM. The correctness of this code function is verified against the original problem's answer. This step ensures the underlying algorithmic logic is sound.
- Stage 2: Algorithm Contextualization:
- Contextualization: The verified natural language algorithm is used to generate new mathematical problems. This involves creating new "contexts" by assigning different values or types to the placeholder variables identified in Stage 1, while adhering to the defined constraints.
- Verification: The newly generated problem, along with its proposed rationale and answer, is then fed into the previously implemented code function. The output of the code function is compared against the synthesized answer. If they match, the synthesized problem is considered verified and correct.
This two-stage process ensures that not only is the underlying logic of the problem sound (Stage 1), but also that the generated problem instances are correct (Stage 2).
Datasets
- Seed Data: The authors used the MATH dataset (7,500 competition-level math problems) and a subset of MAmmoTH2 (30,000 high-quality, instruction-tuned math problems).
- Synthesized Data: Two datasets were generated using AIC:
- AIC-M: Synthesized using Mixtral-8×7B-Instruct.
- AIC-L: Synthesized using Llama3-70B-Instruct. These datasets were used to fine-tune various LLMs for evaluation.
Key Insights and Ideas
- Algorithmic Abstraction is Key: The core idea that mathematical problems can be represented as algorithms is powerful. This allows for a systematic way to generate variations.
- Code as a Verifier: Using code functions to verify both the algorithmic implementation and the synthesized problem instances is a robust mechanism for ensuring correctness, a major limitation of prior work.
- Diversity through Contextualization: By changing the "context" (i.e., the values of placeholder variables) of a verified algorithm, AIC can generate a vast number of diverse problems from a single abstract algorithm.
- Verification Boosts Performance: The paper strongly suggests that verified synthetic data leads to better LLM performance than unverified data, even when generated by the same synthesizer.
Key Results
- Models fine-tuned on AIC-synthesized data (AIC-M and AIC-L) significantly outperformed models trained on the original seed data across multiple challenging benchmarks (MATH, GaoKaoBench-Math, MathOdyssey, OlympiadBench-Math, TheoremQA).
- For example, Mixtral-AIC achieved 35.4% accuracy on MATH, compared to 27.6% for Mixtral-Seed. Llama3-70B-AIC achieved 48.7% accuracy on MATH, compared to 39.2% for Llama3-70B-Seed.
- In a fair comparison with other synthesis methods (NumReplace, MMIQC, Xwin-MATH), AIC outperformed baselines at various data scales.
- An ablation study showed that the verification mechanism in AIC is crucial, leading to improved model performance compared to using datasets without verification.
Limitations and Future Work
- Limited to Mathematical Data: The current method is specifically designed for mathematical data synthesis and needs to be extended to other types of inference data.
- Lack of Diversity in Problem Generation: The authors acknowledge that the method currently lacks diversity in problem generation. Future work should focus on defining more "meta-level" algorithms and developing corresponding abstraction and validation mechanisms to improve the variety of both algorithms and generated problems.
Summary updated