NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Reading Decisions Before Spans: Efficient Generative Verification

Yanbin Gong, Lei Chen

TL;DR

When an AI coding assistant claims "all tests passed" while the execution log shows two failures, you usually just want a quick red flag—not a sluggish, word-for-word essay detailing every hallucinated phrase. By peering into the structured JSON output of a generative verifier, the authors realized the model commits to its binary "alarm vs. all-clear" decision at a single punctuation mark before quoting a single error. Skipping straight to that single-token decision slashes verification compute time by roughly 85% with virtually zero loss in accuracy.

What Problem Does This Paper Address?

Language models hallucinate—and in developer workflows (like summarizing test logs or tool outputs), relying on an unsupported claim breaks things. To catch errors, engineers often run a secondary "generative verifier" model that reads the ground-truth evidence alongside the assistant's report, outputting a structured list of unsupported quotes and error categories.

Figure 1: Screening a developer report before relying on it. The illustrative log contradicts the assistant’s report. Both artifacts reach the same frozen verifier; the application needs an alarm before inspecting error spans. Savings and F1 use all 2,015 code-agent TEST responses, with Full official as the control.

Here is the catch: generating tokens one by one is expensive and slow. If you are just screening reports in a dashboard, you don't always need exact character offsets—you just need an alarm. You could prompt the verifier to output a simple True/False instead of its native JSON span list, or swap in a smaller model, but changing the prompt alters the "output contract" the model was trained on (which can degrade accuracy), and smaller models may lack capability. The authors ask: keeping a 2B-parameter verifier completely frozen, how little generation can we pay for to extract its native answer-level decision?

Methods

The authors examine a frozen 2B span verifier (LettuceDetect Qwen3.5-2B) that natively outputs a JSON list beginning with the exact 7-token string: {"hallucinated_spans":[ (specifically {"hallucinated_spans": followed by the list opening). Right at token #8, the model hits a structural fork in the road: it emits ] if everything is fine, or { to open the first error object.

To exploit this, the authors test two main shortcuts against full generation:

  • NATIVE8 (Early Stopping): Let the model greedily generate 8 tokens and stop immediately. If token 8 is {, sound the alarm; if ], all clear.
  • PREFILL1 (Syntax Prefilling + 1-Token Decode): Because those first 7 JSON syntax tokens never change, why generate them serially? PREFILL1 appends those 7 known tokens directly to the assistant's input prompt so the GPU processes them in parallel with the context, and generates just one unrestricted token (] or {).
Figure 2: Two ways to read the same native branch. NATIVE8 generates the fixed syntax before its decision; PREFILL1 processes that syntax as input and makes one unrestricted choice. The parser reads the reconstructed list branch in both cases. Arrows show execution order, not stage durations; service measurements count all input and output positions.

While assistant prefilling and syntax skipping are known LLM serving primitives, the novelty here is recognizing a span detector's structural JSON branch as a faithful binary alarm, and rigorously separating the speedups of stopping early from parallelizing known syntax. They also test FIRSTQUOTE (stopping right after the first quoted error to get a basic location pointer) and a model cascade (using a fast 307M mmBERT encoder to filter easy cases before escalating uncertain ones to PREFILL1).

Datasets

No models were trained in this study; all evaluations use existing public benchmarks from the LettuceDetect suite (Kovács et al., 2026), which features localized edits and span annotations:

  • Development (DEV): 1,026 Data2txt responses from the upstream training split, used to pin down the exact 7-token prefix and calibrate thresholds.
  • Primary Confirmation (TEST): 2,015 code-agent responses (1,014 containing actual errors).
  • Additional Cohorts: Frozen sets of 617 tool-output responses, 641 README responses, a 1,110-response modern validation mix, and 96 constructed literal tool-return pairs designed to verify the model isn't relying on lazy text shortcuts.

Key Insights and Ideas

  • Token counts lie about compute cost: NATIVE8 (prompt + 8 generated tokens) and PREFILL1 (prompt + 7 prefilled tokens + 1 generated token) process the exact same number of total logical tokens—8,621,241 across the test set. Yet PREFILL1 is ~32% faster in eager execution because GPUs process input tokens together in one parallel swoop, whereas output tokens must be decoded sequentially.
  • Preserving the native format beats forcing a boolean: When the authors prompted the exact same model on DEV to output a grammar-constrained true/false JSON field instead, F1 dropped by 2.32 points (hurting recall). Letting the model "think" in its native span-list format preserves its trained calibration.
  • Math says identical, floating-point says almost: Mathematically, prefilling 7 deterministic tokens should yield the exact same 8th token as generating them one by one. In practice, parallel prefill kernels and sequential decode kernels use slightly different finite-precision math trajectories, flipping the final decision on 8 out of 2,015 test responses!

Key Results

Service time and F1 scores across eager and compiled execution settings

Figure 3: Quality and service cost of native readouts. Top: eager execution on two cohorts, with separate bar scales and clocks. Bottom: default compiled execution on the complete code-agent workload; seqcap is the maximum active sequences, and service totals include two full passes. F1 measures agreement with released references. Three of 126 paired observations at seqcap eight are slower with PREFILL1. Paired intervals and decision changes are reported in the text.
  • Massive Speedup, Same Quality: On the 2,015 code-agent TEST set (eager mode on an H100 GPU), PREFILL1 drops resident service time from 446.41s (Full) to 67.67s—an 84.84% reduction—while achieving an F1 of 83.43 vs. 83.41 for full official generation. It cuts 31.98% off NATIVE8 (99.48s).
  • Survives Compiler Optimization: When re-run with PyTorch compilation and CUDA Graphs enabled, PREFILL1 still beats NATIVE8 by 26.73% at batch concurrency 1, and 6.74% at concurrency 8 (where batching amortizes decoding overhead), with negligible F1 shifts (-0.12 to +0.27 points).
  • Partial Localization (FIRSTQUOTE): Stopping after the first quoted error cuts service time by 51.94% while preserving all raw alarms, sacrificing only 0.59 F1 points on location mapping.
  • Encoder Cascade: Optimizing the 307M encoder with FlashAttention-3 windows drops its median latency to 44.1 ms (faster than PREFILL1), though its standalone F1 is 6.10 points lower on code-agent TEST. On modern validation, routing only uncertain encoder predictions to PREFILL1 (Abs0 gate) trims another ~34% off PREFILL1's time at a modest F1 trade-off (91.03 vs. 94.48).

Limitations and Future Work

The authors are refreshingly candid about what this method does and doesn't do:

  • Single Checkpoint & Grammar: All findings rest on one frozen 2B model family that reliably emits a fixed 7-token JSON prefix.
  • No Locations or Categories: An alarm tells you that something is wrong, not where it is—nor does checking a report against a log prove that underlying code patches actually work in deployment.
  • Billing vs. Compute Reality: Because PREFILL1 reduces total token volume by only 0.91% relative to full generation (long input prompts dominate token counts), this trick saves massive GPU resident service time if you host your own models, not money on per-token commercial APIs.
  • No Future Work Speculation: Beyond noting that human review of dataset/model licenses is required before external artifact release, future research directions are not discussed in the paper.

Summary updated

BibTeX
@misc{gong2026reading,
  author = {Yanbin Gong and Lei Chen},
  title = {{Reading Decisions Before Spans: Efficient Generative Verification}},
  year = {2026},
  eprint = {2611.32931},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32931},
}
Figure