Runaway whitespace under JSON-schema structured output (vLLM/xgrammar) — not seen with the official FP8 checkpoint

#2
by KoliaNik - opened

Heads-up rather than a bug report — this may be useful to other users of the checkpoint and possibly to whoever re-runs the calibration.

Serving Inferact/Qwen3.8-27B-NVFP4 (revision 6128240e) on vLLM 0.28.0 (2× RTX 5090, TP=2, default xgrammar structured-outputs backend, MTP speculative decoding), we see the following with response_format={"type": "json_schema", ...}: roughly a third of requests produce a well-formed JSON prefix, stop right after a key ("user_problems": in our schema), and then emit only spaces / tabs / newlines until max_tokens is exhausted. The response is HTTP 200 with finish_reason="length", so it looks like a successful answer to the client. Without the grammar (JSON by instruction, validated afterwards) the same prompts are fine 15/15.

What we could isolate over two maintenance windows:

  • It is not the engine flags: without speculative decoding 11/30, without async scheduling 7/30, baseline 12/30.
  • It is checkpoint-specific: the official Qwen/Qwen3.8-27B-FP8 (revision 017b9c7a) on the same engine, same flags, same schema and prompts did not do this once in 60 requests over two independent launches, with arrays populated.
  • The only server-side mitigation in vLLM (disable_any_whitespace) stops the runaway but makes this checkpoint emit empty arrays (29/30).

Full numbers and environment: https://github.com/vllm-project/vllm/issues/38696#issuecomment-5522658891 (the underlying engine issue is that xgrammar's JSON grammar allows an unbounded whitespace run, so a checkpoint whose whitespace-token probabilities are slightly shifted can stay "grammatical" forever).

Two questions, if you have a moment:

  1. Did the calibration set include any JSON / code-like data? A plausible mechanism is that whitespace tokens in value positions got their probabilities shifted during NVFP4 calibration.
  2. Have you seen this with other Qwen3.8 NVFP4 builds? We plan to test a couple more quants and can report back here.

Thanks for publishing the checkpoint — apart from this, it has been our production model since August.

Sign up or log in to comment