cd /news/large-language-models/in-context-optimization-for-retrieva… · home topics large-language-models article
[ARTICLE · art-14920] src=arxiv.org pub= topic=large-language-models verified=true sentiment=· neutral

In-Context Optimization for Retrieval-Augmented Generation: A Gradient-Descent Perspective

Researchers have demonstrated that retrieval-augmented generation (RAG) can be understood as an in-context optimization process, where a single linear self-attention layer performs a gradient-descent step on a unified RAG objective. The team developed a lightweight method that predicts context-conditioned updates to a generator's evidence-use interface, improving performance across seven question-answering benchmarks with two retrievers and two frozen large language model backbones. This approach matches test-time gradient adaptation at a fraction of the computational cost, offering a practical way to enhance RAG systems without modifying the retriever or backbone model.

read1 min publishedMay 27, 2026

arXiv:2605.26356v1 Announce Type: new Abstract: In-context learning has recently been linked to implicit gradient descent in linear self-attention models, suggesting that context can induce a forward-pass update. Retrieval-augmented generation (RAG) also relies on context, but retrieved documents are usually treated as static evidence rather than signals for adaptation. We study RAG as an in-context optimization process. First, we show that one linear self-attention layer can implement one gradient-descent step on a unified linearized RAG objective covering both projection-based and dot-product retrieval interfaces. This gives an exact regime where retrieval-augmented prediction and in-context optimization coincide. We use this result not as a literal model of LLM computation, but as a guide for adapting the interaction between queries and retrieved evidence. We then test the boundary of this correspondence: it remains stable under controlled linear extensions, but becomes feature-distribution dependent under nonlinear architectures. Finally, we turn this view into a lightweight method for frozen RAG LLMs. The method keeps the retriever and backbone fixed, and predicts a context-conditioned update to a generator-side evidence-use interface. Across seven QA benchmarks, two retrievers, and two frozen LLM backbones, this forward-only update improves a shared-interface baseline, transfers to held-out tasks, and approaches test-time gradient adaptation at much lower per-query cost.

── more in #large-language-models 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/in-context-optimizat…] indexed:0 read:1min 2026-05-27 ·