TL;DR
SYRELM (Symbolic Reasoning with Language Models) enables "frugal" LMs (6B–13B parameters) to tackle complex arithmetic word problems by acting as translators to formal code. By combining Low-Rank Adaptation (LoRA) with reinforcement learning guided by a symbolic solver, these smaller models achieve massive accuracy gains, sometimes rivaling GPT-3.5 while remaining interpretable and runnable on modest hardware.
What Problem Does This Paper Address?
Mathematical reasoning is often cited as an "emergent" property of scale, typically appearing only in Large Language Models (LLMs) with 50 billion parameters or more. Smaller models struggle with multi-step reasoning, often failing to maintain the logical chain required to solve grade-school word problems.
Existing solutions like "Chain-of-Thought" (CoT) prompting work well for giants but fail for smaller models. Meanwhile, "tool-augmented" approaches (like giving an LM a calculator) often treat the tool as an afterthought, not integrating the tool's feedback into the model's training phase. The authors aim to bridge this gap by teaching small LMs to "formalize then solve," mimicking the way students are taught to identify variables and relationships before reaching for a calculator.
Methods
The authors introduce SYRELM, a framework that treats the LM as a translator from natural language to a Formal Language (FL).
- Architecture: The system uses a frozen base LM (like GPT-J 6B or Vicuna 13B) equipped with a Low-Rank Adapter (LoRA). This allows for parameter-efficient fine-tuning without losing the model's general linguistic capabilities.
- Formal Languages: Depending on the model's strength, SYRELM uses different FLs. For instruction-tuned models like Vicuna, it generates Python code. For vanilla models like GPT-J, it uses a simpler, custom parsable pseudocode (see Figure 2).
- Two-Stage Training:
- Stage 1 (Supervised): The model is fine-tuned to translate word problems into FL expressions that include natural language comments (blending CoT and Program-of-Thought).
- Stage 2 (Reinforcement Learning): The authors use Proximal Policy Optimization (PPO). Crucially, the rewards are provided by the symbolic solver (e.g., a Python interpreter). The model receives rewards for successful compilation, matching the correct number of variables, using the right arithmetic operators, and—finally—getting the correct answer.
Datasets
The models were evaluated on three standard arithmetic benchmarks:
- SVAMP: A challenge set of simple math word problems.
- GSM8K: High-quality grade school math word problems.
- MultiArith: Multi-step arithmetic problems.
To train the adapters, the authors curated a new dataset by taking problems from ASDiv, MAWPS, and Math23k, using InstructGPT to generate initial code solutions, and then manually cleaning the data to ensure accuracy.
Key Insights and Ideas
- Pedagogy as a Blueprint: The system follows a 5-step recipe used in schools: allocate variables, bind constants, extract relationships, identify the target, and invoke a solver.
- Closing the Loop: Unlike previous tool-use methods where the tool is "detached," SYRELM uses the symbolic solver's feedback during the PPO phase. This forces the LM to learn the logic of the tool, not just how to call it.
- Reward Shaping is Critical: For small models, just rewarding the "correct answer" is too sparse. By rewarding intermediate steps (like using the correct number of variables), the authors provide a "richer set of learning feedback" that helps the model learn to reason systematically.
- Generalization: Interestingly, the models showed an ability to generalize to longer reasoning chains than those seen in the training data, suggesting that learning the formal structure of math is more robust than memorizing patterns.
Key Results
SYRELM delivers dramatic performance boosts over base models and existing methods:
- Massive Gains: On the SVAMP dataset, GPT-J 6B saw a +30.65 point absolute improvement in accuracy. On MultiArith, the jump was even larger: +51.16 points.
- Punching Above Weight: Vicuna 13B with SYRELM performed comparably to GPT-3.5 (standard 8-shot prompting) on both SVAMP and GSM8K.
- Outperforming Baselines: SYRELM significantly outperformed other tool-use frameworks like Toolformer (+10.7 points on SVAMP) and ART, which often fails when the base model is small.
Limitations and Future Work
While SYRELM is powerful, it isn't perfect. The authors noted three main error types: syntax errors (failing to follow the FL rules), irrelevant answers (answering a different question than asked), and reasoning mistakes (see Figure 3).
The PPO training phase also requires significant GPU-hours compared to zero-shot inference. Future work could involve expanding the symbolic solver to handle more complex domains like geometry or calculus, and further refining the reward functions to reduce syntax-related failures in very small models.
Summary updated