RICoT: Recurrent Interleaved Chain-of-Thought for Page Stream Segmentation

arXiv cs.CL Papers

Summary

The paper proposes RICoT, a Recurrent Interleaved Chain-of-Thought prompting framework that treats Page Stream Segmentation as a sequential reading process over sliding windows with carried-forward state, and introduces the FinancePSS-205 benchmark of real-world financial page streams.

arXiv:2611.22382v1 Announce Type: new Abstract: 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.
Original Article
View Cached Full Text

Cached at: 11/19/26, 03:01 AM

# Recurrent Interleaved Chain-of-Thought for Page Stream Segmentation
Source: [https://arxiv.org/html/2611.22382](https://arxiv.org/html/2611.22382)
Bhavana MalagavalliAffiliation:HyperbotsSaiful HaqAffiliation:Indian Institute of Technology BombayNiyati ChhayaAffiliation:Hyperbots

###### Abstract

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 proposeRICoT\(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 introduceFinancePSS\-205, a benchmark of205205real\-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 F10\.8470\.847and boundary F10\.9150\.915, above published zero\-shot results\. A22B\-parameter student, trained on a larger teacher’s decisions with and without the page\-level reasoning, performs comparably in both modes and comes within0\.050\.05document F1 of the strongest prompted model on FinancePSS\-205\.

## 1Introduction

Document\-level information retrieval typically assumes predefined document boundaries\. However, real\-world “page streams”—sequences of scanned or digital pages—often bundle multiple documents into a single file\. Page Stream Segmentation \(PSS\) partitions these streams into their constituent documents \(Figure[1](https://arxiv.org/html/2611.22382#S1.F1)\), a task critical for finance automation \(AP/AR\), where batched invoices, purchase orders, and receipts are processed together; failing to segment them leads to merged field values, duplicated line items, and failed reconciliation\.

![Refer to caption](https://arxiv.org/html/2611.22382v1/figures/pss_intro.png)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\.Traditional PSS relies onpairwise classification[Wiedemann and Heyer \(2018\)](https://arxiv.org/html/2611.22382#bib.bib26);[Mungmeeprued et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib17);[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib9), deciding if pagePiP\_\{i\}starts a new document based onPi−1P\_\{i\-1\}\. This paradigm suffers from two primary limitations:

- •Contextual Isolation:Decisions often require long\-range dependencies\. For example, a remittance advice on page 11 may only be identifiable as part of a page 1 invoice via headers that a pairwise classifier cannot see\.
- •Computational Redundancy:Encoding each page twice—once as context and once as a target—doubles token costs without improving long\-range reasoning\.

Conversely,full\-stream processingfalters as sequence length grows, since LLMs degrade in long contexts[Liu et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib16)\.Windowed classification[Pottanigari et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib19)is a middle ground but is limited by fixed window boundaries\.

Our contributions are:

- •The RICoT framework\(Section[3](https://arxiv.org/html/2611.22382#S3)\): a sliding\-window PSS framework that combines interleaved per\-page chain\-of\-thought reasoning within each window with recurrent state propagation across windows—a short reasoning history and an active\-segment summary that maintain document\-level coherence for arbitrarily long streams\.
- •A distilled22B student\(Section[4](https://arxiv.org/html/2611.22382#S4)\): Qwen\-3\.5\-2B trained on Kimi\-K2\-Instruct’s RICoT outputs over a finance\-filtered subset of FinePDFs, with and without the page\-level reasoning; the two modes perform comparably, and the student comes within0\.050\.05DocF1 of the strongest prompted model on FinancePSS\-205\.
- •FinancePSS\-205\(Section[5\.1](https://arxiv.org/html/2611.22382#S5.SS1)\): a new benchmark of205205real\-world, de\-identified AP/AR page streams, to be released publicly with labels and evaluation scripts\.111The dataset, evaluation code, prompt templates, and the additional materials referenced throughout this paper \(“the public release”\) are not yet public; a URL will be added in a future version of this preprint\.
- •Extensive component ablations\(Sections[6\.4](https://arxiv.org/html/2611.22382#S6.SS4)and[6\.5](https://arxiv.org/html/2611.22382#S6.SS5)\) trace how each load\-bearing element of RICoT—pagewise interleaved reasoning, recurrent state propagation, the structured decision schema, and the deployment\-time*expand*post\-processing—contributes to the framework’s accuracy\.

## 2Related Work

#### Page stream segmentation\.

PSS has progressed from visual CNNs classifying adjacent page pairs[Wiedemann and Heyer \(2018\)](https://arxiv.org/html/2611.22382#bib.bib26)through joint text\-layout encoders[Mungmeeprued et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib17)to layout\-feature embedding schemes[Drumond et al\. \(2023\)](https://arxiv.org/html/2611.22382#bib.bib6)and efficient image\-only pipelines[Braz et al\. \(2021\)](https://arxiv.org/html/2611.22382#bib.bib4)on the Tobacco800 benchmark[Lewis et al\. \(2006\)](https://arxiv.org/html/2611.22382#bib.bib14);[University of California, San Francisco \(2007\)](https://arxiv.org/html/2611.22382#bib.bib22);[Agam et al\. \(2006\)](https://arxiv.org/html/2611.22382#bib.bib1)\.[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib9)adapt the paradigm to LLMs by prompting instruction\-tuned models on adjacent page pairs and obtain the strongest zero\-shot decoder baseline on TABME prior to our work;[Heidenreich et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib10)extend the LLM treatment with new metrics and stronger fine\-tuned baselines\. PSS has also been formalized in adjacent media, e\.g\. multimodal Transformers on comic\-book page streams[Serra Ortega et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib21), and real\-world open benchmarks of Dutch government streams have been released[van Heusden et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib23);[van Heusden et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib24)\. A common thread across this prior work is the*pairwise*assumption: boundary decisions are made independently for each page given only the immediately preceding page, which limits context to the local pair\. Concurrent MSBD[Pottanigari et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib19)predicts all boundaries of a window in one call \(the design of our Windowed baseline\) and degrades at larger windows; generation\-based segmenters[Inan et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib11);[Li et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib15)are trained and read the full input\. RICoT is zero\-shot, keeps windows bounded, reasons per page, and carries state across windows\. Commercial document\-AI services, such as LandingAI’s Agentic Document Extraction,222[https://docs\.landing\.ai/ade/ade\-split](https://docs.landing.ai/ade/ade-split)Reducto,333[https://docs\.reducto\.ai/api\-reference/split](https://docs.reducto.ai/api-reference/split)and LlamaIndex’s LlamaParse,444[https://developers\.llamaindex\.ai/llamaparse/split/getting\_started/](https://developers.llamaindex.ai/llamaparse/split/getting_started/); all accessed October 2026\.also offer document splitting, but do not publish their methods, so they cannot serve as reproducible baselines\.

#### Interleaved chain\-of\-thought reasoning\.

Chain\-of\-thought prompting[Wei et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib25)elicits intermediate reasoning steps before the final answer\. The closest precedent for the mechanism we use is ReAct[Yao et al\. \(2023\)](https://arxiv.org/html/2611.22382#bib.bib29), which interleaves*thought*and*action*steps for agentic tasks; RICoT adapts the same interleaving principle to sequential*classification*, alternating per\-page reasoning and per\-page decision within a window in one call, avoiding the per\-page cost of a multi\-call agentic loop\. Interleaved reasoning has recently been explored as a training paradigm for LLMs[Xie et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib28); our contribution is at inference time, integrated with windowed processing and recurrent state for multi\-page sequential classification\.

#### Long\-context state propagation\.

Long\-context use is limited by the lost\-in\-the\-middle effect[Liu et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib16)and by the cost of extending context windows\. Architectural mitigations[Beltagy et al\. \(2020\)](https://arxiv.org/html/2611.22382#bib.bib3);[Zaheer et al\. \(2020\)](https://arxiv.org/html/2611.22382#bib.bib30)and recursive decomposition[Zhang et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib31)change the underlying inference procedure; explicit memory\-management approaches such as MemGPT[Packer et al\. \(2023\)](https://arxiv.org/html/2611.22382#bib.bib18)pass state across turns through structured summaries\. RICoT shares the explicit\-state philosophy, instantiated for PSS as a recurrent active\-segment summary plus a short reasoning history carried across overlapping windows\.

## 3RICoT Framework

### 3\.1Task definition

Let𝐗=\(x1,…,xN\)\\mathbf\{X\}=\(x\_\{1\},\\dots,x\_\{N\}\)be a page stream ofNNpages, each represented by OCR\-extracted text and layout features\. PSS maps𝐗\\mathbf\{X\}to binary boundary labels𝐲=\(y1,…,yN\)\\mathbf\{y\}=\(y\_\{1\},\\dots,y\_\{N\}\)withyi=1y\_\{i\}=1iff pagexix\_\{i\}starts a new document; by conventiony1=1y\_\{1\}=1\. The labels induce a partitioning intoKKcontiguous documents\{D1,…,DK\}\\\{D\_\{1\},\\dots,D\_\{K\}\\\}whereDk=\(xsk,…,xek\)D\_\{k\}=\(x\_\{s\_\{k\}\},\\dots,x\_\{e\_\{k\}\}\)and\{s1<⋯<sK\}=\{i∣yi=1\}\\\{s\_\{1\}<\\dots<s\_\{K\}\\\}=\\\{i\\mid y\_\{i\}=1\\\}\.

### 3\.2Sliding windows and the two\-axis decision

RICoT \(Figure[2](https://arxiv.org/html/2611.22382#S3.F2)\) processes𝐗\\mathbf\{X\}with*token\-budgeted*windows\. Each windowWcW\_\{c\}is packed greedily with consecutive pages until the running token count would exceed a budgetBBor a page capwmaxw\_\{\\max\}is reached, with a one\-page overlapoointo the previous window\.555We useB=3600B=3600tokens,wmax=6w\_\{\\max\}=6,o=1o=1across all experiments; values were fixed*a priori*, not tuned\.This adapts window size to page density—short pages pack densely up towmaxw\_\{\\max\}, long pages truncate early—so context utilization is consistent across stream geometries\.

#### Two\-axis decision\.

For each page in the window the model emits

di=\(yi,zi,ℓi,gi,ci\),d\_\{i\}\\;=\\;\(y\_\{i\},\\,z\_\{i\},\\,\\ell\_\{i\},\\,g\_\{i\},\\,c\_\{i\}\),\(1\)where the*segment axis*yi∈\{S,C\}y\_\{i\}\\in\\\{\\mathrm\{S\},\\mathrm\{C\}\\\}marks a new segment \(S\) or continuation \(C\); on continuations, the*sub\-document axis*zi∈\{D,∅\}z\_\{i\}\\in\\\{\\mathrm\{D\},\\varnothing\\\}optionally marks a nested document instance \(e\.g\. an invoice inside a statement of account\)\.ℓi\\ell\_\{i\}is a document\-class label,gig\_\{i\}a grounding fingerprint \(page identifier \+ short evidence quote\), andcic\_\{i\}a categorical confidence \(high↦9\\textsc\{high\}\{\\mapsto\}9,mod↦6\\textsc\{mod\}\{\\mapsto\}6,low↦3\\textsc\{low\}\{\\mapsto\}3\)\.ℓi\\ell\_\{i\}is emitted only on S decisions, so each segment has one label\. Keeping segment\-start and sub\-document\-start as separate axes at decision time preserves both signals for downstream control \(Section[3\.4](https://arxiv.org/html/2611.22382#S3.SS4)\)\.

### 3\.3Interleaved reasoning and recurrent state

Within a window, RICoT generates per\-page reasoning \(<think\>\) interleaved with the per\-page decision \(<decision\>\) before moving to the next page\. We refer to this as*pagewise thinking*\(PwT\); the alternative of emitting one block of reasoning followed by all decisions is the*windowed thinking*variant we ablate in Section[6\.4](https://arxiv.org/html/2611.22382#S6.SS4)\. Interleaving grounds each decision in evidence local to its target page\.

Two recurrent state objects,\(ℋ\(c\),𝒜\(c\)\)\(\\mathcal\{H\}^\{\(c\)\},\\mathcal\{A\}^\{\(c\)\}\), are propagated across windows\.ℋ\(c\)\\mathcal\{H\}^\{\(c\)\}is an anchored recency window: up to thek=6k\{=\}6most recent thought–decision pairs, always preserving the two decisions that opened the active segment \(joined by an elision marker once they age out\)\.𝒜\(c\)\\mathcal\{A\}^\{\(c\)\}describes the currently open segment in two parts: \(i\) deterministic metadata\(s,ℓs,pages\-covered\)\(s,\\ell\_\{s\},\\textsc\{pages\-covered\}\)derived by walking back to the most recent S decision, and \(ii\) a model\-emitted<active\_segment\_carry\_forward\>blockκ\(c\)\\kappa^\{\(c\)\}summarizing anticipated content and progress for the next window\. The stream is wrapped with<stream\>/</stream\>tags so the model suppressesκ\\kappaon the terminal window where no successor exists\. Each page is decided in the first window containing it; later emissions for the overlap page are ignored\. A worked example is in Appendix[F](https://arxiv.org/html/2611.22382#A6)\.

#### Robust decoding\.

A decision cache𝒞\\mathcal\{C\}stores the most recent validdid\_\{i\}per page\. After parsing, any missing, malformed, or duplicate page is filled from𝒞\\mathcal\{C\}first; if the page will recur in the next overlapping window the correction is deferred; remaining gaps are repaired by a correction call, and finally by rule\-based fallbacks \(continuation by default, low\-confidenceunknownotherwise\)\. The full procedure is summarized in Algorithm[1](https://arxiv.org/html/2611.22382#alg1)\(Appendix[U](https://arxiv.org/html/2611.22382#A21)\)\.

### 3\.4Expand: deployment\-time controllability

Because the two\-axis decision keeps sub\-document starts as a separate signal even when their parent segment is open, downstream consumers can re\-threshold what counts as a segment without re\-running inference\. We use this for one specific operating choice on FinancePSS\-205, which we call*expand*: when a predicted sub\-document of a priority class \(invoice,statement,purchase\_order,packing\_slip,bill\_of\_lading,commercial\_invoice,packing\_list\) appears inside a parent segment, the sub\-document’s start is promoted to a true segment start in post\-processing\. The priority list is taken from the document ontology of the AP/AR workflows the data come from and was fixed before any FinancePSS evaluation; expand uses no re\-inference and no gold labels\. We report its effect alongside the no\-expand variant throughout Section[6](https://arxiv.org/html/2611.22382#S6)so its contribution is visible rather than absorbed into the headline number\.

![Refer to caption](https://arxiv.org/html/2611.22382v1/figures/ricot_final_v2.png)Figure 2:RICoT architecture\. WindowWcW\_\{c\}processes its pages with interleaved per\-page reasoning and decisions, receiving reasoning historyℋ\(c\)\\mathcal\{H\}^\{\(c\)\}and active\-segment summary𝒜\(c\)\\mathcal\{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\.

## 4Distilling RICoT into a Small Model

A small model running the same framework is more attractive to deploy than a large prompted one, so we distill RICoT into a22B student: a larger teacher LLM runs RICoT over a training corpus, and the student learns to produce the teacher’s per\-page decisions both with and without the accompanying page\-level reasoning\.

### 4\.1Training corpus from FinePDFs

We construct training data from FinePDFs[Kydlíček et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib13), a publicly available PDF\-sourced corpus \(∼\\sim33T tokens,∼\\sim475475M documents\)\. We restrict to the English subset \(∼\\sim206206M documents\) and isolate finance content through a two\-stage filter: Stage 1 is a high\-recall keyword pass over a tiered finance lexicon, and Stage 2 is an XGBoost classifier over TF\-IDF features trained on∼\\sim100100K Stage\-1 documents labeled by an LLM judge for finance vs\. non\-finance\. The combined filter yields12\.312\.3M finance documents \(∼\\sim100100B tokens\)\. Lexicon tiers, classifier details, and classification threshold tuning are in Appendix[S](https://arxiv.org/html/2611.22382#A19)\.

From this pool we sampled300300K documents\. Because FinePDFs lacks page markers, we re\-fetch each PDF via its Common Crawl URL and re\-OCR it per page, using FinePDFs’ per\-page language list to verify page\-count alignment and drop unsupported scripts;150,448150\{,\}448documents \(∼\\sim50%50\\%\) survive \(Appendix[P](https://arxiv.org/html/2611.22382#A16)\)\.

We then ran RICoT with the teacher model \(Kimi\-K2\-Instruct[Kimi Team \(2025\)](https://arxiv.org/html/2611.22382#bib.bib12)\) over the150,448150\{,\}448documents, producing467,229467\{,\}229chunk\-level samples \(each chunk is one sliding\-window span with the teacher’s interleaved reasoning, per\-page decisions, andactive\_segment\_carry\_forwardsummary\)\. Only20,95920\{,\}959\(13\.9%13\.9\\%\) source documents contain two or more segments; the remaining86%86\\%are self\-contained single\-segment documents, reflecting FinePDFs’ web\-crawled provenance\.

#### Chunk selection\.

We keep every multi\-segment file and every*special*chunk in it \(containing or immediately preceding a segment start, or ending the file\), subsampling other chunks up to a cap\. Single\-segment files are downsampled within embedding clusters of the teacher’s free\-form class labels, and truncated or single\-page documents are dropped\. The final corpus has46,79146\{,\}791documents \(20,95920\{,\}959multi\-segment,25,83225\{,\}832single\-segment\); caps will be included in the public release\.

### 4\.2Training with and without page\-level reasoning

Each training sample is a triple\(sys,ctx,out\)\(\\textsc\{sys\},\\textsc\{ctx\},\\textsc\{out\}\)—system instruction, stream context, chunk output—always rewritten together so the schema declared, carried, and produced agree\. With probability0\.400\.40per chunk, the sample is rendered without page\-level reasoning: the per\-page<think\>blocks are removed and the instruction no longer mentions reasoning, so the target is the teacher’s decisions alone; otherwise it keeps the teacher’s interleaved reasoning and decisions\. One student thus serves both modes at deployment: with reasoning \(Q3\.5\-2B⋆,PwT\) and decisions only \(Q3\.5\-2B⋆; Section[5\.2](https://arxiv.org/html/2611.22382#S5.SS2)\)\. A worked example of each will be included in the public release \(Appendix[R](https://arxiv.org/html/2611.22382#A18)\)\.

For operational convenience only, some samples also omit optional decision fields \(e\.g\., document class, confidence, grounding\) or the carry\-forwardprogressfield, so that one student accepts reduced or full schemas without retraining;yiy\_\{i\}is never removed, and we claim no accuracy contribution for this variation \(Appendix[O](https://arxiv.org/html/2611.22382#A15)\)\.

### 4\.3Training setup

We fine\-tune Qwen\-3\.5\-2B[Qwen Team \(2026\)](https://arxiv.org/html/2611.22382#bib.bib20)with QLoRA[Dettmers et al\. \(2023\)](https://arxiv.org/html/2611.22382#bib.bib5)of rank3232\(α=64\\alpha\{=\}64, dropout00, target modules: all linear projections\) for11epoch on the46,79146\{,\}791\-document training corpus, with∼\\sim1,8001\{,\}800samples held out for validation\. We use cosine learning\-rate schedule \(8×10−58\{\\times\}10^\{\-5\},8%8\\%warmup\), AdamW\-88bit, bf16 with gradient checkpointing, effective batch size1616\(per\-device88, grad\-accumulation22\)\. Training took∼\\sim4444hours on4×4\{\\times\}A100 80GB\. The full hyperparameter set is in Appendix[Q](https://arxiv.org/html/2611.22382#A17)\. We report a single training run; we did not sweep the sampling probabilities of Section[4\.2](https://arxiv.org/html/2611.22382#S4.SS2)or the LoRA rank\.

## 5Experimental Setup

### 5\.1Datasets

We evaluate on three benchmarks spanning different domains and complexity levels \(Table[1](https://arxiv.org/html/2611.22382#S5.T1)\)\.

#### TABME[Mungmeeprued et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib17)\.

A large synthetic page\-stream benchmark built from the Truth Tobacco Industry Documents archive, in which∼\\sim44,76944\{,\}769source PDFs were concatenated into folders mimicking real folder length and type distributions\. Each source PDF forms one ground\-truth segment, so TABME provides a large, reproducible test of file\-level segmentation\. Inference cost on the full5,0005\{,\}000\-stream test set is substantial, so we run prompting experiments on a fixed random subset of250250streams \(TABME\-250; stream IDs in Appendix[G](https://arxiv.org/html/2611.22382#A7)\); our distilled model is additionally evaluated on the full5,0005\{,\}000\-stream test set, where numbers track the subset closely \(DocF10\.7560\.756vs\.0\.7700\.770on⋆,PwT\\star,\\mathrm\{PwT\}; Section[6\.1](https://arxiv.org/html/2611.22382#S6.SS1)\)\.

#### Tobacco800[Lewis et al\. \(2006\)](https://arxiv.org/html/2611.22382#bib.bib14);[University of California, San Francisco \(2007\)](https://arxiv.org/html/2611.22382#bib.bib22);[Agam et al\. \(2006\)](https://arxiv.org/html/2611.22382#bib.bib1)\.

A standard PSS benchmark from the same archive, containing scanned letters, memos, and reports\. Following[Wiedemann and Heyer \(2020\)](https://arxiv.org/html/2611.22382#bib.bib27)and[Mungmeeprued et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib17), we evaluate on the last259259pages from153153documents, ordered alphabetically by filename and treated as a single continuous stream\. It is near ceiling and serves as a reference rather than discriminating benchmark\.

#### FinancePSS\-205 \(new\)\.

205205real\-world page streams from production AP/AR workflows, mixing invoices, remittance advice, purchase orders, delivery receipts, statements, and email, with typical finance bundling \(invoice–remittance pairs, PO–invoice matches, invoices nested in statements\)\. Each stream is one file exactly as received, so boundaries between related same\-vendor documents must be inferred from content\. A new document starts wherever a page begins a document with its own transactional identity; labels were produced by the research team \(no inter\-annotator agreement study; see Limitations\)\. We will release the de\-identified page\-level, spatially\-aware text \(the exact model input\) with labels under CC BY\-NC 4\.0 \(non\-commercial research use\) and the evaluation scripts under Apache\-2\.0; the dataset card and trivial baselines are in Appendix[A](https://arxiv.org/html/2611.22382#A1)\.

We use only the test partitions of the public datasets; no training data from any benchmark is used in this work\.

TABME\-250Tob800FinPSSStreams2501205Segments \(docs\)2,627 \(1,542\)153685Pages7,271 \(4,240\)2591,772Pages/stream29\.1 / 27 / 3 / 81259†8\.6 / 5 / 2 / 82Segs/stream10\.5 / 10 / 3 / 19153†3\.3 / 2 / 1 / 44Segment length2\.8 / 1 / 1 / 201\.7 / 1 / 1 / 172\.6 / 2 / 1 / 66Table 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](https://arxiv.org/html/2611.22382#A2)\)\. Stream statistics reported as avg/med/min/max;†Tobacco800 is evaluated as a single continuous stream, so per\-stream distributional statistics do not apply\.

### 5\.2Models

#### Prompted LLMs\.

GLM\-4\.7\-flash[GLM Team et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib8)is the∼\\sim3030B small variant of the GLM\-4\.7 family, our small\-model prompting baseline—roughly15×15\\timesthe size of our distilled student;GLM\-4\.7[GLM Team et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib8)is the full GLM\-4\.7 model;GLM\-5[GLM\-5 Team \(2026\)](https://arxiv.org/html/2611.22382#bib.bib7)is a744744B\-parameter Mixture\-of\-Experts model released under the MIT license by Z\.ai;Claude Haiku 4\.5[Anthropic \(2025\)](https://arxiv.org/html/2611.22382#bib.bib2)is included as a non\-GLM frontier prompted\-model point of comparison\. By default we run RICoT with each model’s internal extended thinking*off*\(Section[6\.4](https://arxiv.org/html/2611.22382#S6.SS4)\)\.

#### Distilled student\.

Qwen\-3\.5\-2B[Qwen Team \(2026\)](https://arxiv.org/html/2611.22382#bib.bib20)distilled from Kimi\-K2\-Instruct[Kimi Team \(2025\)](https://arxiv.org/html/2611.22382#bib.bib12)as described in Section[4](https://arxiv.org/html/2611.22382#S4); the base model prompted with RICoT*without*fine\-tuning is reported as a control\.

#### Table labels\.

G4\.7\-Ffor GLM\-4\.7\-flash,G4\.7for GLM\-4\.7,G5for GLM\-5,C\-H4\.5for Claude Haiku 4\.5, andQ3\.5\-2Bfor the Qwen\-3\.5\-2B base model\. The distilled\-student variants are denotedQ3\.5\-2B⋆\(no pagewise thinking\) andQ3\.5\-2B⋆,PwT\(with pagewise thinking\)\.

### 5\.3Evaluation metrics

We report five metrics spanning page, segment, and stream granularities\.PageF1[Heidenreich et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib10);[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib9)is page\-level boundary\-classification F1\.B\-F1[Pottanigari et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib19)is the same F1 over adjacent\-page decisions only, excluding each stream’s first page\.DocF1[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib9);[Heidenreich et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib10)is F1 over documents, each represented as the tuple of its page indices; a true positive is an exact tuple match\. All F1 scores are micro\-averaged over streams\.MNDDμ\\mathrm\{\\textbf\{MNDD\}\}\_\{\\mu\}\(per\-stream mean of Minimum Number of Drag\-and\-Drops\) is a user\-centric metric counting the minimum drag\-and\-drop operations needed to reconcile a prediction with the ground truth in a folder\-management UI; lower is better\.STP%\(Straight\-Through Pass\) is the percentage of streams with zero boundary errors\. All metrics are computed on the segment axisyyonly and ignore class labels; the sub\-document axis enters only through the with\-expand rows \(Section[3\.4](https://arxiv.org/html/2611.22382#S3.SS4)\)\.

### 5\.4Baselines

Baselines are re\-run on our infrastructure with the same backbones as RICoT\.

Pairwise\.Each adjacent page pair\(pi−1,pi\)\(p\_\{i\-1\},p\_\{i\}\)is classified independently for whetherpip\_\{i\}starts a new document[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib9);[Heidenreich et al\. \(2025\)](https://arxiv.org/html/2611.22382#bib.bib10); window sizew=2w\{=\}2, overlapo=1o\{=\}1\. Internal extended thinking enabled \(its strongest configuration per Section[6\.4](https://arxiv.org/html/2611.22382#S6.SS4)\)\.

Windowed\.A fixed\-size window ofw=5w\{=\}5pages is shown to the LLM with a single decision prompt asking for boundary labels across the window; windows overlap byo=1o\{=\}1\. Internal extended thinking enabled\. The same single\-call, multi\-boundary design was proposed concurrently as MSBD[Pottanigari et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib19)\.

### 5\.5Implementation details

The RICoT sliding window is sized by a constant token budget \(B=3600B\{=\}3600\), a per\-window page cap \(wmax=6w\_\{\\max\}\{=\}6\), and a one\-page overlap \(o=1o\{=\}1\); these were fixed*a priori*and held constant across all experiments \(sweep in Appendix[C](https://arxiv.org/html/2611.22382#A3)\)\. Pages whose tokenized length exceeds a fixed per\-page threshold are truncated using a head\-and\-tail rule \(first500500\+ last300300tokens, with an explicit truncation marker between\), since segmentation signal concentrates at document openings and closings\. All inference uses temperature0\.0010\.001\(top\-pp11\) for both prompting and the distilled model\. The inference configuration is described in Appendix[T](https://arxiv.org/html/2611.22382#A20); structural prompt templates will be included in the public release\.

Prompted results are single runs; distilled\-model FinancePSS and Tobacco800 numbers are means of55inference runs\. Run\-to\-run variability and confidence intervals are in Appendix[B](https://arxiv.org/html/2611.22382#A2)\.

## 6Results

FinancePSS cells read*with\-expand \(no\-expand\)*, e\.g\.0\.832​\(0\.795\)0\.832\\,\(0\.795\); superscriptsiT\\mathrm\{iT\},PwT\\mathrm\{PwT\},⋆\\stardenote internal\-thinking, pagewise\-thinking, and fine\-tuned runs, and em\-dashes mark cells we did not run\.

### 6\.1Headline cross\-dataset results

Table[2](https://arxiv.org/html/2611.22382#S6.T2)reports RICoT across all four prompted models and two distilled\-model variants on the three benchmarks\. The strongest prompted model \(GLM\-5\) reaches DocF10\.9670\.967on Tobacco800 and0\.8470\.847on TABME\-250, and the strongest prompted\-model FinancePSS configuration \(GLM\-4\.7\) reaches0\.8320\.832with expand\. The distilled22B model \(Qwen\-3\.5\-2B⋆,PwT\\text\{Qwen\-3\.5\-2B\}^\{\\star,\\mathrm\{PwT\}\}\) reaches0\.7850\.785on FinancePSS\-205 and0\.7700\.770on the full5,0005\{,\}000\-stream TABME test set without exposure to TABME training data\. Its gap to the strongest prompted model is0\.0470\.047DocF1 on FinancePSS\-205,0\.0400\.040on Tobacco800, and0\.0910\.091on TABME\-250 \(same streams\)\. The same base Qwen\-3\.5\-2B prompted with RICoT but*without*fine\-tuning reaches only0\.4450\.445/0\.3960\.396/0\.2810\.281on the three datasets, isolating the contribution of distillation from base\-model capacity and framework prompts\. The two student modes perform comparably \(0\.7850\.785vs\.0\.7730\.773on FinancePSS\-205, with overlapping intervals in Appendix[B](https://arxiv.org/html/2611.22382#A2);0\.7700\.770vs\.0\.7740\.774on full TABME\), so page\-level reasoning can be skipped at inference\.

FinancePSS\-205Tobacco800TABME\-250ModelDocF1PageF1MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}DocF1PageF1MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}DocF1PageF1MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}G4\.7\-F0\.762 \(0\.741\)0\.898 \(0\.884\)1\.005 \(1\.225\)0\.8670\.94948\.00\.6830\.8295\.65G4\.70\.832\(0\.795\)0\.916\(0\.884\)0\.848\(1\.255\)0\.9610\.9877\.00\.7940\.8923\.31C\-H4\.50\.776 \(0\.739\)0\.880 \(0\.831\)1\.172 \(1\.647\)0\.9570\.9848\.00\.8160\.9102\.88G50\.826 \(0\.769\)0\.906 \(0\.864\)0\.975 \(1\.422\)0\.9670\.9873\.00\.8470\.9222\.40Q3\.5\-2B \(base\)0\.4450\.6883\.1030\.3960\.664167\.00\.2810\.56314\.62Q3\.5\-2B⋆0\.773 \(0\.763\)0\.904 \(0\.892\)0\.897 \(1\.079\)0\.9140\.95426\.60\.753 / 0\.774F0\.873 / 0\.894F4\.56 / 4\.21FQ3\.5\-2B⋆,PwT0\.785 \(0\.779\)0\.901 \(0\.897\)1\.044 \(1\.073\)0\.9270\.96518\.60\.756 / 0\.770F0\.885 / 0\.896F4\.20 / 4\.30FTable 2:Headline cross\-dataset results for RICoT\. DocF1 / PageF1 higher is better;MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}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\-3232QLoRA;PwTpagewise thinking enabled\.FFull5,0005\{,\}000\-stream TABME test set \(vs\.250250\-stream prompting subset\)\.
### 6\.2Comparison to prior published TABME baselines

Table[3](https://arxiv.org/html/2611.22382#S6.T3)compares RICoT with published TABME results\([Heidenreich et al\., 2024](https://arxiv.org/html/2611.22382#bib.bib9);[Heidenreich et al\., 2025](https://arxiv.org/html/2611.22382#bib.bib10);[Pottanigari et al\., 2026](https://arxiv.org/html/2611.22382#bib.bib19)\)\. These span different test sets and OCR versions \(table footnotes\) and are indicative only\. RICoT with GLM\-5 \(DocF10\.8470\.847\) beats the strongest published zero\-shot decoder \(GPT\-4o\-ZS\) by\+0\.144\+0\.144DocF1 and\+32\+32STP points; the distilled22B model on the full test set \(0\.7700\.770\) beats the XGBoost and DiT baselines of[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib9)and GPT\-4o\-ZS by\+0\.067\+0\.067\. On boundary F1, we list for each model of[Pottanigari et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib19)its best result across all their methods \(PC, BD, MSBD\), window sizes, and inputs:0\.8660\.866\(Claude Haiku 4\.5\),0\.8870\.887\(Gemini 3\.1 Flash\-Lite\), and0\.8760\.876\(GPT\-5\.4\-mini\)\. RICoT, using text only, exceeds all of them: GLM\-5 reaches0\.9150\.915and Claude Haiku 4\.50\.9010\.901\(\+0\.035\+0\.035over the same model’s best\), and even the22B students \(0\.8900\.890,0\.8870\.887\) match or exceed them\. None of our models approaches the fine\-tuned LLMs \(Phi\-3\-mini, Mistral\-7B\) trained on TABME’s training split; the gap reflects both TABME’s file\-level segment granularity and genuine errors of our models \(Section[6\.6](https://arxiv.org/html/2611.22382#S6.SS6)\)\.

ModelTypeInputDocF1B\-F1STP%MNDDXGBoostfttxt0\.642–7\.410\.85DiTftvis0\.623–6\.610\.48Phi\-3\-minizstxt0\.060–0\.014\.79Mistral\-7Bzstxt0\.368–1\.421\.15GPT\-4oazstxt0\.703–9\.47\.79C\-H4\.5 \(BD\)bzstxt–0\.866––Gemini\-3\.1\-FL \(MSBD\)bzsvis–0\.887––GPT\-5\.4\-mini \(BD\)bzsvis–0\.876––Phi\-3\-minifttxt0\.933–63\.71\.76Mistral\-7Bfttxt0\.967–80\.00\.81C\-H4\.5250\(RICoT\)zstxt0\.8160\.90133\.62\.88G5250\(RICoT\)zstxt0\.8470\.91541\.62\.40Q3\.5\-2B⋆F\{\}^\{\\star\\,\\mathrm\{F\}\}\(RICoT\)disttxt0\.7740\.89023\.24\.21Q3\.5\-2B⋆,PwT​F\{\}^\{\\star,\\mathrm\{PwT\}\\,\\mathrm\{F\}\}\(RICoT\)disttxt0\.7700\.88721\.94\.30

Table 3:TABME comparison against published baselines\([Heidenreich et al\., 2024](https://arxiv.org/html/2611.22382#bib.bib9);[Heidenreich et al\., 2025](https://arxiv.org/html/2611.22382#bib.bib10);[Pottanigari et al\., 2026](https://arxiv.org/html/2611.22382#bib.bib19)\)\.zs/ft: zero\-shot vs\. fine\-tuned on TABME training split;dist: distilled from teacher outputs on a FinePDFs subset, no TABME data\. Input: OCR text \(txt\) or page images \(vis\)\. Bold: overall best; underline: best zero\-shot; –: not reported\.aGPT\-4o\-ZS evaluated on a10%10\\%subset;bbest result per model over all methods, window sizes, and inputs in[Pottanigari et al\. \(2026\)](https://arxiv.org/html/2611.22382#bib.bib19)\(TABME\+\+; BD: pairwise\);250TABME\-250;Ffull5,0005\{,\}000\-stream test set\.
### 6\.3RICoT vs\. pairwise and windowed paradigms

Table[4](https://arxiv.org/html/2611.22382#S6.T4)reports DocF1 head\-to\-head against pairwise and windowed LLM\-PSS baselines on all three datasets for the GLM family, with every method run on the same backbone \(Tobacco800 has only one stream, but the single\-stream DocF1 still differentiates configurations\)\. On FinancePSS, RICoT is the best configuration for every model, by\+0\.154\+0\.154,\+0\.069\+0\.069, and\+0\.057\+0\.057over the best baseline \(GLM\-4\.7\-flash, GLM\-4\.7, GLM\-5\)\. Without expand the margins are\+0\.133\+0\.133and\+0\.032\+0\.032and a tie on GLM\-5 \(Section[6\.6](https://arxiv.org/html/2611.22382#S6.SS6)\)\. Context length does not explain the gain: in a control that keeps pairwise decisions but shows a symmetric55\-page context \(GLM\-4\.7\-flash,55runs; Appendix[D](https://arxiv.org/html/2611.22382#A4)\), pairwise rises from0\.5060\.506to0\.6510\.651, yet RICoT still leads it by\+0\.111\+0\.111\(\+0\.090\+0\.090without expand\) with2\.152\.15vs\.∼\\sim7\.67\.6calls per stream\. On the near\-ceiling Tobacco800, RICoT wins for GLM\-4\.7 and GLM\-5\. On TABME\-250, RICoT leads for GLM\-4\.7 \(\+0\.052\+0\.052\) and GLM\-5 \(\+0\.092\+0\.092\), while for the small GLM\-4\.7\-flash, pairwise classification with internal thinking is stronger \(0\.7710\.771vs\.0\.6830\.683\), mirroring its Tobacco800 result\.

Tobacco800FinancePSS\-205TABME\-250MethodG4\.7\-FG4\.7G5G4\.7\-FG4\.7G5G4\.7\-FG4\.7G5PairwiseiT0\.8860\.8880\.8720\.5060\.7630\.7390\.7710\.7040\.697WindowediT0\.8230\.8670\.9580\.6080\.7570\.7690\.7310\.7420\.755RICoT0\.8670\.9610\.9670\.7620\.8320\.8260\.6830\.7940\.847no expand–––0\.7410\.7950\.769–––

Table 4:DocF1 of RICoT vs\. pairwise and windowed LLM\-PSS baselines on the same backbone\. Baselines run with internal thinking \(their best general configuration\); RICoT without \(Section[6\.4](https://arxiv.org/html/2611.22382#S6.SS4)\)\. Expand applies to FinancePSS only\. Bold: best per column\.
### 6\.4Pagewise vs\. internal extended thinking

Do RICoT’s gains overlap with models’ internal extended thinking? We run a2×22\{\\times\}2ablation on GLM\-4\.7\-flash crossing pagewise interleaved thinking with internal extended thinking across all three datasets \(Table[5](https://arxiv.org/html/2611.22382#S6.T5)\)\. Pagewise yields a positive DocF1 delta on every dataset; internal\-thinking alone is positive only on FinancePSS and neutral\-to\-negative elsewhere; the two are roughly additive when combined\. Per\-page output\-token costs differ by an order of magnitude: on FinancePSS\-flash, pagewise adds∼\\sim6060output tokens to gain\+0\.074\+0\.074DocF1, while internal thinking adds∼\\sim650650tokens for\+0\.028\+0\.028\. The per\-channel cost breakdown is in Appendix[J](https://arxiv.org/html/2611.22382#A10)\. We therefore default to internal\-thinking\-off for all RICoT runs in this paper\.

ConfigurationFinPSSTob\.TABMEOut toksno\-think \(baseline\)0\.6880\.8220\.661172internal only\+0\.028\+0\.028−0\.012\-0\.012−0\.008\-0\.008823pagewise only\+0\.074\+0\.074\+0\.045\+0\.045\+0\.022\+0\.022232both\+0\.118\\mathbf\{\+0\.118\}\+0\.057\\mathbf\{\+0\.057\}\+0\.046\\mathbf\{\+0\.046\}722

Table 5:2×22\{\\times\}2DocF1 deltas vs\. no\-think baseline on GLM\-4\.7\-flash\. Last column reports per\-page output tokens on FinancePSS\-flash\.
### 6\.5Component ablations

Table[6](https://arxiv.org/html/2611.22382#S6.T6)ablates each load\-bearing component of RICoT on FinancePSS\-205 across the three prompted GLM models by removing one component at a time and re\-running\.*Pagewise thinking*is the largest single contributor on all three models \(−0\.048\-0\.048to−0\.088\-0\.088DocF1\)\.*Context propagation*\(reasoning historyℋ\(c\)\\mathcal\{H\}^\{\(c\)\}and active\-segment summary𝒜\(c\)\\mathcal\{A\}^\{\(c\)\}\) matters most for GLM\-5 \(−0\.048\-0\.048\) and on long streams \(Appendix[E](https://arxiv.org/html/2611.22382#A5)\)\.*Grounding*is reliably positive for GLM\-4\.7\-flash and GLM\-5\. Removing only the model\-emitted*carry\-forward block*is mixed, so the state\-propagation story rests on the reasoning history; Appendix[B](https://arxiv.org/html/2611.22382#A2)marks which deltas exceed run\-to\-run noise\.*Expand*contributes\+0\.021\+0\.021to\+0\.057\+0\.057\. Per\-dataset full ablation tables, including TABME and Tobacco800, are in Appendices[K](https://arxiv.org/html/2611.22382#A11),[L](https://arxiv.org/html/2611.22382#A12), and[M](https://arxiv.org/html/2611.22382#A13)\.

ConfigurationG4\.7\-FG4\.7G5RICoT \(full\)0\.7620\.8320\.826−\-pagewise thinking0\.688 \(−\.074\-\.074\)0\.784 \(−\.048\-\.048\)0\.738 \(−\.088\-\.088\)−\-context propagation0\.752 \(−\.010\-\.010\)0\.837 \(\+\.005\+\.005\)0\.778 \(−\.048\-\.048\)−\-carry\-forward block0\.736 \(−\.026\-\.026\)0\.841 \(\+\.009\+\.009\)0\.795 \(−\.031\-\.031\)−\-grounding0\.695 \(−\.067\-\.067\)0\.831 \(−\.001\-\.001\)0\.755 \(−\.071\-\.071\)−\-expand \(no\-expand\)0\.741 \(−\.021\-\.021\)0\.795 \(−\.037\-\.037\)0\.769 \(−\.057\-\.057\)Table 6:Component ablations on FinancePSS\-205 DocF1\. Each row removes one component from the full RICoT \(with\-expand\) configuration;Δ\\Deltashown in parentheses\. “Carry\-forward block” removes only the model\-emittedκ\\kappa\.
### 6\.6Discussion

#### Segment granularity on TABME\.

TABME assigns one segment to each source file, whereas RICoT segments individual document instances and marks nested documents on its sub\-document axis\. Consistent with this difference, RICoT’s TABME errors are predominantly additional boundaries: page\-level recall is at least0\.9550\.955for every prompted model, against precision of0\.7330\.733–0\.8730\.873\(Appendix[H](https://arxiv.org/html/2611.22382#A8)\)\. To characterise these additional boundaries, we manually reviewed100100false boundaries of Q3\.5\-2B⋆on the full test set \(Appendix[I](https://arxiv.org/html/2611.22382#A9)\)\. Weighted by how often each error recurs across streams, about17%17\\%are genuine document starts within a single source file, which file\-level labels merge \(treating them as correct would raise precision from0\.8360\.836to about0\.860\.86\); about33%33\\%are nested documents, such as envelopes, attachments, and fax payloads, predicted as top\-level rather than sub\-document starts; about33%33\\%are over\-segmentations triggered by repeated headers or explicit continuations \(“Page 2 of 2”\); and the remaining17%17\\%are ambiguous\. The precision gap on TABME thus reflects both a difference in segment granularity and genuine model errors, and fine\-tuning on TABME’s training split plausibly addresses both\.

#### Expand on FinancePSS\.

On FinancePSS, expand drives a meaningful share of the gain for the larger models: without it, RICoT\-GLM\-5 ties the best baseline and RICoT\-GLM\-4\.7 leads by\+0\.032\+0\.032; with it the margins become\+0\.057\+0\.057and\+0\.069\+0\.069\. GLM\-4\.7\-flash wins regardless \(\+0\.133\+0\.133without expand\)\. GLM\-5 more often places bundled\-packet boundaries on the sub\-document axis rather than the segment axis; expand re\-thresholds these detected starts, closing its gap to GLM\-4\.7 from0\.0260\.026to0\.0060\.006\.

## Limitations

Our evaluation is restricted to English documents; multilingual streams—common in global enterprises—remain untested, and we did not evaluate on recent non\-English open benchmarks[van Heusden et al\. \(2022\)](https://arxiv.org/html/2611.22382#bib.bib23);[van Heusden et al\. \(2024\)](https://arxiv.org/html/2611.22382#bib.bib24)\. The discriminating evidence rests mainly on FinancePSS\-205, which is modest in size \(205205streams\), curated rather than randomly sampled, labeled by the research team without an agreement study, and covers a single domain, so generalization to legal or medical content requires further validation; Tobacco800 is near ceiling, and TABME scores file\-level segments, so its precision mixes granularity differences with model errors \(Section[6\.6](https://arxiv.org/html/2611.22382#S6.SS6)\)\. Run\-to\-run variability was measured with five repeats on GLM\-4\.7\-flash \(Appendix[B](https://arxiv.org/html/2611.22382#A2)\) and assumed to transfer to the other models, whose results are single runs; the student was trained once, and the effect of omitting optional decision fields during training was not isolated\. Model coverage spans one model family at three scales plus one non\-GLM model\. The framework assumes that the first page of a stream begins a document and treats each page image as one logical unit, with no granularity for multiple pages combined into a single scan\. It relies on sequential continuity and cannot reassociate non\-contiguous or interleaved pages into one document entity\. Finally, recurrent state propagation makes within\-stream processing strictly causal: multiple streams can be processed in parallel, but a single long stream must be processed sequentially\.

## Ethical Considerations

The FinancePSS dataset was collected from production workflows under the data\-handling agreements in force at the time and pseudonymised: personal names, addresses, contact details, and account numbers were consistently replaced with type\- and length\-consistent synthetic values, preserving document structure\. The planned release will contain only this de\-identified text \(no page images\), which was audited for retained identifiers \(Appendix[A](https://arxiv.org/html/2611.22382#A1)\), and will be licensed for non\-commercial research use \(CC BY\-NC 4\.0\) under terms of use that prohibit re\-identification; because free\-text pseudonymisation cannot fully exclude re\-identification, we treat the release as pseudonymised rather than anonymous\. No human annotators beyond the research team were employed for dataset labeling\. AI writing assistance was used for portions of manuscript drafting; all scientific content, experimental design, results, and conclusions are entirely the authors’ own\.

## References

- Agam et al\. \(2006\)Gady Agam, Shlomo Argamon, Ophir Frieder, David Grossman, and David D\. Lewis\. 2006\.[The complex document image processing \(CDIP\) test collection](http://ir.iit.edu/projects/CDIP.html)\.Technical report, Illinois Institute of Technology\.
- Anthropic \(2025\)Anthropic\. 2025\.Introducing Claude Haiku 4\.5\.Anthropic blog post\.[https://www\.anthropic\.com/news/claude\-haiku\-4\-5](https://www.anthropic.com/news/claude-haiku-4-5)\.
- Beltagy et al\. \(2020\)Iz Beltagy, Matthew E\. Peters, and Arman Cohan\. 2020\.Longformer: The long\-document transformer\.*arXiv preprint arXiv:2004\.05150*\.
- Braz et al\. \(2021\)Fabricio Ataides Braz, Nilton Correia da Silva, and Jonathan Alis Salgado Lima\. 2021\.[Leveraging effectiveness and efficiency in Page Stream Deep Segmentation](https://doi.org/10.1016/j.engappai.2021.104394)\.*Engineering Applications of Artificial Intelligence*, 105:104394\.
- Dettmers et al\. \(2023\)Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer\. 2023\.[QLoRA: Efficient finetuning of quantized LLMs](https://arxiv.org/abs/2305.14314)\.In*Advances in Neural Information Processing Systems*, volume 36\.
- Drumond et al\. \(2023\)Patricia Medyna Lauritzen de Lucena Drumond, Lindeberg Pessoa Leite, Teofilo E\. de Campos, and Fabricio Ataides Braz\. 2023\.[LayoutQT—Layout Quadrant Tags to embed visual features for document analysis](https://doi.org/10.1016/j.engappai.2023.106091)\.*Engineering Applications of Artificial Intelligence*, 122:106091\.
- GLM\-5 Team \(2026\)GLM\-5 Team\. 2026\.[GLM\-5: from vibe coding to agentic engineering](https://arxiv.org/abs/2602.15763)\.*arXiv preprint arXiv:2602\.15763*\.
- GLM Team et al\. \(2025\)GLM Team, Aohan Zeng, et al\. 2025\.[GLM\-4\.5: Agentic, reasoning, and coding \(ARC\) foundation models](https://arxiv.org/abs/2508.06471)\.*arXiv preprint arXiv:2508\.06471*\.Z\.ai\. The GLM\-4\.7 family used in our experiments is a subsequent release in the same line; see[https://github\.com/zai\-org/GLM\-4\.5](https://github.com/zai-org/GLM-4.5)for model cards\.
- Heidenreich et al\. \(2024\)Hunter Heidenreich, Ratish Dalvi, Rohith Mukku, Nikhil Verma, and Neven Pičuljan\. 2024\.[Large language models for page stream segmentation](https://arxiv.org/abs/2408.11981)\.*Preprint*, arXiv:2408\.11981\.
- Heidenreich et al\. \(2025\)Hunter Heidenreich, Ratish Dalvi, Nikhil Verma, and Yosheb Getachew\. 2025\.[Page stream segmentation with LLMs: Challenges and applications in insurance document automation](https://aclanthology.org/2025.coling-industry.26/)\.In*Proceedings of the 31st International Conference on Computational Linguistics: Industry Track*, pages 305–317, Abu Dhabi, UAE\. Association for Computational Linguistics\.
- Inan et al\. \(2022\)Hakan Inan, Rashi Rungta, and Yashar Mehdad\. 2022\.[Structured summarization: Unified text segmentation and segment labeling as a generation task](https://arxiv.org/abs/2209.13759)\.*Preprint*, arXiv:2209\.13759\.
- Kimi Team \(2025\)Kimi Team\. 2025\.[Kimi K2: Open agentic intelligence](https://arxiv.org/abs/2507.20534)\.*arXiv preprint arXiv:2507\.20534*\.Base and post\-trained checkpoints at[https://huggingface\.co/moonshotai/Kimi\-K2\-Instruct](https://huggingface.co/moonshotai/Kimi-K2-Instruct)\.
- Kydlíček et al\. \(2025\)Hynek Kydlíček, Guilherme Penedo, and Leandro von Werra\. 2025\.FinePDFs\.Hugging Face dataset,[https://huggingface\.co/datasets/HuggingFaceFW/finepdfs](https://huggingface.co/datasets/HuggingFaceFW/finepdfs)\.
- Lewis et al\. \(2006\)David D\. Lewis, Gady Agam, Shlomo Argamon, Ophir Frieder, David Grossman, and John Heard\. 2006\.Building a test collection for complex document information processing\.In*Proceedings of the 29th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval \(SIGIR ’06\)*, pages 665–666\. ACM\.
- Li et al\. \(2026\)Haoyuan Li, Zhengyuan Shen, Sullam Jeoung, Yueyan Chen, Jiayu Li, Qi Zhu, Shuai Wang, Vassilis Ioannidis, and Huzefa Rangwala\. 2026\.BoundRL: Efficient token\-level structured text segmentation through reinforced boundary generation\.In*Findings of the Association for Computational Linguistics: ACL 2026*, pages 34706–34726\. Association for Computational Linguistics\.
- Liu et al\. \(2024\)Nelson F\. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang\. 2024\.Lost in the middle: How language models use long contexts\.*Transactions of the Association for Computational Linguistics*, 12:157–173\.
- Mungmeeprued et al\. \(2022\)Thisanaporn Mungmeeprued, Yuxin Ma, Nisarg Mehta, and Aldo Lipani\. 2022\.[Tab this folder of documents: page stream segmentation of business documents](https://doi.org/10.1145/3558100.3563852)\.In*Proceedings of the 22nd ACM Symposium on Document Engineering*, DocEng ’22, New York, NY, USA\. Association for Computing Machinery\.
- Packer et al\. \(2023\)Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G\. Patil, Ion Stoica, and Joseph E\. Gonzalez\. 2023\.MemGPT: Towards LLMs as operating systems\.*arXiv preprint arXiv:2310\.08560*\.
- Pottanigari et al\. \(2026\)Nikhil Reddy Pottanigari, Sepideh Kharaghani, Saverio Vadacchino, Alejandro Posada, and Ying Zhang\. 2026\.[Splitting documents at lower cost: Multi\-split boundary decisions for LLM\-based page stream segmentation](https://arxiv.org/abs/2609.22620)\.*Preprint*, arXiv:2609\.22620\.
- Qwen Team \(2026\)Qwen Team\. 2026\.Qwen3\.5: Model release\.[https://huggingface\.co/Qwen/Qwen3\.5\-2B](https://huggingface.co/Qwen/Qwen3.5-2B)\.Model card for Qwen3\.5\-2B\.
- Serra Ortega et al\. \(2025\)Marc Serra Ortega, Emanuele Vivoli, Artemis Llabrés, and Dimosthenis Karatzas\. 2025\.[CoSMo: A multimodal transformer for page stream segmentation in comic books](https://arxiv.org/abs/2507.10053)\.In*Proceedings of the IEEE/CVF International Conference on Computer Vision \(ICCV\) Workshops*, pages 7506–7514\.
- University of California, San Francisco \(2007\)University of California, San Francisco\. 2007\.The legacy tobacco document library \(LTDL\)\.Now the UCSF Industry Documents Library,[https://www\.industrydocuments\.ucsf\.edu/](https://www.industrydocuments.ucsf.edu/)\.
- van Heusden et al\. \(2022\)Ruben van Heusden, Jaap Kamps, and Maarten Marx\. 2022\.WooIR: A new open page stream segmentation dataset\.In*Proceedings of the 2022 ACM SIGIR International Conference on the Theory of Information Retrieval \(ICTIR\)*\.
- van Heusden et al\. \(2024\)Ruben van Heusden, Jaap Kamps, and Maarten Marx\. 2024\.[OpenPSS: An open page stream segmentation benchmark](https://doi.org/10.1007/978-3-031-72437-4_24)\.In*Linking Theory and Practice of Digital Libraries \(TPDL 2024\)*, volume 15177 of*Lecture Notes in Computer Science*, pages 413–429\. Springer\.
- Wei et al\. \(2022\)Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou\. 2022\.Chain\-of\-thought prompting elicits reasoning in large language models\.In*Advances in Neural Information Processing Systems*, volume 35, pages 24824–24837\.
- Wiedemann and Heyer \(2018\)Gregor Wiedemann and Gerhard Heyer\. 2018\.Multi\-modal page stream segmentation with convolutional neural networks\.In*Proceedings of the 27th ACM International Conference on Information and Knowledge Management*, pages 1735–1738\. ACM\.
- Wiedemann and Heyer \(2020\)Gregor Wiedemann and Gerhard Heyer\. 2020\.[Multi\-modal page stream segmentation with convolutional neural networks](https://doi.org/10.1007/s10579-019-09476-2)\.*Language Resources and Evaluation*, 54\(4\):867–888\.
- Xie et al\. \(2025\)Roy Xie, David Qiu, Deepak Gopinath, Dong Lin, Yanchao Sun, Chong Wang, Saloni Potdar, and Bhuwan Dhingra\. 2025\.[Interleaved reasoning for large language models via reinforcement learning](https://arxiv.org/abs/2505.19640)\.*Preprint*, arXiv:2505\.19640\.
- Yao et al\. \(2023\)Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao\. 2023\.ReAct: Synergizing reasoning and acting in language models\.In*International Conference on Learning Representations*\.
- Zaheer et al\. \(2020\)Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al\. 2020\.Big bird: Transformers for longer sequences\.In*Advances in Neural Information Processing Systems*, volume 33, pages 17283–17297\.
- Zhang et al\. \(2025\)Alex L\. Zhang, Tim Kraska, and Omar Khattab\. 2025\.[Recursive language models](https://arxiv.org/abs/2512.24601)\.*Preprint*, arXiv:2512\.24601\.

## Appendix AFinancePSS\-205 Dataset Card

#### Access and license\.

The dataset is not yet public; it will be released together with the evaluation code, and the URL will be added in a future version of this preprint\. Text and annotations will be licensed under CC BY\-NC 4\.0 for non\-commercial research use, with separate terms of use prohibiting any attempt at re\-identification; evaluation scripts under Apache\-2\.0\.

#### Source and composition\.

205205page streams \(1,7721\{,\}772pages,685685segments\) as they arrived in production accounts\-payable/receivable workflows; documents date from roughly 2024–2025\. Each stream is one real bundle: there is no concatenation or reuse, and no stream is duplicated\. The set is a curated selection, favouring streams that were fully processable and whose de\-identification could be verified, so it is not an unbiased sample of the production distribution\. Segment labels are free text with144144distinct document types \(Table[8](https://arxiv.org/html/2611.22382#A1.T8)\)\.

#### Format\.

One UTF\-8 text file per page in stream order, containing layout\-preserving OCR text \(no images, coordinates, or PDFs\);financepss\_gt\.jsonlists each stream’s segments as \(start\_page,page\_count,document\_label\), contiguous and tiling the stream;MANIFEST\.jsongives per\-file SHA\-256 prefixes\. OCR noise is not corrected;3030pages \(1\.7%1\.7\\%\) are empty after OCR\.

#### Annotation\.

A new segment starts at the first page of each functionally distinct document\. Labels were produced by the research team; no inter\-annotator agreement is available for this version\. The release encodes only the segment axis; sub\-document annotations are planned for a later version\.

#### De\-identification\.

Personal names, addresses, contact details, and account and instrument numbers were replaced with type\- and length\-consistent surrogates, so identifier changes, a primary boundary cue, survive\. An audit on2525sampled streams found mean character similarity to the source of0\.5790\.579with file lengths within0\.5%0\.5\\%; Luhn\-valid1313–1919\-digit strings occur at the chance rate \(10\.2%10\.2\\%\), indicating no retained card numbers\. The release is pseudonymised rather than anonymous, and residual re\-identification risk is not zero\.

#### Difficulty\.

48\.3%48\.3\\%of streams contain a single document, but these hold few of the documents:46\.7%46\.7\\%of segments are single pages and the longest stream has4444\. Trivial predictors therefore score low \(Table[7](https://arxiv.org/html/2611.22382#A1.T7)\)\.

PredictorDocF1B\-F1Every page a document0\.2600\.469Whole stream one document0\.2220\.000RICoT, G4\.7 \(no expand\)0\.795–

Table 7:Trivial predictors versus RICoT on FinancePSS\-205 \(micro\-averaged\)\.Document classSegmentsinvoice330receipt35email18bill of lading18statement15purchase order15delivery receipt15packing list12commercial invoice9hazmat driver checklist9other \(134134types\)209

Table 8:FinancePSS\-205 document\-class distribution \(case\-normalised labels\)\.

## Appendix BUncertainty Estimates

#### Run\-to\-run variability\.

Prompted results in the main paper are single runs, since multi\-run coverage of every model×\\timesconfiguration was cost\-prohibitive\. To measure residual provider\-side variability, we repeated the GLM\-4\.7\-flash RICoT configuration44more times with identical code, configuration, and decoding \(temperature0\.0010\.001, top\-pp11\)\. Table[9](https://arxiv.org/html/2611.22382#A2.T9)reports the55\-run means \(paper run plus44repeats\) with95%95\\%CIs \(Student’stt,n=5n\{=\}5\)\. The runs are genuinely independent:9292of205205FinancePSS streams receive different split counts across repeats\. Every value reported in the main paper lies inside its CI\. We treat differences smaller than the DocF1 band as inconclusive\.

DatasetDocF1PageF1MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}STP%PaperFinPSS \(exp\.\)0\.751±0\.0260\.751\{\\pm\}0\.0260\.890±0\.0170\.890\{\\pm\}0\.0171\.16±0\.241\.16\{\\pm\}0\.2467\.1±1\.667\.1\{\\pm\}1\.60\.762FinPSS \(no exp\.\)0\.739±0\.0120\.739\{\\pm\}0\.0120\.878±0\.0130\.878\{\\pm\}0\.0131\.32±0\.191\.32\{\\pm\}0\.1965\.7±1\.565\.7\{\\pm\}1\.50\.741Tobacco8000\.844±0\.0530\.844\{\\pm\}0\.0530\.928±0\.0360\.928\{\\pm\}0\.03643\.0±14\.643\.0\{\\pm\}14\.60\.00\.00\.867TABME\-2500\.686±0\.0060\.686\{\\pm\}0\.0060\.833±0\.0070\.833\{\\pm\}0\.0075\.65±0\.265\.65\{\\pm\}0\.2616\.2±2\.316\.2\{\\pm\}2\.30\.683

Table 9:GLM\-4\.7\-flash RICoT,55\-run mean±\\pm95%95\\%CI\. “Paper”: the single\-run DocF1 reported in the main tables\. Tobacco800 is one259259\-page stream, hence its wider band\.
#### Implications for the main results\.

- •*Table[4](https://arxiv.org/html/2611.22382#S6.T4), Tobacco800:*only the GLM\-4\.7 margin over the best baseline \(\+0\.073\+0\.073\) exceeds the±0\.053\\pm 0\.053band; Tobacco800 margins are otherwise inconclusive\.
- •*Matched\-context pairwise control \(Appendix[D](https://arxiv.org/html/2611.22382#A4)\):*0\.651±0\.0080\.651\\pm 0\.008over55runs; RICoT’s lead \(\+0\.111\+0\.111with expand,\+0\.090\+0\.090without\) is far outside both this spread and the run\-to\-run band\.
- •*Table[6](https://arxiv.org/html/2611.22382#S6.T6):*deltas with\|Δ\|≤0\.026\|\\Delta\|\\leq 0\.026are within noise: context propagation on GLM\-4\.7\-flash \(−0\.010\-0\.010\) and GLM\-4\.7 \(\+0\.005\+0\.005\), carry\-forward block on GLM\-4\.7\-flash \(−0\.026\-0\.026\) and GLM\-4\.7 \(\+0\.009\+0\.009\), grounding on GLM\-4\.7 \(−0\.001\-0\.001\), and expand on GLM\-4\.7\-flash \(−0\.021\-0\.021\)\. The band was measured on GLM\-4\.7\-flash and is assumed to transfer\.

#### Bootstrap over streams\.

95%95\\%CIs \(1010k resamples of streams\) for the strongest configuration on each multi\-stream dataset: FinancePSS with expand, GLM\-4\.70\.8320\.832\[0\.7820\.782–0\.8780\.878\] and GLM\-50\.8260\.826\[0\.7730\.773–0\.8710\.871\]; TABME\-250, GLM\-50\.8470\.847\[0\.8260\.826–0\.8680\.868\]\. Tobacco800 is a single stream, so its uncertainty is captured by the run\-to\-run band above\.

#### Source\-file reuse on TABME\.

TABME composes its5,0005\{,\}000test streams from2,2382\{,\}238source files, each used in24\.524\.5streams on average \(range99–4242\); this reuse is what lets a fixed archive yield a large and varied test set\. A model’s error inside a file therefore recurs wherever the file appears: for Q3\.5\-2B⋆on the full test set, the9,3319\{,\}331false boundaries fall on only1,0711\{,\}071distinct \(file, page\) sites, and the10%10\\%of files with the most false boundaries hold87%87\\%of them\. Streams are thus not independent units\. Resampling streams \(1010k resamples\) gives B\-F10\.8900\.890\[0\.8870\.887–0\.8930\.893\], while resampling source files gives \[0\.8770\.877–0\.9020\.902\], about four times wider; counting each source file once gives B\-F10\.8960\.896\. We therefore recommend file\-level resampling for model comparisons on the full TABME test set\. On TABME\-250 reuse is much lower \(2,6272\{,\}627segments from1,5421\{,\}542unique files; Table[1](https://arxiv.org/html/2611.22382#S5.T1)\), so stream\-level intervals there are less affected\.

#### Distilled student \(55inference runs\)\.

The student was trained once\. FinancePSS DocF1 with expand:0\.7730\.773\(0\.7630\.763–0\.7820\.782\) for Q3\.5\-2B⋆and0\.7850\.785\(0\.7720\.772–0\.7970\.797\) for Q3\.5\-2B⋆,PwT; Tobacco800:0\.9140\.914\(0\.8970\.897–0\.9300\.930\) and0\.9270\.927\(0\.8980\.898–0\.9560\.956\)\.

## Appendix CWindow\-Parameter Sweep

On GLM\-4\.7\-flash / FinancePSS we replaced RICoT’s token\-budget packing with static windows ofwwpages and overlapoo, one run per configuration \(Table[10](https://arxiv.org/html/2611.22382#A3.T10)\)\.*Overlap11is best:*atw=4w\{=\}4, raisingoofrom11to33increases cost from3\.163\.16to8\.508\.50calls per stream while DocF1 falls from0\.7630\.763to0\.7280\.728\.*Smaller windows are more accurate but costlier:*w=2w\{=\}2reaches0\.8060\.806\(0\.8110\.811without expand\) at about4×4\\timesthe calls of the default, which trades0\.030\.03–0\.060\.06DocF1 for that cost; it was chosen for cost, not tuned for accuracy\. Since each page is capped at800800tokens,B=3600B\{=\}3600admits at least44pages, andwmax=6w\_\{\\max\}\{=\}6bounds the window from above, so the effective window floats within this band\. The token\-budget setting reaches0\.7770\.777at2\.152\.15calls per stream, matching staticw=5w\{=\}5\(0\.7800\.780\) and beating staticw=6w\{=\}6\(0\.7660\.766\) at identical cost\.MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}ranges only0\.860\.86–1\.211\.21across configurations, within its±0\.24\\pm 0\.24noise, so it does not discriminate between them\.

wwooDocF1\(no exp\.\)PageF1calls210\.8060\.8110\.9178\.50310\.7880\.7680\.9094\.44410\.7630\.7600\.8973\.16420\.7620\.7660\.8924\.44430\.7280\.7150\.8918\.50510\.7800\.7500\.9042\.49520\.7700\.7510\.9003\.16530\.7770\.7390\.9044\.44610\.7660\.7490\.8872\.15710\.7600\.7450\.8971\.92B=3600B\{=\}3600,wmax=6w\_\{\\max\}\{=\}60\.7770\.7550\.9072\.15

Table 10:Window\-parameter sweep, GLM\-4\.7\-flash, FinancePSS\-205, single runs\. DocF1/PageF1 with expand; no\-expand DocF1 in the fourth column\. “calls”: LLM calls per stream\.
## Appendix DMatched\-Context Pairwise Control

To test whether RICoT’s gain is a context\-length effect, we keep the pairwise decision paradigm \(one independent call per page, predicting only that page’s label, no carried state or joint decoding\) but show a symmetric55\-page window\(n−2,…,n\+2\)\(n\{\-\}2,\\dots,n\{\+\}2\)instead of\(n−1,n\)\(n\{\-\}1,n\)\. Pages use the same head\-500500/tail\-300300truncation as the Windowed baseline, so per\-decision context is comparable to Windowed and RICoT windows\. GLM\-4\.7\-flash, internal thinking on \(as for the other baselines\), temperature0\.0010\.001;55full runs on FinancePSS\-205, all205205streams with no parse failures\.

#### Results\.

DocF10\.651±0\.0080\.651\\pm 0\.008\(PageF10\.852±0\.0060\.852\\pm 0\.006,95%95\\%CI\)\. Context matters: it lifts pairwise from0\.5060\.506to0\.6510\.651, which accounts for Windowed’s advantage over pairwise \(0\.6080\.608\)\. With context matched, RICoT still leads by\+0\.111\+0\.111\(\+0\.090\+0\.090without expand\), far outside the CI\.

#### Cost\.

The control makes7\.67\.6calls per stream \(one per page after the first, each re\-sending up to55pages\) versus RICoT’s2\.152\.15; each call uses2,8602\{,\}860input and1,2771\{,\}277internal\-thinking tokens on average, whereas RICoT runs with internal thinking off\.

## Appendix ELong Streams and Error Propagation

#### Depth\-stratified state propagation\.

On the1717longest FinancePSS streams, restricting to deep pages \(windows≥5\\geq 5\), full RICoT outperforms the no\-context\-propagation ablation by\+0\.178\+0\.178DocF1 \(GLM\-5\) and\+0\.131\+0\.131\(GLM\-4\.7\), while the effect is negative for GLM\-4\.7\-flash\. Recurrent state therefore matters most where it is exercised \(long streams\) and for models with the capacity to use it; on short streams, which fit in one or two windows, it has little to act on\.

#### Error cascading\.

Mapping boundary errors to windows shows local persistence rather than systematic corruption: the next\-window error rate is5050–71%71\\%after an erroneous window versus55–12%12\\%after a correct one, yet5454–69%69\\%of streams with an early error later produce an error\-free window \(median error run:22windows\)\. This analysis is observational; a causal estimate would require replay with corrected state\.

## Appendix FWorked Inference Example

Below is the teacher output for the first window \(pages 1–2 of 4 shown\) of a FinePDFs stream, in the full schema used for distillation\. Per\-page reasoning precedes each decision; the grounding fingerprint names the identifiers that define the active segment, and later pages cite fulfillment evidence against it\. Because this is the first window, no reasoning history or active\-segment summary is passed in; from the second window on,ℋ\(c\)\\mathcal\{H\}^\{\(c\)\}carries the most recent reasoning–decision pairs in this same format, and𝒜\(c\)\\mathcal\{A\}^\{\(c\)\}carries the active segment’s start page, class, pages covered, and the model\-emitted carry\-forward block\. The complete chunk, including its two decisions\-only renderings \(Appendix[R](https://arxiv.org/html/2611.22382#A18)\), will be included in the public release, with the verbatim instruction prose withheld \(Appendix[T](https://arxiv.org/html/2611.22382#A20)\)\.

<analyze\_page\> First page of the stream\. Header clearly identifies this as a SEC Form 10\-K annual report for Landec Corporation, fiscal year ended October 28, 2001, with commission file number 0\-27446\. Active segment resets to SEC Form 10\-K annual report grounded by Landec Corporation, FY 2001, file number 0\-27446\. </analyze\_page\> <decision\> <page\>1</page\> <segment\_boundary\> <type\>SEGMENT\_START</type\> <document\_class\>SEC Form 10\-K annual report</document\_class\> <grounding\> <fingerprint\>Landec Corporation, FY ended 10/28/2001, Commission file number 0\-27446</fingerprint\> <initiation\_evidence\>Header Dominance: SEC Form 10\-K header with clear company identification, fiscal year, and commission file number; first page of stream</initiation\_evidence\></grounding\> <confidence\>high</confidence\></segment\_boundary\> <page\_role\>cover page with company information and securities registration details</page\_role\> </decision\> <analyze\_page\> Page 2 continues the same Form 10\-K document with ‘‘LANDEC CORPORATION ANNUAL REPORT ON FORM 10\-K’’ header and table of contents listing Items 1\-14\. \[…\] No new segment initiation signals present\. </analyze\_page\> <decision\> <page\>2</page\> <segment\_boundary\> <type\>SEGMENT\_CONTINUATION</type\> <grounding\> <fulfillment\_evidence\>Same Form 10\-K document continuation, table of contents follows cover page structure, consistent company name and document type</fulfillment\_evidence\> </grounding\> <confidence\>high</confidence\></segment\_boundary\> <sub\_document\_start\>none</sub\_document\_start\> <page\_role\>table of contents and beginning of Part I</page\_role\> </decision\>

## Appendix GTABME\-250 Stream IDs

The250250TABME stream IDs used for all prompting experiments were sampled uniformly at random from TABME’s5,0005\{,\}000\-stream test split with a fixed seed and held constant across runs:

> 2492, 1410, 1806, 1699, 2082, 2914, 1944, 3341, 4049, 4073, 2664, 2227, 1672, 2658, 2375, 2024, 2099, 758, 1374, 2002, 3178, 4357, 3601, 1295, 4428, 134, 3494, 2527, 4925, 176, 1965, 4676, 701, 1492, 2347, 4195, 2997, 4865, 225, 1994, 4981, 3060, 2037, 575, 3342, 1517, 3121, 705, 2449, 204, 3614, 440, 2233, 4297, 2162, 4230, 1863, 3107, 2826, 3273, 1089, 3823, 4807, 409, 2605, 2794, 2499, 2845, 1320, 4997, 638, 3191, 1464, 601, 1223, 2791, 3144, 3678, 3659, 650, 2810, 3403, 3540, 2984, 1685, 2817, 4879, 1943, 3412, 4797, 1695, 554, 2866, 813, 3749, 367, 1325, 1638, 1494, 1970, 1509, 42, 2060, 1381, 1760, 4188, 619, 172, 331, 3695, 1399, 3172, 946, 3794, 4975, 1175, 3756, 3687, 1383, 2917, 3688, 4758, 714, 2665, 566, 226, 4821, 4661, 1645, 3663, 4370, 1642, 3498, 3055, 3543, 2606, 3203, 2136, 4858, 989, 1969, 4098, 4362, 2895, 1713, 2278, 1352, 4967, 3934, 1789, 3929, 2532, 2941, 1807, 4933, 2830, 3536, 2859, 3185, 4783, 1395, 402, 2964, 2715, 2117, 1892, 3175, 3503, 3522, 1006, 2581, 4912, 3889, 2334, 4482, 3186, 2422, 2106, 1487, 1237, 950, 1773, 1157, 2870, 3070, 4806, 4825, 3149, 4882, 1179, 3857, 3210, 4991, 844, 2153, 2858, 1061, 4378, 642, 4574, 4533, 471, 2766, 1723, 4900, 786, 746, 3501, 1362, 4893, 4376, 4107, 858, 3825, 1598, 4911, 2088, 2955, 3285, 308, 1465, 1840, 4090, 4270, 485, 4192, 4265, 4598, 242, 3747, 3572, 2772, 2103, 1756, 3923, 2398, 4604, 1143, 2785, 3097, 2860, 854, 1266, 1421, 1423, 1573, 2399, 4253, 4423, 4464

Our distilled22B model is additionally evaluated on the full5,0005\{,\}000\-stream test set \(TABME\-full\); the subset / full numbers track closely \(DocF10\.7560\.756vs\.0\.7700\.770for Qwen\-3\.5\-2B⋆,PwT\), supporting the250250\-stream subset as representative of the full distribution\.

## Appendix HTABME Page\-Level Precision/Recall

Table[11](https://arxiv.org/html/2611.22382#A8.T11)reports page\-level precision and recall on TABME\-250 under RICoT prompting\. Recall is≥0\.955\\geq 0\.955on every prompted model and precision spans0\.7330\.733–0\.8730\.873, so errors are mostly extra boundaries rather than missed ones\. The distilled student shows the same shape on the full test set \(boundary\-level precision0\.8360\.836, recall0\.9510\.951, B\-F10\.8900\.890\)\. Appendix[I](https://arxiv.org/html/2611.22382#A9)analyses these extra boundaries: some are document starts that TABME’s file\-level labels merge, but most are errors of the model\.

ModelPagePPageRGapG4\.7\-F0\.7330\.955\+0\.222\+0\.222G4\.70\.8320\.962\+0\.130\+0\.130C\-H4\.50\.8610\.965\+0\.104\+0\.104G50\.8730\.978\+0\.105\+0\.105Table 11:TABME\-250 page\-level precision/recall under RICoT prompting\.
## Appendix ITABME False Boundaries: Error Analysis

#### Setup\.

We analyse the false boundaries \(FPs\) of Q3\.5\-2B⋆\(RICoT, no pagewise thinking\) on the full5,0005\{,\}000\-stream test set, scoring sub\-document starts as continuations as in all our metrics \(Section[5\.3](https://arxiv.org/html/2611.22382#S5.SS3)\): precision0\.8360\.836, recall0\.9510\.951, B\-F10\.8900\.890,9,3319\{,\}331FPs\. We sampled100100FPs:4545at random \(one per stream\) and5555as one error site per source file, from files not already sampled; they cover9898distinct \(file, page\) sites\. Each was judged by hand from the OCR text, and2525of them, including every A1 site, were also checked against the page images; this changed one label \(a magazine letters page first judged to come from another issue was the next page of the same issue\)\.

#### Categories\.

A1: a genuine top\-level document begins inside one source file \(e\.g\. two separate funding records filed together\); TABME’s file\-level label merges them\.A2: a genuine nested document \(envelope, enclosure, attachment, fax payload\) that the model emitted as a top\-level start\. In our framework the correct output is a sub\-document start, which the metric scores as continuation, so A2 is a model error: the right document at the wrong level\.B: no document starts here; the page continues the same document\.C: ambiguous \(archive slip sheets, near\-empty pages, unreadable OCR\)\.

WeightingA1A2BCPer sampled case \(n=100n\{=\}100\)14274415Per distinct site \(9898\)13274515Per FP occurrence17333317Table 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\\pm 10points\.
#### Findings\.

Table[12](https://arxiv.org/html/2611.22382#A9.T12)gives the breakdown\. A1 and A2 sites recur more often than B sites \(∼\\sim17×17\\timesvs\.∼\\sim9\.6×9\.6\\timesacross the test set\): short files such as a letter and its envelope, or a memo and its attachment, appear in many streams\. Per occurrence, A1 accounts for about17%17\\%of the FPs; counting these pages as correct raises precision from0\.8360\.836to about0\.860\.86\. A1 also includes convention cases, such as a second copy of a form or a technical sheet followed by its safety data sheet\. About two thirds of the FPs \(A2 and B\) are errors of the model\. The B errors follow a few patterns: \(i\) later pages that repeat the title block, project or estimate number, or carry “Pagennofmm”; \(ii\) section, table and figure headings inside a long document; \(iii\) title slides or cover pages inside a deck or brochure; \(iv\) back sides and stamp pages \(e\.g\. the endorsement side of a check\); and \(v\) a memo that follows its own distribution page\.

#### Separate documents within one source file\.

Figure[3](https://arxiv.org/html/2611.22382#A9.F3)shows four A1 cases, in which the page the model marked as a new document begins a separate document filed in the same source PDF; TABME’s file\-level label counts each boundary as an error\. \(a\) Two check transmittal forms of the Council for Tobacco Research for the same grant, one for the third and one for the fourth quarterly payment \(stream 0390, p\. 11; a false boundary in1818of the3333streams containing the file\)\. \(b\) Product\-test summaries of two different projects, with different samples and results \(stream 3712, p\. 7;2727of2929\)\. \(c\) Two separate bibliographic database printouts, each with its own print number, “PAGE 1” header and end\-of\-print marker \(stream 0065, p\. 4;1111of3232\)\. \(d\) Compiled funding records: a grant followed by a contract to a different recipient, with its own activation date and amount \(stream 0211, p\. 14;2828of2828\)\.

![Refer to caption](https://arxiv.org/html/2611.22382v1/figures/tabme/tabme_case056.jpg)

\(a\) Check transmittal forms, third and fourth payment

![Refer to caption](https://arxiv.org/html/2611.22382v1/figures/tabme/tabme_case007.jpg)

\(b\) Product\-test summaries of two projects

![Refer to caption](https://arxiv.org/html/2611.22382v1/figures/tabme/tabme_case049.jpg)

\(c\) Two separate database printouts

![Refer to caption](https://arxiv.org/html/2611.22382v1/figures/tabme/tabme_case038.jpg)

\(d\) A grant record followed by a contract record

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\.

## Appendix JToken\-Cost Breakdown

Table[13](https://arxiv.org/html/2611.22382#A10.T13)expands the cost figures in Section[6\.4](https://arxiv.org/html/2611.22382#S6.SS4)with per\-channel breakdowns, all on GLM\-4\.7\-flash with FinancePSS\-205 input\. Input is approximately constant across modes; output variation is dominated by the internal\-thinking budget, which constitutes73%73\\%–82%82\\%of total output in internal modes\. When internal thinking is on, external pagewise\-thinking tokens drop from7272to4444\(∼\\sim39%39\\%reduction\), evidence of partial substitution between the two reasoning channels\.

ModeInOutInt\.Ext\.Dec\.C\-fwdno\-think7521720014221pagewise79723207212620windowed77225108312820int\.\+pagewise7677225284411516int\. only736823674011017Table 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\.
## Appendix KInterleaved\-Thinking Ablation \(Full\)

Table[14](https://arxiv.org/html/2611.22382#A11.T14)expands the pagewise\-thinking ablation across all three datasets and all three prompted models\. The*think*row is the full RICoT configuration with pagewise thinking;*windowed\_think*replaces the interleaved per\-page reasoning with a single block of reasoning emitted before the window\-level decisions;*wo\_think*disables structured reasoning entirely\. FinancePSS uses with\-expand\.

DatasetConfigurationG4\.7\-FG4\.7G5FinancePSSthink \(full\)0\.7620\.8320\.826windowed\_think0\.7540\.8140\.746wo\_think0\.6880\.7840\.738Tobacco800think \(full\)0\.8670\.9610\.967windowed\_think0\.8460\.9680\.981wo\_think0\.8220\.9420\.981TABME\-250think \(full\)0\.6830\.7940\.847windowed\_think0\.6770\.8050\.847wo\_think0\.6610\.7620\.829Table 14:Interleaved\-thinking ablation, DocF1 by dataset and model\.
## Appendix LState\-Propagation Ablation \(Full\)

Table[15](https://arxiv.org/html/2611.22382#A12.T15)expands the state\-propagation ablation across all three datasets and three models\. The full RICoT configuration carries both the reasoning historyℋ\(c\)\\mathcal\{H\}^\{\(c\)\}\(“cognitive trace”\) and the active\-segment summary𝒜\(c\)\\mathcal\{A\}^\{\(c\)\}\(which includes the model\-emittedactive\_segment\_carry\_forwardblock\) across windows\.*only\_cognitive\_trace*keeps onlyℋ\(c\)\\mathcal\{H\}^\{\(c\)\};*only\_active\_segment*keeps only𝒜\(c\)\\mathcal\{A\}^\{\(c\)\};*no\_carry\_forward*drops the model\-emitted carry\-forward block but keeps the deterministic summary;*no\_context\_propagation*disables all cross\-window state\.

DatasetConfigurationG4\.7\-FG4\.7G5FinancePSSfull0\.7620\.8320\.826only\_cognitive\_trace0\.7480\.8240\.766only\_active\_segment0\.7490\.8010\.786no\_carry\_forward0\.7360\.8410\.795no\_context\_prop\.0\.7520\.8370\.778Tobacco800full0\.8670\.9610\.967only\_cognitive\_trace0\.8870\.9710\.981only\_active\_segment0\.8920\.9350\.968no\_carry\_forward0\.9100\.9680\.967no\_context\_prop\.0\.8920\.9610\.977TABME\-250full0\.6830\.7940\.847only\_cognitive\_trace0\.6920\.7990\.854only\_active\_segment0\.6680\.7890\.818no\_carry\_forward0\.6770\.8160\.855no\_context\_prop\.0\.6700\.7510\.796

Table 15:State\-propagation ablation, DocF1\.The cognitive trace is consistently load\-bearing \(removing it hurts noticeably\), while the carry\-forward block is mixed across models—supporting the framing in Section[6\.5](https://arxiv.org/html/2611.22382#S6.SS5)that the state\-propagation story rests on the cognitive trace rather than carry\-forward specifically\.

## Appendix MDecision\-Block Ablation \(Full\)

Table[16](https://arxiv.org/html/2611.22382#A13.T16)ablates the per\-page decision schema\.*barebone*drops everything exceptyiy\_\{i\}andℓi\\ell\_\{i\};*no\_auxiliary*drops auxiliary tags \(⟨page\_role⟩\\langle\\text\{page\\\_role\}\\rangle,⟨sub\_document\_start⟩\\langle\\text\{sub\\\_document\\\_start\}\\rangle\);*no\_grounding*drops the fingerprint and evidence quote;*no\_nested*drops the sub\-document axisziz\_\{i\}\. The pattern inverts with model size: smaller models often pay a capacity tax for schema overhead, while larger models are roughly invariant or benefit from the structure\.

DatasetConfigurationG4\.7\-FG4\.7G5FinancePSSfull0\.7620\.8320\.826barebone0\.7080\.7720\.760no\_auxiliary0\.7750\.8090\.770no\_grounding0\.6950\.8310\.755no\_nested0\.7400\.8120\.746Tobacco800full0\.8670\.9610\.967barebone0\.9390\.9610\.987no\_auxiliary0\.9100\.9710\.971no\_grounding0\.8510\.9670\.977no\_nested0\.8240\.9680\.977TABME\-250full0\.6830\.7940\.847barebone0\.6610\.8120\.851no\_auxiliary0\.6720\.8040\.849no\_grounding0\.6470\.7910\.841no\_nested0\.6560\.8020\.845Table 16:Decision\-block ablation, DocF1\.#### Class labels\.

Table[16](https://arxiv.org/html/2611.22382#A13.T16)does not isolate the class labels, so we ablated them separately on GLM\-4\.7\-flash / FinancePSS,55runs each, removing each label from prompt, output, and parser \(Table[17](https://arxiv.org/html/2611.22382#A13.T17)\)\. The top\-level classℓi\\ell\_\{i\}is never scored; the sub\-document class is a direct input to the with\-expand protocol, which promotes a nested start only when its predicted class is in the priority set\. Removing both labels changes DocF1 by−0\.011\-0\.011, within noise, so the top\-level label is metric\-neutral; we keep it as a reasoning scaffold \(naming the active document anchors the continuation test\) and because it is the field downstream routing consumes\. The sub\-document label is what lifts the full model from0\.7390\.739\(no\-expand\) to0\.7530\.753\(with expand\); removing it removes that gain by construction\. For pure segment boundaries the nested axis can be dropped at no cost: removing only the sub\-document class is neutral on F1 and lowersMNDDμ\\mathrm\{MNDD\}\_\{\\mu\}\.

ConfigurationDocF1PageF1MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}Full, with expand0\.753±0\.0240\.753\{\\pm\}0\.0240\.892±0\.0160\.892\{\\pm\}0\.0161\.14±0\.231\.14\{\\pm\}0\.23Full, no expand0\.739±0\.0130\.739\{\\pm\}0\.0130\.878±0\.0130\.878\{\\pm\}0\.0131\.32±0\.191\.32\{\\pm\}0\.19−\-sub\-document class0\.743±0\.0210\.743\{\\pm\}0\.0210\.884±0\.0150\.884\{\\pm\}0\.0151\.08±0\.141\.08\{\\pm\}0\.14−\-both class labels0\.728±0\.0270\.728\{\\pm\}0\.0270\.872±0\.0150\.872\{\\pm\}0\.0151\.40±0\.321\.40\{\\pm\}0\.32

Table 17:Class\-label ablation, GLM\-4\.7\-flash, FinancePSS\-205,55\-run mean±\\pm95%95\\%CI\. Without the sub\-document class, with\- and no\-expand scores coincide\.

## Appendix NPer\-Dataset Full Result Dumps

Complete per\-dataset result tables—all metrics \(DocF1, PageF1, PageP, PageR,MNDDμ\\mathrm\{MNDD\}\_\{\\mu\}, STP%\); all backbone×\{\\times\}method×\{\\times\}ablation combinations; both with\-expand and without\-expand variants on FinancePSS—will be included in the public release\.

## Appendix OTraining\-Sample Configuration

Table[18](https://arxiv.org/html/2611.22382#A15.T18)lists the probabilities used when rendering training samples \(Section[4\.2](https://arxiv.org/html/2611.22382#S4.SS2)\): the chunk\-level probability of omitting page\-level reasoning \(first row\) and the per\-field probabilities of omitting optional decision and carry\-forward fields\. The two are sampled independently\. Values were set heuristically, weighted by field importance, and not subjected to hyperparameter sweeps owing to compute constraints\.

Omitted contentProbabilityPagewise reasoning blocks \(chunk\-level\)0\.40Per\-page:document\_class0\.20Per\-page:confidence0\.20Per\-page:grounding\(fingerprint\+evidence\)0\.20Per\-page:sub\_documentnested instance0\.15Carry\-forward:progressfield0\.30

Table 18:Probabilities of omitting content when rendering training samples \(Section[4\.2](https://arxiv.org/html/2611.22382#S4.SS2)\)\.*Note\.*The probabilities above are working values used in the single training run reported in the paper\. We did not sweep them; their effect on accuracy remains unexplored\.

## Appendix PTraining Corpus Attrition Breakdown

Table[19](https://arxiv.org/html/2611.22382#A16.T19)summarizes the per\-stage attrition of the FinePDFs\-derived training corpus\. Of the300300K candidate documents sampled from the12\.312\.3M\-document finance subset, roughly50%50\\%survive download and language\-alignment filtering\. The main attrition stages are: failed Common Crawl fetch \(cache miss / dead URL\), page\-count mismatch between the downloaded PDF and FinePDFs metadata \(indicating unreliable OCR alignment\), and detection of pages in scripts unsupported by our OCR model\. The surviving150,448150\{,\}448documents feed into teacher labeling\.

StageCountFinePDFs \(English subset\)∼\\sim206M docsFinance filter \(stages 1\+2\)12\.3M docsSampled for training pool300K docsDownload, re\-OCR, language filter150,448 docsTeacher labeling \(chunk samples\)467,229 chunksFinal training corpus46,791 docsmulti\-segment20,959single\-segment25,832

Table 19:Training corpus construction pipeline\.
## Appendix QTraining Hyperparameters

Full QLoRA hyperparameters used for Qwen\-3\.5\-2B fine\-tuning \(Section[4\.3](https://arxiv.org/html/2611.22382#S4.SS3)\):

- •LoRA rank3232;α=64\\alpha=64; dropout00; target modulesq\_proj, k\_proj, v\_proj, o\_proj, gate\_proj, up\_proj, down\_proj\.
- •Optimizer: AdamW\-88bit; weight decay0\.010\.01; max grad norm1\.01\.0\.
- •Learning rate:8×10−58\{\\times\}10^\{\-5\}with cosine schedule and8%8\\%warmup ratio\.
- •Batch size: per\-device88, gradient\-accumulation22\(effective1616\); evaluation batch size3232\.
- •Epochs:11; validation split1%1\\%\(∼\\sim1,8001\{,\}800samples\)\.
- •Precision: bf16; gradient checkpointing on\.
- •Hardware:4×4\{\\times\}NVIDIA A100 80GB; wall\-clock∼\\sim4444hours\.

## Appendix RWorked Training\-Sample Example

A complete example showing the same source chunk rendered into a training sample \(i\) with all schema fields present and pagewise reasoning emitted, \(ii\) without page\-level reasoning \(decisions only\), and \(iii\) decisions only, with several optional decision fields also omitted, will be included in the public release\.

## Appendix SFinePDFs Finance\-Filter Classifier

The Stage 1 finance lexicon contains three tiers of keyword patterns of increasing specificity \(high\-confidence finance terms, moderate\-confidence terms, and disambiguation terms used to distinguish between finance vs\. accounting vs\. marketing contexts\)\. The Stage 2 XGBoost classifier was trained on∼\\sim100100K Stage\-1\-surviving documents labeled by an LLM judge \(prompted to apply binary finance vs\. non\-finance labels using a detailed rubric\); we used TF\-IDF features with a5050K\-term vocabulary capped at unigrams and bigrams\. The decision threshold was tuned on a55K\-document held\-out set to maximize F0\.5\(precision\-weighted\)\. The lexicon files, the LLM\-judge prompt, and the fitted TF\-IDF vectorizer will be included in the public release\.

## Appendix TPrompt Templates and Inference Configuration

Structural prompt templates for RICoT and both baselines \(task framing, stream\-context format, and per\-page decision schema\) will be included in the public release; the verbatim instruction prose is withheld\. All inference runs use temperature0\.0010\.001and top\-pp11; other sampling parameters are left at each provider’s defaults\. Internal extended thinking is explicitly disabled in the RICoT runs and enabled in the baseline runs\. Residual provider\-side nondeterminism is quantified in Appendix[B](https://arxiv.org/html/2611.22382#A2)\.

## Appendix UPseudocode for the RICoT Inference Loop

Algorithm[1](https://arxiv.org/html/2611.22382#alg1)gives the full inference\-time procedure referenced in Section[3\.3](https://arxiv.org/html/2611.22382#S3.SS3)\.

0:Stream

𝐗\\mathbf\{X\}, token budget

BB, page cap

wmaxw\_\{\\max\}, overlap

o=1o\\\!=\\\!1, history size

k=6k\\\!=\\\!6
0:Decisions

𝐝=\(d1,…,dN\)\\mathbf\{d\}=\(d\_\{1\},\\dots,d\_\{N\}\)
1:

ℋ←∅\\mathcal\{H\}\\\!\\leftarrow\\\!\\emptyset;

𝒜←∅\\mathcal\{A\}\\\!\\leftarrow\\\!\\emptyset;

κ←∅\\kappa\\\!\\leftarrow\\\!\\emptyset;

𝒞←∅\\mathcal\{C\}\\\!\\leftarrow\\\!\\emptyset;

c←1c\\\!\\leftarrow\\\!1
2:whilepages remaindo

3:

Wc←PackWindow​\(𝐗,B,wmax,o\)W\_\{c\}\\\!\\leftarrow\\textsc\{PackWindow\}\(\\mathbf\{X\};\\,B,w\_\{\\max\},o\)// greedy until budget or cap

4:tag

WcW\_\{c\}with<stream\>/</stream\>if first/last

5:

\(𝐓c,𝐝c,κ′\)←ICoT​\(Wc,ℋ,𝒜∪κ\)\(\\mathbf\{T\}\_\{c\},\\mathbf\{d\}\_\{c\},\\kappa^\{\\prime\}\)\\leftarrow\\textsc\{ICoT\}\(W\_\{c\},\\mathcal\{H\},\\mathcal\{A\}\\cup\\kappa\)
6:

𝐝c←Validate​\(𝐝c,𝒞\)\\mathbf\{d\}\_\{c\}\\leftarrow\\textsc\{Validate\}\(\\mathbf\{d\}\_\{c\},\\mathcal\{C\}\)// cache\-fill, retry, fallback

7:

𝒞←𝒞∪\{d:valid\}\\mathcal\{C\}\\\!\\leftarrow\\\!\\mathcal\{C\}\\cup\\\{d:\\text\{valid\}\\\}; append

𝐝c\\mathbf\{d\}\_\{c\}to

𝐝\\mathbf\{d\}
8:

ℋ←\\mathcal\{H\}\\\!\\leftarrowlast

kkpairs of

\(𝐓c,𝐝c\)\(\\mathbf\{T\}\_\{c\},\\mathbf\{d\}\_\{c\}\)
9:if

∃d∈𝐝c:y=S\\exists\\,d\\in\\mathbf\{d\}\_\{c\}:y\\\!=\\\!\\text\{S\}then

10:

𝒜←\\mathcal\{A\}\\\!\\leftarrowmetadata from new segment

11:else

12:

𝒜←𝒜∪𝐝c\\mathcal\{A\}\\\!\\leftarrow\\\!\\mathcal\{A\}\\cup\\mathbf\{d\}\_\{c\}
13:endif

14:

κ←κ′\\kappa\\\!\\leftarrow\\\!\\kappa^\{\\prime\}\(

∅\\emptysetif final window\)

15:

c←c\+1c\\\!\\leftarrow\\\!c\+1
16:endwhile

17:return

𝐝\\mathbf\{d\}

Algorithm 1RICoT page\-stream segmentation

Similar Articles

InterleaveThinker: Reinforcing Agentic Interleaved Generation

Hugging Face Daily Papers

InterleaveThinker introduces a multi-agent pipeline with planner and critic agents to enable interleaved text-image generation for existing image generators, achieving performance comparable to state-of-the-art models and improving reasoning benchmarks.

REACT: Representational Early Analysis and Control of Chain-of-Thought Trajectories

arXiv cs.LG

The paper introduces REACT, a conditional activation intervention that learns a safety direction from paired safe/unsafe chain-of-thought trajectories and applies a single early edit to frozen reasoning models, boosting fully safe outputs on StrongREJECT-273 from 29.06% to 82.05% and showing that the most effective intervention window lies within the first two to three CoT tokens.