- Rating
- 5
- Clarity
- 4
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
This study connects the theoretical framework of In-Context Learning (ICL) as implicit gradient descent with the Retrieval-Augmented Generation (RAG). First, the authors mathematically show that a single linear self-attention layer can execute a gradient descent step on a linearized RAG objective for retrieval, then and inspired by this theoretical framing, the authors expand their findings to LLMs. The paper presents RAG-GD: a forward-only adaptation technique that trains and employs a lite-weight predictor network to predict (w/o training) LoRA weight updates for the query, key, and value matrices of a frozen LLM using a few examples. The authors compare RAG-GD with several baselines and show its superiority.
Strengths and weaknesses
Strengths
-
Novelty and Theoretical Rigor: The overall proposal is highly novel and can open up opportunities for further improvement. The mathematical proof adds rigor to the paper and the extension to LLMs is reasonable.
-
Stating Limitations: The researchers are transparent regarding the constraints of their linear theory. They present a diagnostic stress test showing that the correspondence between the theoretical predictor and the trained transformer significantly weakens when dealing with skewed or heavy-tailed feature distributions.
-
Context Length Efficiency: RAG-GD cleverly mitigates the limitations of context length and its associated quadratic cost that is present in traditional RAG, although such limitation might still be present itself elsewhere.
Weaknesses
-
Thin Margins w/o Statistical Variance: The empirical results rely on a single run per configuration due to understandable compute constraints. However, RAG-GD outperforms HyperTuning by only ~0.85% on average (EM). The gain on the held-out PopQA benchmark over the Base adapter is only +1.07 EM. Without error bars or multiple seeds, it is difficult to confidently establish statistical significance.
-
Incomplete Modern Baselines: The authors frame RAG-GD as superior to existing context building methods, but the primary comparison is against Prompt Tuning and HyperTuning, which are quite outdated. The related work section identifies more recent adaptation methods (such as HyperFlow and MAC), but the paper fails to compare RAG-GD against them. One would expect the more recent variants of HyperTuning do better and possibly surpass RAG-GD.
-
Theoretical Leap: Lemma 1 mathematically guarantees the gradient descent equivalence strictly under a squared error loss function. However, the LLM-scale implementation shifts to using cross-entropy loss for token generation. The authors acknowledge this is not a "theorem-preserving lift", but it reduces the LLM methodology to a heuristic inspired by the theory, and not a direct application of it.
Questions
-
Statistical Significance: Can you provide error bars, confidence intervals, or results from multiple seeds for at least cases where the margin is thin?
-
Additional Baselines: Why were methods like HyperFlow or MAC excluded from the experimental setup, and how does RAG-GD's performance compare to them?
-
Robustness to Noisy Retrieval: In traditional RAG, we expect the model to reasonably ignore irrelevant documents, while experiencing some degradation in performance. How does RAG-GD do in the presence of noise? It is possible that updating the weights with irrelevant documents harm the performance more than it would in traditional RAG. An experiment on noisy data can reveal this. If this is the case, can training the MLP on irrelevant retrieved doc mitigate this by teaching it to output zero gradient in such cases?
-
Mathematical Equivalence: Because the projection is linear, if I understand correctly, averaging the MLP outputs and then projecting them should result in the exact same output as projecting each MLP output into LoRA weights individually and then averaging the weights. Is this correct and the observed behaviour in practice?
-
Efficiency-1: The authors argue that RAG-GD is highly efficient because it avoids test-time backpropagation. However, computing the input for the predictor network requires a full LLM forward pass for every support example to extract the EOS hidden state. This will introduce significant latency, potentially making it slower than standard RAG (which requires only a single forward pass over the query and concatenated context). Could the authors provide a wall-clock latency comparison and FLOP count between standard RAG and RAG-GD during inference to justify the efficiency claims?
-
Efficiency-2: Given that extracting the EOS hidden states requires running the LLM over the retrieved documents anyway, a natural and highly practical baseline would be to simply prompt the LLM to summarize or extract the relevant evidence from the documents during these initial forward passes, and then feed those concise summaries into the final generation prompt. Did the authors compare RAG-GD against such a baseline? I expect such a baseline to do better than traditional RAG and am interested to see its performance against RAG-GD.
-
Efficiency-3: It is possible that a standard test time scaling method such as Best of N surpasses RAG-GD, with an equal compute power. Has authors tried any such approach as a baseline?
Limitations
yes
Paper formatting concerns
Citation: In Section 5 (lines 237–239) and Section 5.3 (line 262), the authors introduce several major benchmark datasets (NQ, TriviaQA, HotpotQA, 2WikiMultiHopQA, MuSiQue, PopQA, Bamboogle) without inline citations. While these are cited in the appendix, readers expect to find the citations at the very first mention in the main text.
Final justification
I thank the authors for addressing my concerns and answering my questions. I raise my rating to accept.
We thank the reviewer for the thoughtful feedback. We address the concerns on statistical significance, modern baselines, noisy retrieval, mathematical equivalence, and inference-time efficiency below.
For W1 and Q1: Error bars, confidence intervals, and stability of the thin-margin results
We repeated the evaluation under five independent support draws, with all support-conditioned methods receiving the same draw each time. Macro-average EM across seven benchmarks, E5 retrieval:
RAG-GD outperforms every comparator under all five draws, and all confidence intervals exclude zero. In particular, the thin margin over HyperTuning remains positive at +0.89 EM, with a 95% CI of [+0.51,+1.26].
On the reviewer-highlighted PopQA comparison, RAG-GD improves over the fixed Base adapter from 47.05 to 48.12 EM, a gain of +1.07. A paired bootstrap over the 14,267 test questions gives a 95% CI of [+0.45,+1.69].
For W2 and Q2: Comparison with modern adaptation baselines
Our original experiments focused on methods that could be directly evaluated under the same task-level few-shot RAG protocol. HyperFlow was originally developed for few-shot vision adaptation with trajectory-conditioned parameter flows, while MAC targets online document adaptation through a persistent memory bank. Neither is a direct drop-in baseline for our setting. We agree, however, that HyperFlow provides a relevant comparison because it also amortizes an optimization trajectory.
Our open-loop HyperFlow variant shares the backbone, Base adapter, support encoder, Q/K/V LoRA interface, support sets, and training budget with RAG-GD. RAG-GD predicts the endpoint of a K-step autograd trajectory, whereas HyperFlow learns step-conditioned drifts and integrates them with Euler updates. The drift is conditioned on the support representation and step index rather than the full evolving parameter state.
HyperFlow improves over the Base adapter by +1.41 EM. RAG-GD further improves over HyperFlow by +1.36 EM and wins on four of five benchmarks.
MAC instead stores document-conditioned modulations in a persistent memory bank and generates query-specific updates. RAG-GD produces one task-level update from three labeled demonstrations and reuses it across queries. A matched comparison would therefore require changing MAC’s supervision and memory protocol. We will add the HyperFlow results and clarify this distinction in the revision.
For W3: Scope of the linear theory and its connection to the cross-entropy LLM setting
We agree that the practical method is a theory-motivated amortized adaptation method, not a direct application of Lemma 1. The linear result provides an exact answer to a design question: where the update should act and what the predictor should approximate to avoid test-time backpropagation. At LLM scale, Eq. 8 independently defines the target as the actual K-step autograd update of the frozen nonlinear model under answer-token cross-entropy. It does not assume that the linear equivalence continues to hold.
We also directly test whether this gradient-derived target matters. Holding the predictor architecture, parameter count, Base adapter, support context, retrieval cache, training budget, and inference procedure fixed, gradient matching outperforms downstream task-loss supervision in all four backbone–retriever settings. The task-loss predictor improves over the Base adapter by 0.70 EM on average, while gradient matching adds a further 1.28 EM, accounting for about 65% of the aggregate improvement. The additional gain from the gradient target ranges from +0.79 to +2.00 EM.
For Q3: Robustness to noisy retrieval and irrelevant evidence
We test whether adaptation makes the generator more sensitive to noisy query-time retrieval. For each query, we replace r of the top-5 documents with the top-1 retrieved document of another query from the same benchmark. Corruption is seeded per query, so all methods receive identical corrupted contexts. We report average EM across seven benchmarks using Qwen-2.5-7B with E5 retrieval.
RAG-GD achieves the highest EM at every corruption level. Its retention is comparable to Vanilla RAG under mild corruption and higher under severe corruption. At r=5, it retains 65.1% of its clean performance, compared with 58.6% for Vanilla RAG. Thus, a clean support-derived update does not increase sensitivity to irrelevant query-time context.
This experiment keeps the support demonstrations clean and does not test harmful updates from noisy support evidence. As future work, we will investigate training the predictor on corrupted supports to suppress updates when the evidence is uninformative.
For Q4: Whether pooling before projection is equivalent to averaging per-example LoRA updates
The proposed equivalence would hold only if the entire map from each demonstration representation hi to the full update ΔW were linear. Our computation is nonlinear at two points. We first pool the EOS states and apply the post-pooling predictor once:
(U_{\ell,\pi},V_{\ell,\pi})=f_\phi(\bar h(C)), \qquad \Delta W_{\ell,\pi}=U_{\ell,\pi}V_{\ell,\pi}^{\top}.$$ This is not equivalent to predicting an update for each demonstration and averaging afterward. The predictor $f_\phi$ contains a nonlinear MLP, and the LoRA reconstruction is bilinear: $$f_\phi\left(\frac{1}{N}\sum_i h_i\right) \neq \frac{1}{N}\sum_i f_\phi(h_i),$$ $$\frac{1}{N}\sum_i U_iV_i^\top \neq \left(\frac{1}{N}\sum_i U_i\right) \left(\frac{1}{N}\sum_i V_i\right)^\top.$$ Thus, the two procedures differ analytically and are not expected to coincide in practice. Our implementation uses the pool-then-predict procedure. We will clarify the pooling position and computation order in Section 5.2. --- ### **For Q5, Q6 and Q7: End-to-end inference efficiency and compute-matched baselines** **Latency and compute.** The support encoding cost is incurred once per task, not once per query. RAG-GD encodes $N=3$ demonstrations, predicts one task-level update, and reuses it for all test queries. On NQ with Qwen-2.5-7B, E5 retrieval, and an A100, this one-time adaptation takes 108 ms. Amortized over 3,610 queries, the overhead is 0.03 ms per query. Per-query generation takes 317 ms, compared with 307 ms for the Base adapter and 294 ms for Vanilla RAG. Thus, RAG-GD adds only 3.3% latency over the Base adapter, with nearly unchanged peak memory (5.53 vs. 5.50 GB). Under the same protocol, TT-SGD requires 18.6 GB to produce the task-level update, compared with 5.53 GB for RAG-GD. In compute terms, RAG-GD adds three support prefills and one small predictor pass once per task, with no backward pass. Its amortized additional LLM compute is therefore $3F_{\mathrm{support}}/M$ per query for a task with $M$ test queries. We will add the wall-clock, memory, and token-normalized FLOP analysis to the revision. **Summarize-then-answer.** Because support documents address different questions, their summaries cannot replace evidence for a new query. We therefore evaluate the reviewer-suggested practical query-specific version: summarize each query’s retrieved documents, then answer from the summary. This requires an additional autoregressive stage beyond RAG-GD’s non-generative support encoding. | Method | NQ | HotpotQA | NQ latency/query | |---|---:|---:|---:| | Vanilla RAG | 39.16 | 32.45 | 0.29 s | | Summarize-then-answer | 33.89 | 31.30 | 1.57 s | | RAG-GD ($K=5$) | **42.91** | **35.54** | 0.32 s | In these two extractive QA benchmarks, summarization does not improve accuracy and substantially increases latency, likely because compression can remove answer-bearing details. We will include this baseline and its prompt in the revision. **Best-of-$N$.** Due to the limited rebuttal window, we could not complete a reliable Best-of-$N$ evaluation. RAG-GD adds a one-time 108 ms adaptation cost and about 10 ms per query, whereas each additional Best-of-$N$ sample requires another full generation and answer selection. A strict compute match therefore leaves little budget for $N>1$. We do not claim superiority over unrestricted test-time scaling, and the two approaches are complementary. --- We thank the reviewer again for the detailed feedback. In the revised paper, we will incorporate the additional experiments and clarifications above to strengthen the empirical evidence, sharpen the efficiency claims, and more clearly define the scope of the theory-guided LLM method.