00-START-HERE · 01-READING-ROUTES · 00_09_about_the_author · 02_the_competing_answers_to_the_same_problem Retrieval-augmented generation (RAG) interviews test whether you can route knowledge to the right store, price that choice, and recognize when retrieval is the wrong tool.
TL;DR
- A language model is a fixed-capacity knowledge store. A datastore grows as rows are added. RAG joins those two stores.
- The decisive difference is write cost. A datastore row is addressable and reversible. A fact spread through model weights is entangled and expensive to change.
- Five bottlenecks follow from storing knowledge in weights: factual error, no source verification, high update cost, no bounded opt-out, and model size tied to factual coverage.
- Five RAG benefits move those responsibilities into a datastore: correctness, attribution, opt-out, adaptability, and parameter efficiency. Each move creates a retrieval-side cost.
- RAG is one special case of tool use. Its call is read-only, retryable, and returns passages with source identifiers.
- Retrieval cannot answer queries that require every matching record when it returns only the top few records. Aggregates and actions need different tools.
- Retrieval can harm answers the model already knows. Gate it by measured subject popularity or a product-specific frequency proxy once the crossover is known. In the worked popularity example, selective retrieval reaches accuracy, beats always-retrieve by percentage points, and cuts retrieval work by .
The story
Imagine an interview room as a working library with two places to keep knowledge. The first place is a stone memory wall. Facts are carved across many stones at once. This is the parametric store, meaning its capacity was fixed before training. Reading it is fast, but changing one fact means recarving a wide surface. The second place is an expandable card room. Each card has an address and can be inserted, corrected, or removed. This is the non-parametric datastore, meaning its knowledge capacity grows as cards arrive. RAG is the librarian who uses both rooms. The librarian reads the question, retrieves a few cards, and asks the memory wall to compose an answer from the question and those cards. That combination is semi-parametric, meaning one fixed store works with one expandable store. The interviewer first inspects the memory wall for five cracks. Rare facts fade because the carving is lossy. A sentence has no return address to its source. A correction requires recarving. A deletion cannot target one original document. More factual coverage also means paying for a larger wall on every visit. Moving facts into the card room repairs those cracks, but the bill moves too. A missing card can spoil correctness. A citation can point to the wrong support. A deletable card helps only if the same text was never carved into the wall. Fresh cards require an ingestion schedule. A smaller wall now depends on room space and an extra reading step. The library also has other service desks. The retrieval desk returns source cards and is safe to ask twice. The calculator desk returns a value but no source passage. The action desk opens a ticket or sends a message and must not be called twice by accident. RAG is one desk, not the whole library. Some questions ask for a few relevant cards. Other questions ask for the sum of every invoice. A top-card desk cannot guarantee a complete total, even with perfect ranking. The interviewer wants you to route the first query to retrieval and the second to a complete query tool. Finally, a doorman decides whether the librarian should enter the card room at all. Obscure subjects benefit because the wall remembers them poorly. Famous subjects can be harmed by a distracting card because the wall already knows the answer. The strongest interview answer therefore sounds like a library operating plan. Name the two stores. Price each write. Trace the five cracks and five transfers. Route each query to the right desk. Then place a measured gate at the point where retrieval stops helping.
Decoder table
| Technical term | Plain-English meaning | Why it matters |
|---|---|---|
| Retrieval-augmented generation (RAG) | A system that retrieves passages from a datastore and conditions a generator on those passages. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Language model | A model that assigns next-token probabilities from preceding tokens. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Token | One vocabulary unit processed or generated by the model. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Query | The input question or request the system must answer. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Passage | A text span returned by retrieval and supplied to the generator. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Context | The query and supplied text the generator reads for its next output. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Context window | The maximum token sequence available to one model call. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Pre-training | The original large training run that compresses corpus patterns into weights. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Training corpus | The text collection used to update model weights. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Parametric model | A model whose parameter count and capacity are fixed before training. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Parameter | One learned number in the model’s fixed weight tensor. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Weight tensor | The full collection of learned parameters. Facts are distributed across it rather than stored at document addresses. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| The chapter’s symbol for the generator’s parametric weights. | It supports the chapter’s two-store frame and evidence-retrieval decisions. | |
| Conditional token distribution | The model’s probabilities for the next token given preceding tokens. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Vocabulary size | The number of possible token outputs considered by the model. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Lossy compression | Storage that preserves recurring patterns but cannot retain every source fact intact. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Long tail | Rare subjects or facts that appeared too few times to be represented reliably in the weights. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Datastore | The expandable external store that retrieval searches. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Non-parametric store | A store whose effective knowledge capacity grows with the number of stored items. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Semi-parametric system | A system that combines fixed model weights with an expandable datastore. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Capacity | Capacity that grows in proportion to the number of stored chunks. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Chunk | A bounded passage stored and retrieved as one unit. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Embedding | A numerical vector used to place a chunk or query in a searchable space. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Dense retrieval | Ranking by proximity between learned embedding vectors. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Exact-match retrieval | Ranking that rewards literal identifiers or terms, useful for fields such as stock keeping units. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Stock keeping unit (SKU) | A precise catalog identifier whose exact text matters. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Bi-encoder | An encoder that represents the query and chunks separately so their vectors can be compared. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Encoder | The model that converts text into an embedding vector. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| k-nearest-neighbor search | A non-parametric method that returns the closest stored vectors. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Retriever | The read step that maps a query and datastore to passages. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Generator | The model step that maps the query and retrieved passages to an answer. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Top-k | The highest-ranked retrieved items. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Retrieval miss | A query result that fails to include the answer-bearing passage. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Grounding | Constraining an answer to information in supplied passages. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Grounded accuracy | Accuracy measured while requiring correct use of retrieved evidence. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Tenant isolation | Keeping one customer’s stored knowledge separate from another customer’s knowledge. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Addressable | Stored at a location that can be targeted directly. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Revocable | Removable without changing unrelated stored knowledge. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Entangled | Spread across many weights so one fact cannot be isolated cleanly. | It supports the chapter’s two-store frame and evidence-retrieval decisions. |
| Gradient pass | A training update that changes model parameters. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Fine-tuning | Additional training that changes the model’s weights for a target task or corpus. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Full fine-tuning | Updating all model weights. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Continual fine-tuning | Repeatedly training on newly arriving material. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Catastrophic forgetting | Loss of earlier capability when narrow new training changes the weights. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Replay mixture | Old or unrelated training data mixed with new data to protect prior knowledge. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Model editing | A targeted attempt to change a fact in selected model layers. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Collateral damage | Unintended changes to unrelated knowledge after a model edit. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Unlearning | Training that penalizes reproduction of specified sequences in an attempt to remove them. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| 32-bit floating point (FP32) | A four-byte number format used in the source’s memory calculations. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| 16-bit brain floating point (bf16) | A two-byte number format used in the source’s serving calculations. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Adam | The optimizer in the full fine-tuning memory example. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Gradient | The update signal stored for each parameter during training. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Optimizer moments | Adam’s two stored state values per parameter in the source calculation. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Activation | An intermediate value created while the model processes input. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Training epoch | One pass over the selected training corpus. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Regression check | A test that looks for unrelated behavior that worsened after an update. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Floating-point operations (FLOPs) | The arithmetic work used to price training and inference. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Model-FLOPs utilization | The share of hardware peak arithmetic sustained by model execution. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Graphics processing unit hour (GPU-hour) | One accelerator used for one hour. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Accelerator | The computing card used for model training or inference. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| H100 | The accelerator model used for the source’s peak, sustained-throughput, and memory assumptions. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Sustained throughput | The arithmetic rate actually achieved, rather than the hardware’s peak rate. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Index | A data structure that supports fast retrieval over stored chunks. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Index upsert | Insert a new index row or replace the row with the same key. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Latency | Elapsed time added to a served query. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Vector dimension | The number of numeric coordinates in one embedding. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Float32 vector | An embedding whose coordinates each occupy four bytes. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| High-cardinality knowledge | A collection with many distinct values, such as a large catalog. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Low-frequency knowledge | Facts that appear rarely in the training corpus. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Parametric prior | The answer tendency already stored in the model weights before retrieval. | It exposes the update, memory, compute, or serving cost of weights and indexes. |
| Factual correctness | Whether the answer contains the right fact. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Attribution | Connecting an answer claim to a source passage. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Provenance | The origin of the evidence supplied to the answer. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Citation coverage | Whether answer text carries citation markers. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Citation support | Whether the cited span actually entails the associated claim. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Entailment check | A test of whether a cited span supports a generated sentence. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Sample-and-rerank | Generate several candidate answers, then rank them against evidence. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| GopherCite | The cited system that samples answers and reranks them against quoted support. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Opt-out | The ability to remove specified data from the served system. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Adaptability | The ability to serve changed facts without changing model weights. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Freshness objective | A committed limit on how stale the searchable index may become. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Ingestion pipeline | The process that converts changed documents into searchable chunks and index entries. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Rebuild cadence | The schedule for refreshing or reconstructing an index. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Parameter efficiency | Serving the task with fewer generator parameters because facts live outside the weights. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Perplexity | The language-model quality measure cited when low-risk-only training weakens the base model. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| High-bandwidth memory (HBM) | Accelerator memory used for model weights, cache, and activations. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Dynamic random-access memory (DRAM) | Host memory used for the retrieval index in the example. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Host memory | Memory on the retrieval machine rather than on the model accelerator. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Key-value cache (KV cache) | Accelerator memory that stores attention state during generation. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Hierarchical navigable small world (HNSW) | The graph index used in the parameter-efficiency example. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| HNSW neighbor limit | The graph parameter whose source example is . | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Inverted file with product quantization (IVF-PQ) | The compressed vector representation priced at 96 bytes per vector. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Scalar quantization | Another index-compression option named in the source. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Prefill | Processing prompt tokens before answer generation begins. | It identifies a RAG benefit or the datastore-side cost that accompanies it. |
| Retrieval gate | A policy that decides whether a query should retrieve at all. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Closed-book answer | An answer produced from model weights without retrieved context. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Subject popularity | The source’s query-level variable, measured as monthly Wikipedia page views. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Power-law distribution | A distribution with a small popular head and a large rare tail. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Head, torso, and tail | Popularity buckets for frequent, medium-frequency, and rare subjects. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Popularity bucket | A group of queries with a similar subject-frequency range. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Closed-book accuracy | Accuracy without retrieval at subject popularity . | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Retrieval accuracy | Accuracy with retrieval at subject popularity . | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Rescue rate | The chance that retrieval fixes an answer that was wrong without retrieval. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Harm rate | The chance that retrieval spoils an answer that was correct without retrieval. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Retrieval value | The accuracy change caused by retrieval. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Accuracy threshold | The closed-book accuracy level where retrieval’s net value changes sign. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Popularity crossover | The popularity where . Retrieval helps below it and hurts above it. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Retrieval-induced harm | A correct closed-book answer becoming wrong after retrieved context is added. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Rank-1 precision | How often the first retrieved item is answer-bearing. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Recall at 1 | Whether an answer-bearing passage appears in the first retrieved position. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Recall at 20 | Whether an answer-bearing passage appears among the first twenty retrieved items. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Approximate nearest-neighbor (ANN) search | Fast vector search used to retrieve likely neighbors. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Reranker | A second ranking stage applied after initial retrieval. | It defines the measured gate between retrieval rescue and retrieval-induced harm. |
| Tool-augmented model | A generator that can choose and call one or more external tools. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Tool selection | Choosing which available tool to call. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Toolformer | The cited system that learns when to call an application programming interface using self-supervised training. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| ReAct | The cited approach that interleaves explicit reasoning with actions. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Router | A classifier or policy that sends a query to an answer path. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Learned policy | A trained decision rule for selecting an action or tool. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Reinforcement learning | Learning a decision policy from action outcomes, cited for answer-versus-search routing. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Argument synthesis | Producing a tool’s query string or structured input. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Query synthesis | Constructing the executable database or tool query. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Structured Query Language (SQL) | The database query language used for complete aggregates in the example. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| JavaScript Object Notation (JSON) | A structured payload format that must parse and preserve correct fields. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Application programming interface (API) | A callable software boundary used for reads or actions. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Customer relationship management (CRM) | A business-record system named as a destination for a mutating tool call. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Side effect | A call that changes external state. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Retryable | Safe to call again without causing a second external change. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Idempotent by key | A write design where repeating the same keyed request does not create a duplicate effect. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Return type | The kind of result a tool provides, such as source passages or a computed value. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Source identifier | A document reference carried with a retrieved passage. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Read-only tool | A tool that observes data without changing it. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Mutating tool | A tool that changes state, such as creating a ticket. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Complete query | A query that examines every matching record needed for the answer. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Complete aggregate | A sum, count, or average computed over every matching record. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Metadata filter | A structured constraint that selects records by stored fields rather than relevance ranking. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Evidence coverage | The share of all required records supplied to the generator. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Global query | A question whose answer depends on a corpus-wide set rather than a few passages. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Sensemaking query | The source’s related term for a query requiring global corpus evidence. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| Abstention | Declining to answer when the available path cannot support a correct result. | It separates evidence retrieval from general tools, complete queries, and state-changing actions. |
| BM25 | A sparse text-ranking method used to show that RAG is defined by its contract, not vector plumbing. | It anchors a named source example, benchmark, method, or evaluation check. |
| Dense Passage Retrieval (DPR) | The published dense retriever used for two arithmetic sanity checks. | It anchors a named source example, benchmark, method, or evaluation check. |
| PopQA | The entity-question benchmark used for the popularity and retrieval-harm result. | It anchors a named source example, benchmark, method, or evaluation check. |
| Natural Questions | The benchmark used for the reported top-20 retrieval accuracy sanity check. | It anchors a named source example, benchmark, method, or evaluation check. |
| RoBERTa | The larger parametric model in the cited word-sense comparison. | It anchors a named source example, benchmark, method, or evaluation check. |
| Model judge | A model used to score answer quality when its scores are calibrated against human judgments. | It anchors a named source example, benchmark, method, or evaluation check. |
| Held-out calibration set | Human-scored examples kept separate to check whether an automated judge agrees. | It anchors a named source example, benchmark, method, or evaluation check. |
| Personally identifiable information (PII) | Data linked to a person and named as a reason to prefer an addressable store. | It supports the rule that deletable or constrained data must remain addressable. |
| Low-risk training split | Training weights on permissively usable text while placing sensitive or attribution-required text in the datastore. | It supports the rule that deletable or constrained data must remain addressable. |
Core mechanics
Mathematical conventions
Storage is decimal unless marked binary: and . FLOP estimates use and for parameter count and processed tokens . At assumed sustained throughput , on one GPU. These are arithmetic proxies, not measured latency: they omit attention-length effects, bandwidth, communication, batching, index I/O and rollout. Multi-GPU examples assume ideal scaling. Training epochs, replay budgets and routing rates are scenario inputs, not universal requirements. Calculate at full precision, then round; use for rounded or modeled results.
1.1 Parametric, non-parametric, semi-parametric: the frame behind every question
What the frame is
A parametric language model fixes its parameter count before training. That count does not grow with the amount of training data. The model represents the next-token distribution below over a vocabulary of size .
After training, the source corpus is no longer an addressable part of the model. Everything retained from that corpus is compressed into the weights. A non-parametric datastore grows with its contents. Store chunks and its knowledge capacity is . Add chunk and capacity grows without retraining or disturbing an existing row. Dense retrieval is k-nearest-neighbor search in embedding space. It is non-parametric in capacity even though its encoder can contain tens or hundreds of millions of trained weights. RAG composes the two stores.
The query is . The datastore is . The retrieved chunks are through . The answer is .
Why the split exists
The split earns its keep through write-cost asymmetry, not through an unconditional accuracy claim. Writing one fact to embeds one chunk and inserts one row. That write takes milliseconds in the prose example, leaves other rows unchanged, and is reversible by deletion. Writing one fact to requires a gradient pass over the parameters. For a 27-billion-parameter model held in FP32, the weights alone occupy before optimizer state. The update is smeared across the weight tensor and cannot be reversed by subtraction. Knowledge in the weights is effectively write-once and entangled. Knowledge in the datastore is addressable and revocable. Freshness, attribution, opt-out, and tenant isolation follow from that difference. The durable default is behavior in the weights and knowledge in the datastore. Format, instruction following, refusal, and reasoning are learned dispositions. Facts, prices, policies, and tenant data are rows that may need a Tuesday correction.
What breaks without the frame
Putting changing facts into the weights makes corrections depend on another training run. Putting behavior into retrieval does not guarantee that the model will emit a required format such as JSON. The maximalist datastore design also fails. A tiny generator must still resolve references across passages, reconcile contradictions, and notice missing information. A larger datastore increases that reading burden through near-duplicates and conflicting passages. Knowledge load and comprehension load are different. The mirror design that folds retrieval back into the weights also fails the write-cost test. It restores retraining as the update primitive.
Compression arithmetic
The source uses Llama 3 to quantify the lossiness. It reports more than 15 trillion pre-training tokens and an 8-billion-parameter model. That is about . English text is approximated at 4 bytes per token. A bf16 parameter occupies 2 bytes. At the rounded -token reference scale, the input-to-parameter ratio is tokens per parameter. The corresponding input-to-checkpoint byte ratio is . This is a corpus-size comparison, not a claim that each parameter independently stores identifiable source bytes or that every fact is compressed losslessly. Rare facts can be poorly retained, but their learning probability cannot be inferred from this ratio or from a count of three appearances alone.
Worked example: 40,000 internal documents
The corpus has documents at tokens each. That is tokens. About changes each quarter. The generator has 8 billion parameters. The parametric route uses the training-cost identity below.
The factor approximates forward-pass and backward-pass FLOPs per parameter per token. One epoch costs . The worked scenario budgets epochs, totaling ; neither successful memorization nor the necessity of ten epochs follows from that budget. A rounded dense bf16 peak near at utilization gives the assumed . The sustained throughput carried by the source is . Training therefore takes , or about . That cost repeats each quarter. The whole corpus is replayed because training only on the changed invites catastrophic forgetting. The datastore route chunks at 300 tokens. Use non-overlapping -token chunks without crossing document boundaries, retaining a final partial chunk. Each modeled document produces chunks, for vectors. A forward-only embedding proxy for the -million-parameter encoder is , giving approximately at the stated throughput. The previously quoted is not reproduced by those inputs. At fp32 dimensions, vector payload is , excluding the index, identifiers, metadata and source text. Padding and actual encoder throughput can add work. The quarterly refresh touches source tokens, giving approximately of embedding arithmetic before index work. Comparing the initial ten-epoch training run with the initial full-corpus embedding pass gives approximately times the compute. The independent check is . Comparing a full replay training run with a changed-only embedding refresh instead gives approximately times. These are different denominators; do not label the initial-pass ratio as the incremental-refresh ratio.
Practical decisions from the frame
- Route facts to and behavior to by default.
- Keep a required disclaimer or fixed schema in behavior when it must appear even if no query asks for it.
- Choose the store by change frequency and correction deadline. If a correction must land within days, weights are the wrong store.
- Use weights for information that is genuinely static over the model’s service life.
- Size the generator by comprehension load. Measure grounding and conflict resolution at fixed before shrinking it.
- Keep licensed text, PII, and data with deletion obligations in the datastore.
- Put data into weights only when it is provably unencumbered and its distribution is what training should teach.
- Name the routing frame aloud before proposing architecture. If the interviewer has fixed the split, reason within that constraint.
- For an invented SKU, move the changing catalog to , keep fine-tuning for response format, and use exact-match signals for the identifier field.
- A store growing from 2 million to 200 million chunks does not by itself justify shrinking a 70-billion-parameter generator to 8 billion. Test the increased reading load.
- If a licensed corpus must leave within 30 days, separate the claimed four-point language-competence loss from retrievable knowledge and keep the encumbered material deletable.
1.2 The five bottlenecks that created RAG
One storage choice, five consequences
The source’s interview brief has policy documents. A legal team audits every answer. A compliance officer can require one customer’s data to be deleted within 30 days. The team has a 27-billion-parameter open-weight model and eight accelerators. Saying only that fine-tuning hallucinates is incomplete. Even a correct parametric answer cannot identify its source document, guarantee deletion, or avoid retraining cost.
Bottleneck 1: factual error
Weight storage is frequency-weighted and lossy. Accuracy rises with the number of pre-training documents that mention a question’s subject. Rare enterprise facts occupy the weak tail. Adding corpus volume is not proportional to adding distinct facts because web data is heavily correlated. Scaling parameters also fails as a practical tail strategy. The cited trend extrapolates human-level long-tail accuracy to about . At 2 bytes per bf16 parameter, the weights would occupy . Holding them would require accelerators with each. That is 25 million cards for inference weights alone. The estimate is an extrapolation from a fitted curve, not a measurement. An orders-of-magnitude comparison must name its baseline. Relative to the worked -parameter model, , about orders of magnitude. Describing the same target as simply “six” or “nine” orders beyond deployed models is not a reproducible comparison without a specified model size and date. The extrapolation itself remains highly uncertain.
Bottleneck 2: no verification
A fact is a diffuse perturbation across weights, not a value stored at a document address. A sampled token carries no return address to the document that influenced training. Asking the model to cite does not reconstruct provenance and can produce a confabulated citation. The weight tensor is also undated. The correct answer to a leadership question can move from one person to another while the stored tendency stays stale. The source illustrates that drift with a leadership answer moving from Jack Dorsey to Linda Yaccarino and then to another successor.
Bottleneck 3: update cost
Full fine-tuning with Adam in FP32 costs bytes for weights, for gradients, and for optimizer moments. The total is before one activation. At , that is . The forward-pass weights alone are . Training only on a changed document can damage retained behavior; the outcome depends on the update method and data. Replay is one mitigation for forgetting, not a mathematical requirement for every successful update; retention must be evaluated independently.
Bottleneck 4: no bounded opt-out
There is no operation that deletes one source document from a tensor. The cited memorization results establish three regularities. Larger models memorize more. Repeated examples are more extractable. Extractability rises as an attacker supplies more context tokens. Unlearning reverses the training sign to punish specified sequences. It requires enumerating every target sequence in advance. The core problem is that the sensitive content in a large corpus is abundant and not fully known.
Bottleneck 5: model size
Training compute couples knowledge capacity to language competence. In this formula, is parameter count and is training-token count rather than the datastore.
Increasing parametric capacity to improve factual coverage raises work on every forward pass, including queries that need no external facts. Adding one fact does not automatically increase a fixed architecture's parameter count. Scaling can reduce some factual error; it does not itself provide document-level provenance or deletion. Model editing also needs locality and regression checks because changing shared parameters can affect unrelated behavior. Changing neurons associated with one fact can perturb unrelated knowledge and leave contradictory beliefs.
Worked example: one policy changes on Tuesday
The setup uses documents, a -billion-parameter model and eight accelerators. Each sustains the assumed . FP32 Adam weights, gradients and two moments together use before activations. Optimizer moments alone are . Aggregate capacity therefore needs at least cards for those tensors alone; this does not mean six cards are reserved and two are free. Perfectly sharding the state across eight cards uses per card before overhead. The replay budget is tokens. The replay proxy is . With ideal aggregate throughput , elapsed time is approximately hours. The run consumes approximately GPU-hours and costs approximately at per GPU-hour, before regression, communication and rollout. For model editing, the source assumes about 50 atomic statements per document. The corpus then contains facts. At annual churn, it receives edits per year, or 164 per day. Each edit needs a regression check because it can perturb neighboring knowledge. The arrival rate, not the cost of one edit, is the bottleneck. For retrieval, this separate update scenario uses an -token document—an outlier relative to the earlier -token average—split into twenty -token chunks. A -million-parameter bi-encoder processes them in the proxy , or approximately , plus index upsert work. Comparing the eight-GPU replay wall time with this one-GPU embedding-only time gives approximately . This is an idealized, differently resourced wall-time ratio, not a measured end-to-end update speedup. The later deletion is a row removal. The compute identity is checked against GPT-3. For 175 billion parameters and 300 billion tokens, it predicts . The reported training compute is . The 16.5-hour estimate therefore depends mainly on the replay budget assumption.
Practical decisions from the five bottlenecks
- Run all five bottlenecks against every proposal to put company documents into weights.
- Use fine-tuning for stable, always-needed, non-attributable behavior such as house style, output format, and domain jargon.
- Price memory with and training compute with before rejecting the parametric route.
- Below roughly 1 billion parameters, a full fine-tune can take hours on one card. The argument then shifts toward attribution and opt-out.
- Keep customer data, licensed corpora, and retention-controlled data out of weights by default.
- Deleting a datastore row does not remove text memorized during base-model pre-training.
- A stronger model can help high-popularity closed-book accuracy. It does not solve bottlenecks 2 through 5.
- Size update systems by arrival rate. For facts that change annually or less, a scheduled retrain may be simpler.
- A million-token context can paste in a changed policy and keep its source text visible. It also turns index work into per-query prefill and does not solve every opt-out concern.
- Cheap fine-tuning addresses factual fit but leaves attribution, deletion, and coupled serving size intact.
- The long-context argument flips only if prefilling that million-token context costs less than the ranked retrieval stage it replaces.
1.3 The five benefits, and what each one costs you
One responsibility moves five times
The generation step can be written as a conditional answer over the query and retrieved chunks.
The weights are learned and then frozen for service. The datastore is queried at inference time. Each claimed RAG benefit transfers one responsibility from the weights to that datastore. The responsibility does not disappear. It acquires a new operational failure surface.
Benefit 1: factual correctness
The fact no longer has to survive pre-training compression. Rare entities that appeared only a few times can be supplied directly from a document. The cost is placing retrieval on the critical path. A wrong passage can override a parametric answer that would have been correct. The cited PopQA comparison measures this reversal on roughly of questions. Retrieval miss and retrieval-induced harm are therefore part of the correctness budget.
Benefit 2: attribution
Retrieved chunks carry document identifiers, so generated claims can point back to supplied sources. The source names inline citation markers and GopherCite’s verified quotes as examples. Purely parametric generation offers no equivalent path from a token to one training document. The cost is that a citation marker is a provenance claim, not proof of support. A generator can cite a passage it did not use or a passage that does not entail the sentence. GopherCite samples multiple candidate answers and reranks them against quoted spans. Honest verified attribution therefore multiplies generation cost by the sample count.
Benefit 3: data opt-out
If a document exists only in , removal is a row deletion. If it has entered , removal becomes the sequence-enumeration problem of unlearning. The cited low-risk split trains weights only on permissively usable text. Copyrighted, private, and attribution-required material stays in a test-time datastore that can be amended or dropped. The cost appears in the cited perplexity tables. A model trained only on public-domain text is a weaker language model. Retrieval must repay that quality gap on every query, including queries that need no facts.
Benefit 4: adaptability
A current officeholder can change without a gradient step. The price is an index with a freshness objective, an ingestion pipeline, and a rebuild cadence. The stale parametric prior remains underneath the new passage and can contradict it.
Benefit 5: parameter efficiency
A generator that does not need to memorize the world can be smaller. The cited Min et al. result shows a retrieval-augmented model matching a much larger parametric RoBERTa on the two senses of cheap. The retrieved neighbors preserve the distinction between inexpensive and poor-quality construction that the weights had collapsed. The price is index memory and a second latency stage. Continual fine-tuning does not reproduce all five benefits.
It has no source attribution because gradients erase provenance. It has no bounded delete because targets must be enumerated. It suffers from catastrophic forgetting on updates and may require synthetic replay from the original model.
Worked example: 27 billion parameters versus 7 billion plus an index
The documentation corpus contains chunks at 768 dimensions. Serving weights use bf16 at 2 bytes per parameter. A 27-billion-parameter model occupies of accelerator memory. In FP32, it would occupy . On an H100, the BF16 model leaves about for KV cache and activations. A second independent B bf16 checkpoint would not fit alongside the first on one card, though tenants can share one model; tenant count is not itself a checkpoint count. A B generator uses of parameter payload, freeing of HBM. The raw fp32 vectors use . The HNSW example uses . With up to four-byte neighbor identifiers per node, HNSW base-layer link allocation is . Vectors plus these base-layer links total . This is not an all-in index size: upper layers, identifiers, allocation overhead, metadata and source text are omitted. The trade is also across memory media, not simply saved against spent in the same pool; the saved parameter bytes are accelerator HBM. The index budget is host DRAM on a CPU machine. The source’s order-of-magnitude price comparison with HBM is a pricing assumption, not a fixed hardware law. At , IVF-PQ codes for vectors occupy , exactly times smaller than the raw-vector payload. This excludes codebooks, identifiers, coarse centroids, inverted lists and source text. Retrieval also adds prompt work. At chunks and 400 tokens per chunk, retrieval adds prompt tokens. A forward pass is approximated as for parameters and tokens. For the 7-billion-parameter generator, prefill costs . At , that is 82 milliseconds. The vector arithmetic is checked against a shipped DPR index. Twenty-one million Wikipedia passages at 768 float32 dimensions require . The DPR release reports roughly .
Practical decisions from the benefit ledger
- Compute before choosing index compression.
- Move to IVF-PQ or scalar quantization when flat vectors exceed roughly of node memory. The raw-vector payload alone reaches a budget at of host capacity; it is of a host. Add index and application overhead before selecting a machine.
- Use chunk-level citations by default because they add one response field and no extra generation.
- Use verified-quote decoding when an unsupported sentence creates liability in regulated medical, legal, or financial output.
- Budget sample-and-rerank as a generation multiplier, not as a free citation feature.
- Keep the generator’s broad parametric knowledge unless licensing is the binding constraint.
- Use low-risk-only training when a contract or jurisdiction requires proof that specified text never entered training.
- Gate retrieval instead of calling it on every query. This avoids harmful flips and saves the 82-millisecond prefill in the example.
- Retrieve unconditionally when the corpus is private and the model has no parametric coverage, because the gate has no correct skip path.
- State ingestion lag, rebuild cadence, and mid-rebuild reader behavior.
- An append-only immutable corpus, such as statutes or published papers, can use a simpler nightly incremental build.
1.4 RAG is one instance of tool use, not the general case
The formal boundary
A RAG system first retrieves passages and then generates from them.
A tool-augmented generator generalizes that sequence by choosing a tool and arguments before producing an answer.
A simple single-retriever RAG pipeline is the special case , with as its sole tool. This is a modeling example, not a definition restricting all RAG systems to one tool: hybrid search, multiple retrievers and agents can still perform retrieval-augmented generation. The retrieval argument is the query or a reformulation; its evidence return contains passages and source identifiers. The relevant boundary here is that evidence contract, not the number of tools or the index technology. BM25 over web pages can satisfy the RAG contract. A search endpoint that returns only a synthesized answer string does not preserve it.
What general tool use adds
Tool selection turns a fixed retrieval pipeline into a policy. When , a classifier, router, or learned policy must choose . The source names Toolformer as a self-supervised tool-selection approach. It names ReAct as an approach that interleaves reasoning and actions in the trace. It also notes that retrieval research can cast answer-versus-search as a reinforcement-learning policy. Argument synthesis produces a query or payload before the call runs. A weak retrieval query usually degrades into poor ranking. A malformed SQL or JSON argument can fail to parse. A syntactically valid argument with the wrong date range can return a plausible but wrong number. Effects remove cheap retries. Calling read-only retrieval twice adds latency but no second state change. Calling a ticket-creation tool twice can create a duplicate action.
Why retrieval has a distinct contract
The generator already knows how to read text in context, so passages require no new model capability. An answer span can be traced to a retrieved chunk and then to a source document. A human can audit the answer against those passages without trusting the model’s hidden computation. A calculator that returns 42 has a different contract. Its warrant is the calculator’s correctness, not a cited document. RAG returns evidence that can be cited. Other tools often return values that must be trusted. The evidence-returning, state-mutating quadrant is nearly empty. A retrieval call that logs a query or decrements a quota remains citable but is no longer free to retry. That distinction matters when a low-confidence loop re-queries.
Why indexing everything fails
A relevance index returns a few passages; an aggregate or exhaustive list can depend on every matching record. If the answer needs distinct records and retrieval returns records, evidence coverage is bounded above by , and by when . Equality requires every returned record to be relevant and distinct. A strong relevance ranker does not thereby certify completeness. The source calls such corpus-wide demands global or sensemaking queries.
Worked example: route 1,000 production queries
The traffic mix has lookups, aggregates, actions and closed-book queries. In this scenario, assume a retrieval-only product succeeds on every lookup and closed-book query, fails on these aggregates, and has no action execution path. Its resulting upper bound is . This is a conditional workload ceiling, not a universal ceiling for RAG; a product with complete aggregation or action tools changes the assumptions. The aggregate example has Europe, Middle East, and Africa invoices, one per chunk. Even with all twenty returned invoices relevant and distinct, coverage is at most . A sum over of the addends is wrong unless the omitted invoices cancel to zero. A routed design keeps the 620 lookups on retrieval. It sends the 180 aggregates to a text-to-SQL tool that scans all rows. That moves the failure surface from incomplete recall to query synthesis, which can be unit-tested against the database. It sends the 120 actions to a write API behind confirmation. Raising to cover every invoice would add tokens. That does not fit a 128,000-token context window. At an assumed per million input tokens, the prefill would cost per query. The SQL aggregate returns one row of about 20 tokens. The retrieval route uses times as many input tokens for the same answer. Production analytics systems scan an index or columnar store for a complete sum rather than ranking rows by relevance.
Practical routing decisions
- If an answer depends on a few passages, retrieve.
- If it depends on every matching record, use a query or compute tool.
- If it changes the world, use an action tool behind confirmation.
- When , retrieval can still be complete. Listing three support tiers at does not require SQL.
- Keep read-only tools inside retry loops and mutating tools outside them.
- A mutating call can enter the loop only when it is idempotent by key.
- Return passages plus source identifiers, not a pre-digested answer string.
- If latency requires server-side summarization, return both the summary and source identifiers.
- Add a router when more than one answer shape materially appears in traffic.
- Below roughly non-lookup volume, one retrieval path plus abstention can beat the cost of a router.
- Above that range, the ceiling in the worked traffic mix becomes material.
- An encoder-scale classifier is sufficient for triage in the source’s recommendation.
- Before adding RAG to an agent, ask whether an existing search tool already returns passages with source locations.
- If no SQL surface exists, use a metadata-filtered count only when the schema makes it complete. Otherwise abstain.
- A unified agent loop can keep citations only if its retrieval tool still returns passages with source identifiers. Measure citation coverage before and after the migration because the learned policy can skip retrieval.
1.5 When not to retrieve: the popularity curve and retrieval-induced harm
The measured failure
Retrieval is not a strict improvement. The cited PopQA study reports that retrieval flips a correct closed-book answer to a wrong answer on roughly of questions. The unassisted model wins outright on the high-popularity slice. Always retrieving can therefore improve the aggregate while regressing the most common queries. The failure is not necessarily fixed by a better reranker. It follows from the relationship between what the model already knows and what retrieval can spoil.
The popularity model
Let be subject popularity measured by monthly Wikipedia page views. Pre-training text follows a power-law distribution over entities. Popular subjects receive more supporting documents. Their facts are therefore more likely to survive in the weights. Let be closed-book accuracy. Let be retrieval-augmented accuracy. Define as the probability that the final RAG answer is correct conditional on the closed-book answer being wrong, and as the probability that the final RAG answer is wrong conditional on the closed-book answer being correct. Merely retrieving an answer-bearing passage is not the same as successful rescue. The following identity uses conditional rates for that slice; treating as constant across popularity is an additional scenario assumption. It does not imply that both accuracy curves must increase: with fixed rates, .
Retrieval helps when the rescue term exceeds the harm term. The odds form below assumes and . The threshold form assumes . If , both policies tie everywhere; if , retrieval cannot hurt in this model.
The equivalent accuracy threshold is below.
If and are constant across popularity and is strictly increasing, the curves have at most one crossover; an actual crossing also requires the observed accuracy range to straddle . Flat segments can produce ties, and popularity-dependent or can create multiple crossings. The crossover is , where . Retrieval helps below and harms above it. The threshold is a property of the retriever and reader through , not a property of one question. A small harm rate can dominate in the popular head. There, is near zero and suppresses rescue, while is near one and preserves harm.
What creates the harm rate
On the slice where retrieval flips a correct answer, recall at 1 is significantly lower than overall recall. The first-ranked document is often topically related but does not contain the answer. A grounding prompt tells the reader to trust that supplied passage. The strongest distractor in the corpus can then override correct parametric knowledge. The harm rate is approximately rank-1 imprecision filtered through how strongly the prompt orders context use. Always-retrieve wins on average when . It still pays the loss on the popular head, which can carry most traffic and executive scrutiny. Never-retrieve fails on the rare tail. The source again cites the parameter extrapolation as the infeasible scale-only alternative. Popularity is not difficulty. For and , the threshold satisfies . A harmful region is possible near perfect closed-book accuracy, but it need not occur in a finite workload whose observed stays below the threshold. Changing the generator, retriever or prompt can change together; the direction of a real crossover shift must be measured rather than inferred from only one changed quantity. A popular subject can still require fresh, ambiguous, or multi-step evidence. An obscure question can become easy once its one good page is present. The gate must estimate where the answer already lives, not whether the wording looks easy.
Worked example: 100,000 daily queries
The head has at least monthly page views and carries of queries. The torso spans to views and carries . The tail is below views and carries . Closed-book accuracies are for head, for torso, and for tail. The assumed rescue rate is . Traffic-weighted closed-book accuracy is . For this constructed example, assume a joint harmful-flip probability of across all queries and transfer a constant conditional harm rate across buckets. Then , so and . This is a calibration assumption, not a measured bucket-level rate. If a reported flip rate is conditional on an initially correct answer, it means instead and does not justify this division. Under the stated joint-rate scenario, the head lies above the threshold. The torso and tail lie below the threshold. Keeping full precision in , retrieved accuracies are approximately for head, for torso and for tail. Closed-book accuracy is and always-retrieve accuracy is . That is a -percentage-point aggregate gain while the head loses approximately percentage points. Selective retrieval keeps the head closed-book and retrieves for torso and tail. Its accuracy is approximately , beating always-retrieve by approximately percentage points. The recovered probability mass is . The formerly stated equality was not exact and rounded intermediate values too early. Each retrieved query adds five chunks of 400 tokens, or prompt tokens. Always-retrieve prefills 200 million extra tokens per day. Selective retrieval runs for queries and prefills 90 million extra tokens per day. That is a cut in prompt tokens, ANN searches, and reranker calls. The accuracy gain and cost cut point in the same direction because the removed work was harmful. The reported DPR top- retrieval accuracy near on Natural Questions is not a validation or bound for the assumed . That benchmark measures a different target population and event; is end-to-end rescue conditional on a closed-book error in this workload. Measure conditional rescue and harmful-flip rates on matched queries before using the gate in production.
Practical gating decisions
- Slice evaluation into at least three popularity buckets before reporting an aggregate.
- For queries without linkable entities, use query frequency or head-phrase frequency in product logs as the proxy.
- Start with always-retrieve until the crossover is measured, then gate above it.
- If cost is the binding constraint, tune the gate to a spend target and report the accepted accuracy loss.
- Estimate and from matched closed-book/RAG outcomes on held-out queries; rank- precision and prompt trust are diagnostic covariates, not substitutes for those conditional rates.
- A stricter context-only prompt can change both and ; measure their net effect on instead of assuming a fixed direction.
- Re-measure the crossover after a generator or retriever change.
- If a generator changes only upward while remain fixed, the harmful region can expand; actual generator changes can also alter .
- Holding other terms fixed, increasing or decreasing raises and can shrink the harmful region; confirm that an improved retriever changes those outcome rates in the expected way.
- For a minor version change, the source recommends re-measuring on a 2,000-query sample.
- Alert on head-bucket accuracy separately because an aggregate cannot expose a majority-traffic regression.
- Keep the gate and re-measure quarterly. Retire it only when the harm region falls below an agreed traffic share.
- Without relevance labels, run both branches offline on a few thousand sampled queries. Score against resolved tickets, human feedback, or a model judge calibrated on held-out human judgments, then locate the bucket where closed-book stops losing.
Diagrams
The manifest records five figures and zero source tables. All five figures appear below. Figure is a numbered figure rendered as a Markdown matrix, not a source table.
Figure 1.1
Diagram description and source
flowchart TD
Q[query x]
D[D: non-parametric datastore. Capacity grows with stored rows. Write one embedded chunk and row. Reversible in seconds.]
W[[θ: parametric weights. Capacity fixed before training. Write with a gradient pass over every parameter. Entangled and measured in GPU-hours.]]
R[RET returns c_1 through c_k]
G[GEN reads x and c_1 through c_k]
Y[answer y]
Q -->|retrieve| D
Q -->|condition| W
D --> R
R --> G
W --> G
G --> Y
style D stroke-dasharray: 5 5
Figure : RAG is semi-parametric because it holds knowledge in two stores whose write costs differ by orders of magnitude: a row in D can be inserted, corrected, or deleted in seconds, while the same edit to costs a gradient pass and cannot be undone.
Figure 1.2
Diagram description and source
flowchart LR
W[Knowledge lives in N weights. Diffuse. No address. Undated. Inseparable. Priced with fluency.]
B1[1. Factual error. Frequency-weighted and lossy. Failed fix: scale toward 10^18 parameters.]
B2[2. No verification. Tokens have no source return address. Failed fix: generated citations can be false.]
B3[3. Update cost. One changed fact moves weights at 16N bytes. Failed fix: continual training causes forgetting.]
B4[4. No opt-out. A tensor has no document delete. Failed fix: unlearning needs enumerated targets.]
B5[5. Model size. C ≈ 6ND. Facts and fluency are priced together. Failed fix: the coupling is architectural.]
W --> B1
W --> B2
W --> B3
W --> B4
W --> B5
Figure : The five bottlenecks are five consequences of a single storage decision, which is why scaling the model relieves at most one of them and worsens two.
Figure 1.3
Diagram description and source
flowchart LR
W[weights θ]
D[datastore D]
B1[Correctness: facts come from documents. Cost: every retrieval miss.]
B2[Attribution: answers carry pointers. Cost: a pointer is a claim, not proof.]
B3[Opt-out: documents can be deleted. Cost: weights must exclude them.]
B4[Adaptability: new facts need no retraining. Cost: index freshness becomes an objective.]
B5[Parameter efficiency: the generator can be smaller. Cost: index bytes and another latency stage.]
W --> B1 --> D
W --> B2 --> D
W --> B3 --> D
W --> B4 --> D
W --> B5 --> D
style D stroke-dasharray: 5 5
Figure : Each RAG benefit is one responsibility moved from the weights to the datastore, and each move hands you a new failure surface on the receiving side.
Figure 1.4
| Tool effect and retry contract | Returns evidence: passages with source identifiers | Returns a value: computed result with no source passage |
|---|---|---|
| Side-effect free and retryable | RAG. Retrieval over datastore , enterprise search, or web search. Citable and retryable. | Calculator, Python sandbox, SQL over a warehouse, or read-only API. Trusted and not citable. |
| Mutates state and is not retryable | Nearly empty. A few calls both change the world and return evidence. | Create ticket, send email, place order, or write to CRM. Neither citable nor retryable. |
Figure : RAG occupies the one quadrant of the tool space where the call is safe to retry and its result is citable. Every other tool class surrenders one property or both, which is why attribution and recall-style evaluation transfer to retrieval and to nothing else.
Figure 1.5
accuracy
1.0 | p(s) closed-book
| ____/
| _______/#### retrieval-induced harm
| r(s) retrieval .......x........
0.5 | ................../ | p > p⋆
| ____/ |
| retrieval _/ |
| wins here | s⋆
0.0 +------------------------------------------------ popularity s
10^1 10^2 10^3 10^4 10^5 10^6
production traffic by popularity bucket
tail 15% | torso 30% | head 55%
Figure : This is a schematic of a possible crossover, not a measured curve or a universal monotonic law. With fixed and strictly increasing , there is at most one crossing, and only if straddles . In the constructed traffic mix, the harmful head is of traffic; its size and location must be measured for the actual product.
Whiteboard pack
What to draw
- Draw a left box labeled
D: addressable datastoreand a right box labeledθ: entangled weights. - Put
query xabove both boxes. - Draw the retrieval arrow from to and label its output .
- Draw the conditioning arrow from to the weights.
- Join retrieved chunks and weights at a generator box, then draw
answer ybelow it. - Write the five weight bottlenecks beside the weights: error, no source, update, no delete, coupled size.
- Write the five datastore transfers beside : correctness, attribution, opt-out, adaptability, efficiency.
- Add a gate above retrieval and label it
retrieve only when expected rescue exceeds expected harm. - Close with the routing rule: few passages use retrieval, complete sets use query tools, and state changes use confirmed action tools.
Spoken script
The design has two knowledge stores. The weights hold behavior and compressed prior knowledge, while the datastore holds addressable facts. A query can go straight to the generator or retrieve passages first. This split fixes five weight bottlenecks: long-tail error, missing provenance, expensive updates, no bounded deletion, and facts priced with fluency. Each fix creates a datastore cost, including misses, stale indexes, index memory, and extra prefill. I gate retrieval because a distracting passage can override a correct answer. I also route aggregates to complete query tools and state changes to confirmed action tools.
Interview traps
1. Why not fine-tune on every company document?
Fine-tuning can improve fixed-corpus factual fit, but it does not create source addresses or bounded deletion. Price the proposal with memory and training work, then keep changing, attributable, or deletable facts in the datastore.
2. Can a larger datastore justify a much smaller generator?
Not automatically. A larger store increases near-duplicates, contradictions, and reading load, so compare grounded accuracy and conflict resolution at fixed before shrinking the generator.
3. Why can recall at 20 be high while totals are wrong?
Recall asks whether relevant passages appear, but an aggregate needs all matching records. At and , coverage is capped at , so use SQL or another complete compute tool.
4. When should retrieval not be used?
Do not use retrieval for complete aggregates, mutating actions, or popular-subject questions above the measured crossover where harm exceeds rescue. Also skip it when the model already answers reliably and the added passage is more likely to distract than help.
5. Does a citation prove that an answer is supported?
No. Citation coverage only proves that a marker exists, so measure sentence-to-span support with an entailment check and budget verified sample-and-rerank by its generation multiplier.
Key numbers
| Topic | Every committed number or threshold from the source unit |
|---|---|
| Opening design brief | internal policy documents. One version begins three minutes into a round. Other prompts begin about twenty minutes into a round. |
| Chapter ledger | Five weight bottlenecks and five responsibility transfers define the central comparison. |
| Dense-retriever qualifier | A non-parametric datastore can still use an encoder with tens or hundreds of millions of trained weights. |
| Compression corpus | More than 15 trillion tokens and 8 billion parameters. |
| Compression density | tokens per parameter at the rounded reference corpus size; and give input/checkpoint bytes. This is not per-parameter source allocation. |
| Rare-fact illustration | Three appearances illustrate rarity; no retention probability follows from that count alone. |
| Weight write | A 27-billion-parameter model in FP32 occupies before optimizer state. |
| Corpus-routing example | documents, tokens each, 80 million tokens total, quarterly change, and an 8-billion-parameter generator. |
| Training identity | , split as 2 forward-pass parts and 4 backward-pass parts. |
| Parametric corpus cost | per epoch, 10 epochs, and total. |
| H100 assumption | Roughly trillion bf16 FLOPs per second peak, utilization, and sustained. |
| Parametric elapsed time | , about GPU-hours, repeated each quarter over the full corpus. |
| Datastore corpus cost | -token non-crossing chunks, per modeled document, vectors. The embedding proxy gives , not , at the stated throughput. |
| First index memory | of vector payload only. |
| Quarterly index refresh | source tokens and approximately of embedding arithmetic, excluding index work. |
| Corpus route ratio | Initial training/full embedding: approximately . Full replay/changed-only embedding refresh: approximately . Do not mix denominators. |
| Generator-sizing challenge | The store grows from 2 million to 200 million chunks while the proposed generator shrinks from 70 billion to 8 billion parameters. |
| Licensed-corpus challenge | Withdrawal is required within 30 days and the disputed benchmark loss is four points. |
| Compliance brief | Deletion within 30 days, a 27-billion-parameter model, and eight accelerators. |
| Correlated-corpus limit | Five times the web tokens is stated to be nowhere near five times the distinct facts. |
| Scale-only extrapolation | About parameters, , and 25 million accelerators. It is an extrapolation, not a measurement. |
| Extrapolation distance | , or about orders relative to the named B baseline; the extrapolation is not a measurement. |
| Adam memory | weights, gradients, moments, and total bytes before activations. At 27 billion parameters, this is versus for forward-pass weights. |
| Exact Adam bytes | The 27-billion-parameter state is . A model ten times larger remains unauditable and undeletable while costing more to update. |
| Memorization findings | Three regularities are named: larger models, more repetition, and more attacker-supplied context each raise memorization or extractability. |
| Continual update hardware | Eight GPUs; total training-state payload needs at least six cards in aggregate, or per card under ideal eight-way sharding, before overhead. |
| Replay update cost | , ideal wall time hours, and approximately GPU-hours. |
| Replay update price | Approximately at per GPU-hour before evaluation and other overhead. |
| Model-edit arrival rate | 50 atomic statements per document, 2 million facts, annual churn, edits per year, and 164 per day. |
| Retrieval update | A separate -token document scenario: twenty -token chunks, , approximately of embedding arithmetic plus upsert. |
| Update route ratio | Approximately for eight-GPU replay wall time divided by one-GPU embedding-only time; not measured end-to-end latency. |
| Compute sanity check | GPT-3 at 175 billion parameters and 300 billion tokens gives by the rule versus reported. |
| Small-model exception | Below roughly 1 billion parameters, a full fine-tune can be hours on one card. |
| Live pricing speed | The source says the and estimates can be stated in about twenty seconds. |
| Long-context challenge | The interview counterexample uses a 1-million-token context. |
| Retrieval harm baseline | Roughly of questions flip from correct to wrong after retrieval. |
| Fine-tuning benefit limit | Continual fine-tuning promises all five responsibility transfers but delivers at most two. |
| Citation diagnosis | One interview prompt has citation coverage but unsupported sentences. |
| Deletion and eval conflict | One prompt requires deletion within 24 hours while fine-tuning offers a three-point evaluation lift. |
| Parameter-efficiency corpus | 10 million chunks at 768 dimensions and 2 bytes per bf16 parameter. |
| Large generator memory | 27 billion parameters occupy in bf16 or in FP32. On an H100, about remains. |
| Smaller generator memory | 7 billion parameters occupy and free of HBM. |
| HNSW index | vector payload plus base-layer links for , totaling a scoped ; other overhead is excluded. |
| Exact HNSW vector bytes | . |
| Memory-medium price | The source describes host DRAM as roughly one order of magnitude cheaper per byte than accelerator HBM. |
| Compressed index | yields of PQ codes, times smaller than raw vectors; complete index overhead is not included. |
| Retrieval prefill | Five chunks at 400 tokens each add tokens. The 7-billion-parameter prefill costs and about 82 milliseconds. |
| Forward and backward shares | A forward pass is one third of training work. The backward pass supplies the other two thirds. |
| Published index check | 21 million passages at 768 float32 dimensions require versus roughly reported. |
| Exact published-index bytes | The DPR flat vectors occupy . |
| Compression trigger | A raw-vector budget implies host capacity. On , is , before overhead. |
| Chunk-citation overhead | Chunk-level citation adds one response field and no extra generation in the source recommendation. |
| Tool-set special case | is the simple single-retriever abstraction, not a requirement for every RAG system. |
| General-tool freedoms | General tool use adds three degrees of freedom: tool selection, argument synthesis, and effects. |
| Evidence-return consequences | Passage returns yield three consequences: no new consumption capability, source tracing, and human auditability. |
| Tool quadrant | RAG occupies one of four retryability-by-return-type quadrants. The evidence-returning mutating quadrant is nearly empty, not entirely empty. |
| Calculator illustration | A calculator returns 42 without a source passage. |
| Tool traffic mix | One production week contains queries: 620 lookups, 180 aggregates, 120 actions, and 80 closed-book questions. |
| RAG-only ceiling | only under the stated perfect lookup/closed-book success and aggregate/action failure assumptions. |
| Aggregate coverage | At most ; equality requires all returned records to be relevant and distinct. |
| Long-context aggregate | records at 50 tokens each require tokens, beyond a 128,000-token window. |
| Aggregate token price | At per million input tokens, tokens cost . A 20-token SQL result is times smaller in input length. |
| Small complete set | Three support tiers are complete at . |
| Router threshold | Below roughly non-lookup traffic, one retrieval path plus abstention can beat a router. |
| Retrieval metric trap | The interview example gives recall at 20 of while totals remain incomplete. |
| Product-regression lag | The always-retrieve regression example surfaces six weeks after launch. |
| Popularity traffic | queries per day. Head is at least views and of traffic. Torso is to and . Tail is below and . |
| Closed-book bucket accuracy | Head , torso , tail , and weighted total 0.690. |
| Rescue and harm | assumed; joint flip probability assumed; and . Conditional and joint flip rates are not interchangeable. |
| Crossover count and limit | At most one crossover only with fixed , strictly increasing and a range straddling . With and , . |
| Figure axes | Accuracy marks are 0, , and 1.0. Popularity runs from through monthly page views on a log scale. |
| Rescue-harm weighting | In the popular head, a harm rate of a few percent can outweigh a rescue rate of about because rescue is multiplied by and harm by . |
| Retrieved bucket accuracy | Head , torso , tail , rounded only after using the full-precision harm rate. |
| Retrieved bucket arithmetic | for each bucket . |
| Policy comparison | Closed-book , always-retrieve , selective . |
| Policy arithmetic | ; . |
| Hidden regression | Always-retrieve gains percentage points overall but loses approximately points on the head. |
| Gate gain | Approximately percentage points; recovered probability mass is . |
| Daily gate cost | Five 400-token chunks add tokens. Always-retrieve adds 200 million tokens daily. Selective retrieval handles queries and adds 90 million, a cut. |
| Retrieval sanity check | DPR recall near on a different task/population does not validate the conditional rescue assumption . |
| Evaluation commitments | Use three popularity buckets, recheck minor model changes on queries, and re-measure the gate each quarter. |
00-START-HERE · 01-READING-ROUTES · 00_09_about_the_author · 02_the_competing_answers_to_the_same_problem