Prompt-R1: Retrieval-Based Prompt Refinement
- Prompt-R1 is a retrieval-augmented, self-supervised framework that treats the prompt as an optimization target to enhance reasoning in large models.
- It iteratively refines prompts by leveraging retrieved reasoning trajectories and self-supervised signals in a black-box setting.
- Empirical results on GSM8K tasks show a significant accuracy boost from 85.6% to 95.0% using this retrieval-guided prompt refinement methodology.
Prompt-R1, in the usage associated with RASPRef, denotes a retrieval-augmented, self-supervised prompt-refinement framework for large reasoning models (LRMs) that treats the prompt itself as the optimization target rather than optimizing only model outputs. It was introduced to address the prompt sensitivity of reasoning-oriented models such as DeepSeek-R1 and OpenAI o1 on benchmarks including GSM8K, MATH, and multi-hop question answering, where small changes in wording, instruction ordering, example selection, or reasoning style can materially affect accuracy and reasoning stability. RASPRef operates in a black-box setting, retrieves prior reasoning trajectories from memory, evaluates candidate prompts with weak self-supervised signals, and iteratively edits prompts through retrieval-guided refinement (Soni, 27 Mar 2026).
1. Conceptual basis and motivation
RASPRef starts from the observation that, for LRMs, a prompt is not merely a task description but a control signal that shapes the full reasoning trajectory. In this framing, prompt defects can cause premature conclusions, omitted intermediate derivations, unstable reasoning across samples, or ineffective use of prior examples. The framework therefore treats prompt engineering as an optimization problem over discrete natural-language prompts rather than as a purely manual procedure (Soni, 27 Mar 2026).
The motivation is reinforced by adjacent prompt-optimization results on LRMs. In end-to-end event extraction, DeepSeek-R1 and OpenAI o1 still benefited from prompt optimization, and the view that LRMs no longer need prompt engineering was reported as not supported in that case study (Srivastava et al., 10 Apr 2025). Within this broader context, RASPRef can be understood as a systematization of prompt refinement for reasoning models under black-box access, where gradients and parameter updates are unavailable.
A central design claim of RASPRef is that prompt improvement can be driven without human annotations or task-specific supervision. Instead, the method uses retrieved reasoning assets, self-generated critiques, verifier-like signals, and multi-sample behavioral regularities as proxies for prompt quality. This shifts prompt design from a static artifact to an adaptive object that changes as the system accumulates reasoning trajectories (Soni, 27 Mar 2026).
2. Retrieval-guided refinement loop
For a new problem , RASPRef implements a black-box, retrieval-guided, self-supervised prompt optimization loop. It first retrieves a set of prior reasoning trajectories from memory that are similar to the current input. A stored trajectory may include a previous input instance, the prompt used, the full reasoning trace, an optional correctness or reward signal, and self-supervised scores such as consistency or verifier judgments. The retrieved set is denoted (Soni, 27 Mar 2026).
The initial prompt is then built from a base prompt , general task instructions, distilled guidelines extracted from strong trajectories, and representative retrieved examples. The paper emphasizes that these examples are not merely standard few-shot demonstrations; they are prior successful reasoning trajectories treated as reusable reasoning assets. Given a candidate prompt , the frozen reasoning model produces multiple sampled reasoning traces,
These traces are scored with self-supervised signals, after which the model acts as an editor:
The loop repeats up to 0 rounds or until the score stops improving. If the refined prompt fails to improve the score, the process halts early, and the final trajectory is stored back into memory for future retrieval (Soni, 27 Mar 2026).
This organization distinguishes RASPRef from output-only self-improvement schemes. The optimization object is the prompt, while the sampled outputs serve as evidence for whether the current prompt induces stable and useful reasoning behavior.
3. Self-supervised signals and prompt-quality objective
RASPRef evaluates prompts through four weak signals: multi-sample consistency, verifier feedback, model-generated self-critique, and retrieval alignment or reuse. Multi-sample consistency is inspired by self-consistency methods: if multiple sampled traces yield the same normalized final answer under 1, the prompt is scored as more stable. Verifier feedback uses a lightweight verifier 2 that assigns a scalar score in 3 based on plausibility and structure. Self-critique measures whether the model can generate useful or diagnostic critiques of its own traces. Retrieval alignment measures how well a sampled reasoning trace reuses relevant ideas from the retrieved trajectories 4 (Soni, 27 Mar 2026).
| Signal | Intended effect | Paper description |
|---|---|---|
| Multi-sample consistency | Stability | Same final answer across samples |
| Verifier feedback | Process-like supervision | Plausibility and structure score |
| Self-critique quality | Diagnostic capacity | Quality of model-generated critique |
| Retrieval alignment / reuse | Exemplar utilization | Reuse of relevant retrieved ideas |
The overall prompt-quality score is defined as
5
with 6 weighting the four components. The global objective is
7
Operationally, the update rule is monotonic with respect to the self-supervised score: compute 8, edit the prompt, and stop early if 9 (Soni, 27 Mar 2026).
The significance of this construction is methodological. Prompt search is formalized as discrete optimization over natural-language instructions, but the reward proxy is assembled from unlabeled internal signals rather than gold supervision. This suggests a scalable prompt-refinement regime for API-accessed LRMs where only sampled outputs and auxiliary evaluators are available.
4. Memory, retrieval quality, and trajectory selection
RASPRef depends critically on a memory of prior reasoning trajectories and on the quality of retrieval from that memory. The framework explicitly seeks trajectories that are relevant not only lexically but also structurally, including similar reasoning patterns, task format, or domain characteristics. In effect, retrieval is expected to surface reusable reasoning motifs rather than only surface-level textual similarity (Soni, 27 Mar 2026).
The paper identifies trajectory quality as a major bottleneck. Correct, clear, and structurally well-formed trajectories provide useful patterns that can be distilled into stronger prompts. Conversely, trajectories containing wrong logic, unstable reasoning, or irrelevant steps can mislead the refinement process and degrade prompt quality. The practical implication is that prompt refinement is only as good as the examples and trajectories it conditions on (Soni, 27 Mar 2026).
Several directions are discussed for improving retrieval quality: embedding-based semantic similarity, filtering with verifier scores, and consistency-based filtering across multiple samples. These are presented not as fully validated components of the reported experiments but as concrete mechanisms that may improve the effectiveness of prompt refinement. A plausible implication is that RASPRef’s ceiling is constrained at least as much by retrieval fidelity and memory curation as by the editing procedure itself.
This emphasis on prompt sensitivity also aligns with adjacent prompt-diversification work. In medical entity recognition from EHRs, an ensemble of multiple prompt styles combined with semantic alignment and majority voting was reported to improve reliability, which likewise points to prompt formulation as a persistent source of variance rather than a negligible front-end detail (Islam et al., 13 May 2025).
5. Experimental setup and reported results
The empirical study is presented as a prototype validation on GSM8K-style mathematical reasoning tasks rather than a full benchmark campaign. The dataset is based on GSM8K, using a subset of 500 test examples, with a retrieval index built from 200 training examples. The reasoning model is gpt-4o-mini, accessed through API and treated as a frozen model. Trajectories are encoded with text-embedding-3-small, stored in a vector index, and the system retrieves the top-5 trajectories by cosine similarity. Decoding uses temperature 0.7 and top-p 0.95 (Soni, 27 Mar 2026).
For each test input, the evaluation pipeline generates chain-of-thought reasoning, extracts the final answer, compares it to the reference answer, and reports accuracy. Two prompting settings are compared: a static prompting baseline with a fixed CoT template and no retrieval, and retrieval-augmented prompting in which the prompt is augmented with retrieved problem-solution trajectories (Soni, 27 Mar 2026).
| Setting | Accuracy |
|---|---|
| Static prompting | 85.6% |
| Retrieval-augmented prompting | 95.0% |
On the 500-example GSM8K subset, retrieval-augmented prompting exceeded the static baseline by 9.4 percentage points. The paper interprets this as evidence that retrieved reasoning trajectories help the model organize intermediate steps more effectively (Soni, 27 Mar 2026).
The experimental claim is deliberately narrow. The reported numbers validate retrieval-guided prompt construction, but the paper also states that the evaluation mostly focuses on retrieval-guided prompt construction rather than a full end-to-end study of iterative refinement across multiple reasoning domains.
6. Significance, limitations, and relation to the broader prompt-optimization literature
RASPRef’s principal contribution is to reframe prompt engineering for reasoning models as a self-improving memory-based process. Its broader implications are described as scalable prompt engineering, black-box compatibility for closed or API-accessed models, transparency relative to parameter-level optimization, and a future scaling path through stronger retrieval, stronger verifiers, and broader trajectory stores (Soni, 27 Mar 2026).
The limitations are explicit. The current version is only a prototype, centers on one main benchmark family, includes computational overhead because each refinement cycle requires sampling and scoring, and may overfit if the retrieved neighborhood is too narrow. The paper also notes that the reported experiments mostly validate retrieval-guided prompt construction rather than the full iterative loop in a broad end-to-end setting (Soni, 27 Mar 2026).
Within the wider literature, RASPRef occupies one branch of a larger movement toward prompt optimization for LRMs. Event extraction results indicate that LRMs as task models still benefit from prompt optimization and that LRMs can also act as effective prompt optimizers (Srivastava et al., 10 Apr 2025). At the same time, pre-registered clinical evaluation work has shown that prompt components can be beneficial, inactive, harmful, or task-dependent, and that whole-prompt comparisons can miss component-level causal effects (Hu et al., 21 Jun 2026). Together, these findings situate RASPRef within a research program that treats prompts not as incidental wrappers but as structured intervention objects whose design materially affects reasoning behavior.
A common misconception is that reasoning-capable models have rendered prompt design secondary. The accumulated evidence cited here does not support that view. In RASPRef specifically, prompt formulation remains a critical determinant of reasoning performance, and self-supervised prompt refinement is proposed as a practical mechanism for adapting prompts as reasoning experience accumulates (Soni, 27 Mar 2026).