Introduction
Large Language Models (LLMs) are inherently stochastic, often producing multiple reasoning paths and varying conclusions for the same prompt. To improve reliability, researchers frequently employ "Best-of-N" sampling, where a model generates several candidate answers and a verifier selects the most promising one. However, existing verification methods typically require expensive task-specific training (e.g., Reward Models) or are limited to simple majority voting (Self-Consistency), which fails in open-ended generation tasks.
The ReFeri Framework
This paper introduces ReFeri (Recycling Few-shot examples), a training-free framework that leverages the few-shot examples already present in a prompt to verify candidate responses. Instead of discarding these examples after generation, ReFeri treats them as a "gold standard" for evaluating the quality of new outputs.
Methodology
ReFeri decomposes the likelihood of a candidate response into two primary components grounded in Bayes’ Rule:
- Forward Confidence Score ($S_{Forw}$): Measures the probability of generating a response given the query and few-shot examples, ensuring alignment with demonstrated reasoning patterns.
- Backward Consistency Score ($S_{Back}$): A novel "recycling" step that evaluates how well a candidate response explains the provided few-shot examples. Using a leave-one-out strategy, the model checks if conditioning on the candidate response makes the known-good few-shot answers more likely.
To maintain efficiency, ReFeri uses a lightweight approximation, identifying the most relevant few-shot example via an embedding model rather than iterating through the entire set for every candidate.
Experimental Evaluation
The framework was tested across seven diverse benchmarks, including MATH500 (mathematics), GPQA-diamond (graduate-level science), and MuSR (complex spatial reasoning). The evaluation utilized several state-of-the-art models, including GPT-4o, GPT-4o-mini, and LLaMA-3.1-8B.
Key Results
ReFeri achieved an average accuracy gain of 4.5% over random selection and 2.4% over the best existing prompt-based selection methods. Notably, the framework demonstrates robust scaling properties; unlike some methods that degrade as the number of candidates ($N$) increases due to noise, ReFeri's accuracy improves consistently with more samples.
Furthermore, ReFeri proves highly efficient. A 1B parameter model (LLaMA-3.2-1B) using ReFeri can outperform an 8B model using standard selection methods, while being 60–65% faster during inference.
Conclusion
ReFeri provides a powerful, training-free alternative for LLM verification by effectively "recycling" existing prompt data. By combining forward generation probability with backward consistency checks, it offers a scalable and model-agnostic way to boost reasoning performance without the overhead of fine-tuning or specialized reward models. Future work may extend this logic to token-level verification for long-form reasoning chains.
Summary updated