ContentsRAG from Scratch to TRECAdisak Sukul · Iowa State University

Start here

Part 1 · Foundations

Part 2 · Finding the evidence

Part 3 · Writing the answer

Part 4 · Judging RAG

Part 5 · TREC and the 2026 tracks

Part 6 · Case studies: our submissions

Part 7 · Beyond text: video

Part 8 · Streams and advanced RAG

Back matter

Back matter · Appendix A

Glossary

Every term used so far, in one line, in alphabetical order. The list grows with each chapter. The full book will have about 150 terms.

Ablation
An experiment that changes one part of a system and keeps the rest fixed. Ch 15
Agent (coding agent)
A language model that reads files, runs commands and calls services over many steps toward a goal a person set. 0.4
Answer object
One piece of a RAG track answer, usually a sentence, with its own list of up to three citations. Ch 24
Assessor
A person who judges system output for an evaluation. At TREC, assessors work for NIST. Ch 17
Audience conditioning
Telling the writer who the reader is, so it can choose and order the facts for that reader. Ch 16
Baseline run
A run released by the track organizers that any team may start from. Ch 25
Battle
A comparison in which an assessor sees two anonymous answers to the same question and says which is better. Ch 24
Bi-encoder
A model that embeds the query and the document separately and compares the two vectors. Ch 6
BM25
The standard keyword ranking formula. It rewards documents that contain the query's rarer words, with a correction for document length. Ch 5
Bradley–Terry rating
A rating per system computed from many pairwise wins and losses, much like a chess rating. Ch 17
Calibration
Choosing a setting, such as a threshold, on questions where the right answers are known. Ch 10
Candidates
The documents the first stage of a search hands to the reranker. Ch 9
Checksum
A short fingerprint computed from a file. If the file changes, the fingerprint changes. Ch 28
Circularity
Testing a judge against a reference that was made, in part, by the same kind of judge. Ch 21
Citation
A pointer from a sentence in the answer to the document that supports it. 0.2
Citation drift
After a rewrite, a sentence cites a document that no longer supports what it says. Ch 14
Citation precision
Of the citations given, the share that support their sentence. Ch 19
Citation recall
Of the sentences that need a citation, the share that have a supporting one. Ch 19
ClimbMix-400b
The document collection of the TREC RAG 2026 track. It replaced MS MARCO V2.1 and is reached through a hosted search service. 0.4
Cohen's kappa
Agreement between two labellers on single items, corrected for agreement by chance. Ch 21
CombSUM
Score fusion: normalize each list's scores, then add them. Ch 8
Compression
Rewriting an answer in fewer words while trying to keep its facts. Ch 14
Confound
Two things changed at once between two runs, so a difference in score cannot be assigned to either. 0.4, Chapter 22.
Context window
The most text a model can take in at once, counted in tokens. Ch 13
Corpus
The collection of documents a system searches.
Cosine similarity
A number from −1 to 1 that says how closely two vectors point in the same direction. Ch 6
Cross-encoder
A model that reads the query and one document together and outputs one relevance score. Ch 9
Cross-language retrieval (CLIR)
Search where the query is in one language and the documents are in another. Ch 11
Dense retrieval
Search by nearest embedding vectors, which matches on meaning. Ch 6
Depth (k)
How many documents a system returns for one question. Ch 10
Development (dev) set
Questions with known answers used to tune a system before the real test. Ch 10
Dissemination agreement
A form an organization signs once a year before taking part in TREC. It sets how results may be used and shared. Ch 28
Embedding
The vector of numbers a model produces for a text. Texts with similar meaning get similar vectors. Ch 6
Evalbase
NIST's web system where teams upload runs and later download their scores. 0.3
Evidence selection
A step between retrieval and writing that decides which retrieved documents the writer will see. Ch 16
F1
One number that combines precision and recall. It is high only when both are high. Ch 10
Fusion
Merging several ranked lists into one. Ch 8
Gate
A test a change must pass before it is allowed to ship. Ch 14
Generator
The language model that writes the answer in a RAG system. Ch 2
Grounding
Tying each statement in an answer to a source the reader can check. Ch 1
Hallucination
A fluent, confident statement that is not true or not supported by the sources. Ch 1
Holm correction
A standard way to adjust p-values when several tests were run. Ch 22
Host track
A track whose system outputs are handed to the Auto-Judge track to be judged. Ch 27
Hosted index
A search index that someone else runs and that you query over the network. Ch 25
Hybrid search
Keyword search and embedding search run together and fused. Ch 8
HyDE
Hypothetical document embeddings. A language model writes a made-up answer, and the search uses it as the query. Ch 7
IDF
Inverse document frequency. A weight that is high for rare words and low for common ones. Ch 5
Inverted index
A table from each word to the documents that contain it. Ch 3
k (in RRF)
The constant in the RRF formula. Usually 60. Ch 8
Kendall's tau
A number from −1 to 1 that says how alike two orderings are. Ch 21
Knowledge cutoff
The date after which a model has seen no text. Ch 1
Language bias
A system favouring documents in one language whatever their content. Ch 11
Leaderboard
A list of systems ordered by score. Ch 21
Length normalization
The part of BM25 that keeps long documents from winning only by their size. Ch 5
Listwise reranking
Showing a model several documents at once and asking for their order. Ch 9
LLM
Large language model. A program trained on a very large amount of text to predict the next piece of text. Ch 1
LLM judge
A language model asked to grade or compare system output. Ch 20
Lost in the middle
The finding that models use facts at the start and end of a long input better than facts in the middle. Ch 13
Manifest
A team’s own list of every run it sent, with file name, date and checksum. Ch 28
Meta-evaluation
Evaluating an evaluation method. Ch 21
MLIR
Multilingual information retrieval: one ranked list that mixes documents from several languages. Ch 27
Model family
The models made by one developer. Ch 20
Multilingual retrieval (MLIR)
Search over documents in several languages that returns one ranked list. Ch 11
Multiple testing
Running many tests, which makes it likely that one looks good by luck. Ch 22
Named measure
The one measure a judge commits to before any result is seen. Ch 21
Narrative
The long-form description of an information need that serves as the question in TREC RAG 2026. There are 119 of them. 0.2
nDCG
A ranked measure from 0 to 1 that rewards putting the most relevant documents first. Ch 4
NIST
The US National Institute of Standards and Technology, which runs TREC. Ch 23
Nugget
One key fact that a good answer should contain. Answers are scored by how many nuggets they cover. Chapter 18.
Nugget assignment
Deciding, for one answer, which nuggets it contains. Ch 18
Nugget gain
For a set of documents: the share of the nuggets that the documents contain. Ch 8
Nugget recall
The share of the nuggets that the answer contains. Ch 18
Okay nugget
A fact that is useful in an answer and not essential. Ch 18
p-value
How often a difference this large would appear by luck alone if two systems were really equal. Ch 22
Paired runs
Two runs built to differ in one thing only, so a difference in score can be traced to it. Ch 13
Pairwise judging
Showing a judge two answers to the same question and asking which is better. Ch 20
Panel
Several judges whose verdicts are combined. Ch 20
Pool
The set of candidate documents passed to the next step of a pipeline. Ch 8
Pooling
Judging only the documents that submitted systems ranked highly. Ch 23
Position bias
A judge's habit of favouring the answer shown first, or the one shown second. Ch 20
Post-processing
Code that cleans, checks and reshapes a model's output. Ch 12
Pre-registration
Writing down the plan, the measure and the rule for deciding before seeing the results. Ch 22
Precision
Of the documents returned, the share that are relevant. Ch 4
Priority (of a run)
The order in which a team asks the organizers to judge its runs. Limited human judging goes to the first ones. Ch 24
Progressive disclosure
Showing an agent a short description of a skill first and the details only when it needs them. Ch 26
Prompt
Everything sent to the model: instructions, the question and the evidence. Ch 12
Qrels
The file of relevance judgments for a test collection. Ch 3
Query rewriting
Turning a person's words into a query that searches better. Ch 7
Query variant
One of several different queries written for the same information need. Ch 7
RAG
Retrieval-augmented generation. A search step fetches documents, and a language model writes the answer from them, with citations. 0.2
Rank
A document's position in a ranked list, counted from 1.
Recall
Of all the relevant documents that exist, the share that were returned. Ch 4
Reciprocal Rank Fusion (RRF)
Fusion by positions: each list gives a document 1 / (k + rank) points. Ch 8
Report request
A description of what a report should cover and who it is for. Ch 16
Reranker
A slower, more accurate model that re-sorts a short candidate list. Ch 9
Retriever
The search part of a RAG system. Ch 2
Rubric
A written list of what a good answer must contain or do, made before the answers are read. Ch 17
Run
One file of system output for all the questions of a task, submitted under a run tag. 0.3
Run cap
The largest number of runs a team may send to one task. Ch 28
Saturation
In BM25, each extra repeat of a word adds less than the one before. Ch 5
Self-preference
A judge's habit of favouring text written by itself or by a model from the same maker. Ch 20
Sentence-level citation
Each sentence of the answer lists the documents that support it. Ch 12
Shard
One file of a collection that has been split into many files. Ch 25
Sign test
A check that counts on how many topics one system beats another. Ch 4
Skill
A folder of instructions, reference files and scripts that an agent loads on demand. 0.4
Snippet
A short piece of a document, such as its first 500 characters. Ch 13
Sparse retrieval
Search that matches words, such as BM25. Ch 5
Strict score
A nugget score that counts a nugget only when the answer supports it fully. Ch 18
Structured output
An answer in a fixed machine-readable form, such as JSON. Ch 12
Support
The cited document states, or clearly implies, everything the sentence claims. Ch 19
tau-AP
A version of Kendall's tau that punishes mistakes near the top of the list more. Ch 21
Temperature
A setting that controls how much chance enters a model's word choices. Ch 12
Term frequency (tf)
How many times a word appears in one document. Ch 5
Test collection
Documents, topics and relevance judgments together. Ch 3
Threshold
A score value. Documents that score above it are kept. Ch 10
Token
The unit a model reads and writes: a word or a piece of a word. Ch 1
Track
One themed competition inside TREC, with its own tasks, data and organizers.
Track median
The middle score among all runs in a task. Half the runs are above it.
TREC
The Text REtrieval Conference, a yearly evaluation series run by NIST since 1992. 0.3
Trimming
Removing whole sentences until an answer fits its length limit. Ch 14
Validation
Checking that output obeys the required format and rules. Ch 12
Variable depth
Returning a different number of documents for each question. Ch 10
Verification pass
A second, independent check of a result by a person, a program or an agent that did not produce it. Ch 26
Vital nugget
A fact an answer must have to be good. Ch 18
Vocabulary mismatch
The question and the relevant document use different words for the same thing. Ch 5
Workflow
A system in which the steps are fixed in code and a language model fills in each one. Compare agent. Ch 26