Introduction
Quantitative reasoning in Question Answering (QA) requires models to map natural language queries to executable mathematical programs. While current state-of-the-art models perform well on simple, single-step operations, they often struggle with multi-step reasoning. This difficulty stems from a lack of compositional generalization—the ability to combine known operations into novel, complex sequences. Instead of learning the underlying logic, models frequently overfit to "spurious patterns," memorizing common word-to-operation mappings that fail when the reasoning complexity increases.
The Challenge of Multi-Step Reasoning
A significant hurdle in training models for complex math is the "long-tail" distribution of data. While 1-step programs are abundant in training sets, 3+ step programs are rare. This scarcity makes it difficult for models to learn the necessary compositions through brute force. Consequently, models often fall back on simple patterns seen frequently, leading to errors in complex calculations like distinguishing between "net change" and "percent change."
Methods: The CompAQT Module
To address these challenges, researchers introduced CompAQT (COMPositional Attention for QuanTitative reasoning). CompAQT is a plug-and-play self-attention module designed to "prime" input representations before they reach the decoder.
Key components of the CompAQT framework include:
- Self-Attention Priming: Adjusts attention weights to highlight non-repetitive, logically significant tokens (e.g., "growth") while downplaying repetitive headers or years.
- Alignment Loss: A novel function that encourages the model to shift its focus from "already-processed" terms in early steps to new logical cues in later steps.
- Coverage Penalty: Prevents the model from repeatedly attending to the same words, forcing it to explore different parts of the input for each step of a multi-step program.
- Linear Decay: Prioritizes accuracy in the foundational early steps of a program by assigning higher penalties to errors made at the start of the sequence.
Datasets and Evaluation
The study evaluated CompAQT across four major numerical reasoning datasets: FinQA (financial reports), TAT-QA (hybrid table/text), HiTab (hierarchical tables), and MultiHiertt (nested tables). A key contribution of this work is the creation of a Unified Dataset, which standardizes these diverse sources into the FinQA format, providing a robust benchmark for multi-step reasoning.
Key Insights: Attention as a Logical Filter
The core innovation of CompAQT is its ability to force the model to find "operative" words that signal specific mathematical functions. By penalizing attention on tokens shared between the question and the facts (like "2018" or "expenses"), the model must rely on unique logical cues.
This mechanism allows the model to correctly distinguish between operations that might otherwise look similar in text, such as "net change" (subtraction) versus "percent change" (subtraction followed by division and multiplication).
Results
The addition of CompAQT yielded substantial improvements in program accuracy across all tested datasets:
- FinQA: Overall accuracy increased by +5.30%, with a notable +9.25% gain specifically on 2-step programs.
- HiTab: Despite its small size and skewed distribution, the dataset saw a +4.50% improvement on 2-step programs.
- Robustness: Ablation studies confirmed that these gains were due to the CompAQT loss functions rather than simply adding more parameters, as standard additional layers led to overfitting and decreased performance.
Conclusion and Future Work
CompAQT demonstrates that forcing models to focus on unique logical cues significantly improves compositional generalization in quantitative reasoning. While highly effective, future work is needed to expand these techniques to other domains like scientific data and to integrate them with more advanced retrieval systems. Additionally, exploring "data-native" approaches like synthetic data augmentation could further bolster the model's ability to learn complex mathematical logic.
Summary updated