TL;DR
Large Reasoning Models (LRMs) like DeepSeek-R1 and OpenAI's o1 achieve incredible accuracy by thinking step-by-step, but they often suffer from "overthinking"—wasting massive amounts of compute on redundant self-exploration and validation loops. This paper introduces Precedent-Informed Reasoning (PIR), a test-time framework that dynamically selects relevant solved examples and uses lightweight optimization to internalize their solution patterns. The result is a dramatic reduction in reasoning token length and inference time, all while maintaining or even improving final task accuracy.
What Problem Does This Paper Address?
When faced with complex math or coding problems, state-of-the-art LRMs generate long, internal chain-of-thought (CoT) traces. While effective, these models frequently get trapped in repetitive trial-and-error cycles, checking and re-checking their work unnecessarily. This overthinking problem inflates computational costs, increases latency, and can sometimes even degrade performance if the model hallucinates during its extended exploration.
Existing solutions typically try to force early stopping or compress the internal representations after the fact. However, these methods don't change the underlying trial-and-error behavior; they just shorten the leash. The authors of this paper look to human behavior for a better alternative: when we solve a hard problem, we recall similar past cases (precedents) to narrow our search space and avoid reinventing the wheel.
Methods
PIR transforms the LRM reasoning paradigm from exhaustive self-exploration to guided learning using two core components executed entirely at test time:
- Adaptive Precedent Selection (APS): To determine what to imitate, APS performs a multi-criteria search over a database of solved problems. It first filters candidates based on semantic similarity, then refines this selection using a "Reference Score" that factors in model perplexity (how familiar the model already is with the example). Crucially, instead of using a fixed number of few-shot examples, APS dynamically adjusts the number of precedents to maximize the relative perplexity reduction for that specific query.
- Test-time Experience Internalization (TEI): To determine how to imitate, PIR moves beyond passive in-context learning. It takes the selected precedents and the target question, constructs a prompt, and runs a single label-free gradient backward pass to update a lightweight LoRA adapter. This actively bakes the solution patterns of the precedents into the model's weights as a behavioral prior before it begins generating its final answer.
Datasets
The authors evaluated PIR across five challenging, reasoning-intensive benchmarks spanning three distinct domains:
- Mathematical Reasoning: GSM8K (grade-school math), MATH500 (advanced math), and AMC AIME (highly challenging competition-level math).
- Scientific QA: GPQA DIAMOND (expert-level physics, chemistry, and biology questions).
- Code Generation: LiveCodeBench (holistic, contamination-free competitive programming problems).
The training sets of these benchmarks were utilized purely as the database of solved precedents, ensuring zero overlap with the test instances.
Key Insights and Ideas
- Passive Prompting Isn't Enough: Simply pasting examples into the context window (traditional few-shot in-context learning) does not reliably curb overthinking. Models need active parameter adaptation (like TEI) to truly constrain their internal search space and adopt efficient reasoning paths.
- No Universal Few-Shot Number: The optimal number of examples varies wildly depending on the model scale and task difficulty. Harder tasks benefit from multiple complementary precedents, whereas simple tasks can be derailed or slowed down by too much context. APS successfully automates this trade-off.
- Redundancy Reduction, Not Truncation: By analyzing attention maps on the model's internal
</think>tokens, the authors proved that PIR specifically eliminates low-impact, circular reasoning steps rather than blindly cutting off necessary cognitive processing.
Key Results
PIR was tested across multiple model architectures, including DeepSeek-R1-Distilled (7B, 14B, 32B) and QwQ-32B, yielding impressive accuracy-efficiency trade-offs:
- Massive Token Savings: On LiveCodeBench using DeepSeek-R1-32B, PIR reduced the average reasoning length by 28.30% while simultaneously boosting accuracy by 11.61%.
- Significant Latency Speedups: On the highly complex AMC AIME math dataset, PIR cut down the overall end-to-end inference latency from 174.35 seconds to just 54.57 seconds—a 3.19× speedup over the base model.
- Case Study Impact: In individual complex math derivations, the authors observed reasoning trace reductions of up to 74% without losing correctness, steering the model directly toward clean algebraic patterns rather than endless derivative checks.
Limitations and Future Work
While highly effective, the authors note two primary limitations:
- Precedent Dependency: PIR's performance gains are inherently tied to the quality and coverage of the available precedent database. If a problem domain shifts rapidly or lacks good examples, the benefits diminish. The authors suggest exploring dynamically maintained, evolving precedent sets as a future fix.
- Test-Time Overhead: The framework introduces a retrieval step and a single LoRA backward pass before generation. While this overhead is negligible (accounting for only 2-3% of total reasoning time) and heavily offset by the token savings on hard tasks, it can slightly slow down very simple queries (like GSM8K). Future work will focus on system-level optimizations like caching and batched retrieval to minimize this initial footprint.
Summary updated