Nemotron 3.5 Parse needs 4 to 20 seconds per page on my DGX Spark, and vLLM returns the page in one piece. The header is decoded in the first half second. You get it when the last table cell is done.
The output format
The model writes each region as one block:
<x_0.0527><y_0.0133>THE GOLDMAN SACHS GROUP, INC. ...<x_0.4277><y_0.0445><class_Page-header>
<x_0.0518><y_0.0672>\begin{tabular}{ccccccc} ... \end{tabular}<x_0.4707><y_0.7344><class_Table>
Two coordinates, the content, two coordinates, a class. Each coordinate and each class is a single token.
Nothing after the class token refers back to the block, so the block is done when the class arrives. Set stream: true and skip_special_tokens: false, and vLLM streams the tags.
The parser
A tokenizer splits the deltas into x, y, class and text tokens. It holds a half-received tag like <cla until the > arrives, up to the length of the longest tag. Past that, it's text, so a < b in a sentence stays text.
A state machine with five states consumes the tokens:
class State(StrEnum):
OUTSIDE = "outside"
AFTER_X0 = "after_x0"
TEXT = "text"
AFTER_X1 = "after_x1"
AFTER_Y1 = "after_y1"
def consume(self, token: Token) -> Iterator[Block]:
if self.state is State.OUTSIDE:
if token.kind is Kind.X:
self.pending = [token]
self.state = State.AFTER_X0
return
if self.state is State.AFTER_X0:
if token.kind is Kind.Y:
self.start = (self.pending[0].value, token.value)
self.pending, self.text, self.state = [], [], State.TEXT
return
self.pending, self.state = [], State.OUTSIDE
yield from self.consume(token)
return
if self.state is State.TEXT:
if token.kind is Kind.X:
self.pending = [token]
self.state = State.AFTER_X1
return
if token.kind is Kind.CLASS and not self.text:
self.state = State.OUTSIDE
return
self.text.append(token.raw)
return
if self.state is State.AFTER_X1:
if token.kind is Kind.Y:
self.pending.append(token)
self.state = State.AFTER_Y1
return
self.demote_pending()
yield from self.consume(token)
return
if token.kind is Kind.CLASS:
yield self.close(token.label)
return
self.demote_pending()
yield from self.consume(token)
Two cases come up in real output. A coordinate token in the middle of content, or an x without a y: demote_pending puts the held tokens back into the text, and parsing stays inside the block. And on 5 of the 503 ParseBench table pages, the model writes <x><y><class_Page-footer> with no content, then the real block. NVIDIA's postprocessing strips that first, so the parser drops a class token that arrives before any content.
Fed seven characters at a time, all 503 pages produce the same blocks as NVIDIA's pipeline. Each block goes out as one JSON line.
One page
A half-year report page with two tables side by side, one request:
| Box | Arrived | Class |
|---|---|---|
| 1 | 0.19 s | Page-header |
| 2 | 3.03 s | Table, left |
| 3 | 6.57 s | Table, right |
| 4, 5 | 6.62 s | Page-footer |
The header arrives 6.4 s early, the left table 3.6 s early. The GPU does the same work.
Repetition loops
12 of the 503 pages ran to the 8,744-token cap, repeating a row until cut off. They are 2.4% of the pages and 12.8% of the generated tokens.
A streaming client sees the second identical block and cancels, and vLLM hands the slot to the next page. NVIDIA ships a logits processor that breaks the loop server-side after ten repeats. I run both.
Limits
Throughput doesn't change.
A table completes after its whole LaTeX body, so big tables still arrive in one piece. Splitting on \\ rows would fix that. I haven't needed it.
JSON through structured output is out. The model never saw JSON, and a grammar would make it spell coordinates digit by digit. Coordinates and classes are 2.7% of the output anyway. Table bodies are 69%.