00-START-HERE · 01-READING-ROUTES · 26_iterative_recursive_and_agentic_retrieval · 28_training_the_retriever Purpose: Decide when Retrieval-Augmented Generation (RAG) errors belong to the generator, choose a training objective that matches the retrieval defects seen in production, and size the resulting fine-tuning job without confusing behavior, knowledge, robustness, invariance, or memory efficiency.
TL;DR
- SFT can change behavior and knowledge in shared weights; retrieval changes query-time evidence without updating the generator. Diagnose both with production hit/miss accuracy, an oracle-context intervention, closed-book performance and a clearly defined retrieval metric.
- RAFT-style missing-gold examples keep the answer target while changing evidence. They train toward correct answers under insufficient context, not abstention, and can encourage factual learning or memorization. Generalization and safe override are not guaranteed.
- Retrieval defects differ: related but answerless text, off-topic text and plausible false claims require different tests. Relevance alone cannot certify truth or current applicability.
- RbFT-style defect labels and utility extraction provide additional per-document supervision; answer-only loss can still learn document selection, but supplies less explicit supervision for it.
- Split-context fixed-target training has an exact Jensen-gap decomposition for the target probability. It does not guarantee invariance of the whole output distribution, and duplicating questions and targets changes compute. Insufficient evidence creates a generalization and identifiability problem, not an inability to fit training labels.
- LoRA freezes the base and trains a factored update; QLoRA additionally compresses frozen weights. Count optimizer state, activations, quantization metadata and peak workspaces before claiming a device fit.
- Choose the intervention from measured production slices, held-out generalization, source/tenant/time policy and resource costs. None of the toy thresholds is a universal release rule.
The story
Imagine a clinical assistant as a hospital with a library and a physician. Retrieval updates the shelves; fine-tuning changes the physician’s habits and possibly memory. Put verified evidence in the prompt to test whether failures persist, but do not assume every remaining error is only a behavioral deficit: labels, reasoning, context format and ambiguity matter too. RAFT sometimes removes the correct chart while retaining the answer target. That trains for answering without supplied support, not abstention, and may encourage learning or memorizing the labeled fact. RbFT adds chart-specific defect labels and extraction targets; a plausible false chart still needs a trusted truth signal, not just topical relevance. Split-context training asks for one answer under several chart views. It penalizes variation in that target’s probability, but cannot guarantee that the whole response is context-insensitive or correct. Finally, full Adam tuning stores state for every trainable weight. LoRA freezes the base and learns a small update; QLoRA compresses frozen storage further. Choose the clinical source-of-truth and abstention policy first, train the observed behavior next, and measure actual peak memory before scheduling the job.
Decoder table
| Source term or symbol | Plain-language decoder | Why it matters and what fails if misread |
|---|---|---|
| Supervised fine-tuning (SFT) | Maximum-likelihood training on labeled inputs and outputs | Can change both behavior and factual knowledge; held-out generalization and provenance still matter |
| Dataset and pair | Labeled training set, supervised input and target | A target absent from context can still be fitted through learning or memorization; arbitrary unseen facts require information |
| Parameters , token index , and target length | Shared weights, one output position, and the number of target tokens | They locate the trainable object and summed token losses. Confusing weights with context erases the chapter’s main boundary |
| Retrieval-Augmented Generation (RAG) | Query-time conditioning on retrieved chunks | It supplies current, attributable knowledge. Treating retrieval failure as generator failure funds the wrong loop |
| Query , chunks , and retrieval depth | Question, retrieved contexts and depth | Complete sufficient evidence may span several chunks; missing one source does not cap all possible generator knowledge |
| Parametric update | A gradient update to shared model weights | Can learn behavior or facts while changing other inputs; it is not a document-keyed update |
| Non-parametric update | A keyed content/index update without generator gradients | Serving needs propagation and read-path checks; current evidence still requires correct reader behavior |
| End-to-end accuracy | End-to-end correctness across production contexts | The exact mixture uses conditional hit/miss rates and a specified sufficient-evidence event |
| Oracle-context accuracy | Accuracy after supplying a verified gold context | An intervention, not automatically production hit accuracy or a pure behavior score |
| Distractors-only accuracy | Accuracy under a deliberately insufficient distractor context | A probe; production miss transfer and cohort comparability must be tested |
| Recall or | Retrieval-success probability under a named evidence event | Single-gold presence, marginal document recall and complete multi-hop evidence coverage differ |
| Behavior deficit | Residual error on the oracle-context intervention | Can reflect reasoning, labels, context format or other limitations; not a ceiling that retrieval can never change |
| Knowledge deficit | Delivery failure under the specified evidence definition | Not proof that the answer is absent from weights or all other sources |
| Closed-book accuracy | Accuracy without retrieved evidence | Compare paired cohorts for distraction; a net accuracy gap is not a correct-to-wrong flip probability |
| Conditional accuracies and | Production correctness conditional on sufficient versus insufficient evidence | Missing-context ability remains defined even if the training dataset does not explicitly supervise it |
| Parameter count and training tokens | Model size and token volume in the training estimate | They price the parametric loop. Ignoring either understates training compute |
| Retrieval Augmented Fine-Tuning (RAFT) | Domain SFT that mixes golden-document and missing-gold contexts | It rehearses production retrieval failures. It does not by itself teach abstention |
| Gold answer and golden document | The fixed target and the context that supports it | RAFT keeps the answer fixed while changing evidence. Changing both would remove the intended contrast |
| Retention fraction | Fraction of training items retaining the designated gold document | Equals sufficient-context frequency only with construction checks; always-gold data lacks explicit miss supervision |
| Missing-gold branch | Remove gold but retain the answer target | May train prior reliance, factual learning or memorization; not abstention or guaranteed safe override |
| Retriever top- distractors | Retriever-derived distractors intended to resemble serving near misses | Validate support, truth and distribution; exact matching is not guaranteed by sampling from the retriever |
| Reasoning chain with quoted spans | Targets containing reasoning and quoted evidence | Useful supervision, not a grounding certificate; a quote from removed evidence is unsupported by the supplied context |
| Noisy document | On-topic and high-scoring, but without an answer span | It can tempt the model into an adjacent claim. Calling it irrelevant hides its observed harm |
| Irrelevant document | Off-topic text for the question | Its effect is empirical; off-topic content is not universally harmless or least harmful |
| Counterfactual document | An answer-shaped, relevant false or inapplicable claim | Relevance does not certify truth; confident error requires an additional confidence criterion |
| Tests , , and | Topicality, answer-shaped content and grounded truth/current applicability | Similarity scores do not certify the first two; contingent truth generally needs a reliable world/date signal |
| Corruption rate and count | Per-vote corruption probability and corrupt-vote count | The binomial calculation assumes independent votes; it is not an automatic reader answer-error guarantee |
| Corroboration | Agreement among sources | Can help under independence; common sources and coordinated errors defeat a simple majority model |
| Robust fine-tuning against retrieval defects (RbFT) | Answer training with document defect labels and utility extraction | Provides explicit per-document supervision; answer-only loss can still learn selection implicitly |
| Defect detection | Predict per-document audit labels | Additional supervision, not an assertion that a global answer loss can never learn which document is wrong |
| Utility extraction | Recover the usable fragment from a partial document | Thin long-tail topics may lack one complete source. A binary filter discards partial evidence |
| Answer invariance | Train a shared answer target under different context views | Targets should remain valid; equal target probability does not imply equal entire output distributions |
| RA-DIT | Source-named retrieval-augmented dual instruction-tuning approach | The uniform per-context fixed-target variant here is explicitly defined; do not assume every implementation is identical |
| Per-context probability and mean | Target-sequence probability under each view and its arithmetic mean | The Jensen gap is target-specific; mean target probability is not classification accuracy |
| Jensen gap | Nonnegative difference between log arithmetic mean and mean log probability | Zero exactly when positive target probabilities agree; no full-distribution or correctness guarantee |
| and | Population spread of target probabilities and spread divided by their mean | The one-half-CV-squared relation is a small-relative-deviation approximation |
| Closed-book accuracy | Held-out question-only correctness before adaptation | A diagnostic, not a hard upper bound on post-training knowledge or an impossible-minimum test |
| Concatenate layout | One question and all retrieved chunks in one window | Other chunks need not be gradient-inert even when one chunk supports the target |
| Split layout | Repeat question and target for each isolated passage | Changes token volume, evidence mix and attention cost; not automatically a factor-of-depth speedup |
| Supporting fraction | Supporting-instance fraction under one sufficient passage on every successful query | The formula requires individually sufficient support and no alternative support on misses |
| Reweighting and retained count | Loss weight on support and average number of retained non-support examples | Restores a chosen global weighted/sampled mix, not evidence or the same mix for every query |
| REPLUG and REALM | Frozen-generator retrieval/ensembling versus retrieval-aware pretraining | REPLUG needs appropriate probability access; neither alternative establishes robustness by itself |
| Parameter-efficient fine-tuning (PEFT) | Adaptation that freezes most base parameters | It changes the optimizer-state budget. Counting only weights misses full-tuning memory |
| Adam moments and | First and second raw-gradient moment estimates | The second raw moment is not the centered variance; declared dtypes set optimizer-state bytes |
| Base matrix and update | Frozen base matrix and learned correction | The update is low rank; the base need not be low rank or full rank |
| Factors , , dimensions , , and rank | Two thin matrices whose product forms the correction | Their count is rather than . Here and are matrix width and adapter rank, not retrieval depth and recall |
| Scale , input , and output | Forward residual multiplier, layer input and output | Constant scale does not isolate all rank-dependent initialization or optimizer dynamics |
| Low-Rank Adaptation (LoRA) | Learn a low-rank correction while freezing the base | It removes base gradients and Adam state. Counting only base weights misses full-tuning cost |
| Quantized Low-Rank Adaptation (QLoRA) | LoRA with eligible frozen weights stored as four-bit codes | Storage compression can change throughput; nominal dense FLOPs and measured latency are different |
| 4-bit NormalFloat (NF4) | Four-bit code format with ideal half-byte payload per eligible weight | Scales, unquantized tensors and workspaces are extra; compute uses a higher-precision representation |
| Double quantization | Quantization of scaling metadata | Reported approximate savings depend on block format and configuration, not adapter compression |
| Paged optimizer | Migrate some optimizer allocations between device and host | Changes placement and latency; does not guarantee fit or erase state |
| Adapter coverage | Selected matrices receiving trainable factors | Tune coverage and rank against held-out quality and resources; parameter count alone does not prove superiority |
| Folded adapter | Add a scaled low-rank residual into dense weights | Can remove residual-branch operations; quantized requantization can change numerics and tenant bases lose sharing |
| bfloat16, 16-bit floating point (FP16), and 32-bit floating point (FP32) | Two 16-bit formats and one 32-bit format | Precision choices set byte counts. Mixing their budgets produces false capacity claims |
| Graphics processing unit (GPU), floating-point operations (FLOPs), and high-bandwidth memory (HBM) | Accelerator, operation count, and memory bandwidth | They separate compute from memory traffic. Confusing them misprices training and decoding |
| Best Matching 25 (BM25) and Dense Passage Retrieval (DPR) | Lexical and dense retrieval methods named in the source | Benchmarks, depths and thresholds do not transfer automatically between tasks |
| Large language model integer inference (LLM.int8()) | Mixed-precision integer serving with outlier handling | Reported model-size behavior is not a universal sharp threshold or the same as NF4 storage |
| Index vector quantization | Compression of stored retrieval representations | Distinct from generator precision, though both can affect their respective quality/resource trade-offs |
Core mechanics
Mathematical conventions
Use natural logarithms and decimal byte units unless explicitly binary: , and . Preserve precision until final rounding. Accuracy is a fraction; an absolute change of is one percentage point. For the arithmetic examples, and , with sustained arithmetic rate . These dense-model proxies omit attention-length effects, utilization differences between models, launch overhead, communication, evaluation and release work. A job-to-incremental-update FLOP ratio is not a measured per-fact latency ratio. The full-training memory rule assumes bf16/fp16 weights and gradients plus fp32 first and second Adam moments. It is per trainable parameter without an fp32 master copy and with one. Optimizer implementations vary. LoRA ledgers include one frozen base plus adapter state; NF4 code payload excludes scales, unquantized tensors and workspace. The checkpointed block-input activation count is one component, not a complete peak-memory bound. A sum of listed components is an accounting scenario, not necessarily a simultaneous live allocation or a bound on peak memory. Compare with the runtime-reported capacity in bytes; and are different budgets. A subtotal below capacity does not prove that training fits. Symbols are local: denotes retrieval-success probability in RAFT but rank in LoRA; denotes retrieval depth but matrix input width in the factorization. A golden passage, a complete sufficient evidence set, marginal Recall@k and conditional answer correctness are not interchangeable. Oracle interventions and production retrieval slices must be distinguished.
27.1 SFT teaches behavior, RAG supplies knowledge
What
The source’s motivating project compares reranking with fine-tuning a -billion-parameter generator on question-answer pairs from the same PDFs. Each is assigned about one quarter of the GPU budget, with a two-quarter consequence for the wrong decision after two months of development. Those are planning anecdotes, not costs derived from the equations. Split training and evaluation by appropriate document, time or question families so source reuse does not hide leakage. SFT minimizes negative log-likelihood over labeled input-output pairs.
Here the supervised input is and loss is applied to target positions in , not automatically to every prompt token. The trainable object may be all parameters or an adapter subset. A fixed-generator retrieval update changes the conditioning information while leaving unchanged:
Formatting, tone, refusal and citation conventions can be shared behaviors, while dated facts often belong in a keyed index. This is a design heuristic, not a mathematical partition: facts can occur many times, SFT can learn factual knowledge, and behavior can be input-specific. The source’s rank-eight or rank-sixteen LoRA suggestion is an empirical starting point, not a sufficient-capacity theorem. A proprietary identifier or DSL can require both a shared output syntax and specific factual mappings; validate vocabulary, tokenizer and mapping correctness separately.
Why
Let mean that production context contains all evidence required by the evaluation’s definition of success. Define , and . The exact mixture is a law of total probability. Oracle-context accuracy is a separate intervention; it is a proxy for only if query cohorts, context format, distractors and reader behavior transfer.
Holding the other conditional rates fixed, the partial derivatives are
An intervention that changes retrieval usually changes which queries are hits and the context they receive, so it can also change both conditional accuracies. If they are differentiable functions of , the total derivative adds . Oracle failures show residual errors despite supplied evidence, not a pure or irreparable “behavior deficit.” A miss rate is a delivery deficit under the chosen evidence labels, not proof the answer is absent from model knowledge. Multi-document evidence coverage also need not equal marginal document Recall@k.
Failure without it
Training on a changing corpus can create freshness, interference and provenance problems. The chapter reports Gekhman et al. (2024) on hallucination during factual learning and Ovadia et al. (2024) on retrieval versus unsupervised fine-tuning for knowledge injection; these are experiment-specific findings, not replicated here. Oracle-context failures may improve through prompting, context selection, reasoning or generator training. A generator cannot directly read an unfetched document, but may answer from other sufficient evidence or prior knowledge; neither component has a universal monopoly on repair.
Cost and complexity
For a coarse full-fine-tuning arithmetic ledger, take parameters and processed training tokens:
At , this is arithmetic GPU-hours, excluding evaluation and release. Separately, embedding ten -token chunks through a -parameter encoder gives the forward proxy
At the same stipulated arithmetic rate, the embedding component is . The FLOP ratio is approximately , but its numerator is a fifty-million-token training job and denominator a ten-chunk incremental embedding update. They are not matched single-fact workloads. Small-encoder utilization, storage/index writes and serving propagation are omitted; this ratio is not a measured update-latency or per-fact cost advantage. Figure uses this same analytical ledger. The previous schematic labels of GPU-hours and used inconsistent values and are not separate measured results.
Worked example
The diagnostic scenario has held-out questions, closed-book accuracy , oracle-context probe accuracy , distractor-probe accuracy and retrieval-success probability . For the following calculation only, assume that the probes transfer to production conditional rates: and . Without that assumption, the exact production mixture needs directly measured conditional rates.
Configuration one reranks a top-fifty lexical/dense fused candidate set and keeps five. If retrieval success increases to while both conditional accuracies remain fixed, the predicted gain is
That prediction is , not before rounding. Configuration two instead holds and changes the stipulated conditional accuracies to and :
The SFT-scenario gain is percentage points: from the hit slice and from the miss slice. The mixture prediction is points above the reported end-to-end result; numerical proximity alone does not validate probe transfer. For an IID -question Bernoulli estimate near the prediction, a nominal normal-interval half-width is about points, before other uncertainty. Closed-book minus distractor-probe is a ten-point net accuracy difference only for comparable cohorts. It is not the probability that retrieval flips a previously correct answer: that needs paired correct-to-wrong and wrong-to-correct counts. The source-reported Mallen et al. (2023) flip statistic requires its original denominator and task; do not identify it with this difference. A forty-point penalty can motivate a data/chunking audit but does not prove broken labels. Dropping retrieval leaves arithmetic accuracy headroom , not an achievable gain guarantee. Refresh costs depend on the chosen training workload; use the arithmetic-hour job and ten-chunk embedding proxy only within their stated, unmatched scopes.
Decisions and claim limits
Run oracle, closed-book and distractor interventions on representative held-out questions, and separately record actual production hit/miss correctness and sufficient-evidence coverage. A human-judged top chunk without verified gold is a proxy, not an optimistic mathematical bound. Default frequently changing facts to an index and shared formatting behavior to prompting or SFT, while enforcing source, tenant and date policy. Fewer than five hundred prompt tokens, hourly index refresh and quarterly weight releases are source heuristics, not general cost optima. An immutable corpus may reduce refresh pressure but does not eliminate evidence-quality or provenance requirements. At fixed conditional rates, the coefficient on improving is , so this particular benefit shrinks as . Distractors can still harm hit contexts, and changing retrieval or checkpoints changes the conditional rates. The source’s reconsideration threshold near is a planning heuristic; remeasure the full mixture.
27.2 RAFT trains with distractors on purpose
What
The source reports clean held-out accuracy rising from to , followed by production complaints two weeks later. A one-in-five context miss rate motivates the subsequent scenario, but only a defined sufficient-evidence event makes that mixture precise. For this section, let be sufficient-evidence presence in the serving context, answer accuracy conditional on presence and answer accuracy conditional on absence. These are conditional probabilities on their respective query/context populations:
In the analyzed RAFT-style recipe, each item has question , gold target , supporting document and retriever-derived distractors. For fraction , retain gold; otherwise remove it while keeping the answer target. To match a fixed serving depth , use one gold plus distractors on the retained branch and distractors on the missing branch, replacing rather than merely dropping a slot. Verify that other distractors do not independently contain the answer: is a gold-retention fraction, and equals a context-sufficiency prior only under those construction checks. An always-gold dataset does not leave mathematically undefined; it leaves missing-context behavior unsupervised by that dataset. The source describes RAFT as study for an open-book exam. That analogy must not conceal the missing-evidence branch: its unchanged target still demands an answer, so it can train factual learning or memorization as well as context selection. It does not itself train abstention.
Why
Missing-gold examples expose the generator to insufficient contexts if the data construction truly removes all supporting evidence. Hard negatives sampled from the deployed retriever can better resemble production than random off-topic text, but their provenance and changing distribution require validation. The reported quote-marker format makes target evidence explicit on supported examples. If a missing-gold target retains a quote from the removed document, it is not a quote supported by the supplied context; do not present that generated rationale or citation as context-grounded evidence.
Failure without it
At , the dataset supplies no explicit missing-gold supervision, yet pretrained behavior can still generalize to misses; copying all context is not generally the minimum-loss answer policy. At , the model is not forced to ignore context, nor must : pretraining, residual cues and test-time evidence can preserve a difference. The worked versus values already show this. Keeping the correct-answer target on unsupported examples can encourage reliance on weights or learning labeled facts; it is not an abstention objective. A refusal, uncertainty or externally verified override target defines a different policy, especially important for clinical applications.
Cost and complexity
This is supervised sequence training and can use LoRA. Label quality, leakage checks, evidence sufficiency and the deployed negative distribution are major costs. After a retriever or corpus update, re-estimate recall and miss/hit behavior and consider a fresh sweep. A change under two recall points is not a guarantee that distractor hardness, counterfactual exposure or calibration stayed unchanged.
Worked example
Use serving , and exactly one sufficient golden document on successful contexts. Successful contexts contain one gold plus four distractors; misses contain five distractors with no alternative support. Configuration one has , stipulated and :
Configuration two uses and stipulated conditional rates , :
It sacrifices three points on the hit slice for twenty-nine points on the miss slice. Configuration three, with , and , gives ; no equality of its two conditional rates is implied. Configuration two gains absolute points over one, or approximately relative. Its two contributions are
The hit-slice contribution is
They sum to . Holding configuration one’s conditional rates fixed, the retrieval-success rate needed to reach solves
Recall must increase by about percentage points from , under the frozen-rate assumption. At , configurations one and two score and ; the gap is points, or times the original gap. Karpukhin et al. (2020) is reported to give DPR top-twenty retrieval accuracy of on Natural Questions. A different benchmark, index, evidence definition and depth cannot certify that top-five is optimistic or attainable on this deployment. At , the two scenarios give and . Their fixed-rate crossover solves
Above success, configuration one wins only if those four conditional rates stay fixed. At its advantage is accuracy points. Whether that is statistically distinguishable needs the held-out size, paired discordance, confidence level and test design; it cannot be declared “within split noise” from the point estimates alone.
Decisions and claim limits
Use measured sufficient-evidence rate as an initial data-mixture reference, not a theorem that is optimal or that the best sweep direction is always downward. Validate in both directions, show and with uncertainty, and test unsupported-answer, abstention and citation policies separately. Re-evaluate after retrieval, corpus or checkpoint changes.
27.3 Robustness to noisy, irrelevant, and counterfactual retrieval
What
The opening example repeats a rate limit retired eighteen months earlier. The source’s recall-at-five value of implies a fifteen-percent missing-evidence slice only if that recall metric means presence of a complete sufficient answer context. Stale but answer-shaped evidence needs an additional truth-and-date check. The reported example asks which album contains Pink Floyd’s “Time”: gold is The Dark Side of the Moon; a general band overview is related but answerless, another artist is irrelevant, and a document naming Wish You Were Here is counterfactual. Let test topical relation, the presence of an answer-shaped span and its truth and applicability. The first two can be judged from the pair in principle but are not certified by a similarity score. For an externally contingent claim, the same text can occur in worlds where it is true or false; pair-local fluency cannot identify the world. Use trusted construction, authoritative dated evidence or other grounded checks. Model priors and document agreement are fallible, especially under common-source duplication.
Why
The chapter reports Cuconasu et al. (2024) finding different effects for related answerless and random off-topic documents in their setting. These are not universal signs of harm. For a separate idealized majority-vote example, let five document votes independently be corrupt with probability , and let count corrupt votes:
The reduction ratio is . Calling this answer-error reduction additionally requires equally relevant votes and a reader that follows the correct majority. Independent document corruption alone does not guarantee model answer accuracy, especially for multi-hop evidence. If all five reproduce the same corrupted source, the majority can be wrong with probability , not .
Failure without it
An answer-level sequence loss can learn to select among documents through attention and gradients, but does not provide explicit document-level defect labels; it is not mathematically incapable of credit assignment. The RbFT-style recipe adds a label per document and utility extraction from partially useful passages. Those labels need trustworthy supervision, including how counterfactuals were constructed. A relevance filter can remove obvious off-topic text and can correlate with usefulness, but cannot in general distinguish two equally relevant claims solely by their truth. The source associates a pre-filter approach with Yoran et al. (2024); retain needed qualifiers and partial evidence instead of assuming every binary filter is sufficient.
Cost and complexity
Audit live queries at top five for query-document pairs. That is not a guaranteed afternoon of labeling: expert time, adjudication and within-query dependence matter. Five four-token defect tags add twenty output tokens. For an -billion-parameter fp16 model with of weights and bandwidth, the full-weight-stream component is
Twenty tag tokens cost and a forty-token answer in this component, so tags add fifty percent to output-token work. Adding thirty extracted-span tokens gives fifty extra tokens, costing beyond the answer, or extra output work. These are not full wall-clock costs. The corresponding weight-stream token rate is
A measured rate above this one-stream full-weight-read model invalidates at least one assumption, not necessarily fp16 precision. Aggregate batching, speculation or multi-token decoding, multiple devices, caching/reuse, actual model size and bandwidth can change the denominator. Conversely, attention, kernels and other traffic can make actual rate lower.
Worked example
The stipulated audit has helpful, noisy, irrelevant and counterfactual pairs. Exactly of queries are covered, giving helpful documents per covered query if helpful pairs occur only there. Thirty distinct queries have one counterfactual each; twenty-five are covered. Groups A/B/C/D therefore contain covered-clean, covered-counterfactual, uncovered-clean and five uncovered-counterfactual queries. Assume correct-evidence reader success , correct-evidence selection probability under a competing claim, noisy-context correctness and learned miss correctness . The selection rate is not already final accuracy, which is why group B multiplies it by . All response rates below are scenario assumptions, not measured causal effects of training.
Answer-only SFT then gives expected correct responses, or . With no abstention, the wrong-response rate is ; “confidently wrong” is not its synonym without a separate confidence/assurance criterion. Fractional counts are expectations. For configuration two, stipulate unchanged covered groups and miss accuracy in both uncovered groups, including a counterfactual miss:
This RAFT-style scenario totals expected correct, or , a -point gain confined by assumption to uncovered queries. For configuration three, assume counterfactual detection recall with no false-discard harm in the listed groups; detection restores the supported reader path, while an undetected competitor still has correct-selection probability :
Also stipulate that utility extraction improves group A correctness from to , while groups C and D remain at configuration two’s rates:
Total expected correct is , or : points over the RAFT-style scenario. Of the net additional correct responses, come from group B and from A. Group B is of queries and supplies approximately of this stipulated gain, not a measured fraction of all achievable headroom. The source reports RGB evaluation axes including noise robustness, negative rejection, information integration and counterfactual robustness, with weakness on the latter in evaluated systems; this does not independently validate the toy rates.
Decisions and claim limits
Label the deployed defect mix and report pair- and query-level denominators separately: counterfactual pairs here, but affected queries. The suggested thirty-percent miss gate for withholding is a heuristic, not an optimal threshold. Document labels can help recognize insufficiency or abstain even when no answer exists in the context, though they cannot create missing evidence. Emitting labels can aid auditing but also costs decode and can be wrong; choose whether extraction is a training target or a required inference/citation artifact. Evaluate authoritative updates against erroneous priors, source recency, metadata and correlated corroboration. Neither a three-percent pair rate nor a twenty-percent adversarial scenario alone determines whether to prefer faithfulness or override; that requires stakes, conditional error rates and an explicit source-of-truth policy. Track correctness, abstention and defined confidently-wrong outcomes separately, particularly for clinical use. The cited Longpre et al. (2021) result motivates testing context/knowledge conflict, not a universal percentage-based policy.
27.4 Answer invariance to context as a training objective
What
The opening reports exact match and self-consistency with a changed fourth-ranked passage ten minutes after an index refresh. Consistency needs a defined repetition protocol and denominator; it is neither correctness nor evidence invariance. Deterministic decoding removes one source of sampling variation, not changes to retrieval, prompts, kernels or model versions. For concatenated context, one supervised answer loss is
One supporting chunk may suffice to predict the target, but the other chunks are not necessarily gradient-inert: shared representations and attention can still receive gradients. The source associates split-context training with RA-DIT (Lin et al., 2023). The equation below defines the uniform per-context variant analyzed here, rather than asserting that every implementation uses identical weighting:
This fixed target is appropriate only when should remain valid for every sampled view, with sufficient task conditioning. It asks for target predictability under context variation; it does not establish that context is irrelevant to every part of the response. For and positive target-sequence probabilities, define
Add and subtract the log of the arithmetic mean:
Jensen’s inequality gives , with equality exactly when all target probabilities are equal. It is not an equality condition for the entire output distributions: the remaining probability mass can vary, and even the most likely wrong answer can change. All can also be equally small, giving zero gap but poor accuracy. For population variance and small relative deviations from a positive mean, a second-order expansion gives
For target probabilities and , and . The exact gap is
The second-order approximation is close, but not equal:
Why
The loss thus decomposes into target probability under a uniform mixture and a target-specific spread term, not classification accuracy plus full response invariance. The loss diverges as one , and its derivative with respect to is . That does not imply an unbounded or always-largest parameter gradient: for a Bernoulli target logit , the derivative is , which is bounded, and network Jacobians/shared gradients matter. Splitting can reduce attention work, but repeats the question, answer and fixed overhead; the reduction is not automatically a factor of at equal total compute.
Failure without it
REPLUG freezes the generator and trains or weights retrieval, potentially ensembling passage-conditioned predictions when the API exposes sufficient probabilities; a chosen-token log probability alone does not necessarily expose a full next-token distribution. It does not update generator weights, and an agreeing ensemble can still be wrong. REALM’s retrieval-aware pretraining and index refresh are a different training route, not a general robustness guarantee. A fixed target absent from the supplied context is still reachable on training examples through factual learning, memorization or generalization from the question and other data. The genuine limit is information: for a new arbitrary fact not inferable from any available input or learned knowledge, the model has no basis to identify the correct answer. Low closed-book accuracy is a warning about unsupported generalization, not proof of an impossible training minimum. Jointly required multi-hop evidence should not be split into individually insufficient views unless an explicitly justified objective handles that loss. Tenant- or date-dependent answers require those variables and appropriate per-view targets.
Cost and complexity
Use questions, , serving sufficient-evidence rate and exactly one individually supporting chunk on each successful query. To make repeated-question costs explicit, choose question/instruction length , chunk length and target length tokens. Each split input has tokens, but concatenating ten chunks with the question only once has , not . Concatenation therefore has million input plus million target positions; splitting has million input plus million target positions. Totals are versus million positions, a increase under splitting. Extra repeated questions contribute million positions and extra repeated targets million. All counts exclude separators or other template tokens unless included in .
There are split instances, so support fraction is and insufficient-context fraction , versus a twenty-percent insufficient-query rate before splitting. For context-only full-square attention proxies, the concatenate count is
The corresponding split count is
The context-square ratio is , not ten for this actual layout. Including targets and counting causal query-key pairs gives versus , a ratio of approximately . These are attention-pair counts, not end-to-end FLOPs or measured speedups; the larger token volume adds linear-model work. The ideal equal-partition comparison holds only when duplicated questions/targets are deliberately ignored or included equally. Fusion-in-Decoder similarly motivates passage-separated encoding, but its joint decoder can combine evidence; it is not statistically equivalent to forcing each isolated passage to predict the whole answer. To make support carry sixty percent of a globally weighted split loss, solve
This is a loss weight, not additional observed support; the average raw weight is . Normalize the weighted loss explicitly rather than accidentally changing the learning-rate scale. It restores a global weighted mix, not sixty-percent support for every query. Alternatively, retain all supporting instances and an average of non-supporting instances per original query:
From available non-supporting instances per query on average, retain about and discard . Implement fractional averages through sampling or a corpus-level quota; a single query cannot retain half an example, and some have no support to retain. For an analogous top-twenty rate of and exactly one supporting passage conditional on success:
If instead exactly three passages individually support the answer on every successful query and none on misses, the fraction is
Decisions and claim limits
Measure held-out closed-book accuracy , unsupported-context accuracy, correctness under swaps and target-probability spread. is a diagnostic, not a hard upper bound on post-training : supervision can change knowledge and generalization. Small Jensen gap alone is insufficient; compare full response/claim changes, correctness and support. Match the training context distribution and task conditioning to serving, and validate any reweighting or negative subsampling. Freezing the retriever can simplify diagnosis. Updating a document encoder requires re-encoding affected index representations; changing only a reranker or query encoder does not automatically require full document re-encoding. A fixed-target conditional loss is not mathematically restricted to prepended text: embedding- or adapter-conditioned generators can define analogous losses when their interfaces permit training. An opaque frozen API cannot directly fine-tune its generator through this objective. If policy requires abstention on insufficient context, provide verified sufficiency labels and appropriate abstention or uncertainty targets rather than silently retaining every answer target. If parametric override is allowed, verify that policy and test its factual generalization instead of assuming weights know the fact. A prompt can alter learned behavior, but cannot guarantee reversal of a conflicting training objective. Re-estimate support mix, answer quality and source/tenant/date behavior after retrieval changes.
27.5 PEFT with LoRA, QLoRA, and quantization
What
The opening -billion-parameter bf16 base has a weight payload, not a full training footprint. Allocating two fp32 Adam moment arrays adds ; bf16 gradients add another . Lazy moment allocation can therefore expose the underestimate at the first optimizer step. For a declared implementation with two-byte weights, two-byte gradients and two four-byte Adam moments, trainable state per parameter is
An additional fp32 master copy adds four bytes per parameter, raising the rule to . Not every optimizer uses these dtypes or keeps a master copy. Under the twelve-byte rule,
The weights are one sixth of that state ledger, not necessarily of actual peak memory. LoRA freezes and learns a factored residual:
The factor parameter count is rather than : an matrix has forty-eight entries, while rank-one and rank-two factors have fourteen and twenty-eight trainable values. These are factor counts, not minimal intrinsic degrees of freedom; a generic rank- matrix has degrees because the factorization is redundant. Eckart–Young describes best low-rank approximation to a given matrix in specified norms; it does not prove that the optimum fine-tuning update is low rank or that LoRA optimization finds its truncated SVD. The low-rank object is the update, not necessarily the base matrix. The source cites Aghajanyan et al. (2021) as empirical motivation for low-dimensional adaptation. With and nonzero randomly initialized , the initial residual is zero; initially the task gradient through is zero, while can receive a gradient. Initializing both factors to zero would block that task gradient. QLoRA stores eligible frozen weights with four-bit NF4 codes: ideal code payload is , or at seven billion eligible weights, before scales, unquantized tensors and workspace. A reported approximate double-quantization saving of bits per parameter gives
Paged optimizers can migrate state between device and host memory during pressure spikes. They do not delete state or guarantee that a job fits: host capacity, paging latency, activation peaks and framework allocations remain relevant.
Why
LoRA removes trainable-base gradients, moments and any master copy while retaining a frozen base. QLoRA then reduces eligible frozen-weight code payload by four relative to two-byte storage; metadata and unquantized tensors mean total memory does not shrink by exactly four. A conventional inserted adapter adds serial modules. LoRA instead adds a residual branch with two low-rank multiplies that can be merged into a dense base when precision and serving policy permit:
Prefix tuning consumes additional prefix positions, a trade-off to evaluate rather than categorically reject for RAG. NF4 is a code/storage format: kernels dequantize into a chosen higher-precision compute representation, often bf16. It does not make the dense matrix multiply four-bit arithmetic or guarantee fewer FLOPs, though memory traffic, throughput and overhead can change. Merging into a quantized base may require dequantization and requantization, so it is not necessarily numerically identical to an unmerged higher-precision residual. The source’s LLM.int8() discussion concerns mixed-precision outlier handling in studied models, not a universal sharp failure threshold at billion parameters. Generator training precision, serving precision and retrieval-vector quantization are separate decisions.
Failure without it
The unsharded full-tuning state ledger is already before activations, or with a master copy. Sharding, offload or different state dtypes change device requirements. Retaining adapters in bf16/fp16 is a common stable default for this comparison, not a theorem that all quantized-adapter training is impossible; specialized quantization-aware methods have different analysis. Pin the base checkpoint, tokenizer, adapter configuration and quantization settings. Merging a base per tenant removes simple base sharing. The reported Biderman et al. (2024) comparison of LoRA and full tuning on code/mathematics and forgetting is experiment-specific; it is not proof that LoRA cannot learn new knowledge or that all facts must live in an index.
Cost and complexity
The sizing scenario uses Llama-2-like block shapes: thirty-two layers, hidden width , MLP width , sequence length , batch one, gradient checkpointing and FlashAttention. Use as the coarse base-size denominator rather than claiming the rounded count is the exact architecture total. Saving one bf16 block input per layer gives the following activation component; recomputation, internal tensors, logits, gradients, workspaces and allocator peaks are additional:
Full tuning’s listed state plus block-input subtotal is without a master copy and with one. These components need not all be live simultaneously, so their sum is not a rigorous peak bound. The first exceeds an eighty-decimal-gigabyte budget but is below by ; that narrow nominal margin does not establish a fit once omitted allocations are considered. Check actual device capacity in bytes and profile peak live memory rather than inferring an out-of-memory result from the product label. The master-copy state alone exceeds either budget. Rank-sixteen LoRA on query and value projections of shape adds per matrix
Two such matrices per layer across thirty-two layers give factor parameters, or of the rounded seven-billion base. Under the same twelve-byte adapter-state rule:
The frozen-base, adapter-state and block-input subtotal is
This subtotal leaves nominal room on a twenty-four-gigabyte device, but is not a peak-memory guarantee. Profile the actual sequence, batch, optimizer and kernels. The bf16 adapter weight artifact alone is
That is times smaller than a fourteen-decimal-gigabyte base-weight artifact, excluding metadata and training state. The next configuration changes both storage and adapter capacity: rank sixty-four on the seven transformer-block matrices , gate, up and down, not every linear tensor such as an output head. For the stated full-width key/value projections, its count per layer is
Across thirty-two layers this gives adapter parameters, or of the rounded base and times the rank-sixteen query/value setup. Grouped-query architectures with narrower key/value projections need different shapes. Adapter state is ; adding an ideal NF4 code payload and the same block-input component gives
This subtotal excludes quantization scales, unquantized tensors, dequantization/optimizer workspaces and other peaks. At batch eight, the block-input component totals , an increase of over batch one, not an additional . The listed all-linear QLoRA subtotal then becomes before omitted terms; activations dominate its listed components. For an independent shape-count example with ninety-six layers, width and rank four on query/value:
At two bytes per factor this is . Against the source-reported MB artifact, the arithmetic difference is if that report uses decimal MB, or if it means MiB. Units, exact configuration and artifact metadata must be reconciled before treating closeness as validation.
Decisions and claim limits
Budget frozen weights, trainable state, activations and peak workspace together. Ideal one-byte Adam moments change the no-master rule to , or at seven billion parameters; an fp32 master copy raises it to , before metadata and other memory. Actual eight-bit optimizers can use mixed state formats. Evaluate adapter coverage and rank on quality and resources: rank sixteen on all seven block matrices has factors versus for rank on query/value only. This is not a quality ordering theorem. Holding fixed holds one forward multiplier fixed, not all rank-dependent initialization or optimization dynamics; tune learning rate and scaling too. Pin exact model and precision metadata. For forty customers, forty resident merged bf16 bases have a weight payload, while unmerged query/value adapters have
Add one shared fourteen-gigabyte base for a weight payload, excluding caches, runtime and replicas. The per-adapted-matrix multiply-add ratio for the rank-sixteen square projection is
This is extra arithmetic for each touched matrix, not a whole-network latency penalty: kernel launches, routing, adapter batching and memory traffic can dominate. Merging a tenant with eighty percent of traffic onto a dedicated replica is a source heuristic; account for extra base replicas, precision effects, isolation and actual request distribution before deciding.
Diagrams
Figure 27.1
Panel A, two write loops:
Diagram description and source
flowchart LR
S["SFT: 50 million processed tokens, 7B generator"] -->|"6ND proxy: 1.715686 arithmetic GPU-hours"| W["Shared weights theta"]
W --> G["Generator"]
C["Incremental update: ten 512-token chunks, 110M encoder"] -->|"2NT proxy: 3.312941 arithmetic ms"| X["Updated index then query-time context"]
X --> G
Panel B, oracle-context probe:
| Oracle-context probe | Production evidence coverage high | Production evidence coverage low |
|---|---|---|
| high | Check production reader errors, policy, cost and uncertainty; this alone is not a ship gate | Investigate retrieval coverage; confirm that the oracle probe transfers to production hits |
| low | Investigate evidence format, labels, reasoning and context use; prompting or generator training may help | Audit both paths and compare matched intervention costs; retrieval is not automatically the first or cheaper repair |
Figure : A fifty-million-token training job and ten-chunk embedding update have an unmatched FLOP ratio of approximately under the stated proxies. It is not a single-fact or measured wall-clock comparison. An oracle-context probe is a useful intervention, but does not uniquely attribute every error or automatically equal production hit accuracy. The exact production mixture uses and , not unvalidated substitutes.
Figure 27.2
Diagram description and source
flowchart TB
I["Item: q, target a-star, gold document D-star, verified distractor pool"]
I -->|"fraction P"| GP["Fixed k slots: one gold plus k minus 1 distractors"]
I -->|"fraction 1 minus P"| GM["Fixed k slots: k distractors; verify no alternative support"]
GP --> T["Same answer target; any removed-source quote is not grounded in supplied context"]
GM --> T
T --> S["Serving distribution determines sufficient-evidence presence r"]
S --> HIT["Sufficient evidence: measure conditional accuracy g"]
S --> MISS["Insufficient evidence: measure conditional accuracy b and abstention policy"]
Figure : The fixed-depth construction replaces gold rather than changing . Gold-retention fraction equals sufficient-context frequency only if the gold is sufficient and distractors provide no alternative support. At this dataset lacks explicit missing-gold supervision, not all possible missing-context ability. Other defects or incomplete gold can create insufficient examples too. Withholding gold while keeping the answer target does not teach abstention and can encourage learning or memorizing the labeled fact.
Figure 27.3
Diagram description and source
flowchart TB
D["Retrieved document d for query q"] --> T1{"T1: Topically related? Pair-local judgment, not score-certified"}
T1 -->|"no"| I["Off-topic; ignore or filter after checking utility and harm"]
T1 -->|"yes"| T2{"T2: Contains answer-shaped evidence? Inspect content"}
T2 -->|"no"| N["Related but answerless; preserve partial utility or recognize insufficiency"]
T2 -->|"yes"| T3{"T3: True, current and applicable? Requires a grounded truth signal"}
T3 -->|"false or stale"| C["Reject the claim; override only under verified source policy, otherwise qualify or abstain"]
T3 -->|"verified"| H["Use evidence and cite its source"]
O["Trusted construction, authoritative dated evidence, metadata and independent checks"] -.-> T3
style T3 stroke-dasharray: 5 5
style C stroke-dasharray: 5 5
Figure : and answer-shaped can be assessed from a query-document pair in principle, but a high similarity score does not decide them. Externally contingent truth generally needs a reliable world-and-date signal; fluency, model priors and document agreement are not certificates. Some documents can contain checkable proofs or provenance, so it is too strong to say that no amount of reading can ever decide . Dashed boxes mark the need for grounding, not a universal impossibility theorem.
Table 27.1
Table : These are limited analogies about selective information or computation, not the same mathematical projection or objective. Dropout includes masking and rescaling; bagging resamples data; sparse expert routing selects computation. RAFT’s missing-gold answer target and defect-specific labels require their own evidence and policy analysis.
| Technique | Operation | Scope and limitation |
|---|---|---|
| Dropout | Stochastic activation/feature masks, usually with rescaling | Regularizes a network; not simply a fixed feature projection |
| Masked language modeling | Hide or replace selected token inputs and predict targets | A reconstruction objective; not a fixed answer target under every passage |
| Bagging, random forests | Bootstrap training examples and, in forests, sample candidate features | Resampling can duplicate rows; it is not merely deleting evidence |
| Mixture of experts | Route tokens to a subset of experts | Selects computation during training and serving; not necessarily missing information |
| RAFT, defect training | Withhold verified support or create labeled retrieval defects | Gold removal is one construction; not every defect is equivalent to a dropped row |
Figure 27.4
Diagram description and source
flowchart LR
subgraph A["Concatenate: one example per question"]
AW["One question plus k chunks; input length Q plus kC"] --> AY["One target y of length Y"]
AY --> AN["Supporting evidence may suffice; other chunks are not necessarily gradient-inert"]
end
subgraph B["Split: k passage-conditioned examples"]
B1["Question plus chunk 1"] --> BY["Repeat target y for every view"]
B2["Question plus chunk 2"] --> BY
BK["Question plus chunk k"] --> BY
BY --> BN["Mean negative log target probability; Jensen gap concerns that target only"]
end
Figure : Splitting repeats both the question and target and changes the support mix. Zero Jensen gap means equal target probabilities, not equal full distributions or correct answers. In the explicit , , , layout, total positions increase by approximately . The context-square attention-pair ratio is ; including targets and causal pairs gives about . The ideal factor of ten requires a different equal-partition abstraction. None is a measured training speedup.
Figure 27.5
LoRA path:
Diagram description and source
flowchart LR
X["x, dimension k"] --> W["Frozen W, d by k: bf16 LoRA or eligible NF4 codes for QLoRA"]
W --> C["NF4 requires scales and higher-precision compute; metadata and workspace are extra"]
X --> A["A, r by k, nonzero random initialization"]
A --> B["B, d by r, initialized to zero"]
B --> S["Scale by alpha divided by r"]
C --> P["Add base and residual paths"]
S --> P
P --> H["h, dimension d"]
Memory bars under the figure assumptions:
| Training configuration | Listed components in decimal GB | Component subtotal | Capacity and peak-fit interpretation |
|---|---|---|---|
| Full fine-tuning, bf16, no master copy | trainable state; block inputs | Above but below ; not a simultaneous-allocation or peak bound. Profile runtime capacity and omitted allocations | |
| LoRA, bf16 base, rank on | base; adapter state; block inputs | Subtotal below both nominal budgets; actual fit still requires profiling | |
| QLoRA, ideal NF4 codes, rank on | code payload; adapter state; block inputs | Quantization metadata, unquantized tensors and peak workspaces omitted; no guaranteed fit |
Figure : Listed component sums are not measured peak memory, and components need not be simultaneously live. Compare actual capacity in bytes: is not . An fp32 master copy adds to full-tuning state. All rows use the batch-one, length- block-input component; only adapter rows use rank-sixteen query/value factors. The rank-sixty-four all-seven-block-matrix worked QLoRA setup is a different configuration with a listed subtotal. Four-bit codes compress eligible frozen weights by four relative to bf16, not total training memory by four.
Whiteboard pack
What to draw
- Draw shared weights and retrieved evidence as separate inputs to the generator.
- Write for production slices; draw oracle accuracy as a separate intervention.
- Add the diagnostic matrix, with explicit probe-transfer and source-of-truth checks rather than an automatic release decision.
- Draw fixed-depth RAFT branches: gold plus distractors versus verified non-supporting distractors; keep the answer target and distinguish this from abstention.
- Draw and mark the truth/current-applicability test as requiring grounded evidence, not merely relevance or consensus.
- Draw concatenate and split layouts with repeated question/target tokens. Label the Jensen gap as target-probability spread, not full-output invariance.
- Show component subtotals , and for matching configurations; add metadata/workspace and distinguish decimal capacity from GiB before making a fit claim.
Spoken script
Separate shared-weight updates from query-time evidence updates. Measure actual hit/miss correctness and evidence sufficiency, and use oracle, closed-book and distractor probes as interventions whose transfer must be checked. RAFT changes evidence while retaining answer targets, which can train factual learning rather than abstention. RbFT adds explicit document supervision without making truth locally identifiable from fluency. Split-context training penalizes target-probability spread but does not guarantee full-output invariance; it also repeats questions and answers. Finally, size full state, frozen storage, adapter state and live activation/workspace peaks in consistent units. The twelve-byte Adam rule is conditional on dtypes and absence of a master copy, and NF4 code payload is not total QLoRA memory.
Interview traps
1. Should a nightly policy change go into LoRA?
Default a verified dated fact to the keyed index, while considering prompting or training for shared format, tone, refusal and evidence-use behavior. The scenario’s arithmetic-hour training job and ten-chunk embedding component are unmatched workloads, not a measured per-fact latency comparison. Oracle-context failures are diagnostic, not the only reason to consider SFT or proof that weights are the right repair. Compare held-out production slices, freshness, provenance, source policy and matched costs before choosing.
2. Why train RAFT without the golden document?
The missing-gold branch supplies explicit supervision for insufficient contexts only after verifying that no alternative support remains. At the dataset lacks that supervision, not all possible miss behavior. An unchanged correct-answer target can encourage factual learning, memorization or prior reliance; it does not teach abstention or guarantee safe override. Use measured evidence sufficiency as an initial mixture reference, sweep in both directions, and show , , uncertainty and policy outcomes separately.
3. Why can RAFT miss a plausible false claim?
Answer-only loss can learn document selection, but does not provide explicit per-document truth labels. Add defect labels and utility extraction where their supervision is reliable. A plausible false or stale claim can be highly relevant, so use authoritative dated evidence, trusted construction or verified provenance; model priors and correlated corroboration are fallible. Choose whether to reject, override, qualify or abstain under an explicit source-of-truth policy rather than a universal trust gate.
4. Why hold one target across every retrieved chunk?
One fixed target encodes a task assumption about valid answers across views. The split loss has a target-probability Jensen gap, not a full-response invariance guarantee. With sufficient-evidence rate , and exactly one supporting passage on hits, eight percent of split instances support the target. Weight support by in a normalized global loss or discard approximately of non-support instances to obtain the worked sixty-percent global mix. Neither operation creates new evidence. Low closed-book accuracy warns about unsupported generalization but is not a hard bound on learning training facts. Include tenant/date conditioning, and keep jointly required evidence together when individual chunks cannot support the target.
5. Why does a 14 GB model not fit full fine-tuning?
A fourteen-decimal-gigabyte base excludes gradients, moments and other allocations. The declared twelve-byte Adam state rule gives at the rounded seven-billion size, or with an fp32 master copy. Matching rank-sixteen query/value LoRA and NF4 QLoRA listed subtotals are and ; all-seven-matrix rank-sixty-four QLoRA is . These are component sums, not measured peaks or universal fit verdicts; distinguish from and inspect runtime capacity. Tune coverage, rank, scaling and learning rate jointly: constant fixes one multiplier, not all learning dynamics. Pin the base and precision metadata and measure full live memory.
Key numbers
| Topic | Number | Interpretation |
|---|---|---|
| Opening resource choice | parameters; pairs; one-quarter GPU budget per option | Source-reported planning anecdote, not a cost derived from the FLOP ledger |
| Opening time horizon | Two months of development; two quarters of consequence | Motivating time horizon, not a measured universal delay |
| Behavior adapter rank | Rank or | Empirical starting range, not a sufficient-capacity theorem |
| Oracle diagnostic example | ; ; distractor probe ; | Using probe accuracies as production conditional rates is an additional assumption |
| Predicted baseline | Conditional mixture prediction; reported measured score is 69 percent on questions, not proof of probe transfer | |
| Reranker option | ; gain points; | Conditional accuracies held fixed; changing retrieval can change them in practice |
| Distractor-aware SFT option | Hit ; miss ; | Stipulated training scenario gains absolute points, not a measured causal result |
| Distractor term | of points | Miss-slice contribution; hit slice contributes points |
| Distraction penalty | net accuracy points | Comparable-cohort closed-book versus distractor gap; not the paired correct-to-wrong flip rate |
| Fine-tuning compute | ; ; GPU-hours | Arithmetic proxy for seven billion parameters over fifty million processed training tokens |
| Index update compute | ; | Ten 512-token chunks through a 110-million-parameter encoder at the stipulated rate; index writes excluded |
| Compute ratio | Unmatched full-training-job versus ten-chunk embedding FLOP ratio; not a measured per-fact latency ratio | |
| Figure labels | arithmetic GPU-hours; | Figure now matches the analytical inputs; earlier 1.5-hour and 2.8-ms labels were inconsistent |
| Prompt threshold | Under system-prompt tokens | Source heuristic favoring prompting; not a general optimum |
| Release cadence | Hourly index updates; quarterly weight releases | Source cadence heuristic, not an unavoidable architectural schedule |
| Clean RAFT opening | held-out accuracy; two weeks | Reported clean-context opening; does not independently measure production miss behavior |
| RAFT sweep | at ; at ; at | Toy sufficient-evidence rate is ; P-zero does not imply equal hit/miss accuracy |
| RAFT conditional scores | versus | Stipulated rates trade three hit-slice points for twenty-nine miss-slice points |
| RAFT gain | points at ; at | The gap ratio is approximately only with these conditional rates fixed |
| RAFT contribution check | and | Miss and hit contributions sum to |
| Equivalent recall | Retrieval success required to match while configuration-one conditional rates stay fixed | |
| DPR plausibility check | at top | Reported DPR benchmark; cannot validate top-five 80-percent success on a different deployment |
| Old-model crossover | Exact crossover of the two fixed-rate toy lines; remeasure after intervention | |
| Reranked comparison | versus at | A 0.44-point margin; statistical distinguishability needs sample size and paired test design |
| Re-sweep exception | Under about two recall points | Source re-sweep heuristic; small recall changes do not guarantee unchanged distractor or truth exposure |
| Defect opening | Eighteen-month-old rate; top-five success | Fifteen-percent misses only if the retrieval metric means complete sufficient-evidence coverage |
| Corruption vote | ; | Independent five-vote majority-corruption rate, not automatically model answer error |
| Corruption reduction | Independence-based vote reduction; correlated common sources can leave corruption at | |
| Defect audit | helpful; noisy; irrelevant; counterfactual | query-document pairs from 200 top-five questions; these are pair counts |
| Covered-query audit | covered; uncovered; | Helpful documents per covered question, under the stated allocation |
| Answer-only SFT | correct; wrong | No abstention assumed; confident error requires a separately defined confidence criterion |
| RAFT-style withholding | ; gain points | RAFT-style toy changes only uncovered-group rates |
| Per-document RbFT | ; gain points | RbFT toy with specified detection, no false-discard harm and improved supported-reader success |
| Counterfactual headroom | of queries; of net toy gain | Group B supplies of additional expected correct answers, not all possible headroom |
| Defect labels | extra output tokens | Five four-token defect labels |
| Decode roofline inputs | weights; ; | One-stream full-weight-read component, not complete decode time |
| Defect-tag decode | Twenty extra tags in the weight-stream component | |
| Answer decode | tokens; | Tags add fifty percent to answer output work in this proxy |
| Extracted-span decode | extra tokens; | Twenty tags plus thirty extracted tokens; 125-percent extra output work beyond a forty-token answer |
| Single-stream roofline | One-stream full-weight-read model; faster aggregate rate can indicate batching or other changed assumptions | |
| Audit policy gates | counterfactual pairs; affected queries | Thirty-percent miss and twenty-percent override scenarios are policy heuristics, not derived optimal gates |
| Invariance opening | exact match; consistency; ten-minute repeat | Reported opening needs a defined repetition denominator; consistency is not correctness |
| Jensen check | ; quadratic | Distinct exact-log and second-order values; zero gap only equates target probabilities |
| Invariance corpus | questions; ; ; ; | Explicit repeated-question and target layout; sufficient-evidence rate |
| Input-token volume | million versus million input positions | Concatenation uses the question once, splitting ten times; token volumes are not equal |
| Split instance count | instances | Ten passage-conditioned examples per original question |
| Repeated questions and targets | million extra target; million extra question positions | Total positions rise from to million, about percent |
| Split training mix | supporting; insufficient | Requires exactly one individually sufficient passage on each successful query and none on misses |
| Split attention | versus context-square pairs | Ratio ; with full causal positions approximately , not an automatic speedup |
| Mix restoration | or discard of non-support | Restores a sixty-percent global weighted/sampled mix, not new evidence or every-query balance |
| Deep retrieval support | or supporting instances | Top-twenty success with exactly one or three individually sufficient passages per hit, respectively |
| Full-tuning budget rule | ; with fp32 master | Declared bf16 weights/gradients plus fp32 first and second raw moments |
| Base-only mistake | base; gradients; moments | Base weight payload is not training state or actual peak memory |
| LoRA toy factorization | entries; rank-one factors ; rank-two factors | Factor parameter counts, not minimal rank-manifold degrees of freedom |
| Frozen NF4 base | ; ideal codes | Scales, unquantized tensors, adapter state and workspaces are extra |
| Full 7B fine-tuning | listed components | Not a rigorous peak bound; above 80 decimal GB but below . Master-copy subtotal is |
| LoRA and | subtotal; factors | Rank-sixteen query/value; artifact is or |
| LoRA compression | trainable; artifact ratio | Relative to the rounded seven-billion base; artifact ratio is not a training-memory ratio |
| QLoRA figure row | listed subtotal | Matching rank-sixteen query/value NF4 row, before omitted allocations |
| QLoRA worked row | subtotal; factors | Rank-sixty-four all-seven-block-matrix setup; not the same adapter as the figure row |
| QLoRA coverage count | factors per layer; ; times | Seven specified full-width block matrices; other architectures and output heads change the count |
| Larger-batch activation component | total block inputs; increase | Batch eight versus one; all-linear QLoRA listed subtotal becomes |
| Double quantization | bits per parameter; at | Reported approximate double-quantization saving under the specified code format |
| Outlier threshold | About billion parameters | Experiment-specific int8 outlier observation, not a universal size cliff |
| GPT-3 check | layers; width ; rank ; query/value | factors; two-byte artifact is or for the stated GPT-3-like shape |
| GPT-3 agreement | versus decimal MB; versus MiB | Reconcile units, exact architecture and metadata before treating the reported artifact as validation |
| Eight-bit optimizer | at seven billion | Ideal one-byte moments without master; master-copy state is . Metadata and other allocations omitted |
| Rank-coverage choice | all-block rank-sixteen factors versus query/value rank-128 factors | Coverage/rank trade-off requires quality measurements, not parameter-count ordering |
| Forty adapters | adapters; shared total | Forty query/value adapter artifacts plus one base versus merged-base payload; runtime and replicas excluded |
| Adapter arithmetic overhead | for each adapted square matrix | Extra low-rank arithmetic only, not whole-network or measured serving-latency overhead |
| Heavy tenant boundary | of requests | Source heavy-tenant heuristic for a dedicated merged replica; price capacity, precision and isolation |
| Publication years | 2019 through 2024 | Reported publication lineage; no empirical result independently replicated in this pass |
00-START-HERE · 01-READING-ROUTES · 26_iterative_recursive_and_agentic_retrieval · 28_training_the_retriever