Why this week is positioned where it is. Weeks 5-7 produced working systems. Week 8 produced eval. Week 9 made it cheap. Week 10 extended it to multimodal and code. Reliability is the load-bearing concern for every system you've built — and it's deliberately last because the techniques here only work on top of competent eval. You can't measure miscalibration without ground truth; you can't validate a verifier ensemble without a held-out set. Reliability is what eval discipline buys you.
The honest disclaimer up front. None of these techniques eliminate failure modes. They reduce them, surface them earlier, or contain their blast radius. Production reliability is layers of imperfect defenses, not a single silver bullet. The teams that ship reliable systems don't have one trick — they have ten things stacked on top of each other.
1. Why LLMs fail unpredictably
The patterns of LLM failure are different from traditional software bugs.
Hallucination. The model produces fluent text that's factually wrong. Surface fluency makes it hard to detect — there's no syntax error, no exception, just confidently asserted nonsense. Common in: factual recall outside training distribution, multi-hop reasoning, math, citations.
Sycophancy. The model agrees with the user even when the user is wrong. Trained for via RLHF — "helpful" and "agreeable" got conflated in the reward signal. Real cost: a system that confirms whatever the user already believed isn't useful for analysis.
Distribution shift. Production traffic looks different from training/eval data. The model degrades silently — outputs are still fluent but quality drops. Catches teams off-guard because eval scores stay high on the fixed eval set even as production behavior worsens.
Out-of-distribution (OOD) inputs. A query phrased in a way the model rarely sees during training. Performance drops sharply but the model's confidence often doesn't. The model "doesn't know what it doesn't know."
Compounding errors in chains. An agent or multi-step system fails because each step is 95% reliable but ten steps in a row is 60% reliable. Reliability is multiplicative across pipeline stages. The system you built last week with 8 agent steps at 90% step-reliability has only 43% end-to-end success.
Adversarial inputs. Users (or upstream systems) phrase inputs in ways that exploit the model's weaknesses — prompt injections, jailbreaks, edge cases. Most production systems eventually face this regardless of intended use case.
The common thread: most LLM failures are not surfaced by errors. They're silent. The reliability problem is "how do I detect failure when the system isn't telling me it failed?"
2. Calibration — does confidence mean what it says?
A model is well-calibrated if when it says "90% confident" it's right about 90% of the time. Calibrated confidence is the foundation of reliable systems because it lets you make threshold decisions: "if confidence < 80%, escalate to human."
The three ways models express confidence:
- Token probabilities. The softmax output over vocabulary. The probability of the predicted token under the model. Available from logprobs APIs.
- Verbal hedging. "I think...", "probably...", "I'm not sure but...". Surface-level signals.
- Explicit confidence scores. "On a scale of 1-10, how confident are you?" The model is asked to introspect.
RLHF-trained models tend to be overconfident. The reward signal pushed them toward decisive-sounding outputs. A pre-RLHF model saying "I'm not sure" got penalized; a confident-but-wrong answer often got rewarded for being helpful-sounding. By 2026, frontier model providers actively train for calibration as a separate objective, but the residual overconfidence is real.
Expected Calibration Error (ECE) is the standard metric:
ECE = sum over bins of: (|bin| / N) × |average_confidence(bin) - accuracy(bin)|
Bin predictions by confidence (e.g., 0-10%, 10-20%, ..., 90-100%). For each bin, compute the model's average stated confidence and its actual accuracy on those samples. Take the weighted average of the absolute differences.
- ECE = 0: perfect calibration; confidence equals accuracy.
- ECE > 0: gap between stated confidence and actual accuracy.
- Most production LLMs: ECE around 0.05-0.20 depending on domain and elicitation method.
A reliability diagram plots confidence (x) vs accuracy (y) per bin. Perfect calibration = diagonal line. Overconfident = below the diagonal (model says 90% confident but right only 75% of the time). Underconfident = above (rare for RLHF-trained models).
What to do with calibration data:
- Threshold-based routing. "If confidence < 0.7, send to a stronger model or human reviewer." Requires calibrated confidence; otherwise the threshold is meaningless.
- Selective answering. "If confidence < 0.5, answer 'I don't know' instead of guessing." Trades coverage for precision.
- Post-hoc calibration. Fit a calibration map (Platt scaling, isotonic regression) on a held-out set. Adjusts the model's confidence to be empirically calibrated.
- Verbal vs token confidence. Verbal hedging often correlates better with actual accuracy than token probabilities for long-form generation. Worth measuring on your specific workload.
Domain-specific calibration matters. A model can be calibrated on general factual questions and miscalibrated on legal text. Calibration is a property of model + workload, not just model. Re-measure on your domain before relying on confidence scores.
Your customer-support chatbot has token-probability confidence scores. You measure ECE = 0.18, with the model overconfident — when it says 90%, it's actually right 72% of the time. You want to route low-confidence cases to humans. What's the right immediate fix?
-
Lower your routing threshold from 80% to 70% to compensate.
-
Fit a post-hoc calibration map on a held-out set, then route on calibrated confidence.
-
Switch to a different model that's better calibrated.
-
Use verbal hedging instead of token probabilities as the signal.
Correct. Lowering the threshold (option 1) is a band-aid that breaks if the calibration error is non-uniform across confidence levels — and ECE = 0.18 typically means the gap varies. Switching models (option 3) is expensive and may regress on quality. Verbal hedging (option 4) is a reasonable signal but no reason to think it's well-calibrated either without measurement. Post-hoc calibration (Platt scaling, isotonic regression, or temperature scaling) is the right move: fit a small monotonic function on held-out data that maps raw confidence to calibrated confidence, then use that for routing decisions. Cheap, well-understood, and produces measurable ECE improvements on the held-out set. The standard practice in 2026 production is to ship calibration maps alongside models and refresh them when distribution shifts.
3. Verifiers — separate models that check outputs
A verifier is a model whose job is to evaluate another model's output. Used at inference time: generate, verify, accept or retry. The pattern that stuck in 2026 production stacks.
Why verifiers work: the errors made by a generator are not perfectly correlated with errors made by a verifier trained differently. If both models would make exactly the same errors, the verifier adds nothing. To the extent their failure modes diverge, the verifier catches errors the generator missed.
Two architectures:
-
Outcome reward model (ORM). Looks at the final output and rates it. Used in best-of-N sampling: generate N candidates, verifier scores each, pick the highest. Common in code generation and math.
-
Process reward model (PRM). Looks at intermediate reasoning steps and rates each. Catches errors as they happen rather than waiting for the wrong final answer. More expensive but catches more errors. Used in math reasoning systems and complex agent traces.
The math of verifier ensembles is the surprising result. If a single verifier catches an error with probability p, then N independent verifiers catch the error with probability 1 - (1-p)^N if any one of them flags it.
Concrete example. One verifier with p = 0.9 (catches 90% of errors). Five verifiers with p = 0.6 each (catches 60% of errors).
- One strong verifier: 90% catch rate.
- Five weak verifiers, "any one flags":
1 - (1-0.6)^5 = 1 - 0.01 = 99%catch rate.
The ensemble of mediocre verifiers beats the single strong one — IF errors detected by each verifier are independent. They're not perfectly independent in practice (verifiers trained on similar data make similar mistakes), but they're independent enough that ensembles consistently outperform.
The independence assumption matters. Five copies of the same verifier produce zero ensemble benefit. The trick is making the verifiers diverse:
- Different model families (Claude, GPT, Gemini).
- Different prompts (different rubrics, different framings).
- Different aspects (one verifier for factuality, one for completeness, one for safety).
- Different temperatures (sample diverse rationales).
The cost-quality tradeoff. Each verifier call has a cost. A 5-verifier ensemble at 60% accuracy each costs 5× more than a single 90% verifier. Sometimes worth it (high-stakes domains where missing an error is catastrophic), often not (low-stakes domains where 90% is plenty).
Generator-verifier asymmetry. Verifying is often easier than generating. You can verify "is this code correct?" by running the test suite — much faster than generating correct code. This asymmetry is what makes verifiers feasible: you can use cheaper, smaller models to verify outputs of larger generators.
4. Tool use as grounding
The model that can call tools doesn't have to remember everything. Each tool call replaces "model knows the answer" with "model knows where to find the answer." Tools are a reliability mechanism more than a capability mechanism.
The basic tools that improve reliability:
- Calculator / Python execution. Arithmetic and quantitative reasoning fail-rate drops from ~10-30% to near-zero. Anywhere you ask a model to compute, route through a calculator.
- Search / retrieval. Factual questions about current events or specifics. Replaces "model recalled" with "system retrieved and quoted." Reduces hallucination on factual claims.
- Code execution. "Did this code work?" → run it. Replaces predicted-correctness with actual-correctness. Massive reliability win on code generation.
- Date/time service. Models don't reliably know "what day is it today." A clock tool fixes the entire class of date arithmetic errors.
- Database queries. Structured data retrieval. Replaces hallucinated SQL with executed SQL.
The grounding pattern: any factual claim the system makes should be either (a) retrievable from a tool the system used, or (b) flagged as the model's own assertion. The output format becomes:
The contract terminates on [tool: query("contracts", id=X) → "2026-08-15"].
The penalty is 1.5× the daily rate of [tool: query("rates", X) → "$200/day"],
which equals [tool: calc("1.5 * 200") → "$300/day"].
Each claim links to a tool call that produced the value. Auditing becomes possible. Hallucinations become detectable.
Citation as grounding (revisited from Week 5). RAG with citations is a special case: retrieval is the grounding tool. The system shouldn't make claims that aren't traceable to a retrieved chunk. Production RAG systems should reject or flag generations that introduce facts not in the retrieved context.
Tool-use as a contract. When the model says "let me compute that" and calls calc, it's committing to using the result. Some systems enforce this: if calc returns 42, the model can't then say 43 in its final answer. The contract makes tool use load-bearing rather than decorative.
The cost. Tool calls are forward passes plus tool execution. A tool-heavy agent makes 10-20 forward passes for one user query. Reliability has a cost — usually worth it in high-stakes domains, often skipped in chat where speed matters more.
5. Self-consistency and majority voting
Generate K candidate answers; if they agree, the answer is robust; if they disagree, you have evidence of unreliability.
The basic pattern:
- Generate K samples at temperature T > 0 (so they differ).
- Cluster by answer.
- Take the majority answer.
For tasks with a small answer space (multiple choice, classification, single-number math): majority voting reduces error by exploiting the diversity of the samples. If errors are diverse and correct answers cluster, the majority is more likely right than any single sample.
Self-consistency vs verifier ensemble. Self-consistency uses one model with multiple samples; verifier ensemble uses multiple models. They compose: generate K samples with the generator, score each with M verifiers, take the highest-scored.
Where self-consistency works:
- Math: multiple solution paths, but correct answers converge. Wei et al. 2022 showed +18% on GSM8K with self-consistency.
- Multiple choice: voting on the choice.
- Code: voting on outputs of running the candidate code.
- Classification: standard ensemble logic.
Where it doesn't work:
- Open-ended generation (no obvious "voting" function over text).
- Tasks where errors are systematic — the wrong answer outnumbers the right one because the model is consistently biased.
- High-cost generation where the K× cost is prohibitive.
Cost. K× the inference cost of one sample. Combined with verifier ensembles (M verifiers × K samples), you can quickly balloon to 10-50× the cost of a single forward pass. Budget accordingly. Reserve for queries that warrant the cost.
The variance reduction is real. A 7B model with self-consistency at K=10 often beats a 70B model on math benchmarks. The smaller-and-many tradeoff is worth doing the math on for your workload.
6. Constitutional AI and output filtering
Output-time filtering catches issues that slipped past the generator. The "outer ring" of reliability.
Constitutional AI (Bai et al., 2022) — the model is asked to critique and revise its own outputs against a set of principles ("avoid harmful content," "be honest about uncertainty"). Anthropic's approach to safety training. By 2026, similar self-critique loops are standard in production.
Output classifiers. Separate small models that flag specific issues:
- PII detection. Did the output contain a Social Security number, phone number, address?
- Profanity / toxicity. Standard filter for consumer-facing systems.
- Factuality. Specialized model that checks claims against retrieved evidence.
- Code safety. Did the generated code attempt anything dangerous (
rm -rf, network exfiltration)? - Domain-specific. Medical advice in a non-medical product, financial advice without disclaimers, etc.
The filtering pattern:
generated_output = model.generate(prompt)
for filter in output_filters:
flagged, reason = filter.check(generated_output)
if flagged:
# Decide: refuse, redact, escalate, or retry
return handle_flag(reason)
return generated_output
Filters are not always rejection. Common patterns: redact (remove PII before showing user), escalate (flag for human review, ship the original to user with a flag), retry (regenerate with stronger prompt about avoiding the issue), refuse (don't return the output, return an error).
False positive rates matter. A PII filter that flags 30% of outputs is unusable. Shipping a tight filter starts at the 1-3% false-positive range; tuning the boundary is part of productionization.
The filter stack composes. PII → toxicity → factuality → domain-specific → final. Each adds latency (typically 50-200ms each); each catches a class of failure. Production systems typically have 3-5 filters running on every output.
7. Formal methods and symbolic verification
For some domains, you can verify outputs with mathematical certainty. The output is correct if it satisfies a formal specification.
Where formal verification is feasible in 2026:
- Type checking. Generated code typechecks → guaranteed not a type error. The compiler is the verifier. Used in TypeScript code agents, Rust code agents.
- Test execution. Generated code passes tests → guaranteed correct on the tested cases. Used in code generation and SWE-bench evaluation.
- Proof assistants. Lean, Coq, Isabelle. Generated proof typechecks → mathematically guaranteed correct. Used in math research and some safety-critical software domains.
- SMT solvers. Z3, CVC4. "Does this assertion always hold?" → solved by SMT. Used in formal verification of generated invariants and constraints.
- Schema validation. Generated JSON conforms to schema → guaranteed format-correct. Trivial verifier; common in production.
The 2026 pattern: LLM proposes, formal tool disposes. The LLM is good at generating candidate solutions; the formal tool is good at verifying. Generate-and-check loops dominate the high-reliability domains.
for attempt in range(max_attempts):
candidate = llm.generate(spec)
verified, error = verifier.check(candidate)
if verified:
return candidate
spec = update_spec_with_error(spec, error)
return None # gave up
This is the architecture behind code agents that solve programming competition problems, theorem provers that prove research-grade math, and SQL generators that produce queries with provable correctness on the schema.
The limitation. Formal verification only verifies the formal property. Code that passes tests can still be wrong on cases not in the tests. A proof of "function returns positive number" doesn't prove the number is what the user wanted. Formal verification is necessary, not sufficient.
Citations as proofs revisited. RAG with strict citation enforcement is a lightweight formal method. The "proof" is: "this claim appears in citation X, which is a retrieved chunk." If a claim has no citation, reject the output. This is more rigorous than it sounds — production RAG systems that ship without enforcing citation grounding have ~5-15% citation hallucination rates by 2026 measurements.
8. The reliability stack in production
Reliability isn't only about model-level techniques. It's about the systems-engineering layer that surrounds them.
Monitoring. What does production look like right now?
- Per-feature error rates. When did the chat bot's hallucination rate jump? Track it.
- Confidence distribution shift. Sudden drop in average confidence = OOD traffic.
- Verifier rejection rate. Verifiers rejecting more outputs than usual = upstream regression.
- User feedback signals. Thumbs-down rate, "this didn't help" clicks, escalation to human.
- Latency percentiles. P95, P99. Tail latency degrades silently.
Circuit breakers. When error rates spike, circuit-break to a safer fallback.
if recent_error_rate > threshold:
switch to fallback_strategy # cached response, simpler model, "service degraded" message
Standard pattern in distributed systems; underused in LLM systems. The first time your LLM provider has an outage and your product fully breaks because there was no fallback, you'll wish you had this.
Fallbacks at multiple layers.
- Primary model fails (timeout, error) → route to backup model (different provider).
- Both models fail → route to retrieval-only (return relevant chunks without generation).
- Retrieval fails → return a graceful "we couldn't retrieve information about this" message.
- Everything fails → static error page. Don't crash.
Rollback discipline. Every deployment should have a fast rollback path. Model upgrades regress quality silently — sometimes only on specific user segments. Be able to revert in under 5 minutes when monitoring shows regression.
Shadow deployments. Run the new model alongside the old, compare outputs, ship to production only after the comparison is favorable. Eats compute but catches regressions before users see them.
Canary rollouts. Send 1%, then 10%, then 50%, then 100% of traffic to the new model. Watch metrics at each step. Standard practice for any model upgrade.
Per-customer safety nets. High-value customers get heavier verification, lower latency tolerance for swap-out, possibly entirely separate routing. Acceptable failure modes are different for them.
You're building a medical-information chatbot. Calibration is the dominant concern — confidently wrong medical advice is worse than acknowledging uncertainty. Your generator has ECE = 0.15 (overconfident), and you've added (a) post-hoc temperature calibration, (b) a 3-verifier ensemble checking factuality, (c) RAG with strict citation enforcement, (d) an output filter for "this is medical advice, see a doctor" disclaimers. Cost is 7× a baseline single-call system. What's the biggest remaining reliability gap?
-
Verifier ensemble agreement isn't being used as a confidence signal.
-
Citation enforcement only checks retrieved chunks, not external knowledge.
-
The fallback path when retrieval returns no relevant chunks isn't specified.
-
The user has no way to escalate to a human reviewer.
Correct. Options 1, 2, and 3 are real concerns but not the biggest gap. Verifier-ensemble disagreement should be used as a confidence signal (option 1), and that's worth adding — but it's a refinement, not a foundational gap. Citation enforcement (option 2) is doing exactly what it should: blocking unverified claims. The fallback path (option 3) is a real concern but typical for medical info systems — the answer is "I don't have information about that, please consult a healthcare provider." But option 4 — no human escalation — is the killer gap in a high-stakes medical context. You can have the best technical reliability stack and still need humans in the loop for medical advice. Production medical AI in 2026 universally has explicit human-review paths for novel/high-stakes queries; the technical reliability stack is for triage, not decision. The triage routes to either: (a) confidently answer if the query is in well-covered territory and verification passes, or (b) escalate to a human reviewer. No third option.
Build this week
Pick at least two:
-
Measure ECE on your eval set. For your highest-volume production endpoint, capture confidence scores alongside outputs. Bin and compute ECE. If ECE > 0.10, fit a calibration map and re-measure.
-
Build a verifier ensemble for your highest-stakes feature. Three verifiers minimum — different models or different prompts. Measure: catch rate vs single-verifier baseline. Confirm independence empirically (are the verifiers catching different errors, or the same ones?).
-
Add citation enforcement to your RAG system. Block any output that introduces facts not in the retrieved context. Measure citation hallucination rate before and after.
-
Implement at least one output filter. PII, toxicity, or domain-specific. Measure false positive rate and tune to acceptable level.
-
Build a circuit-breaker. Pick one upstream dependency (LLM provider, retrieval service). Add error-rate monitoring; switch to a degraded-but-functional fallback when error rate exceeds threshold.
Read this
- "Calibration of Modern Neural Networks" (Guo et al., 2017). The foundational paper on temperature scaling and calibration. Pre-LLM but the techniques transferred directly.
- "Constitutional AI" (Bai et al., 2022). The Anthropic paper on self-critique loops.
- "Self-Consistency Improves Chain of Thought Reasoning" (Wei et al., 2022). The +18% on GSM8K result.
- "Process Reward Model for Math Reasoning" (OpenAI / Lightman et al., 2023). The PRM vs ORM tradeoff for reasoning.
- "Toolformer" (Schick et al., 2023). Tool-use grounding done well; the paper that mainstreamed the pattern.
- "Chain-of-Verification Reduces Hallucination" (Dhuliawala et al., 2023). A clean self-verification pattern for factual generation.
- Anthropic's "Reliability and AI Safety" engineering blog series. Practical writeups on production reliability patterns.
Interview prompts
- What is calibration, and why does it matter for production LLM systems?
- Walk through ECE. How do you measure it, and what's a good number?
- Compare process reward models and outcome reward models. When would you use each?
- Why does an ensemble of weak verifiers often beat a single strong verifier?
- What's the difference between self-consistency and verifier ensembles? When do you reach for each?
- Walk through tool-use as a reliability mechanism. What are the standard tools, and what do they ground?
- How does citation enforcement reduce hallucination, and what are its failure modes?
- What's a circuit breaker, and where would you put it in an LLM serving stack?
- You're seeing a sudden 5% drop in user thumbs-up rate. What's your investigation order?
- A new model release improved your eval scores by 8%. Why might you still hold off on shipping?
What "done" looks like
By the end of this week you should be able to:
- Measure calibration on your own system and apply post-hoc fixes.
- Architect a verifier ensemble with intentional diversity, and measure its catch rate.
- Decide between self-consistency, verifier ensembles, or both for a given workload, given cost-quality requirements.
- Identify which parts of your output should be grounded in tool calls vs model assertion.
- Set up output filtering that catches the failure modes that matter for your domain.
- Apply formal verification where the domain admits it (code, math, structured data).
- Design the production reliability stack: monitoring, circuit breakers, fallbacks, rollouts.
- Recognize when a "good eval score" is masking unreliability and what to measure instead.
If you can do those, you're ready for Week 12 — production patterns and the interview prep guide — which closes the 12-week arc with what to do when all of this hits real users at real scale.