liveBook · Manning

Latent variable

As explained in Retrieval Augmented Generation, The Foundational Ideas

A latent variable is an unobserved variable whose possible values are integrated or inferred when modeling observed outcomes.

A latent variable is an unobserved intermediate variable whose possible values influence an observed outcome. In retrieval-augmented generation, retrieved documents act as latent variables: the system combines their generation probabilities rather than trusting a single result. section 4.2

Combining retrieved documents

For a question about the 2008 financial crisis, a retriever may rank a Lehman Brothers article first while lower-ranked documents discuss subprime mortgages, mortgage-backed securities, and regulatory failures. Marginalizing over the top five documents lets supporting evidence from several documents contribute to the final answer, reducing the risk of missing the most relevant result. section 4.2

p(y|x) = ∑z ∈ Z  p(z|x) ⋅ (p(y|x,z)

The marginalization equation represents the answer probability as a weighted sum over candidate documents, using retriever confidence and document-conditioned generation probability. section 4.2

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Defines latent variables and works through probability-weighted top-K marginalization, without descending into implementation details.
Examples
Uses a 2008 financial-crisis question with five retrieved documents covering Lehman Brothers, mortgages, securities, and regulation.
What it assumes
Assumes familiarity with retrieved documents and probabilities while defining latent variables and marginalization through analogy.
What you can do after
Evaluate/understand how marginalizing over documents makes generated answers less dependent on one retrieval result.
How it connects
Connects latent variables to marginalization, retrieval-augmented generation, retriever confidence, and the missed-top-rank failure mode.

Also explained in

Compare how 4 books explain latent variable →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.