Beyond Semantic Similarity: Abstraction-Based Demonstration Retrieval for Mathematical Reasoning
Abstract
Selecting useful demonstrations is crucial for in-context mathematical reasoning with large language models (LLMs). However, using the original problem for retrieval often focuses too much on surface wording while ignoring the underlying mathematical relations needed for reasoning. To address this, we propose MetaPR, a retrieval-aligned meta-problem framework that learns to generate structured abstractions for retrieving demonstrations with reusable solution structures. For each problem, MetaPR generates a structured abstraction that combines a compact meta-problem with a concept list, preserving key constraints and mathematical relations while filtering out irrelevant details. The structured abstraction is combined with the original problem to form a multi-view retrieval representation. To ensure the generated abstractions genuinely help retrieval rather than merely being well-formed, the generator is initialized via supervised fine-tuning (SFT) and then optimized with Group Relative Policy Optimization (GRPO). During GRPO, we assign a Correctness-transition reward to each sampled abstraction by comparing answer correctness with and without the demonstrations it retrieves. Experiments across two NuminaMath-derived datasets and three downstream solvers demonstrate that MetaPR outperforms lexical, dense, skill-based, and reasoning-graph retrieval baselines in answer accuracy.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.