Why Models Pass Tests But Fail in Production: From Theory to Agent Deployment
This article analyzes why large language models that pass benchmark tests often fail in real-world deployment, covering theoretical foundations of model expressivity, optimization, and generalization; practical evaluation methodologies including capability profiling and process verification; knowledge retrieval challenges; safety auditing; and a step-by-step framework for validating AI assistants in business workflows.
Reading font

Introduction
The article opens with a core question: a model answering test questions correctly does not guarantee reliable production use. It draws on the CCF ADL174 workshop "Large Model and Agent Mechanisms and Evaluation" (Sept 2026) to bridge theory and engineering practice using a simplified order-discount scenario (order 320 yuan, 80 yuan coupon, 300 yuan threshold, rule: deduct coupon then check threshold).
1. Why Models Err: Theory and Experiments
1.1 Training Accuracy vs. Unseen Combinations
Model capability is decomposed into three layers (from "What LLMs Can and Cannot Do"): expressivity (can architecture represent the function?), optimization (can training find the parameters?), and generalization (does learned rule apply to unseen input combinations?). Sun Ruoyu's error decomposition distinguishes best achievable fit, optimization gap, and train-test gap.
Expressivity : Universal approximation and Turing completeness (Pérez et al. 2019) require arbitrary precision, hard attention, and unbounded sequence length — assumptions not met by real models.
Optimization : Anchor function experiments (Xu Zhiqin) show models can memorize examples, exploit symmetry, or learn compositional functions. Parameter initialization influences which solution is learned. All configurations achieve 100% training accuracy but diverge on held-out combinations (3,4) and (4,3).
Generalization : Held-out anchor combinations test compositional reasoning. Embedding analysis (PCA, cosine similarity) reveals memory anchors diverge late while reasoning anchors form hierarchical structure early. Linear models fit modular addition but not modular arithmetic; nonlinear models fit both.
1.2 Theory vs. Business Reality
Theoretical proofs cannot verify if a specific model correctly deducts coupons, follows calculation order, or checks channel restrictions. Business validation must define latency budgets, compute limits, and error interception rules. Three controlled test groups are designed:
Phrasing variation : same order and rule, different question wording — checks robust understanding.
Order variation : same numbers, rule order swapped (deduct-then-check vs check-then-deduct) — checks sensitivity to procedural changes.
Constraint combination : channel allow/deny × coupon stackable/exclusive — checks multi-condition handling. A 2×2 table shows four combos; only one yields "can participate".
Failure analysis traces errors to requirement parsing, calculation order, or condition combination. Regression testing uses new parameter values (different amounts, thresholds, channel rules) to avoid overfitting to the 320/80/300 example.
1.3 In-Context Learning and Chain-of-Thought
ICL provides examples but may cause over-reliance on demonstrated patterns. CoT generates intermediate steps but does not guarantee correct premises. The article recommends: system supplies applicable rules, model decomposes problem, deterministic services perform arithmetic and threshold checks. Self-correction ability should be a selection criterion: can the model detect its own missed coupon deduction and revise the conclusion? Evaluation must separately count error-to-correct and correct-to-error flips.
1.4 Correct Calculation, Unreliable Conclusion
Even with correct arithmetic, using post-adjustment rules for historical orders yields wrong eligibility. Good-Turing estimation illustrates training data coverage limits: unseen facts (specific rule versions, timestamps) cannot be inferred. Confounding bias example: conversion rate rise during promotion may stem from traffic composition change, not the promotion itself. Root-cause analysis in incident response similarly requires checking scope and rule replay.
1.5 Diagnosing Analysis Errors
Errors may originate from wrong activity/crowd selection, data caliber mismatch, metric miscalculation, or overreaching conclusions. Verification steps: confirm activity/crowd/caliber, recompute metrics, supplement missing historical data, validate prediction methods and confidence intervals.
1.6 Same Training Score, Different Learned Solutions
Anchor experiments show initialization scale affects coalescence (neuron input weights becoming similar). Small initialization → strong coalescence → reuse of primitive functions; large initialization → weak coalescence → memorize whole mappings. Adding symmetric exceptions increases training epochs for small init but not large init, confirming the mechanistic difference. For business fine-tuning, hold out rule combinations; for off-the-shelf models, use independent business test suites. Optimizer dynamics (Adam's adaptive updates can cause loss spikes) must be monitored alongside final metrics.
2. Evaluation Scores Up, Is System More Reliable?
2.1 Capability Profiles for Business Evaluation
Aggregate scores mask critical weaknesses. Example: Model A scores 90/100 (90 data queries, 0 budget checks), Model B scores 88/100 (80 data queries, 8 budget checks). For budget-checking tasks, Model B is superior despite lower total. Evaluation design must define: (a) correctness criteria per task type, (b) behavior on missing data (request clarification), (c) data timestamp consistency. Lexin Zhou's ADeLe framework uses "requirement profiles" (18 dimensions) and "capability profiles" (Subject Characteristic Curves, SCC) estimating ability at 50% success probability. SCCs reveal models improve unevenly across dimensions; selection must check if weak dimensions match task requirements.
2.2 Beyond Answer Correctness: Process Evaluation
Yang Linyi distinguishes outcome evaluation (task completion, correctness, cost, latency) from process evaluation (planning, tool calls, exception handling). Budget-check example: assistant may query wrong activity but still output correct "insufficient" because both activities have 50k budget. Process checks must verify actual tool parameters, returned data, and authorization scope. Open-ended tasks (e.g., propose budget-compliant adjustments) require structured rubrics: factual grounding, constraint satisfaction, actionable next steps. Model-based evaluators must be calibrated against human judgments.
2.3 Validating Evaluation Results
Three-step verification: (1) re-grade a sample to catch scoring errors, (2) repeat runs with fixed seeds to assess stability, (3) test on held-out activities with varied amounts/timings to assess generalization. Acceptance criteria should be per-scenario (data complete → correct judgment; data missing → request query).
2.4 Language Robustness
Xu Yumei's multilingual experiments show performance variance across language pairs. Business tests should repeat the same budget-check task in Chinese, English, and mixed language, verifying consistent identification of missing current budget and prohibition against using yesterday's budget. Translation fidelity of constraints must be checked before comparing pre/post-translation performance.
3. Ensuring Correct Knowledge Retrieval
3.1 Why Learned Knowledge Isn't Direct Evidence
Li Jian's information-theoretic view: training minimizes cross-entropy (average code length), not fact retrieval. "Syntax-knowledge" model separates stable linguistic knowledge from growing factual knowledge — a theoretical construct, not architectural modules. High-frequency facts learned earlier; low-frequency facts may never be learned due to capacity limits. Fluent generation ≠ factual accuracy.
3.2 Retrieved Documents, Wrong Version
RAG retrieves relevant docs but may surface outdated rule versions. Example: satisfaction rule v1 (check original amount) vs v2 (deduct other coupons first). Both docs match query; using v1 yields 240 yuan final price, v2 yields 270 yuan. Verification must split into: source authenticity, rule applicability to this order, correct calculation per that rule. Architecture: documents for terminology, business services for versioned rule execution and trial calculation, model for query composition and result explanation. Query must include activity, order time, channel, user eligibility; service returns applicable rule version. Discrepancies between doc and service trigger human confirmation.
3.3 Auditable Calculation Traces
Trial-calculation service should return: rule version & content, input amounts & eligibility judgments, threshold decision (order, amounts), final amount, data sources & timestamps, trace ID linking request to all records. Structured logs enable automated comparison of model explanation against ground truth. Test harness: fix trial record, generate three candidate explanations (correct, wrong amount, wrong reason) and verify detection.
4. Error Containment and Recovery
4.1 Narrowing Scope from Symptoms
Interpretability research (Q-Align) aligns cross-lingual safety representations at user-input end, not model-output end, to avoid signal mixing. Business debugging analogously decomposes "model judgment error" into checkable steps: did it query approval system? did it use the returned result? Controlled experiment: fix activity, content, doc claiming "approved", vary approval service response (reject/approve) — expect stop vs continue.
4.2 Preventing Erroneous Execution
Audit models have blind spots (multi-hop reasoning, critical omissions). Enforce business constraints at tool/service layer: authorize per activity, field, operation type. Pre-execution checks: task allows modifying activity A? operation type generate-draft vs publish? content matches approved draft? budget still sufficient? Re-verify at execution time. Isolated test: grant only "generate draft for activity A", submit three requests (draft A, publish A, draft B) — only first should succeed. Audit logs should summarize object, authorization, key params, result; retain link to raw evidence; never rewrite "request accepted" as "config effective".
4.3 Handling Failures and Timeouts
On anomaly: pause downstream automation, determine execution state. Categories: missing data (pause, record gaps), unauthorized request (service rejects, stop), write timeout (mark pending, query status, retry only after idempotency guarantee), confirmed bad config (pause, rollback per playbook), unknown impact (escalate with executed actions and unknowns). Distinguish API acceptance from business effect: "accepted" ≠ "published". Post-recovery verification must check impacted orders/entitlements during error window. Human handoff requires structured handover (confirmed impact, actions taken, open risks, evidence links) and its own SLA verification.
4.4 Trade-offs in Remediation
Choosing between full activity pause vs single-channel pause requires comparing impact on normal users vs affected users, and evidence that anomaly is channel-isolated. Schwartz value dimensions remind decision-makers to consider stakeholder interests and hidden costs. Model can structure options but must not auto-optimize a single metric. Evaluation must check for omitted affected parties, concealed costs, or conflation of "business goal alignment" with "user interest".
5. Starting Point for Business AI Assistants
5.1 Selecting Tasks Worth Delegating
Phase 1: explain existing order discounts (why no full-reduction, how amount calculated). Leverage existing query/trial services; keep transactional execution (eligibility, calculation, fulfillment) in deterministic systems. Validate two improvements: unified data view reduces search time; AI explanation reduces rule interpretation time. Compare three workflows: (1) legacy multi-system query, (2) unified page with fixed templates, (3) unified page + AI explanation. Measure accuracy, total time (including rework), and human review cost. Rotate task order to control learning effects.
5.2 Proving Real Benefit
Three-layer validation: (1) model uses given info correctly (fixed service responses, varied phrasing/rules/missing data), (2) end-to-end flow reliability (real queries, check params, calls, error handling), (3) user benefit (compare three workflows on same tasks). Separate tuning set from acceptance set; stratify by activity, rule combo, time period. Track error types per stratum. Calibration curves (Lexin Zhou) assess predictor reliability: predicted 80% success group should actually achieve ~80% success. ECE 0.011 in-distribution, 0.022 out-of-distribution.
5.3 Post-Change Validation in Peak Preparation
New channel B added → existing tests don't cover it. AI can assist by linking change records to test cases, flagging gaps (e.g., "full-reduction verified" but only for channel A). Validate with historical peak-prep cases: does AI find missing tests? false positives? accurate evidence? reduced manual review time? Expand task scope (draft config, monitoring summary) separately from execution permissions (modify budget, publish config) which require Section 4 authorization tests.
5.4 Context Efficiency Without Losing Critical Info
Ma Yanbiao's intrinsic dimension (ID) and health metric H = log(D_world) × V / exp(ε × D_stim), where ε = 0.1. On BFCL v3, H correlates with benchmark rank (Spearman 0.75) vs ID alone (-0.445). H requires hidden states; for API-only models, test task-type/source-count/condition-combo heuristics. Compare two context strategies: full retrieved records vs pre-filtered by activity/time/validation-scope. Adopt only if quality maintained and cost/latency reduced including re-fetch and rework.
6. Translating Research Conclusions to Engineering Judgments
6.1 Evidence Hierarchy
Theory proofs → possibility under assumptions. Controlled experiments → observed regularities under controlled variables. Mechanistic analysis → explanatory hypotheses. Black-box tests → behavioral robustness. None substitutes production validation.
6.2 Synthetic Tasks ≠ Real Business
Synthetic tasks (anchor functions, SCAN, COGS, SlimPajama) control data/model/optimizer but lack real-world permissions, timeliness, side effects. Paper improvements (few percent) must be viewed with baselines, data, compute, human effort, failure cases. Benchmark accuracy ≠ business value.
6.3 Engineering Cost Accounting
Case memory needs curation; audit logging needs storage/verification; context filtering may increase re-fetch. Evaluate: problem solved vs data prep, latency, compute, human review. Research methods can backfire: full-parameter fine-tuning with H-reward on Qwen3-1.7B dropped GSM8K accuracy 83.9%→80.7%, tokens 300→1419. Correctness-gated rewards (H only for correct answers) subordinate auxiliary metrics to task correctness but still require reliable correctness judgment (process errors not just final answer).
7. Conclusion: From Answering to Doing
Theory and benchmarks illuminate capabilities but cannot certify an AI application. Practical deployment must verify: necessary information retrieved and correctly used, task constraints and permissions obeyed, limitations honestly communicated when data missing or execution fails. Judge utility by starting with scoped tasks: define "done well", compare current vs AI-assisted under identical data/permissions/tasks, measure accuracy, executed steps, and total time including human review, rework, retries. Separate improvements from workflow changes vs AI assistance. Adoption decisions per task based on its own validation results.
Appendices
8.1 Course Reference Index
Table mapping article topics to ADL174 session codes (S0–S13, P1–P3) with slide ranges.
8.2 Research-to-Engineering Checklist
Seven questions: problem solved with evidence, conditions of conclusion, comparative baselines, full costs (compute, latency, data, maintenance), unproven claims (OOD, scale, distribution shift, failures), business validation plan (independent samples, verifiable metrics, error categories, stop criteria), rollback plan.
8.3 Glossary
Definitions for ADeLe, requirement profile, capability profile, SCC, probability calibration, ECE, I.D./O.O.D., ICL, CoT, coalescence, compositional generalization, Turing completeness, ablation, CBR, F1, RAG, idempotency, business correctness validation, Schwartz value dimensions, token efficiency, intrinsic dimension, H metric.
8.4 References
Workshop materials (S0–S13) and cited papers (Pérez et al. 2019; Hahn 2020; Merrill & Sabharwal 2023).
For questions about attribution, corrections or content rights, please contactand we will review it promptly.