← Back to article

Equation 21 · From BM25 to Agentic Retrieval: A History of Retrieval-Augmented Generation

What does this equation mean?

p(y∣x)≈∑z∈top-k(pη(⋅∣x))pη(z∣x) pθ(y∣x,z),p(y \mid x) \approx \sum_{z \in \mathrm{top}\text{-}k\left(p_\eta(\cdot \mid x)\right)} p_\eta(z \mid x) \, p_\theta(y \mid x, z),

Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.

This equation gives an approximation: it relates the quantities while allowing an approximation. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.

Read it piece by piece

pp

Symbol p

p appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.

Understand this part →

yy

Symbol y

y is a part of this expression. Its role is fixed by the surrounding article and by the operations shown in the formula.

Understand this part →

xx

Symbol x

the writing.

Understand this part →

zz

Symbol z

z appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.

Understand this part →

kk

Symbol k

k appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.

Understand this part →

pηp_\eta

Symbol p_eta

pep_eta appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.

Understand this part →

pθp_\theta

Symbol p_θ

p_θ is a part of this expression. Its role is fixed by the surrounding article and by the operations shown in the formula.

Understand this part →

≈

≈

Approximately equal to; the equality is not exact.

Understand this part →

multiplication

multiplication

Multiply the quantities on either side.

Understand this part →

subscript

subscript

The lower label selects a particular version, component, or indexed member of the quantity. For example, x₀ and xₜ can be values at different positions.

Understand this part →

z∈top-k(pη(⋅∣x))z \in \mathrm{top}\text{-}k\left(p_\eta(\cdot \mid x)\right)

Starting index or lower bound: z in top-k(p_eta( × mid x))

This label says where the repeated addition, multiplication, or accumulation starts. Read its value or condition together with the article’s description of the index.

Understand this part →

How to interpret it

Its accuracy depends on the assumptions and range of use described in the article.

What the article says around this equation

By the time Lewis and colleagues published in 2020, learned dense retrieval and large pretrained generators both already existed as separate lines of work. The paper’s specific technical contribution was neither — it was making the whole pipeline trainable end to end through a single differentiable objective, treating the retrieved passage as a latent variable to be marginalized over rather than a fixed input handed to a frozen reader [ 8 ] . Writing x for the input, y for the output, z for a retrieved passage, and η\eta and θ\theta for the retriever’s and generator’s parameters respectively, the RAG-Sequence variant approximates p(y∣x)≈∑z∈top-k(pη(⋅∣x))pη(z∣x) pθ(y∣x,z)p(y \mid x) \approx \sum_{z \in \mathrm{top}\text{-}k\left(p_\eta(\cdot \mid x)\right)} p_\eta(z \mid x) \, p_\theta(y \mid x, z). holding a single retrieved passage fixed…
Read the full surrounding passage
By the time Lewis and colleagues published in 2020, learned dense retrieval and large pretrained generators both already existed as separate lines of work. The paper’s specific technical contribution was neither — it was making the whole pipeline trainable end to end through a single differentiable objective, treating the retrieved passage as a latent variable to be marginalized over rather than a fixed input handed to a frozen reader [ 8 ] . Writing x for the input, y for the output, z for a retrieved passage, and η\eta and θ\theta for the retriever’s and generator’s parameters respectively, the RAG-Sequence variant approximates p(y∣x)≈∑z∈top-k(pη(⋅∣x))pη(z∣x) pθ(y∣x,z)p(y \mid x) \approx \sum_{z \in \mathrm{top}\text{-}k\left(p_\eta(\cdot \mid x)\right)} p_\eta(z \mid x) \, p_\theta(y \mid x, z). holding a single retrieved passage fixed across the whole generated sequence, while the RAG-Token variant allows the marginalization to be recomputed at every output token, letting different passages inform different parts of the answer. The retriever itself was a DPR-style dual encoder and the generator was BART; nothing about either component was new. What was new was the training signal running backward through the whole thing, so that the retriever’s parameters could be nudged by whether the passages it surfaced actually helped the generator, rather than being trained once, upstream, and frozen. Evaluated on knowledge-intensive tasks, the resulting models achieved state-of-the-art results and generated language the authors described as more specific, diverse, and factual than comparable parametric-only baselines [ 8 ] . The name retrieval-augmented generation describes this specific technical move — differentiable retrieval as part of a generation objective — not the broader retrieve-then-read pattern DrQA had already established three years earlier.

Read the equation in its article →

Sources cited in the surrounding passage

These citations give research context. Read each source to check which claims it supports.

Return to From BM25 to Agentic Retrieval: A History of Retrieval-Augmented Generation

See this formula across 1 published context →

Browse the mathematical compendium →