BRAG: Bayesian Retrieval Augmented Generation
Javier Movellan, Manjot Bilkhu, Young-mok Jung, Sirajul Salekin, Henry Tran, Zhao Huang
Abstract
Retrieval-augmented generation (RAG) ranks memory chunks by semantic similarity to the query. Many methods improve on this by learning from feedback on what was retrieved, but each is a separate heuristic, with no account of when it is the right choice. We introduce BRAG, a generative model of retrieval with use. Each chunk generates the queries it answers from a mixture of von Mises-Fisher components anchored at its original embedding, and each chunk has a latent utility that drifts over time. The model gives the optimal inference, a closed-form filter that stores a few keys and two scalars per chunk and updates them online from the labels of a curator, and it frames retrieval as a control problem. It also shows when existing methods are optimal. Query averaging, Rocchio-style feedback and frequency reranking are special cases with fixed parameters, NUDGE is the case of one key per chunk with no dynamics, and LADER the limit of one key per past query. On two public long-term memory benchmarks, BRAG matches these methods on queries asked before, as expected, because when nothing changes over time the assumptions behind these special cases hold. On harder problems, where a new chunk makes an old one obsolete, BRAG outscores them. They all stay at plain-search level (Recall@5 0.67-0.71), while BRAG retrieves the new chunk 0.80-0.86 of the time. We also ran BRAG on three of NUDGE's seven text benchmarks, and it matches or beats NUDGE on all three. On nine months of a personal agent's memory (20,640 chunks), BRAG raises Recall@5 on held-out queries from 0.75 to 0.98 and Recall@1 from 0.44 to 0.97, with little change on chunks never queried.
Create a lesson
Related papers
Automatic Occupational Coding through Retrieval-Augmented Generation
Shared title terminologycs.AIMathijs A. Langezaal, Egon L. van den Broek, Lukas P. A. Arts et al.
GaokaoMathGen: Chinese Gaokao Mathematics Finale Problem Generation Controlled by Latent Reasoning Structures
Shared title terminologycs.AIQian Chen, Kun Zhu, Zhongyi Wang et al.
A Generative AI Agent to Emulate Interactive Human-driven Vehicles for Automated Driving Testing in Urban Areas
Shared title terminologycs.AIJia Hu, Changjian Yu, Panqu Wang et al.
Reproducing History Is Not Enough: Intervention-Level Assurance for LLM-Generated Simulators
Shared title terminologycs.AIAshraf Abdul-Muumin, Aniruddha Chattopadhyay, Noorbakhsh Golilarz et al.
Beyond Static Charts: Benchmarking Interactive Chart-to-Code Generation for MLLMs
Shared title terminologycs.AIYuhan Bian, Haoyu Liu, Siyu Li et al.
Needwise: Generation-Free Conversational Recommendation from Need-Level Typed Decisions
Shared title terminologycs.AISungchul Kim, Weixiao Huang, Mekala Raja Sekhar Reddy et al.