RICoT: Recurrent Interleaved Chain-of-Thought for Page Stream Segmentation
Abstract
Page Stream Segmentation (PSS) partitions multi-page files into constituent documents—a task critical for finance automation where batched invoices, purchase orders, and remittance advice must be correctly separated. Existing LLM approaches rely on pairwise classification, which restricts context to adjacent pages and redundantly encodes each page twice. We introduce RICoT (Recurrent Interleaved Chain-of-Thought), a prompting framework with two key innovations: (a) interleaved chain-of-thought reasoning that alternates per-page analysis with structured boundary decisions within each sliding window, and (b) recurrent state propagation that carries reasoning history and an active-segment summary across windows, preserving long-range context for arbitrarily long streams. Across commercial and open-source LLMs, RICoT achieves DocF1 of 0.847 on TABME, outperforming all prior zero-shot baselines by +0.144 over GPT-4o. Ablations reveal that interleaved page-level reasoning is the dominant contributor.