TL;DR
This paper introduces SalaMAnder, a novel framework that uses Shapley values to attribute the contribution of individual mathematical expressions within a Large Language Model's (LLM) Chain-of-Thought (CoT) reasoning process. It also proposes the CoSP metric, which correlates strongly with model performance, offering a principled way to understand and optimize CoT reasoning.
What Problem Does This Paper Address?
Chain-of-Thought (CoT) prompting has significantly boosted LLMs' mathematical reasoning abilities, but why it works remains largely a mystery. Existing explanations are often heuristic or rely on labor-intensive methods with high computational costs. The authors aim to bridge this gap by providing a theoretically grounded, mathematically rigorous method to understand which parts of a CoT reasoning chain contribute most to the final answer, and to develop a metric that reliably reflects model performance.
Methods
The core of SalaMAnder lies in two key innovations:
- Mathematical Expression Attribution: Instead of treating individual tokens as the smallest unit (which can lead to semantic fragmentation), SalaMAnder defines mathematical expressions as atomic components for attribution. This approach is more aligned with the semantic units of mathematical reasoning.
- Efficient Shapley Value Computation (SalaMA): Calculating Shapley values, a standard method for fair attribution in cooperative game theory, is computationally prohibitive due to its exponential complexity. The authors propose SalaMA, a stratified sampling algorithm that significantly reduces this complexity from O(2^n+1) to O(2mn^2) (where 'n' is the number of components and 'm' is the number of samples) by decomposing the calculation based on the order of Shapley values.
- CoSP Metric: The Cardinality of Shapley Positives (CoSP) metric is developed based on the computed Shapley values. It quantifies the number of expressions with positive contributions, weighted by a penalty for negative contributions. This metric is designed to have a strong, monotonic correlation with model performance.
Datasets
The authors evaluated their framework on several standard mathematical reasoning benchmarks:
- GSM8K
- MathQA
- AQUA
- MultiArith
- SVAMP
They used popular LLMs like LLaMA-2-13B-chat, LLaMA-3-8B-Instruct, and Qwen2.5-7B-Instruct for their experiments.
Key Insights and Ideas
- Mathematical Expressions as Meaningful Units: Treating entire mathematical expressions, rather than individual tokens, as the "players" in the attribution game provides a more semantically coherent and interpretable analysis of CoT reasoning.
- Shapley Values Offer Rigorous Attribution: Shapley values provide a theoretically sound way to fairly distribute the "reward" (model performance) among the components of a CoT.
- Efficiency is Achievable: The SalaMA algorithm demonstrates that it's possible to approximate Shapley values efficiently, making this powerful attribution technique practical for LLM reasoning analysis.
- CoSP as a Reliable Performance Predictor: The CoSP metric's strong, monotonic correlation with model accuracy suggests it can serve as a valuable proxy for understanding and potentially optimizing CoT reasoning quality.
- Beyond Simple Correctness: The proposed reward function, which combines prediction confidence logits with correctness, offers a more nuanced measure of component contribution than binary correctness alone.
Key Results
- CoSP-0 as the Best Metric: Across various models and datasets, CoSP-0 (where the penalty for negative contributions is set to zero) consistently showed the strongest correlation with model accuracy, outperforming other metrics like SSV (sum of Shapley values) and NoE (number of expressions).
- Monotonic Correlation: The CoSP metric exhibits a robust monotonic correlation with model performance, meaning as CoSP increases, model accuracy generally increases.
- Efficiency Gains: The SalaMA algorithm significantly reduces the computational complexity of Shapley value calculation, making it feasible for practical use.
- Qualitative Insights: The analysis revealed that expressions with higher CoSP values are more critical to the reasoning process. Modifying or removing low-CoSP expressions had less impact on performance compared to altering high-CoSP expressions.
Limitations and Future Work
- Focus on Mathematical Reasoning: While SalaMAnder is theoretically general, the current work focuses on mathematical reasoning problems due to their representative nature for few-shot CoT. The authors aim to expand its application to broader task domains.
- Computational Resource Constraints: Experiments were limited to LLMs with parameter scales between 7 and 13 billion due to computational resource limitations.
- Future Work: The authors suggest exploring the application of SalaMAnder to a wider range of tasks beyond mathematical reasoning.
Summary updated