Ask a frontier or mid-tier LLM to read a dense scientific text and synthesize source-grounded multiple-choice verification probes, and the output looks production-ready at a glance. Inspect the candidate foils closely, however, and four structural failure modes appear consistently.
While benchmarking a document-grounded Q&A synthesis pipeline against a 41,364-character, 38-section physics monograph (Richard Feynman’s “The Relation of Physics to Other Sciences”), baseline single-pass generation failed along predictable axes:
- RAG-trapped circularity: Feynman remarks in passing that an enzyme “does not care in which direction the reaction goes, for if it did it would violate one of the laws of physics” — without naming the law in that passage. Strictly grounded to the text, the generator asked why enzymes show no directional preference and keyed: “Because favoring one direction would require something that violates a law of physics.”
- Surface-heuristic length leakage: Verified keys routinely ran 23–28 words of hedged, clause-heavy precision alongside 12–15 word throwaway foils — allowing downstream models or human test-takers to pass via length heuristics without reading the source.
- Domain-implausible foils: On a probe testing how spectroscopy proves stars are composed of terrestrial elements, Candidate Foil C read: “Stars were sampled directly by spacecraft.”
- Positional attention clustering: Handed all 38 sections in context, generators concentrated ~50% of probes on Biology (enzymes, nerves, DNA) while omitting Astronomy and Geology entirely.
The default industry fix is LLM-as-a-Judge: place a second autoregressive model downstream with a multi-criterion rubric to score and filter defective items. To test whether a generative rubric judge actually catches these failures, I built an evaluation harness pitting deepseek-flash against Jev (jev-1.14.0), TypeSafe AI’s non-autoregressive “System-1” discriminative model trained via Reinforcement Learning for Calibrated Decisions (RLCD).
The empirical gap between the two architectures forced a complete redesign of how I gate synthetic data and RAG pipelines.
Experiment 1: Generative Rubric Judge vs. Calibrated Discriminative Head
Unlike chat-tuned LLMs that decode paragraphs of chain-of-thought justification before emitting a scalar score, Jev generates zero prose. Given a state (source document + candidate probe) and typed decision primitives (Noul binary predicates and Choice distributions), it computes calibrated probabilities P(true) directly in a single forward pass.
Evaluating the exact same 9-probe batch under identical rubric criteria exposed severe grade compression in the generative judge:
| Benchmark Dimension | deepseek-flash(Generative Rubric) | jev-1.14.0(Discriminative RLCD) |
|---|---|---|
| Aggregate Score Distribution | 0.91 – 0.96 (0 flags, 9/9 PASS) | 0.881 – 0.937 (3 flags, clean separation) |
| Foil Plausibility Spread | 0.85 on 8 of 9 items (flatlined) | 54.0% – 79.0% (25-point dynamic range) |
| Probe 7 (Spectroscopy / “Spacecraft” Foil) | 0.94 PASS (0.85 foil quality) | 0.896 FLAG (54.0% FLAG foil quality) |
| Probe 8 (C¹²/C¹³ Isotopes / Circular Foil) | 0.94 PASS (0.85 foil quality) | 0.881 FLAG (61.0% FLAG foil quality) |
Most revealing was deepseek-flash’s own reasoning trace on Probe 7:
“The candidate foils represent plausible misconceptions for the domain... though the spacecraft option is somewhat implausible. Score: 0.85 / 1.00 — PASS.”
Why Generative Judges Collapse Onto 0.85
Autoregressive LLMs are not continuous floating-point regressors; they sample discrete text tokens ("0", ".", "8", "5") conditioned on preceding context. Across pretraining corpora (academic grading rubrics, peer reviews) and RLHF preference datasets, qualitative assessments of “strong overall, minor flaw” cluster heavily around 85% (B+). Once the judge’s own chain-of-thought introduces polite hedging, RLHF lenience bias combines with token-prior mode collapse, snapping continuous [0, 1] prompts onto discrete token attractors (0.85, 0.90, 0.95).
Experiment 2: Scratchpad Leakage & Persuasive Framing Bias (A/B Test)
Many agent evaluation pipelines pass the generator’s full structured output — including its internal rationale or thinking trace — straight into the evaluator prompt. To measure whether generator rationales help or corrupt calibration, I ran a paired A/B test on jev-1.14.0, holding the source text, probes, and rubric constant while toggling rationale visibility:
| Probe | Foil Quality (Rationale Stripped) | Foil Quality (Rationale Exposed) | Calibration Drift | Gate Impact |
|---|---|---|---|---|
| Probe 1 (Natural philosophy) | 70.0% (FLAG) | 87.0% (PASS) | +17.0 pts | False PASS |
| Probe 7 (Spectroscopy / Spacecraft) | 54.0% (FLAG) | 69.0% (FLAG) | +15.0 pts | Masked severity |
| Probe 8 (C¹²/C¹³ Isotopes) | 61.0% (FLAG) | 80.0% (PASS) | +19.0 pts | Flipped FLAG → PASS |
Across all three defective items Jev flagged with rationales stripped (shown above), exposing the generator’s design rationale inflated foil plausibility by +15 to +19 percentage points — and flipped two of the three from FLAG to PASS.
Generators are remarkably good at rationalizing weak outputs (“Option C is intentionally designed to test a naive direct-sampling hypothesis”). Exposed to that justification, the evaluator exhibits persuasive framing sycophancy — scoring the generator’s stated pedagogical intent rather than the surface quality of the artifact.
System Architecture: Sub-Second Parallel Gating & Field-Locked Repair
Replacing a rubber-stamp judge with a strict calibrated gate surfaces a second systems problem: if Pass-1 generation only clears a strict gate 20% of the time, naive full-item regeneration burns latency and routinely breaks verified answer keys while trying to fix weak foils.
To achieve high verified yield without multi-turn latency blowups, I structured the pipeline as a 5-stage deterministic DAG:
1. Stratified Blueprinting & Schema-First Conditioning (A/B Test)
Rather than letting a single prompt choose topics freely across 41KB of text, Stage 1 maps all 38 sections into candidate test points while deterministic TypeScript enforces a 40 / 40 / 20 complexity quota and caps per-section sampling (maxPerSection: 2).
In Stage 2 (Probe Synthesis), I ran a second A/B test comparing prose-heavy system instructions (lecturing the model on foil quality) against schema-first conditioning (stripping prose rules and placing misconception-planning fields ahead of option text inside the structured output schema, so autoregressive decoding conditions each foil on a distinct domain trap). Schema-first conditioning lifted Pass-1 clean generation from 2/10 (20%) to 8/10 (80%) while cutting planner/generator token overhead.
2. Zero-Cost Deterministic Heuristic Pre-Gate
Before invoking any neural evaluator, a deterministic pre-gate checks surface length symmetry. An item is flagged for length leakage only when the keyed answer exceeds the median foil word count by more than 1.35× and satisfies a joint word-and-character delta:
Requiring the conjunction (Δw ≥ 5 ∧ Δc ≥ 25) rather than a disjunction prevents false positives on compact noun phrases (e.g., 5 words vs. 2 words) or short-word analogies where word counts differ by 5 (22w vs. 17w) while rendered character lengths are virtually identical (109 chars vs. 108 chars). Catching true length leaks deterministically routes items straight to repair and saves ~33% of Pass-1 judge calls.
3. Isolated Dual-Call Jev Gate + Single-Call KV Cache Warm-Up
Batching all 10 probes into a single judge prompt introduces cross-item score anchoring and leaks domain clues across stems. Instead, every probe executes two isolated calls sharing a byte-identical prefix ([System Preamble + 41KB Source Text]):
- Source-Grounded Blind Solve (
Choice): Evaluates [A, B, C, D] with the answer key withheld. Requires argmax P(choice) = key with calibrated confidence above threshold; mismatches indicate ungrounded or ambiguous keys and trigger an immediate hard drop + resample. - 6-Criterion Rubric Audit (
Noul): Evaluates standalone clarity, source grounding, foil plausibility, and single-key unambiguity with generator rationales stripped.
Firing 20 isolated 41KB requests at t = 0 ms against a cold inference server causes a cache-stampede prefill: concurrent workers redundantly compute KV states for the same 41KB document before the first request commits to cache. Instead, the gate executes Probe 1’s blindSolve sequentially first (273ms) to warm the provider’s KV prefix cache in VRAM, then fans out all remaining [blindSolve, audit] pairs concurrently behind a bounded async semaphore.
4. Field-Locked Surgical Repair (max_attempts = 1)
When an item passes blindSolve (P(key) ≈ 100%) but fails foil plausibility or length symmetry, regenerating the entire item risks corrupting a verified stem and key. Instead, the repair stage freezes the stem and verified key as read-only inputs, diagnoses the specific weak foils, synthesizes replacement foils drawn from adjacent document sections within a target word-count band, reshuffles A–D deterministically in code, and runs a single Jev re-verification wave.
End-to-End Telemetry: Baseline vs. Tuned Pipeline
Benchmarking both configurations end-to-end on the 38-section physics text produced the following stage-level telemetry:
| Pipeline Metric | Run 1 (Prose Prompt + Baseline Gate) | Run 2 (Schema-First + Warmed Parallel Gate) | Delta |
|---|---|---|---|
| Blueprint Planner Output | 10,504 tokens (38.2s) | 7,617 tokens (31.3s) | −27.5% tokens |
| Pass-1 Clean Yield (Pre-Repair) | 2 / 10 (20%) | 8 / 10 (80%) | 4× Pass-1 yield |
| Surgical Repair Stage | 8 items (12.93s) | 2 items (4.16s) | 3.1× faster |
| Jev Gate Wall-Clock (Full-Doc Calls) | 24 calls (1.39s) | 20 calls / 226,136 input tokens (1.17s) | 117ms amortized per probe ~265ms per individual call |
| Blind-Solve Key Verification | 10 / 10 (98–100%) | 10 / 10 (100% on 9/10 items) | 0 broken keys |
| Total End-to-End Wall-Clock | 84.59s | 66.40s | −21.5% latency |
| Final Verified Yield | 5 / 10 (50%) | 9 / 10 (90%) | +80% yield |
Note: the single non-passing probe in Run 2 was a false-positive heuristic trigger (22w / 109 chars vs. 17w / 108 chars) under an initial || rule, which motivated tightening the pre-gate to the ∧ conjunction shown above.
On a HARD inference probe (Section 9, examining why plant biology demonstrates nerves are not a universal prerequisite for life), the 4.16s surgical repair pass resolved a 1.64× length imbalance cleanly without touching the verified stem:
- Before Repair: Key ran 18 words against a 9-word throwaway foil (“Nerve research is unimportant because plants survive without nerves”).
- After Repair: Stem locked verbatim; key tightened to 16 words; all three replacement foils landed between 13–17 words targeting substantive domain misconceptions (cellular reductionism, rudimentary plant nerve structures, bioelectrical equivalence), clearing post-repair Jev re-verification at 0.9143 aggregate (100% blind solve).
Inference Gotcha: json_schema Constrained Decoding Breaks Cross-Stage Prefix Caching
Logging cached_input_tokens per stage exposed an undocumented prefix-cache failure mode worth noting for anyone building multi-stage document pipelines.
To maximize KV-cache reuse across the Generator, Resampler, and Surgical Repair stages on the /responses endpoint, I structured every request so the first two input items — input[0] (system preamble) and input[1] (the 41KB document) — were byte-for-byte identical, placing stage-specific instructions in input[2].
Despite an identical shared leading prefix, the Surgical Repair stage consistently reported 0 cached input tokens immediately after the Generator stage — whereas Generator ↔ Resampler and all 20 Jev calls hit the prefix cache cleanly.
Likely Mechanism: The most consistent explanation is that when grammar-constrained structured outputs (text.format.type = "json_schema") are enabled, the serving engine renders the schema definition into hidden prompt tokens ahead of input[0]. The pattern fits: stages with matching schemas (Generator ↔ Resampler) hit the cache cleanly, while stages with different schemas (Generator → Surgical Repair) reported 0 cached tokens — as if their token sequences diverged at index 0, invalidating the entire 41KB document prefix downstream.
Takeaways for Production Evaluation Pipelines
- Decouple System-2 synthesis from System-1 gating. Use generative models for planning, synthesis, and constrained span editing; use calibrated non-autoregressive probability heads (Jev) for high-variance, sub-second gating free from 0.85 token-prior mode collapse.
- Sanitize judge context aggressively. Never expose generator chain-of-thought, tool scratchpads, or design rationales to an evaluator unless you want +15 to +19 percentage points of sycophancy inflation on exactly the items that should fail.
- Freeze verified spans during repair. Field-locking passing components (stems, verified claims, citations) while surgically regenerating only the failing vector turns flaky multi-turn retry loops into fast, deterministic single-pass edits.
About the author
Suyash
AI Architect · Data Scientist
I build AI systems that hold up in production — from experimentation platforms to evaluation and inference pipelines. Off the keyboard: landscape photography, martial arts, and yoga. The through-line across all of it: discipline, craft, and execution.
