Large Language Models (LLMs) are surprisingly good at math, until they aren't. If you change a word problem from "John has 5 apples" to "Arash has 302 crackers," or add a distracting sentence about the weather, even powerful models can stumble. This "brittleness" suggests that models often memorize patterns rather than understanding the underlying logic.
In a new paper titled AbstRaL, researchers from Apple and EPFL propose a shift in how we train models to reason. Instead of just giving them more examples (instantiation), they teach models to abstract—to strip away the "flavor text" and focus on the symbolic logic underneath.
TL;DR
AbstRaL is a framework that trains LLMs to solve math problems by first generating an abstract symbolic representation of the logic. By using Reinforcement Learning (RL) with a novel "symbolic distance" reward, the authors significantly improve model robustness against distracting information and changes in variables, while also boosting general reasoning performance on out-of-distribution tasks.
What Problem Does This Paper Address?
The core issue is a lack of reasoning robustness. Small LLMs, in particular, suffer drastic performance drops when faced with "distribution shifts." These come in two main flavors:
- Instantiation Shifts: Changing numerical values or names (e.g., changing "12" to "12.5").
- Interferential Shifts: Adding "topic-related but useless" information (distractors) that tricks the model into performing the wrong calculation.
While common strategies involve "scaling up" training data with millions of synthetic variations, this is computationally expensive and doesn't necessarily teach the model the principle of the problem.
Methods
The authors introduce AbstRaL (Reinforced AbstRaction Learning), which follows a four-step pipeline to separate the math from the story:
- Condition Recognition: The model identifies the variables in a word problem (e.g.,
in0=12,in1=2). - Abstract Reasoning: The model generates a reasoning chain using only these symbols (e.g.,
<<in0 + in1 = out0>>). - Abstraction Retrieval: The symbolic logic is extracted from the text.
- Symbolic Derivation: An external tool (like SymPy) solves the equations to ensure mathematical precision.
The Training "Secret Sauce"
To make this work, the authors created GranulAR data—a fine-grained dataset where problems are decomposed into sub-questions and symbolic steps.
Crucially, they found that Supervised Fine-Tuning (SFT) wasn't enough; models would learn the format but still fail the logic when the context changed. To fix this, they used Reinforcement Learning (GRPO) with a dual reward system:
- Answer Correctness Reward: Did the model get the right final number?
- Symbolic Distance Reward: How close is the model's generated symbolic logic to the "gold standard" logic? This uses a normalized Levenshtein distance to provide a granular learning signal.
Key Insights and Ideas
- Abstraction > Instantiation: Teaching a model to ignore irrelevant details is more efficient and effective than trying to show it every possible irrelevant detail during training.
- RL is Essential for Faithfulness: SFT often results in "hallucinated" abstractions that look right but are logically disconnected from the problem. The RL phase forces the model to ensure its abstraction is actually "faithful" to the input.
- The "Implicit Benefit": This is the most surprising finding. Training a model to think abstractly in the domain of grade-school math actually makes it better at general reasoning tasks (like those in BBH or MMLU) that have nothing to do with math. Abstract thinking appears to be a "meta-skill" that improves generalizability.
Key Results
- Reverting the Drop: On the GSM-Symbolic benchmark, AbstRaL almost entirely eliminated the performance gap between original problems and perturbed ones. For Qwen2.5-0.5B, accuracy on varied problems jumped from 34.0% to 44.6%.
- Crushing Distractors: On GSM-Plus (Distract), AbstRaL significantly outperformed standard Chain-of-Thought (CoT) and Program-of-Thought (PoT) methods. While other models' scores plummeted when distractors were added, AbstRaL remained stable.
- Zero-Shot Gains: On the AIME24 (a high-level math competition) benchmark, AbstRaL improved Qwen2.5-Math-7B's performance from 13.3% to 16.7%, despite never being trained on competition-level math.
Limitations and Future Work
- Oracle Dependency: The initial GranulAR data relies on a larger "oracle" model (Llama-3.3-70B) for distillation, though the authors show that even a weaker oracle can produce good results.
- Scope: The study focused primarily on English and grade-school level math. Extending this to higher-level symbolic reasoning or other languages remains an open challenge.
- Computation: Full RL fine-tuning is resource-intensive. Future work could explore more efficient training methods like LoRA.
- Abstraction Shifts: The current work assumes the underlying math rule stays the same. Future research could investigate how models handle changes to the logic itself (e.g., changing an addition problem to a subtraction problem).
Summary updated