Large language models (LLMs) have renewed interest in Page Stream Segmentation (PSS), splitting a multi-page file into its constituent documents. Yet published LLM methods still frame the task as boundary classification over one or a few neighboring pages, and commercial document-splitting APIs do not disclose their methods. We reimagine PSS for LLMs as a sequential process over the whole stream and propose RICoT (Recurrent Interleaved Chain-of-Thought), a prompting framework that works through the pages as a reader would: within a sliding window it reasons about each page and commits its boundary decision before moving on, and across windows it carries forward a compact record of what it has read, keeping per-call cost bounded. We also introduce FinancePSS-205, a benchmark of 205 real-world, de-identified financial page streams, to be released publicly. On FinancePSS-205, RICoT matches or outperforms pairwise and windowed prompting with the same backbone for each of three open-weight LLMs; on a TABME test subset, RICoT with GLM-5 reaches document F1 0.847 and boundary F1 0.915, above published zero-shot results. A 2B-parameter student, trained on a larger teacher's decisions with and without the page-level reasoning, performs comparably in both modes and comes within 0.05 document F1 of the strongest prompted model on FinancePSS-205.
Figures & tables
Figure 1: Page Stream Segmentation task. A stream of six pages is segmented into four documents: two invoices (pages 1–2 and 3), a delivery receipt (pages 4–5), and an email (page 6). Each document may span one or more consecutive pages.
Figure 2: RICoT architecture. Window Wc processes its pages with interleaved per-page reasoning and decisions, receiving reasoning history H(c) and active-segment summary A(c) from preceding windows. Recurrent state and the per-page two-axis decision (segment + sub-document) extend effective context beyond the window boundary while keeping per-window inference cost bounded.
TABME-250
Tob800
FinPSS
Streams
250
1
205
Segments (docs)
2,627 (1,542)
153
685
Pages
7,271 (4,240)
259
1,772
Pages/stream
29.1 / 27 / 3 / 81
259 †
8.6 / 5 / 2 / 82
Segs/stream
10.5 / 10 / 3 / 19
153 †
3.3 / 2 / 1 / 44
Segment length
2.8 / 1 / 1 / 20
1.7 / 1 / 1 / 17
2.6 / 2 / 1 / 66
Table 1: Test-set statistics. TABME segment/page counts shown as total (unique) since TABME composes its streams from a shared pool of source files (Appendix B ). Stream statistics reported as avg/med/min/max; † Tobacco800 is evaluated as a single continuous stream, so per-stream distributional statistics do not apply.
FinancePSS-205
Tobacco800
TABME-250
Model
DocF1
PageF1
MNDDμ
DocF1
PageF1
MNDDμ
DocF1
PageF1
MNDDμ
G4.7-F
0.762 (0.741)
0.898 (0.884)
1.005 (1.225)
0.867
0.949
48.0
0.683
0.829
5.65
G4.7
0.832 (0.795)
0.916 (0.884)
0.848 (1.255)
0.961
0.987
7.0
0.794
0.892
3.31
C-H4.5
0.776 (0.739)
0.880 (0.831)
1.172 (1.647)
0.957
0.984
8.0
0.816
0.910
2.88
G5
0.826 (0.769)
0.906 (0.864)
0.975 (1.422)
0.967
0.987
3.0
0.847
0.922
2.40
Q3.5-2B (base)
0.445
0.688
3.103
0.396
0.664
167.0
0.281
0.563
14.62
Table 2: Headline cross-dataset results for RICoT. DocF1 / PageF1 higher is better; MNDDμ lower. FinancePSS numbers show with-expand outside parentheses and without-expand inside; without expand, predicted sub-document starts count as continuations, which is how TABME and Tobacco800 are scored throughout. TABME-250 / TABME-full reported separately for the distilled model. Bold marks the column best. ⋆ fine-tuned rank- 32 QLoRA; PwT pagewise thinking enabled. F Full 5,000 -stream TABME test set (vs. 250 -stream prompting subset).
Configuration
G4.7-F
G4.7
G5
RICoT (full)
0.762
0.832
0.826
− pagewise thinking
0.688 ( −.074 )
0.784 ( −.048 )
0.738 ( −.088 )
− context propagation
0.752 ( −.010 )
0.837 ( +.005 )
0.778 ( −.048 )
− carry-forward block
0.736 ( −.026 )
0.841 ( +.009 )
0.795 ( −.031 )
− grounding
0.695 ( −.067 )
0.831 ( −.001 )
0.755 ( −.071 )
− expand (no-expand)
0.741 ( −.021 )
0.795 ( −.037 )
0.769 ( −.057 )
Table 6: Component ablations on FinancePSS-205 DocF1. Each row removes one component from the full RICoT (with-expand) configuration; Δ shown in parentheses. “Carry-forward block” removes only the model-emitted κ .
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Model
PageP
PageR
Gap
G4.7-F
0.733
0.955
+0.222
G4.7
0.832
0.962
+0.130
C-H4.5
0.861
0.965
+0.104
G5
0.873
0.978
+0.105
Appendix
Table 11: TABME-250 page-level precision/recall under RICoT prompting.
Weighting
A1
A2
B
C
Per sampled case ( n=100 )
14
27
44
15
Per distinct site ( 98 )
13
27
45
15
Per FP occurrence
17
33
33
17
Appendix
Table 12: Share (%) of TABME false boundaries by category, Q3.5-2B ⋆ , full test set. “Per FP occurrence” weights each site by how often it is a false boundary across the test set. Each share is uncertain by about ±10 points.
Figure 3: Separate documents inside a single TABME source file. In each pair, the right page (red border) is where the model started a new document; TABME’s ground truth treats it as a continuation of the left page (grey border) because both belong to the same source PDF.
Mode
In
Out
Int.
Ext.
Dec.
C-fwd
no-think
752
172
0
0
142
21
pagewise
797
232
0
72
126
20
windowed
772
251
0
83
128
20
int.+pagewise
767
722
528
44
115
16
int. only
736
823
674
0
110
17
Appendix
Table 13: Per-page output-token cost on GLM-4.7-flash, FinancePSS-205, broken out by component. Input is roughly constant across modes. Int. = internal reasoning tokens; Ext. = external (pagewise) reasoning tokens.
Dataset
Configuration
G4.7-F
G4.7
G5
FinancePSS
think (full)
0.762
0.832
0.826
windowed_think
0.754
0.814
0.746
wo_think
0.688
0.784
0.738
Tobacco800
think (full)
0.867
0.961
0.967
windowed_think
0.846
0.968
0.981
wo_think
0.822
0.942
0.981
Appendix
Table 14: Interleaved-thinking ablation, DocF1 by dataset and model.
Scanned mail, uploaded PDFs, and consolidated attachments often arrive as page streams that must be split into individual documents before downstream classification, extraction, or routing. Zero-shot large language models can detect document boundaries without task-specific training, but standard Page Classification (PC) and Boundary Decision (BD) formulations resolve only one boundary per model call. We introduce Multi-Split Boundary Decision (MSBD), which predicts multiple boundaries within a page window in a single call, reducing the number of inference requests. We evaluate MSBD across multiple language models, document collections, input modalities, and window sizes. The results reveal a model- and corpus-dependent operating range in which MSBD preserves strong segmentation accuracy while substantially improving inference efficiency, followed by a sharp decline at larger windows. MSBD provided the strongest overall accuracy--efficiency trade-off, while large windows expose distinct over- and under-segmentation behavior across models. These findings show that multi-boundary prediction can make zero-shot page stream segmentation more efficient when the window size is selected for the target corpus.
Large language models (LLMs) receive each user message as plain text, even when it combines text from different sources. For example, a user may paste text into a prompt and keep typing a comment directly below it. We study absorption: a phenomenon where the model treats a trailing user comment as part of the pasted text, returning it inside the edited text. This happens even though the user did not intend the comment to become part of that text. Existing instruction-data separation benchmarks tell the model which text is instruction and which is data, then test whether it obeys that separation. They do not test harmless user speech following an unmarked paste. We introduce SEAM, a controlled benchmark of 300 editing examples. Each example is tested under six matched conditions that vary how the boundary between pasted text and later user speech is expressed. Across 20 models, absorption at a bare newline ranges from 7.7% to 66.7%. Adding a blank line does not significantly reduce absorption in any model, while boundary markers reduce it in 19 of 20 models. Comments that fit the pasted text, such as a code comment typed after code, are absorbed significantly more often in 17 of 20 models. Models often fail to separate pasted material from later user speech, and explicit boundaries reduce but do not remove this failure.
End-to-end document parsers provide a unified interface, but serialize page layouts and regional contents into one autoregressive sequence. This formulation forces independent regions onto a decoding path whose length grows with the total content, whereas crop-based two-stage parsers expose region-level parallelism at the cost of repeated visual prefills and fragmented page context. To retain full-page context while removing dependencies, we propose PaDoc, a layout-grounded parser that treats the predicted layout as a branching structure over a shared page representation. Under a region-sufficiency assumption, we derive a prefix-conditioned factorization in which the layout stream and regional content branches advance concurrently, reducing the decoding depth to the longest layout-content path. We realize this factorization within a single MLLM: packed variable-length ancestor attention preserves the visibility under standard next-token training, while masked parallel decoding creates branches that the evaluated vLLM backend serves as concurrent requests with cache-resident shared-prefix reuse. On OmniDocBench Full, PaDoc attains an Overall layout F1 of 91.1 and, among end-to-end parsers, a top-tier Overall score of 94.24 together with the best Text Edit (0.038) and Formula CDM (95.59). On a 384-page subset and one A800 GPU, it is the fastest end-to-end parser at five concurrency levels, improving valid-page throughput by 67.4-118% and reducing P95 latency by 39.2-54.9% relative to a same-backbone Sequential SFT baseline. Code is available at https://github.com/Longin-Yu/Padoc