TL;DR
RICoT (Recurrent Interleaved Chain-of-Thought) is a novel framework that reimagines Page Stream Segmentation (PSS) as a sequential reading process for LLMs. By interleaving per-page reasoning with boundary decisions and carrying a "recurrent state" across sliding windows, RICoT achieves state-of-the-art performance on document splitting while significantly reducing computational redundancy.
What Problem Does This Paper Address?
Imagine a single PDF file containing a hundred scanned pages: a mix of invoices, receipts, emails, and shipping notices. Page Stream Segmentation (PSS) is the task of automatically splitting this "stream" into its constituent individual documents. This is a critical first step in automated financial workflows (like Accounts Payable), where merging two different invoices can lead to costly errors.
Traditional approaches rely on pairwise classification, where a model looks at two adjacent pages and decides if a boundary exists between them. This method has two major flaws:
- Contextual Isolation: Some documents can only be identified by looking at headers or summaries many pages back. A pairwise classifier is "short-sighted."
- Computational Redundancy: To process a stream, models often re-encode the same pages multiple times as they slide a window across the document, wasting tokens and compute.
Methods
The authors propose RICoT, which treats PSS like a human reader would: moving through the pages sequentially and keeping a mental note of what has been seen so far.
Key technical innovations include:
- Pagewise Thinking (PwT): Within a sliding window, the model generates a reasoning block (
<think>) for a page, followed immediately by its decision (<decision>), before moving to the next page. This "interleaving" grounds every decision in local evidence. - Recurrent State Propagation: To maintain long-range coherence, RICoT passes two objects between windows:
- $H^{(c)}$: A short history of recent reasoning-decision pairs.
- $A^{(c)}$: A summary of the currently "active" document segment.
- Two-Axis Decision Schema: The model doesn't just predict "start" or "continue." It predicts on two axes: the segment axis (is this a new document?) and the sub-document axis (is this a nested item, like an attachment?).
- Distillation: The researchers distilled the RICoT logic from a large "teacher" model into a compact 2B-parameter student model (based on Qwen-3.5), making high-performance segmentation viable for edge deployment.
Datasets
The study evaluates RICoT across three distinct benchmarks:
- FinancePSS-205 (New): A newly introduced benchmark of 205 real-world, de-identified financial page streams. It features complex "bundling" common in industry, such as invoices nested within statements.
- TABME: A large-scale synthetic benchmark built from tobacco industry documents.
- Tobacco800: A classic, smaller PSS benchmark used for historical comparison.
For training the distilled student model, the authors curated a finance-specific subset of the FinePDFs corpus, filtering it down to 12.3M documents using a two-stage keyword and XGBoost classifier.
Key Insights and Ideas
- Sequential > Pairwise: The "aha moment" is that PSS is fundamentally a sequential task. By allowing the LLM to "read" and carry state, it can resolve ambiguities that stump pairwise models (e.g., recognizing a page as a continuation because it matches a specific invoice ID seen 5 pages ago).
- Interleaving Matters: Ablation studies showed that "Pagewise Thinking"—reasoning immediately before each decision—is the single most important factor for accuracy, outperforming models that reason about a whole block of pages at once.
- Small Models Punch Up: Through distillation, a 2B model can achieve performance within 0.05 DocF1 of a 30B+ parameter prompted model. This suggests that the framework of RICoT is as important as the raw capacity of the underlying LLM.
- Controllability via "Expand": By separating segment starts from sub-document starts, the authors created a "knob" for deployment. Users can choose to treat attachments as separate documents ("expand" mode) or keep them merged without re-running the model.
Key Results
RICoT consistently outperformed pairwise and windowed baselines across all backbones (GLM-4.7, GLM-5, Claude Haiku).
- FinancePSS-205: RICoT achieved a DocF1 of 0.832 (with GLM-4.7), a significant jump over the best pairwise baseline (0.763).
- TABME: On the full 5,000-stream test set, the distilled 2B student reached a DocF1 of 0.770, surpassing previous zero-shot results from much larger models like GPT-4o.
- Efficiency: RICoT reduces the number of LLM calls per stream. For example, on FinancePSS, it required only ~2.15 calls per stream compared to ~7.6 for a context-matched pairwise baseline.
Limitations and Future Work
- Language: The current evaluation is restricted to English documents.
- Causality: Because it is a sequential, recurrent process, RICoT cannot be parallelized within a single long stream (though multiple streams can be processed in parallel).
- Granularity: The model treats each page as a single unit; it does not currently handle cases where multiple documents might be scanned onto a single physical page.
- Future Directions: The authors suggest extending RICoT to multilingual streams and exploring non-contiguous document re-association (e.g., finding a missing page of an invoice located elsewhere in the file).
Summary updated