AI For Engineers, Part 2: Verified Engineering Documents & Eliminating AI Slop

Series Track: AI For Engineers · Part 02 of 09 (ai-for-engineers-part-2, Modules 01–14) [10]
Architectural Scope: Five-Part Document Specifications, Staged Synthesis, Anti-Slop Controls, Three-Gate Expert Governance, Adversarial Red-Teaming & Deterministic Claim Verification [1][3]
Companion Archive (-sources.zip): Illustrative, Reproducible Synthetic Engineering Case Bundle (evidence/LOG-104.csv, evidence/SPEC-201.json, pump_report_draft.md, verify_document.py, pump_report_verified.md, audit_report.json) [1]


1. Why Single-Shot Prompts Fail & The Five-Part Document Specification (Modules 01–03)

Advancing from Episode 1's single-turn prompt mechanics—tokenization, Transformer layer continuations, and role-context-task-format framing—into Episode 2's Document and Verification Lab (Modules 01–14, led by Dr. Grace and Dr. Claude) addresses a core systems challenge: prompting techniques suited to short queries fail on multi-section failure analyses and engineering specifications [3][10]. Asking a language model to draft a ten-page failure report from a brief bench note still executes autoregressive token prediction rather than database lookup [3][5]. Even when positive temperature logit scaling (z_i / τ for τ > 0 before Softmax) is replaced by temperature = 0—implemented in inference engines as the greedy argmax decision rule (with deterministic or engine-specific tie-breaking) because division by zero is undefined—greedy decoding yields only mostly deterministic token sequences [5]. Repeatability across API calls remains subject to GPU floating-point reduction non-associativity, dynamic batching, Mixture-of-Experts routing, and backend updates tracked via system_fingerprint, and greedy argmax never guarantees factual truth [5].

When document structure, evidence boundaries, or abstention rules are left unspecified, the model bridges sections with high-probability filler, blends observations with guesses, and fabricates standard IDs or shifted metrics—a hazard classified in NIST AI 600-1 as confabulation [3]. Preventing confabulation requires expanding a basic four-part prompt into a Five-Part Document Specification grounded in Retrieval-Augmented Generation (RAG, Lewis et al., 2020), pairing parametric generation with bounded non-parametric source artifacts in context [3]:

  1. Decision Purpose and Audience: Define the reviewing engineering body and the specific disposition decision the document supports [1][3].
  2. Locked Section Skeleton: Fix section headings, technical scope, and length budgets prior to prose generation [3][4].
  3. Bounded Evidence Packet: Attach primary source files with immutable identifiers—demonstrated here via the illustrative, reproducible synthetic engineering case bundle (LOG-104.csv bench telemetry and SPEC-201.json acceptance criteria in -sources.zip) [1][3].
  4. Explicit Non-Goals: State excluded topics (such as uninstrumented lifecycle extrapolations or vendor redesign pricing) [2][3].
  5. Evidence and Unknowns Contract: Require every factual claim and number to cite [Source: ID], and mandate explicit 'UNKNOWN' abstention whenever a parameter—such as internal seal-face temperature during run LOG-104—is unmeasured [1][3].

2. Three-Stage Document Synthesis & Long-Context Recall Physics (Module 04)

Even with a Five-Part Specification, generating a multi-section report in one pass invites context drift [4]. Empirical multi-document retrieval studies by Liu et al. (Lost in the Middle, 2024) establish a U-shaped positional recall curve in long-context models: primacy and recency biases produce highest accuracy at the very start and end of the context window, while recall drops sharply for facts buried in middle positions [4]. Advertising a 128K–1M-token window specifies token capacity, not uniform recall fidelity across dense specification binders or telemetry logs [4].

Engineers counter middle-context dilution by synthesizing documents in three controlled stages [3][4]:

[GATE 1: Pre-Draft Framing] -> Curate LOG-104.csv & SPEC-201.json; lock 5-Part Spec
             |
             v
[3-STAGE SYNTHESIS + 4 ANTI-SLOP CONTROLS]
  Stage 1: Outline/Checklist -> Stage 2: Evidence Map -> Stage 3: Section Draft
  (Ban boilerplate | Units + [Source: ID] density | Tables/Schemas | Compress)
             |
             v
[GATE 2: Mid-Draft Calibration] -> Verify physics, sensor taps & UNKNOWN states
             |
             v
[4-CHALLENGE ADVERSARIAL RED-TEAM (Fresh Session)]
  Assumptions | >=3 Rivals | Steel-Man | Pre-Mortem (KSB NPSHa > NPSHr vs 84.2 °C)
             |
             v
[4-STAGE verify_document.py + GATE 3 SIGN-OFF]
  Parse claims -> CSV/JSON math check -> Entailment -> Quarantine -> Engineer signs

3. Post-Training Sycophancy, AI Slop & Enforceable Controls (Modules 05–06)

A primary hazard in generated engineering prose is AI slop: fluent text with near-zero information density that wastes reviewer attention and masks missing evidence [3][9]. Its root lies in post-training alignment [9]. Classical online Reinforcement Learning from Human Feedback (RLHF, Ouyang et al., 2022) fits a separate neural reward model to human preference comparisons and optimizes policy weights via online RL (such as PPO) with KL-divergence regularization [9]. Offline Direct Preference Optimization (DPO, Rafailov et al., 2023) analytically reparameterizes the KL-constrained reward objective in closed form, updating policy weights directly on preferred/dispreferred pairs via a binary cross-entropy loss without an explicit reward model or online RL loop [9]. Under both RLHF and DPO, preference raters can inadvertently reward confident, polished boilerplate over 'UNKNOWN' abstention, encouraging sycophancy and ungrounded polish [3][9].

Engineering AI slop exhibits four patterns: (1) throat-clearing introductions announcing generic reliability truisms, (2) vague hedge words and unquantified adjectives ("significantly improved", "various operational factors"), (3) symmetrical filler bullets restating headings, and (4) ungrounded polish masking missing data [3][9]. Engineers eliminate slop through four enforceable controls [3][6][9]:

  1. Banned Boilerplate Rule: Forbid throat-clearing openings, generic conclusions, and unquantified superlatives [3][9].
  2. Information Density Rule: Require every paragraph to carry a concrete measurement with units, a primary source citation, a causal mechanism, or a testable decision [1][3].
  3. Structured Formats & Grammar Schemas: Replace padded paragraphs with comparison tables, fault trees, checklists, or strict: true JSON Schema Structured Outputs [6].
  4. Anti-Slop Compression Pass: Delete every sentence whose removal leaves all engineering facts, citations, and requirements unchanged [3][9].
Document Hazard Underlying LLM Mechanism Prompt / Architecture Control Human & Script Verification Gate [7]
Single-Shot Confabulation Autoregressive continuation fills unspecified gaps with plausible priors [3][5] 5-Part Spec: Purpose, Skeleton, Bounded Evidence, Non-Goals, 'UNKNOWN' rule [1][3] Gate 1 (Pre-Draft Framing) + Stage 1 Outline check [3][4]
Middle-Context Recall Drop U-shaped positional curve degrades middle-buried log retrieval (Lost in the Middle) [4] 3-Stage Synthesis: Stage 2 Evidence Map + boundary-placed subsystem chunks [3][4] Gate 2 (Mid-Draft Calibration) against primary files [1][4]
AI Slop & Polite Boilerplate Online RLHF (reward model + PPO) & offline DPO (binary cross-entropy) favor fluent confidence [9] Banned Boilerplate, Density Rule, tables/schemas [6], Compression Pass [3][9] Anti-Slop pruning pass + Gate 2 density audit [3][9]
Premature Root-Cause Lock-In Conversational sycophancy reinforces initial user framing without physics checks [2][9] Separate-session 4-part Adversarial Review (Assumptions, ≥3 Rivals, Steel-Man, Pre-Mortem) [2][3][9] Gate 2 / Gate 3 KSB NPSHa > NPSHr & thermal audit [1][2]
Micro-Hallucinations (94.2 °C, SPEC-992) Probabilistic decoding & valid JSON types still admit drifted floats and fake IDs [1][5][6] Standardized [CLAIM-XX], [Source: ID], [Metric: field=value] claim syntax [1][3] Gate 3 (Post-Draft Redline) via verify_document.py [1]

4. Engineer of Record, Three Checkpoints & Citation Boundaries (Modules 07–08)

Removing slop improves readability, not truth [2][3]. Language models lack physical intuition, lab instrumentation, and professional liability [3][5]. The model accelerates mechanical drafting—organizing raw notes, cross-referencing LOG-104.csv timestamps, formatting traceability tables, and drafting initial sections—while the human Engineer of Record owns problem framing, physical boundary conditions, governing equations, safety/regulatory trade-offs, and final sign-off [1][2][3].

Active governance enforces three mandatory expert checkpoints [3][4]:

Source-citation tools assist Gates 2 and 3 when paired with strict data and verification discipline [7][8]. For data governance, engineers must separate four distinct controls: (1) model training opt-out / frozen weights (for instance, Google NotebookLM does not train base Gemini weights on user uploads [8]), (2) provider operational/safety request log retention windows, (3) TTL-bounded inference KV/prefix caches, and (4) persistent workspace or notebook document stores [8]. For verification, Anthropic Citations anchors sentences to character-index intervals in plain text or PDF page ranges outside billed output tokens [7], while NotebookLM restricts responses, briefings, mind maps, and overviews to uploaded sources with clickable passage links [8]. Neither feature guarantees exhaustive claim coverage, prevents misreading dense tables or subtle clauses, or validates source truth; human review and deterministic scripts remain mandatory [7][8].


5. Adversarial Red-Teaming & Impeller-Eye Cavitation Physics (Modules 09–10)

Fluent explanations trigger human confirmation bias and model sycophancy [3][9]. Engineers counter both by running a separate, unprimed adversarial session executing four challenges [3][4][9]: (1) Assumption Extraction (listing unstated physical and sensor assumptions), (2) Rival Hypotheses (requiring at least three alternative physical mechanisms), (3) Steel-Man Counterargument (arguing in a fresh session why the main recommendation could fail), and (4) Pre-Mortem Check (assuming field failure and tracing the likeliest blind spot) [2][3][9].

Consider how adversarial red-teaming redirects root-cause analysis on the reproducible synthetic engineering case bundle (LOG-104.csv and SPEC-201.json) [1]. Endurance log LOG-104.csv records three states: at 14:05:00 (THERMAL_RISE_DETECTED), suction_psi = 34.2, vapor_pressure_psi = 14.8, discharge_drop_psi = 1.2, housing_temp_c = 84.2; at 14:08:12 (PRESSURE_DROP_EVENT), suction_psi = 33.8, vapor_pressure_psi = 14.8, discharge_drop_psi = 18.4, housing_temp_c = 83.9; and at 14:12:00 (HOLD_TEST_REQUIRED), suction_psi = 34.0, vapor_pressure_psi = 14.8, discharge_drop_psi = 17.9, housing_temp_c = 82.5 [1]. Against SPEC-201.json, discharge_drop_psi = 18.4 psi (14:08:12) breaches max_allowed_drop_psi = 5.0 psi by 13.4 psi [1].

Suppose an initial draft blames pump cavitation at 14:08:12 [1][2]. Adversarial review against LOG-104.csv and KSB centrifugal pump hydrodynamics uncovers two decisive constraints [1][2]:


6. Deterministic Auditing (verify_document.py) & Playbook (Modules 11–14)

In twenty-page drafts, human reviewers easily miss transposed digits (84.2 °C → 94.2 °C) or fabricated standards (SPEC-992) [1][3]. Neither schema-constrained decoding nor neural judges suffice alone [5][6]. strict: true JSON Schema Structured Outputs enforce context-free grammar syntax only on completed, non-refused responses—requiring explicit handling for safety refusals, max_output_tokens truncation, and semantic hallucinations inside valid numeric/string fields [6]. Likewise, temperature = 0 entailment checks (such as Ragas faithfulness [3] under greedy argmax [5]) supplement but never replace exact arithmetic against primary logs [1][3][5].

Bundled script verify_document.py (python3 verify_document.py --draft pump_report_draft.md --sources evidence) executes four stages [1]: (1) Atomic Claim Extraction parsing [CLAIM-XX], [Source: ID], and [Metric: field=value]; (2) Deterministic Source & Math Audit checking file existence in evidence/ and CSV/JSON float matches (tol = 1 × 10⁻³) to flag FAIL_UNCITED, FAIL_PHANTOM_CITATION, FAIL_UNGROUNDED_METRIC, or FAIL_NUMERIC_DRIFT; (3) Grounded Entailment Check scoring prose faithfulness at temperature = 0 [3][5]; and (4) Redline Quarantine Output writing pump_report_verified.md and audit_report.json (4 claims: 2 PASS, 2 QUARANTINED) [1].

Claim ID Draft Claim, Citation & Metric (pump_report_draft.md) [1] Ground Truth (LOG-104.csv / SPEC-201.json) [1] verify_document.py Result Engineering Consequence
CLAIM-01 Discharge drop 18.4 psi at 14:08:12 [Source: LOG-104] [Metric: discharge_drop_psi=18.4] [1] LOG-104.csv (14:08:12): discharge_drop_psi = 18.4 [1] PASS (Exact numeric match) [1] Confirms 13.4 psi breach over SPEC-201 5.0 psi limit [1]
CLAIM-02 Peak housing temp 94.2 °C [Source: LOG-104] [Metric: housing_temp_c=94.2] [1] LOG-104.csv records [84.2, 83.9, 82.5] (peak 84.2 °C at 14:05:00) [1] QUARANTINED (FAIL_NUMERIC_DRIFT) [1] Prevents false +9.2 °C breach; 84.2 °C is within 85.0 °C ceiling (0.8 °C margin; internal face UNKNOWN) [1]
CLAIM-03 Seal verified per aerospace standard [Source: SPEC-992] [Metric: max_seal_temp_c=150.0] [1] SPEC-992 absent from evidence/ (LOG-104.csv, SPEC-201.json only) [1] QUARANTINED (FAIL_PHANTOM_CITATION) [1] Removes confabulated 150.0 °C rating masking SPEC-201's 85.0 °C limit [1][3]
CLAIM-04 Next test: 30-minute pressure hold at 120 psi [Source: SPEC-201] [1] SPEC-201.json: next_verification_test = "30-minute pressure hold at 120 psi" [1] PASS (Entailed by SPEC-201) [1] Clears hydrostatic hold test to isolate seal bypass [1][2]

Verified Engineering Document Playbook (Module 14)

Primary References, Runnable Case Bundles & Provenance

  • [1] Reproducible Synthetic Engineering Case Bundle — LOG-104.csv, SPEC-201.json & Runnable verify_document.py — AI Foundations Reproducible Synthetic Engineering Dataset (Bundled in -sources.zip: LOG-104.csv, SPEC-201.json, pump_report_draft.md, verify_document.py, audit_report.json). · Highlighted Case Dossier & Runnable Files · Download Runnable .zip
  • [2] KSB Centrifugal Pump Lexicon — Net Positive Suction Head (NPSH) & Cavitation Physics (S8 / R4) — KSB SE & Co. KGaA (2026). Centrifugal Pump Lexicon: Net Positive Suction Head (NPSH = NPSHa vs. NPSHr). Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [3] Lewis et al. (2020) RAG (arXiv:2005.11401), Es et al. (2024) Ragas & NIST AI 600-1 Generative AI Profile — Lewis, P. et al. (2020) Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (NeurIPS, arXiv:2005.11401); Es, S. et al. (2024) Ragas (EACL, arXiv:2309.15217); NIST AI 600-1 (2024) Generative AI Profile. · Official Primary Source · Highlighted Verification Note
  • [4] Liu et al. (2023/2024) — Lost in the Middle: How Language Models Use Long Contexts (arXiv:2307.03172, S7 / R7) — Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the Middle: How Language Models Use Long Contexts. TACL 12:157-173 (arXiv:2307.03712 / 2307.03172). Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [5] OpenAI API Guide — Reproducible Outputs, Greedy Decoding & System Fingerprint Caveats (S5 / R10) — OpenAI Developer Documentation (2026). Advanced Usage: Reproducible Outputs, temperature, and seed parameters. Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [6] OpenAI API Guide — Structured Outputs, Context-Free Grammar Decoding & Refusal/Truncation Edge Cases (S6 / R11) — OpenAI Developer Documentation (2026). Structured Outputs (strict: true JSON Schema Constrained Decoding). Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [7] Anthropic Platform Documentation — Citations Mode Span Grounding & Verification Caveats (S11 / R12) — Anthropic (2026). Build with Claude: Citations Documentation (Character, Page, and Content-Block Spans). Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [8] Google NotebookLM Help Center — Source-Grounded Chat, Inline Citations & Human Review Guidance (R13) — Google Support (2026). NotebookLM Help: Ask questions, inspect inline citations, and verify source passages. Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [9] Rafailov et al. (2023) — Direct Preference Optimization (DPO) & Ouyang et al. (2022) RLHF (arXiv:2305.18290, S10 / R8) — Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C. D., & Finn, C. (2023). Direct Preference Optimization: Your Language Model is Secretly a Reward Model. NeurIPS 2023 (arXiv:2305.18290); Ouyang, L. et al. (2022) InstructGPT (arXiv:2203.02155). Consulted 15 November 2026. · Official Primary Source · Highlighted Verification Note
  • [10] Episode Production Provenance & Module Transcript — AI For Engineers, Part 2: Verified Engineering Documents & Eliminating AI Slop — Generator Studio Remediated Episode Transcript (ai-for-engineers-part-2, Consulted 15 November 2026 — Module Continuity Provenance Only). · Open Studio Video · Module Transcript Reader

Related Topic Artifacts