以更低成本分割文档:基于LLM的页面流分割的Multi-Split边界决策
摘要
本文提出Multi-Split边界决策(MSBD),用于降低基于大语言模型的零样本页面流分割中的推理成本,在适当窗口大小下展示效率提升并保持准确性。
arXiv:2609.22620v1 Announce Type: new
Abstract: Scanned mail, uploaded PDFs, and consolidated attachments often arrive as page streams that must be split into individual documents before downstream classification, extraction, or routing. Zero-shot large language models can detect document boundaries without task-specific training, but standard Page Classification (PC) and Boundary Decision (BD) formulations resolve only one boundary per model call. We introduce Multi-Split Boundary Decision (MSBD), which predicts multiple boundaries within a page window in a single call, reducing the number of inference requests. We evaluate MSBD across multiple language models, document collections, input modalities, and window sizes. The results reveal a model- and corpus-dependent operating range in which MSBD preserves strong segmentation accuracy while substantially improving inference efficiency, followed by a sharp decline at larger windows. MSBD provided the strongest overall accuracy--efficiency trade-off, while large windows expose distinct over- and under-segmentation behavior across models. These findings show that multi-boundary prediction can make zero-shot page stream segmentation more efficient when the window size is selected for the target corpus.
查看缓存全文
缓存时间: 2026/09/23 09:10
# Splitting Documents at Lower Cost: Multi-Split Boundary Decisions for LLM-Based Page Stream Segmentation
Source: [https://arxiv.org/html/2609.22620](https://arxiv.org/html/2609.22620)
Sepideh KharaghaniSaverio VadacchinoAffiliation:Alejandro PosadaYing ZhangAffiliation:ServiceNow CanadaAffiliation:\{nikhilreddy\.pottanigari, sepideh\.kharaghani,Affiliation:saverio\.vadacchino, alejandro\.posada,Email:[yin\.zhang\}@servicenow\.com](mailto:)
###### Abstract
Scanned mail, uploaded PDFs, and consolidated attachments often arrive as page streams that must be split into individual documents before downstream classification, extraction, or routing\. Zero\-shot large language models can detect document boundaries without task\-specific training, but standard Page Classification \(PC\) and Boundary Decision \(BD\) formulations resolve only one boundary per model call\. We introduceMulti\-Split Boundary Decision\(MSBD\), which predicts multiple boundaries within a page window in a single call, reducing the number of inference requests\. We evaluate MSBD across multiple language models, document collections, input modalities, and window sizes\. The results reveal a model\- and corpus\-dependent operating range in which MSBD preserves strong segmentation accuracy while substantially improving inference efficiency, followed by a sharp decline at larger windows\. MSBD provided the strongest overall accuracy–efficiency trade\-off, while large windows expose distinct over\- and under\-segmentation behavior across models\. These findings show that multi\-boundary prediction can make zero\-shot page stream segmentation more efficient when the window size is selected for the target corpus\.
## 1Introduction
Figure 1:Zero\-shot PSS formulations\. PC classifies each page independently, BD evaluates one adjacent\-page pair per call, and MSBD predicts allK−1K\{\-\}1boundaries within aKK\-page window in a single call\.Documents often arrive as batches of scanned pages, consolidated attachments, or multi\-document PDF uploads rather than as individually separated files\. Before classification, extraction, or routing, these page streams must be partitioned into their constituent documents\. An incorrect boundary can either merge unrelated documents or split one document into fragments, affecting every downstream processing step\.
This task is known asPage Stream Segmentation\(PSS\)\. Given an ordered page streamP=\(p1,…,pN\)P=\(p\_\{1\},\\dots,p\_\{N\}\), the goal is to determine whether each page begins a new document \(*cut*\) or continues the preceding one \(*continue*\)\([Gordo et al\., 2013](https://arxiv.org/html/2609.22620#bib.bib5);[Wiedemann and Heyer, 2021](https://arxiv.org/html/2609.22620#bib.bib4);[Mungmeeprued et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib3)\)\. PSS is an important component of document\-processing workflows in domains such as healthcare, finance, and logistics\([Islam et al\., 2026](https://arxiv.org/html/2609.22620#bib.bib9)\)\.
Most prior PSS systems rely on task\-specific training using hand\-crafted features, neural classifiers, or Transformer\-based models\([Gordo et al\., 2013](https://arxiv.org/html/2609.22620#bib.bib5);[Wiedemann and Heyer, 2021](https://arxiv.org/html/2609.22620#bib.bib4)\)\. Although effective within their target domains, these approaches require labelled boundary data and may need retraining when document distributions change\. General\-purpose language and vision\-language models provide an alternative: they can perform PSS zero\-shot, without training a dedicated boundary detector\.
However, existing zero\-shot formulations remain inefficient\.Page Classification\(PC\) examines one page at a time, whileBoundary Decision\(BD\) examines one adjacent\-page pair at a time\. Both resolve only one candidate boundary per model call, so processing cost grows linearly with stream length\.
We introduceMulti\-Split Boundary Decision\(MSBD\), which predicts all boundaries within a window ofKKconsecutive pages in a single call\. MSBD therefore reduces the number of model requests by sharing one inference call across multiple adjacent\-page decisions\. This creates a central trade\-off: larger windows improve efficiency but may make the prediction task more difficult\.
We study this trade\-off in the*split\-only*setting, where pages are already ordered and the task is limited to boundary detection rather than document classification or page reordering\. We compare MSBD with PC, BD, and conventional trained and feature\-similarity baselines across multiple models, datasets, input modalities, and window sizes\.
#### Contributions
1. \(1\)We introduceMulti\-Split Boundary Decision, a zero\-shot PSS formulation that predicts multiple adjacent\-page boundaries within a single model call\.
2. \(2\)We systematically evaluate how window size affects segmentation accuracy, model calls, inference cost, latency, and output reliability across language models, datasets, and text and vision inputs\.
3. \(3\)We identify a model\- and corpus\-dependent operating range in which MSBD preserves strong boundary accuracy while substantially reducing inference requests, and characterize the failure modes that emerge beyond this range\.
4. \(4\)We compare zero\-shot PC, BD, and MSBD with conventional supervised and feature\-similarity baselines, clarifying the trade\-offs between task\-specific training and general\-purpose prompting\.
## 2Background and Related Work
#### From hand\-crafted features to decoder LLMs
Early PSS systems used constrained clustering over inter\-page similarity or supervised classifiers over hand\-crafted structural, textual, and visual features\([Collins\-Thompson and Nickolov, 2002](https://arxiv.org/html/2609.22620#bib.bib16);[Gordo et al\., 2013](https://arxiv.org/html/2609.22620#bib.bib5);[Daher and Belaïd, 2014](https://arxiv.org/html/2609.22620#bib.bib8);[Agin et al\., 2015](https://arxiv.org/html/2609.22620#bib.bib17)\)\. Later work introduced recurrent language models, CNNs, and RNNs over textual and visual page representations\([Wiedemann and Heyer, 2021](https://arxiv.org/html/2609.22620#bib.bib4);[Neche et al\., 2020](https://arxiv.org/html/2609.22620#bib.bib18)\), and deep page embeddings enabled agglomerative clustering\([Busch et al\., 2023](https://arxiv.org/html/2609.22620#bib.bib20)\)\. Transformer\-based methods remained limited: prior work combined LEGAL\-BERT or LayoutLM with CNNs over consecutive pages\([Guha et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib7);[Mungmeeprued et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib3)\), and[Braz et al\. \(2021\)](https://arxiv.org/html/2609.22620#bib.bib6)compared windows of one to three pages\. More recently,[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2609.22620#bib.bib1)fine\-tuned Mistral\-7B and Phi\-3 on TABME\+\+, outperforming encoder models and an XGBoost baseline, and showed that zero\-shot GPT\-4o was competitive with trained encoders and that OCR quality strongly affects text\-based PSS\. Follow\-up work in insurance reported similar fine\-tuning gains while highlighting the difficulty of stream\-level calibration\([Heidenreich et al\., 2025](https://arxiv.org/html/2609.22620#bib.bib2)\)\.
#### Boundaries, types, and order
[Islam et al\. \(2026\)](https://arxiv.org/html/2609.22620#bib.bib9)define*document packet splitting*as the joint problem of detecting boundaries, classifying document types, and reconstructing page order in shuffled packets; they find boundary detection to be the main bottleneck, motivating our split\-only focus\. Other work jointly models inter\-page relations, segmentation, and classification\([Demirtaş et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib21)\)\. Benchmark coverage has expanded from the synthetic streams in TABME\([Mungmeeprued et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib3)\)to more realistic public datasets such as WooIR and OpenPSS\([Van Heusden et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib19);[van Heusden et al\., 2024](https://arxiv.org/html/2609.22620#bib.bib10)\)and to domain\-specific settings such as comic books\([Ortega et al\., 2025](https://arxiv.org/html/2609.22620#bib.bib11)\)\.
#### Multi\-instance prompting
Packing several task instances into one call to amortize API cost is known in general\-purpose prompting\([Cheng et al\., 2023](https://arxiv.org/html/2609.22620#bib.bib22)\), where accuracy typically degrades as batch size grows\. MSBD differs in one important respect: theK−1K\{\-\}1decisions in a window are not independent instances but related decisions over a shared page sequence, so enlarging the window adds both prediction load and context\. Consequently, accuracy can plateau rather than immediately degrade at small values ofKK\.
#### Positioning
Unlike prior work that trains or fine\-tunes models for PSS, we keep all models fixed and evaluate them entirely zero\-shot, comparing text and vision inputs on TABME\+\+ and on a form\-heavy corpus constructed from VRDU\([Wang et al\., 2023](https://arxiv.org/html/2609.22620#bib.bib12)\)\.
## 3Task Formulation and Methods
The three zero\-shot formulations we study \(Figure[1](https://arxiv.org/html/2609.22620#S1.F1)\) all use the same fixed LLM or VLM without fine\-tuning; they differ only in the context provided per call and the number of boundaries predicted at once\. Our method, MSBD, is described next, while the single\-call baselines against which we compare, PC and BD, are defined in §[5](https://arxiv.org/html/2609.22620#S5)\.
#### MSBD: Multi\-Split Boundary Decision
MSBD processes a window ofKKconsecutive pages and predicts allK−1K\{\-\}1boundaries within that window in a single call\. The model returns one JSON field per adjacent pair, fromsplit\_1tosplit\_\(K−1\)\(K\{\-\}1\), with each field labelledcut\_pageorcontinuous\_page\(Appendix[C](https://arxiv.org/html/2609.22620#A3)\)\.
Windows are tiled with strideK−1K\{\-\}1, so consecutive windows overlap by one page and every adjacent pair is evaluated exactly once\. This reduces the number of calls to approximately
⌈N−1K−1⌉\.\\left\\lceil\\frac\{N\-1\}\{K\-1\}\\right\\rceil\.WhenK=2K\{=\}2, MSBD is equivalent to BD\. We evaluateK∈\{3,5,7,10,20,30,50\}K\\in\\\{3,5,7,10,20,30,50\\\}\.
The predicted fields are concatenated in page order to reconstruct the full boundary sequencey2,…,yNy\_\{2\},\\dots,y\_\{N\}, and documents are recovered by cutting at every predictedcut\_page\. A well\-formed response contains one field for every candidate boundary in its window \(normallyK−1K\{\-\}1, with fewer in a final short window\)\. The window sizeKKtherefore trades fewer calls against a harder multi\-page prediction problem\.
## 4Experimental Setup
#### Datasets
*TABME\+\+*\([Heidenreich et al\., 2024](https://arxiv.org/html/2609.22620#bib.bib1)\)extends TABME\([Mungmeeprued et al\., 2022](https://arxiv.org/html/2609.22620#bib.bib3)\), a collection of synthetic streams formed by concatenating business documents, with improved commercial OCR\. We use the dataset unmodified, as samples are already organized into page streams\. It contains approximately6\.26\.2k pages and a similar number of adjacent\-page decisions\.
*VRDU*\([Wang et al\., 2023](https://arxiv.org/html/2609.22620#bib.bib12)\)is a public, form\-heavy dataset containing registration and advertising\-buy forms, but it is not provided as page streams\. We construct streams by concatenating complete documents and label the first page of each document as acut\. This construction makes many boundaries visually distinctive, which partly explains the strong PC performance on VRDU\. The resulting corpus contains approximately1\.11\.1k pages\. Both datasets are reasonably balanced at the adjacent\-pair level, with cut rates between approximately36%36\\%and46%46\\%\.
#### Models and protocol
We evaluate three models in a zero\-shot setting:gemini\-3\.1\-flash\-lite\([Google, 2026](https://arxiv.org/html/2609.22620#bib.bib14)\),gpt\-5\.4\-mini\([OpenAI, 2026](https://arxiv.org/html/2609.22620#bib.bib15)\), andclaude\-haiku\-4\.5\([Amazon Web Services, 2026](https://arxiv.org/html/2609.22620#bib.bib13)\)\. Each formulation, PC, BD, and MSBD, is evaluated with OCR\-text and page\-image inputs on both datasets\. All models are prompted to return structured JSON, decoded at temperature00, and limited to10241024output tokens\. Page images are rendered at300300DPI\. We run one decoding pass per configuration\.
#### Metrics
We report Boundary F1 \(B\-F1\), the F1 of thecutclass over adjacent\-page decisions, as the primary metric of the zero\-shot study; the complete sweep results are provided in Appendix[A](https://arxiv.org/html/2609.22620#A1)\. The available pre\-LLM baseline results \(§[5\.2](https://arxiv.org/html/2609.22620#S5.SS2)\) use per\-class and overall \(Micro\) accuracy instead, so comparisons between the two families are directional rather than strictly controlled\.
#### Cost accounting
For each configuration, we report model calls, total test\-set cost, and mean per\-call latency\. Call count depends on stream length and, for MSBD, window sizeKK\. Costs are computed from provider token usage and prices at evaluation time using LiteLLM111[https://docs\.litellm\.ai/docs/completion/token\_usage](https://docs.litellm.ai/docs/completion/token_usage)\. Because prices may change, we also report cost per1,0001\{,\}000pages and interpret values comparatively\.
Figure 2:Boundary F1 for PC and BD\. Adjacent\-page context substantially improves TABME\+\+, but provides limited benefit on the form\-heavy VRDU dataset\.
## 5Baselines
We compare MSBD against two families of baselines: the single\-call zero\-shot prompts it is designed to replace \(PC and BD\), and pre\-LLM systems that require task\-specific training\. Both families are evaluated on the same TABME\+\+ and VRDU streams described in §[4](https://arxiv.org/html/2609.22620#S4)\.
### 5\.1Zero\-shot single\-call baselines
PC and BD use the same fixed models and prompting protocol as MSBD, but resolve a single boundary per call\.
#### PC – Page Classification
PC processes each pagepjp\_\{j\}independently, using either its OCR text or page image, and predictsfirst\_pageornon\_first\_pagebased on whether the page begins a new document\. A boundary is inserted before each page predicted asfirst\_page; thus, anNN\-page stream requiresN−1N\{\-\}1calls\. Responses are parsed from a single JSON field \(Appendix[C](https://arxiv.org/html/2609.22620#A3)\)\.
#### BD – Boundary Decision
BD processes each adjacent page pair\(pj−1,pj\)\(p\_\{j\-1\},p\_\{j\}\)and predictscut\_pageorcontinuous\_page, indicating whetherpjp\_\{j\}begins a new document relative topj−1p\_\{j\-1\}\. Each decision therefore uses one neighbouring page as context but still requires one model call per candidate boundary\. The stream is split at every pair labelledcut\_page\. Responses are parsed from a single JSON field \(Appendix[C](https://arxiv.org/html/2609.22620#A3)\)\.
### 5\.2Pre\-LLM baselines
We compare zero\-shot LLMs with two conventional PSS baselines: trained boundary classifiers and distance\-based feature similarity\. Both predict whether pagepjp\_\{j\}starts a new document \(cut\) or continues the document containingpj−1p\_\{j\-1\}\(continue\)\.
#### Trained boundary classifiers
Lethjh\_\{j\}denote the frozen visual representation of pagepjp\_\{j\}\. We evaluate three trained configurations:
PC:classifyhjh\_\{j\}alone to determine whetherpjp\_\{j\}is a first page\.
BD\-Concat:concatenate\[hj−1;hj\]\[h\_\{j\-1\};h\_\{j\}\]and classify the boundary between the two pages\.
BD\-LSTM:process\(hj−1,hj\)\(h\_\{j\-1\},h\_\{j\}\)as an ordered two\-page sequence with a one\-layer LSTM before classification\.
PC uses only the current page\. Both BD variants use the previous and current pages; BD\-Concat combines their features directly, whereas BD\-LSTM models their sequential relationship\.
We use penultimate\-layer features from a frozen, in\-house*Vision Classifier*, a convolutional model trained to classify business\-document pages\. We evaluate linear, MLP, and LSTM heads and sweep Kullback–Leibler divergence regularization and report validation Micro accuracy on held\-out TABME\+\+ and VRDU streams\.
Table[1](https://arxiv.org/html/2609.22620#S5.T1)shows that adjacent\-page context helps on TABME\+\+: BD\-Concat improves Micro accuracy from0\.7570\.757to0\.7690\.769, and BD\-LSTM further improves it to0\.8170\.817\. The LSTM gain comes mainly from highercontinueaccuracy \(0\.824→0\.9260\.824\\rightarrow 0\.926\), indicating better recognition of pages from the same document\. On VRDU, PC performs best, suggesting that first pages are visually distinctive enough to identify independently\.
Table 1:Accuracy of trained boundary classifiers using frozen Vision Classifier†features\. PC uses one page, BD\-Concat concatenates adjacent\-page features, and BD\-LSTM processes the same pair sequentially\.*Cut*and*Continue*are per\-class accuracies;*Micro*is overall accuracy\. Best Micro per dataset is inbold\.†In\-house proprietary feature extractor; results are indicative rather than independently reproducible\.
#### Distance\-based feature similarity
We also infer boundaries from adjacent\-page features without training a classifier\. Using labelled page pairs, the*prototype*method computes one representative prototype for each class and assigns each test pair to its nearestcutorcontinueprototype under Euclidean distance\.
Table[2](https://arxiv.org/html/2609.22620#S5.T2)compares features from the Vision Classifier, an FCOS detector backbone, and GUSE\. Vision Classifier features achieve the highest Micro accuracy on both datasets\. However, the class\-wise results vary substantially across features and datasets\. On TABME\+\+, all three feature sources favourcontinue; FCOS detects only18\.5%18\.5\\%of cuts but98\.1%98\.1\\%of continuations\. On VRDU, the Vision Classifier also favourscontinue, whereas FCOS and GUSE favourcut\. Feature distance therefore does not provide a consistent boundary signal\.
Table 2:Prototype\-based feature\-similarity results using Euclidean distance\. Each adjacent\-page pair is assigned to its nearestcutorcontinueprototype\.*Cut*and*Continue*are per\-class accuracies;*Micro*is overall accuracy\. Best Micro per dataset is inbold\.†In\-house proprietary Vision Classifier features\.
#### Implications for zero\-shot PSS
The two tables show that adjacent\-page context can improve trained classifiers, but the benefit is dataset\-dependent\. They also show that visual representations provide a stronger and more consistent boundary signal than conventional text embeddings\. These methods nevertheless require labelled data to train classifiers or construct class prototypes, motivating our evaluation of zero\-shot LLMs\.
## 6Results: Multi\-Split Boundary Decision
We first compare PC and BD to isolate the value of adjacent\-page context\. We then examine how MSBD trades boundary accuracy for fewer model calls as the window sizeKKincreases\.
#### PC versus BD: value of neighbouring context
Table[3](https://arxiv.org/html/2609.22620#S6.T3)compares PC, which classifies the current page alone, with BD, which classifies the previous and current pages together\. Both predict one boundary per call\.
On TABME\+\+, BD improves Boundary F1 by0\.130\.13–0\.190\.19over PC across the six model–modality combinations, showing that the previous page provides useful context\. On VRDU, PC is already near ceiling because first pages are often visually distinctive, so BD offers little consistent improvement\. The main exception is GPT\-5\.4\-mini with text input, where Boundary F1 falls from0\.9480\.948to0\.7830\.783\.
Vision improves some PC results, but provides no consistent advantage over text once adjacent\-page context is available and is more expensive in every BD setting\. We therefore use text\-based BD as the main reference for MSBD\.
TABME\+\+VRDUModelInputMethodB\-F1LatCostModelInputMethodB\-F1LatCostClaude Haiku 4\.5textPC0\.6742\.1210\.33Claude Haiku 4\.5textPC0\.9612\.252\.30textBD0\.8662\.4213\.75textBD0\.9692\.503\.26textMSBD \(K=3K\{=\}3\)0\.8441\.196\.94textMSBD \(K=3K\{=\}3\)0\.9001\.061\.79textMSBD \(K=5K\{=\}5\)0\.8171\.305\.18textMSBD \(K=5K\{=\}5\)0\.7951\.151\.39visionPC0\.7112\.7514\.22visionPC0\.9552\.702\.91visionBD0\.8372\.9121\.25visionBD0\.9693\.154\.50visionMSBD \(K=3K\{=\}3\)0\.8441\.5312\.63visionMSBD \(K=3K\{=\}3\)0\.9281\.702\.73visionMSBD \(K=5K\{=\}5\)0\.7991\.789\.90visionMSBD \(K=5K\{=\}5\)0\.7552\.082\.15Gemini 3\.1 Flash\-LitetextPC0\.7311\.101\.97Gemini 3\.1 Flash\-LitetextPC0\.9511\.020\.44textBD0\.8831\.202\.79textBD0\.9711\.070\.66textMSBD \(K=3K\{=\}3\)0\.8471\.081\.61textMSBD \(K=3K\{=\}3\)0\.9400\.910\.41textMSBD \(K=5K\{=\}5\)0\.8701\.141\.22textMSBD \(K=5K\{=\}5\)0\.9431\.060\.32visionPC0\.7491\.702\.96visionPC0\.9681\.510\.53visionBD0\.8821\.824\.74visionBD0\.9311\.720\.85visionMSBD \(K=3K\{=\}3\)0\.8871\.833\.13visionMSBD \(K=3K\{=\}3\)0\.9381\.580\.56visionMSBD \(K=5K\{=\}5\)0\.8812\.142\.49visionMSBD \(K=5K\{=\}5\)0\.8882\.030\.44GPT\-5\.4\-minitextPC0\.6871\.245\.68GPT\-5\.4\-minitextPC0\.9481\.401\.23textBD0\.8731\.667\.72textBD0\.7831\.301\.84textMSBD \(K=3K\{=\}3\)0\.8280\.884\.28textMSBD \(K=3K\{=\}3\)0\.7511\.031\.11textMSBD \(K=5K\{=\}5\)0\.7930\.993\.18textMSBD \(K=5K\{=\}5\)0\.6092\.410\.86visionPC0\.7121\.517\.96visionPC0\.9712\.001\.42visionBD0\.8761\.6812\.39visionBD0\.9622\.342\.22visionMSBD \(K=3K\{=\}3\)0\.8461\.477\.84visionMSBD \(K=3K\{=\}3\)0\.8692\.341\.41visionMSBD \(K=5K\{=\}5\)0\.8111\.716\.14visionMSBD \(K=5K\{=\}5\)0\.8002\.771\.11GPT\-4o†zero\-shot0\.859––Phi\-3\-mini†fine\-tuned0\.973––Mistral\-7B†fine\-tuned0\.987––Table 3:PC, BD, and MSBD results across datasets, models, and input modalities \(B\-F1 = Boundary F1; Lat = per\-call latency in seconds; Cost = full test set, USD\)\. MSBD is shown atK=3K\{=\}3andK=5K\{=\}5for both modalities; the complete sweep \(K=2K\{=\}2–5050\) with costs and call counts appears in Tables[4](https://arxiv.org/html/2609.22620#A1.T4)–[5](https://arxiv.org/html/2609.22620#A1.T5)\. Per dataset and model, the strongest B\-F1 and the lowest cost among the rows shown are inbold; larger windows reduce cost further\.†Page\-level F1 reported by[Heidenreich et al\. \(2024\)](https://arxiv.org/html/2609.22620#bib.bib1); not directly comparable\.
#### Model calls, cost, and latency
Because MSBD predictsK−1K\{\-\}1boundaries per call, the request count decreases rapidly asKKgrows\. On TABME\+\+, increasingKKfrom22\(equivalent to BD\) to5050reduces calls from6,2366\{,\}236to127127, a49×49\\timesreduction\.
Cost falls more slowly because each call contains more pages\. For Gemini with text input,K=10K\{=\}10reduces calls by9×9\\timesand test\-set cost from $2\.79 to $1\.00, or approximately $0\.45 to $0\.16 per1,0001\{,\}000pages\. Mean latency per call remains broadly stable for text throughK=10K\{=\}10but rises at larger windows, particularly for vision input \(Figure[5](https://arxiv.org/html/2609.22620#A1.F5)in Appendix[A](https://arxiv.org/html/2609.22620#A1)\)\. MSBD therefore improves throughput mainly by reducing the number of requests, not by making individual requests faster\.
#### Accuracy and the knee
Accuracy remains relatively stable at small windows and then declines sharply\. We refer to the largest useful window before this decline as the*knee*\.
On TABME\+\+, Gemini with text input remains close to BD fromK=5K\{=\}5toK=10K\{=\}10: Boundary F1 is0\.8700\.870,0\.8630\.863, and0\.8610\.861atK=5K\{=\}5,77, and1010, compared with0\.8830\.883for BD\. The corresponding gaps are0\.0130\.013,0\.0200\.020, and0\.0220\.022\. Claude and GPT\-5\.4\-mini begin degrading at smaller windows\.
The useful range is narrower on VRDU\. Gemini with text remains strong throughK=7K\{=\}7, but declines more clearly atK=10K\{=\}10; Claude and GPT\-5\.4\-mini degrade earlier\. The knee therefore depends on both the model and the corpus\.
At small windows, MSBD can occasionally match BD\. For example, Gemini with vision reaches0\.8870\.887atK=3K\{=\}3, compared with0\.8820\.882for BD\. Because each configuration is evaluated with one decoding pass, this small difference should not be interpreted as a significant improvement\.
Figure 3:MSBD behavior across window sizes on TABME\+\+ \(top\) and VRDU \(bottom\); solid and dashed curves show text and vision inputs\.*Left*: Boundary F1 versus window sizeKK—the useful window \(knee\) depends on the model and dataset, with GPT\-5\.4\-mini degrading earliest\.*Center*: Boundary F1 versus test\-set cost asKKincreases—Gemini provides the strongest cost–accuracy trade\-off\.*Right*: predicted cut rate versusKK—Claude and Gemini increasingly over\-segment, whereas GPT\-5\.4\-mini under\-segments at largeKK; horizontal dashed lines mark the ground\-truth cut rates\.
#### Cost–accuracy trade\-off
Gemini provides the strongest overall trade\-off between Boundary F1 and inference cost\. In particular, Gemini with text input atK=5K\{=\}5–1010retains most of BD’s accuracy while substantially reducing calls and cost, making it the strongest MSBD configuration among those evaluated\.
## 7Failure Modes at Large Windows
Beyond the knee, MSBD fails in two distinct ways: invalid output structure and incorrect boundary behaviour\.
#### Format errors versus silent degradation
Gemini and GPT\-5\.4\-mini return the expected number of boundary labels at all tested window sizes\. Claude increasingly produces missing or extra fields asKKgrows, making some failures detectable through schema validation\. GPT\-5\.4\-mini shows the opposite behaviour: its outputs remain well formed while accuracy declines rapidly\. Such silent degradation cannot be detected from output structure alone\.
#### Over\-segmentation versus under\-segmentation
Claude and Gemini predict too many cuts at largeKK, fragmenting documents through over\-segmentation\. GPT\-5\.4\-mini predicts too few cuts, merging neighbouring documents through under\-segmentation \(Figure[3](https://arxiv.org/html/2609.22620#S6.F3), right\)\. Representative examples appear in Appendix[B](https://arxiv.org/html/2609.22620#A2)\.
## 8Discussion
#### Recommended configuration
Among the evaluated configurations, Gemini with text input provides the strongest accuracy–cost trade\-off\. TABME\+\+ supports windows of approximatelyK=5K\{=\}5–1010, whereas the form\-heavy VRDU corpus requires a more conservative range of approximatelyK=5K\{=\}5–77\. Because the knee depends on the model and corpus, deployments should selectKKusing a small labelled validation set\.
#### Agentic and workflow integration
MSBD can serve as a low\-cost segmentation component in agentic and document\-processing workflows\. It segments a stream in approximately\(N−1\)/\(K−1\)\(N\-1\)/\(K\{\-\}1\)calls, after which the recovered documents can be routed to classification, extraction, or verification components\. Window size provides an efficiency control: larger windows reduce requests, while smaller windows or BD offer a safer fallback when validation shows degraded accuracy\.
## 9Conclusion
Zero\-shot LLMs and VLMs can perform PSS without task\-specific training, but standard formulations require one model call per boundary\. MSBD reduces this overhead by predicting multiple boundaries in each window while preserving strong accuracy up to a model\- and corpus\-dependent knee\. Among the evaluated configurations, Gemini with text input provides the strongest accuracy–efficiency trade\-off, particularly at moderate window sizes\. Beyond the knee, accuracy declines and models exhibit malformed outputs or silent over\- and under\-segmentation\. Reliable deployment therefore requires corpus\-specific window selection, output validation, and monitoring for segmentation errors\.
## Limitations
We run a single pass per configuration at temperature00to control cost\. We do not report variance across seeds or prompt rewording\.
Our evidence covers two English\-language datasets and three models; TABME\+\+ is a synthetic concatenation and VRDU is concatenated by our own recipe, so the knees we report may shift on other corpora or construction recipes\. Costs and latency reflect provider conditions at our run date, so both are relative comparisons rather than durable, absolute figures\.
We also use one prompt and JSON schema per formulation, with no per\-model tuning\. This keeps differences attributable to the formulation, but the large\-window failure modes may be partly tied to this phrasing, and a per\-model schema tweak could push each knee outward\.
## References
- Aginet al\.\(2015\)O\. Agin, C\. Ulas, M\. Ahat, and C\. BekarAn approach to the segmentation of multi\-page document flow using binary classification\.InSixth International Conference on Graphic and Image Processing \(ICGIP 2014\),Vol\.9443,pp\. 216–222\.Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Amazon Web Services \(2026\)Amazon Web ServicesClaude Haiku 4\.5 – Amazon Bedrock\.Note:Accessed 2026\-07\-23External Links:[Link](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-haiku-4-5.html)Cited by:[§4](https://arxiv.org/html/2609.22620#S4.SS0.SSS0.Px2.p1.1)\.
- Brazet al\.\(2021\)F\. A\. Braz, N\. C\. da Silva, and J\. A\. Salgado LimaLeveraging effectiveness and efficiency in page stream deep segmentation\.Engineering Applications of Artificial Intelligence105,pp\. 104394\.External Links:[Document](https://dx.doi.org/10.1016/j.engappai.2021.104394)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Buschet al\.\(2023\)L\. Busch, R\. van Heusden, and M\. MarxUsing deep\-learned vector representations for page stream segmentation by agglomerative clustering\.Algorithms16\(5\),pp\. 259\.Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Chenget al\.\(2023\)Z\. Cheng, J\. Kasai, and T\. YuBatch prompting: efficient inference with large language model apis\.InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: Industry Track,pp\. 792–810\.Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px3.p1.1)\.
- Collins\-Thompson and Nickolov \(2002\)K\. Collins\-Thompson and R\. NickolovA clustering\-based algorithm for automatic document separation\.InSIGIR 2002 Workshop on Information Retrieval and OCR: From Converting Content to Grasping, Meaning, Tampere, Finland,Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Daher and Belaïd \(2014\)H\. Daher and A\. BelaïdDocument flow segmentation for business applications\.InDocument Recognition and Retrieval XXI,Proc\. SPIE, Vol\.9021,pp\. 90210G\.External Links:[Document](https://dx.doi.org/10.1117/12.2043141)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Demirtaşet al\.\(2022\)M\. A\. Demirtaş, B\. Oral, M\. Y\. Akpınar, and O\. DenizSemantic parsing of interpage relations\.In2022 26th International Conference on Pattern Recognition \(ICPR\),pp\. 1579–1585\.Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px2.p1.1)\.
- Google \(2026\)GoogleGemini 3\.1 Flash\-Lite\.Note:Accessed 2026\-07\-23External Links:[Link](https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite)Cited by:[§4](https://arxiv.org/html/2609.22620#S4.SS0.SSS0.Px2.p1.1)\.
- Gordoet al\.\(2013\)A\. Gordo, M\. Rusiñol, D\. Karatzas, and A\. D\. BagdanovDocument classification and page stream segmentation for digital mailroom applications\.In2013 12th International Conference on Document Analysis and Recognition \(ICDAR\),pp\. 621–625\.External Links:[Document](https://dx.doi.org/10.1109/ICDAR.2013.128)Cited by:[§1](https://arxiv.org/html/2609.22620#S1.p2.1),[§1](https://arxiv.org/html/2609.22620#S1.p3.1),[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Guhaet al\.\(2022\)A\. Guha, A\. Alahmadi, D\. Samanta, M\. Z\. Khan, and A\. H\. AlahmadiA multi\-modal approach to digital document stream segmentation for title insurance domain\.IEEE Access10,pp\. 11341–11353\.External Links:[Document](https://dx.doi.org/10.1109/ACCESS.2022.3144185)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Heidenreichet al\.\(2024\)H\. Heidenreich, R\. Dalvi, R\. Mukku, N\. Verma, and N\. PičuljanLarge language models for page stream segmentation\.External Links:2408\.11981,[Link](https://arxiv.org/abs/2408.11981)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1),[§4](https://arxiv.org/html/2609.22620#S4.SS0.SSS0.Px1.p1.1),[Table 3](https://arxiv.org/html/2609.22620#S6.T3)\.
- Heidenreichet al\.\(2025\)H\. Heidenreich, R\. Dalvi, N\. Verma, and Y\. GetachewPage stream segmentation with LLMs: challenges and applications in insurance document automation\.InProceedings of the 31st International Conference on Computational Linguistics: Industry Track,Abu Dhabi, UAE,pp\. 305–317\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.coling-industry.26),[Link](https://aclanthology.org/2025.coling-industry.26/)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- Islamet al\.\(2026\)M\. M\. Islam, M\. S\. Salekin, N\. Balakrishnan, V\. C\. Bishop, N\. Jain, S\. Romo, B\. Strahan, B\. Xie, and D\. A\. SocolinskyDocSplit: a comprehensive benchmark dataset and evaluation approach for document packet recognition and splitting\.InProceedings of the 64th Annual Meeting of the Association for Computational Linguistics \(Volume 6: Industry Track\),San Diego, California, USA,pp\. 159–183\.External Links:[Document](https://dx.doi.org/10.18653/v1/2026.acl-industry.12),[Link](https://aclanthology.org/2026.acl-industry.12/)Cited by:[§1](https://arxiv.org/html/2609.22620#S1.p2.1),[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px2.p1.1)\.
- Mungmeepruedet al\.\(2022\)T\. Mungmeeprued, Y\. Ma, N\. Mehta, and A\. LipaniTab this folder of documents: page stream segmentation of business documents\.InProceedings of the 22nd ACM Symposium on Document Engineering \(DocEng ’22\),San Jose, CA, USA,pp\. 1–10\.External Links:[Document](https://dx.doi.org/10.1145/3558100.3563852)Cited by:[§1](https://arxiv.org/html/2609.22620#S1.p2.1),[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1),[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px2.p1.1),[§4](https://arxiv.org/html/2609.22620#S4.SS0.SSS0.Px1.p1.1)\.
- Necheet al\.\(2020\)C\. E\. Neche, Y\. Belaïd, and A\. BelaïdUse of language models for document stream segmentation\.InInternational Conference on Pattern Recognition Applications and Methods,Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
- OpenAI \(2026\)OpenAIGPT\-5\.4 mini model\.Note:Accessed 2026\-07\-23External Links:[Link](https://developers.openai.com/api/docs/models/gpt-5.4-mini)Cited by:[§4](https://arxiv.org/html/2609.22620#S4.SS0.SSS0.Px2.p1.1)\.
- Ortegaet al\.\(2025\)M\. S\. Ortega, E\. Vivoli, A\. Llabrés, and D\. KaratzasCoSMo: a multimodal transformer for page stream segmentation in comic books\.In2025 IEEE/CVF International Conference on Computer Vision Workshops \(ICCVW\),pp\. 7565–7573\.External Links:[Document](https://dx.doi.org/10.1109/ICCVW69036.2025.00778),[Link](https://openaccess.thecvf.com/content/ICCV2025W/VisionDocs/html/Ortega_CoSMo_A_Multimodal_Transformer_for_Page_Stream_Segmentation_in_Comic_ICCVW_2025_paper.html)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px2.p1.1)\.
- Van Heusdenet al\.\(2022\)R\. Van Heusden, J\. Kamps, and M\. MarxWooIR: a new open page stream segmentation dataset\.InProceedings of the 2022 ACM SIGIR International Conference on Theory of Information Retrieval,pp\. 24–33\.Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px2.p1.1)\.
- van Heusdenet al\.\(2024\)R\. van Heusden, J\. Kamps, and M\. MarxOpenPSS: an open page stream segmentation benchmark\.InLinking Theory and Practice of Digital Libraries: 28th International Conference on Theory and Practice of Digital Libraries,Lecture Notes in Computer Science, Vol\.15177,pp\. 413–429\.External Links:[Document](https://dx.doi.org/10.1007/978-3-031-72437-4%5F24)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px2.p1.1)\.
- Wanget al\.\(2023\)Z\. Wang, Y\. Zhou, W\. Wei, C\. Lee, and S\. TataVRDU: a benchmark for visually\-rich document understanding\.InProceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining \(KDD\),pp\. 5184–5193\.External Links:[Document](https://dx.doi.org/10.1145/3580305.3599929)Cited by:[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px4.p1.1),[§4](https://arxiv.org/html/2609.22620#S4.SS0.SSS0.Px1.p2.1)\.
- Wiedemann and Heyer \(2021\)G\. Wiedemann and G\. HeyerMulti\-modal page stream segmentation with convolutional neural networks\.Language Resources and Evaluation55\(1\),pp\. 127–150\.External Links:[Document](https://dx.doi.org/10.1007/s10579-019-09476-2)Cited by:[§1](https://arxiv.org/html/2609.22620#S1.p2.1),[§1](https://arxiv.org/html/2609.22620#S1.p3.1),[§2](https://arxiv.org/html/2609.22620#S2.SS0.SSS0.Px1.p1.1)\.
## Appendix AExtended Results
This section reports the complete MSBD window\-size sweep underlying the main\-paper results\. Table[4](https://arxiv.org/html/2609.22620#A1.T4)presents Boundary F1, Table[5](https://arxiv.org/html/2609.22620#A1.T5)reports model calls and test\-set cost, and Figures[4](https://arxiv.org/html/2609.22620#A1.F4)and[5](https://arxiv.org/html/2609.22620#A1.F5)summarize the accuracy and latency trends\. TheK=2K\{=\}2setting is equivalent to the single\-boundary BD baseline\.
Table 4:Boundary F1 across the complete MSBD sweep\. TheK=2K\{=\}2setting is equivalent to BD\. Cla, Gem, and GPT denote Claude Haiku 4\.5, Gemini 3\.1 Flash\-Lite, and GPT\-5\.4\-mini; txt and vis denote text and vision inputs\. Results at largeKKon VRDU are based on relatively few windows and should therefore be interpreted cautiously\. Costs and call counts for the same configurations appear in Table[5](https://arxiv.org/html/2609.22620#A1.T5)\.#### Accuracy across window sizes
Gemini retains accuracy over larger windows than the other models\. On TABME\+\+, its text\-input Boundary F1 remains between0\.8610\.861and0\.8700\.870forK=5K\{=\}5–1010, compared with0\.8830\.883atK=2K\{=\}2\. With vision input, Gemini peaks atK=3K\{=\}3\(0\.8870\.887\) and remains close to BD atK=5K\{=\}5\(0\.8810\.881\)\. Claude and GPT\-5\.4\-mini begin degrading at smaller windows\.
The usable window is narrower on VRDU\. Gemini with text remains strong throughK=7K\{=\}7\(0\.9250\.925\), but falls to0\.8560\.856atK=10K\{=\}10\. Claude and GPT\-5\.4\-mini decline more rapidly\. The small non\-monotonic changes at largeKKon VRDU should not be interpreted as recovery, because those settings contain few evaluation windows\.
Table 5:Test\-set cost in USD and model\-call counts across the complete MSBD sweep\. TheK=2K\{=\}2setting is equivalent to BD\. Call counts depend only on the dataset and window size; individual runs may contain one or two fewer completed requests when a model call fails\. Boundary F1 for the same configurations appears in Table[4](https://arxiv.org/html/2609.22620#A1.T4)\.
#### Calls and cost
Call count decreases approximately in proportion to1/\(K−1\)1/\(K\{\-\}1\)\. On TABME\+\+, increasingKKfrom22to5050reduces calls from6,2366\{,\}236to127127; on VRDU, calls decrease from1,1021\{,\}102to2222\.
Cost falls much more slowly because each remaining call contains more pages\. For Gemini with text input on TABME\+\+,K=5K\{=\}5andK=10K\{=\}10reduce cost from $2\.79 to $1\.22 and $1\.00, respectively\. AtK=50K\{=\}50, cost reaches $0\.87, only a3\.2×3\.2\\timesreduction despite approximately49×49\\timesfewer calls\. Costs also flatten or occasionally increase at the largest windows, showing that larger request payloads can offset further reductions in request count\. Vision input is more expensive than text input for every model and window shown\.
Figure 4:Boundary F1 across datasets, models, input modalities, and window sizes\. Darker cells indicate higher F1\. Gemini retains accuracy over the widest range ofKK, while GPT\-5\.4\-mini generally degrades earliest\.
#### Model and modality patterns
Figure[4](https://arxiv.org/html/2609.22620#A1.F4)highlights that Gemini provides the most stable performance across window sizes\. The relative value of text and vision depends on the model, dataset, and window size: vision occasionally improves small\-window accuracy, but it does not provide a consistent advantage and generally degrades faster as more pages are added\. GPT\-5\.4\-mini shows the earliest and steepest large\-window decline\.
Figure 5:Mean latency per model call across the MSBD sweep\. Text\-input latency remains broadly stable at small and medium windows before increasing at largerKK, while vision latency generally rises more quickly as additional pages are included\.
#### Per\-call latency
IncreasingKKreduces the number of calls but does not make each call faster\. Text\-input latency remains broadly stable through the useful window and then increases as prompts become larger; vision\-input latency rises more quickly at large windows\. MSBD’s throughput improvement therefore comes mainly from issuing fewer requests, rather than from reducing the latency of each request\.
## Appendix BQualitative Error Gallery
The galleries below show MSBD windows \(K=20K\{=\}20, VRDU\) illustrating the two failure directions from §[7](https://arxiv.org/html/2609.22620#S7)\. Every panel displays the two pages that flank a single boundary decision:truthgives the ground\-truth label \(cut— a new document begins on the right\-hand page;continue— both pages belong to one document\), and the badges below report each model’s prediction, green when it matches the truth and red when it errs\. Panels are grouped by*who*errs: row headers mark whether all three models fail together or only one model fails while the other two stay correct\. Figure[6](https://arxiv.org/html/2609.22620#A2.F6)shows clear boundaries the models agree on; Figure[7](https://arxiv.org/html/2609.22620#A2.F7)shows over\-segmentation \(false cuts inside one document, the dominant Claude/Gemini failure\); and Figures[8](https://arxiv.org/html/2609.22620#A2.F8)and[9](https://arxiv.org/html/2609.22620#A2.F9)show under\-segmentation \(missed cuts that merge two documents\), for Claude and Gemini in the former and for GPT\-5\.4\-mini alone, its dominant failure mode, in the latter\.
Figure 6:Correctly handled boundaries \(VRDU\)\. On clear transitions \(distinct letterheads, advertisers, or form types\), the models agree with the ground truth in both thecutandcontinuedirections\. These easy cases sit behind VRDU’s high scores at smallKK\.Figure 7:Over\-segmentation \(VRDU\): predicted cuts fall*inside*what is really a single document \(ground truthcontinue\), fragmenting one filing across several predicted documents\. Top row: all three models over\-cut a continuation page \(a contract’s second page; a line\-item table continuing across pages\)\. Middle row: only Claude over\-cuts while Gemini and GPT\-5\.4\-mini correctly continue\. Bottom row: Claude and GPT\-5\.4\-mini over\-cut an agreement form’s own terms page \(left\), and in the rare reverse only Gemini over\-cuts a multi\-page invoice \(right\)\.Figure 8:Under\-segmentation \(VRDU\): a genuine boundary \(ground truthcut\) is predicted ascontinue, merging two documents into one\. Top row: all three models miss the boundary on visually ambiguous transitions \(a schedule form giving way to an invoice; an invoice to a new station’s order\)\. Bottom row: only Claude \(left\) or only Gemini \(right\) merges the documents while the other two models cut correctly\.Figure 9:Under\-segmentation by GPT\-5\.4\-mini \(VRDU\): in each of these windows GPT\-5\.4\-mini alone predictscontinueat a genuine boundary \(ground truthcut\), merging adjacent filings, whereas Gemini and Claude both cut correctly\.
## Appendix CPrompts
Prompts provided in this section are the exact PC, BD, and MSBD prompts used in all runs\.
Page Classification \(PC\) Prompt[⬇](data:text/plain;base64,WW91IGFyZSBhIGRvY3VtZW50IHBhZ2UgY2xhc3NpZmllci4gWW91ciB0YXNrIGlzIHRvIGRldGVybWluZSBpZiBhIGdpdmVuIGRvY3VtZW50IHBhZ2UgaXMKdGhlIGZpcnN0IHBhZ2Ugb2YgYSBkb2N1bWVudCAoZmlyc3RfcGFnZSksIGEgc3Vic2VxdWVudC9ub24tZmlyc3QgcGFnZSAobm9uX2ZpcnN0X3BhZ2UpLgoKQW5hbHl6ZSB0aGUgcGFnZSB1c2luZyBpdHMgdGV4dCBhbmQvb3IgdGhlIHBhZ2UgaW1hZ2UgKHdoaWNoZXZlciBpcyBwcm92aWRlZCksCmNvbnNpZGVyaW5nIHRoZSBmb2xsb3dpbmcgZmVhdHVyZXM6CjEuIEhlYWRlcnMgYW5kIFRpdGxlcyAtIElzIHRoZXJlIGEgcHJvbWluZW50IGRvY3VtZW50IHRpdGxlLCBvcmdhbml6YXRpb24gbmFtZSwgb3IgbWFpbgogICBoZWFkaW5nIGF0IG9y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mljYXRpb24gTGFiZWxzOgpmaXJzdF9wYWdlLCBub25fZmlyc3RfcGFnZQoKT3V0cHV0IEZvcm1hdDoKUmV0dXJuIHlvdXIgcmVzcG9uc2UgaW4gdGhlIGZvbGxvd2luZyBKU09OIGZvcm1hdDoKCnsKImFuc3dlciI6ICJUaGUgcHJlZGljdGVkIGNsYXNzaWZpY2F0aW9uIiwKImV4cGxhbmF0aW9uIjogIkEgYnJpZWYganVzdGlmaWNhdGlvbiBmb3IgdGhlIGNsYXNzaWZpY2F0aW9uIgp9CgpFeGFtcGxlIG91dHB1dDoKewogICAgImFuc3dlciI6ICJmaXJzdF9wYWdlIiwKICAgICJleHBsYW5hdGlvbiI6ICJQYWdlIGhhcyBhIGNlbnRlcmVkIG9yZ2FuaXphdGlvbiB0aXRsZSwgYSBkb2N1bWVudCBkYXRlIGF0IHRoZSB0b3AsCiAgICBhbmQgYmVnaW5zIHdpdGggYW4gaW50cm9kdWN0b3J5IGxldHRlciBvcGVuaW5nLCBhbGwgb2Ygd2hpY2ggaW5kaWNhdGUgdGhpcyBpcyB0aGUKICAgIGZpcnN0IHBhZ2UiCn0KCkJhc2UgeW91ciBkZWNpc2lvbiBvbiB0aGUgcGFnZSB0ZXh0IGFuZC9vciB0aGUgcGFnZSBpbWFnZSBwcm92aWRlZC4gUmV0dXJuIG9ubHkgdGhlIEpTT04Kb2JqZWN0Lg==)Youareadocumentpageclassifier\.Yourtaskistodetermineifagivendocumentpageisthefirstpageofadocument\(first\_page\),asubsequent/non\-firstpage\(non\_first\_page\)\.Analyzethepageusingitstextand/orthepageimage\(whicheverisprovided\),consideringthefollowingfeatures:1\.HeadersandTitles\-Isthereaprominentdocumenttitle,organizationname,ormainheadingatornearthetop?2\.PageNumbers\-Doesthepagehaveapagenumberlike"1","1/2","1in3",orsimilar?Firstpagesoftenusetheseformatsormaylackapagenumberentirely\.3\.ContentStructure\-Doesthepagecontainintroductoryelementssuchasanexecutivesummary,tableofcontents,ordocumentmetadata?4\.DocumentIdentifiers\-AretheredocumentIDs,dates,referencenumbers,ormetadatatypicalofcover/firstpages?5\.FormattingElements\-Istheredistinctiveformatting\(centeredorlargertext,extraspacing,logos\)suggestingacoverortitlepage?6\.OpeningContent\-Doesthetextstartwithintroductoryphrases,adocumentpurposestatement,oraformalopening\(e\.g\.,"Dear\[Name\],""ToWhomItMayConcern,"orsimilar\)?ThepossibleClassificationLabels:first\_page,non\_first\_pageOutputFormat:ReturnyourresponseinthefollowingJSONformat:\{"answer":"Thepredictedclassification","explanation":"Abriefjustificationfortheclassification"\}Exampleoutput:\{"answer":"first\_page","explanation":"Pagehasacenteredorganizationtitle,adocumentdateatthetop,andbeginswithanintroductoryletteropening,allofwhichindicatethisisthefirstpage"\}Baseyourdecisiononthepagetextand/orthepageimageprovided\.ReturnonlytheJSONobject\.
Boundary Decision \(BD\) Prompt[⬇](data:text/plain;base64,WW91IGFyZSBhIGRvY3VtZW50IHBhZ2UgY2xhc3NpZmllci4gWW91ciB0YXNrIGlzIHRvIGRldGVybWluZSB3aGV0aGVyIHRoZSBsYXN0IHBhZ2UgaW4gYQpzZXF1ZW5jZSBvZiB0d28gb3IgbW9yZSBwYWdlcyBiZWxvbmdzIHRvIHRoZSBzYW1lIGRvY3VtZW50IGFzIHRoZSBwcmV2aW91cyBwYWdlKHMpCihjb250aW51b3VzX3BhZ2UpIG9yIHN0YXJ0cyBhIGRpZmZlcmVudCBkb2N1bWVudCAoY3V0X3BhZ2UpLgoKQW5hbHl6ZSB0aGUgZG9jdW1lbnQgcGFnZXMgdXNpbmcgdGhlIHBhZ2UgdGV4dCBhbmQvb3IgdGhlIHBhZ2UgaW1hZ2VzICh3aGljaGV2ZXIgaXMKcHJvdmlkZWQpLCBjb25zaWRlcmluZyBmZWF0dXJlcyBzdWNoIGFzOgoxLiBIZWFkZXJzIGFuZCBmb290ZXJzIC0gRG8gdGhleSBtYXRjaCBhY3Jvc3MgcGFnZXM/CjIuIFBhZ2UgbnVtYmVycyAtIEFyZSB0aG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6ICJjb250aW51b3VzX3BhZ2UiLAogICAgImV4cGxhbmF0aW9uIjogIlBhZ2VzIHNob3cgc2VxdWVudGlhbCBudW1iZXJpbmcgKHBhZ2VzIDMtNCksIG1hdGNoaW5nIGhlYWRlcnMgd2l0aAogICAgY29tcGFueSBuYW1lLCBhbmQgdGhlIHNlbnRlbmNlIGF0IHRoZSBib3R0b20gb2YgZmlyc3QgcGFnZSBjb250aW51ZXMgbmF0dXJhbGx5IGF0CiAgICB0aGUgdG9wIG9mIHRoZSBzZWNvbmQgcGFnZSIKfQoKUmVtZW1iZXIgdGhhdCAiY29udGludW91c19wYWdlIiBtZWFucyB0aGUgbGFzdCBwYWdlIGNvbnRpbnVlcyBmcm9tIHRoZSBwcmV2aW91cyBwYWdlKHMpLAp3aGlsZSAiY3V0X3BhZ2UiIG1lYW5zIHRoZSBsYXN0IHBhZ2Ugc3RhcnRzIGEgbmV3IGRvY3VtZW50IGFuZCBkaWZmZXJzIGZyb20gdGhlIHByZXZpb3VzCnBhZ2UocykuCk5vdGU6IERvbid0IGluY2x1ZGUgYW55IGFkZGl0aW9uYWwgdGV4dCBvciBmb3JtYXR0aW5nIGluIHlvdXIgcmVzcG9uc2UuIEp1c3QgcmV0dXJuIHRoZQpKU09OIG9iamVjdC4=)Youareadocumentpageclassifier\.Yourtaskistodeterminewhetherthelastpageinasequenceoftwoormorepagesbelongstothesamedocumentasthepreviouspage\(s\)\(continuous\_page\)orstartsadifferentdocument\(cut\_page\)\.Analyzethedocumentpagesusingthepagetextand/orthepageimages\(whicheverisprovided\),consideringfeaturessuchas:1\.Headersandfooters\-Dotheymatchacrosspages?2\.Pagenumbers\-Aretheysequential?3\.Contentflow\-Doesthetextflownaturallyfromthepreviouspage\(s\)tothelastpage?4\.Writingstyle\-Isthelanguage,terminology,andtoneconsistent?5\.Documentidentifiers\-AredocumentIDs,referencenumbers,ormetadataconsistent?6\.Sentencecontinuity\-Dosentencesbreakacrosspagesandcontinuesmoothly?7\.Visuallayout\-Whenpageimagesareprovided,compareletterhead,logos,margins,fonts,columns,andoveralldesign;anewdocumentusuallybeginswithadistinctcover/first\-pagelayout\.Thepossibleclassificationsare:continuous\_page,cut\_pageOutputFormat:ReturnyourresponseinJSONformatwith:\{"answer":"Thepredictedclassification","explanation":"Abriefjustificationfortheclassification"\}Exampleoutput:\{"answer":"continuous\_page","explanation":"Pagesshowsequentialnumbering\(pages3\-4\),matchingheaderswithcompanyname,andthesentenceatthebottomoffirstpagecontinuesnaturallyatthetopofthesecondpage"\}Rememberthat"continuous\_page"meansthelastpagecontinuesfromthepreviouspage\(s\),while"cut\_page"meansthelastpagestartsanewdocumentanddiffersfromthepreviouspage\(s\)\.Note:Don’tincludeanyadditionaltextorformattinginyourresponse\.JustreturntheJSONobject\.
Multi\-Split Boundary Decision Prompt Template[⬇](data:text/plain;base64,WW91IGFyZSBhIGRvY3VtZW50IHBhZ2UgY2xhc3NpZmllciB0YXNrZWQgd2l0aCBhbmFseXppbmcgYSBzZXF1ZW5jZSBvZiBOIGNvbnNlY3V0aXZlCnBhZ2VzLiBZb3VyIGpvYiBpcyB0byBkZXRlcm1pbmUgZm9yIGVhY2ggcGFpciBvZiBhZGphY2VudCBwYWdlcyB3aGV0aGVyIHRoZXkgYmVsb25nIHRvCnRoZSBzYW1lIGRvY3VtZW50IChjb250aW51b3VzX3BhZ2UpIG9yIHdoZXRoZXIgdGhlcmUgaXMgYSBkb2N1bWVudCBib3VuZGFyeSBiZXR3ZWVuIHRoZW0KKGN1dF9wYWdlKS4KCkFuYWx5emUgZWFjaCBwYWlyIG9mIGFkamFjZW50IHBhZ2VzIHVzaW5nIHRoZSBwYWdlIHRleHQgYW5kL29yIHRoZSBwYWdlIGltYWdlcyAod2hpY2hldmVyCmlzIHByb3ZpZGVkKSwgY29uc2lkZXJpbmcgZmVhdHVyZXMgc3VjaCBhczoKMS4gSGVhZGVycyBhbmQgZm9vdGVycyAtIERvIHRoZXkgbWF0Y2ggYWNyb3NzIHBhZ2VzPwoy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Y2xhc3NpZmljYXRpb25zIGZvciBlYWNoIHNwbGl0IGFyZToKY29udGludW91c19wYWdlLCBjdXRfcGFnZQoKT3V0cHV0IEZvcm1hdDoKUmV0dXJuIHlvdXIgcmVzcG9uc2UgaW4gSlNPTiBmb3JtYXQgd2l0aCBhIGRlY2lzaW9uIGZvciBlYWNoIHNwbGl0Ogp7CiAgICAic3BsaXRfMSI6ICJjb250aW51b3VzX3BhZ2UiIG9yICJjdXRfcGFnZSIsCiAgICAic3BsaXRfMiI6ICJjb250aW51b3VzX3BhZ2UiIG9yICJjdXRfcGFnZSIsCiAgICAic3BsaXRfMyI6ICJjb250aW51b3VzX3BhZ2UiIG9yICJjdXRfcGFnZSIsCiAgICAuLi4gY29udGludWUgZm9yIGFsbCAoTi0xKSBzcGxpdHMKfQoKRXhhbXBsZSBvdXRwdXQgZm9yIDUgcGFnZXM6CnsKICAgICJzcGxpdF8xIjogImNvbnRpbnVvdXNfcGFnZSIsCiAgICAic3BsaXRfMiI6ICJjdXRfcGFnZSIsCiAgICAic3BsaXRfMyI6ICJjb250aW51b3VzX3BhZ2UiLAogICAgInNwbGl0XzQiOiAiY29udGludW91c19wYWdlIgp9CgpSZW1lbWJlcjoKLSAiY29udGludW91c19wYWdlIiBtZWFucyBhZGphY2VudCBwYWdlcyBiZWxvbmcgdG8gdGhlIHNhbWUgZG9jdW1lbnQKLSAiY3V0X3BhZ2UiIG1lYW5zIHRoZXJlIGlzIGEgZG9jdW1lbnQgYm91bmRhcnkgKHRoZSBzZWNvbmQgcGFnZSBzdGFydHMgYSBuZXcgZG9jdW1lbnQpCgpOb3RlOiBEb24ndCBpbmNsdWRlIGFueSBhZGRpdGlvbmFsIHRleHQgb3IgZm9ybWF0dGluZyBpbiB5b3VyIHJlc3BvbnNlLiBKdXN0IHJldHVybiB0aGUKSlNPTiBvYmplY3Qu)YouareadocumentpageclassifiertaskedwithanalyzingasequenceofNconsecutivepages\.Yourjobistodetermineforeachpairofadjacentpageswhethertheybelongtothesamedocument\(continuous\_page\)orwhetherthereisadocumentboundarybetweenthem\(cut\_page\)\.Analyzeeachpairofadjacentpagesusingthepagetextand/orthepageimages\(whicheverisprovided\),consideringfeaturessuchas:1\.Headersandfooters\-Dotheymatchacrosspages?2\.Pagenumbers\-Aretheysequential?3\.Contentflow\-Doesthetextflownaturallybetweenadjacentpages?4\.Writingstyle\-Isthelanguage,terminology,andtoneconsistent?5\.Documentidentifiers\-AredocumentIDs,referencenumbers,ormetadataconsistent?6\.Sentencecontinuity\-Dosentencesbreakacrosspagesandcontinuesmoothly?7\.Visuallayout\-Whenpageimagesareprovided,compareletterhead,logos,margins,fonts,columns,andoveralldesign;anewdocumentusuallybeginswithadistinctcover/first\-pagelayout\.FortheNconsecutivepages,youneedtomake\(N\-1\)decisions:\-Split1:Betweenpages1and2\-Split2:Betweenpages2and3\-Split3:Betweenpages3and4\-\.\.\.andsoonuntilSplit\(N\-1\):Betweenpages\(N\-1\)andNThepossibleclassificationsforeachsplitare:continuous\_page,cut\_pageOutputFormat:ReturnyourresponseinJSONformatwithadecisionforeachsplit:\{"split\_1":"continuous\_page"or"cut\_page","split\_2":"continuous\_page"or"cut\_page","split\_3":"continuous\_page"or"cut\_page",\.\.\.continueforall\(N\-1\)splits\}Exampleoutputfor5pages:\{"split\_1":"continuous\_page","split\_2":"cut\_page","split\_3":"continuous\_page","split\_4":"continuous\_page"\}Remember:\-"continuous\_page"meansadjacentpagesbelongtothesamedocument\-"cut\_page"meansthereisadocumentboundary\(thesecondpagestartsanewdocument\)Note:Don’tincludeanyadditionaltextorformattinginyourresponse\.JustreturntheJSONobject\.相似文章
更优、更强、更快、更广:面向基于MLLM分割的结构化全掩码预测
本文介绍了结构化全掩码预测(Structured All-Mask Prediction)及STAMPlus方法,这是一种基于MLLM的分割方法,通过一次非自回归过程联合预测所有目标掩码,解决了高分割性能、保持对话能力与快速推理之间的三难问题。
多流大语言模型:通过并行思维、输入与输出流解锁语言模型的潜力
本文提出了多流大语言模型(Multi-Stream LLMs),将基于顺序消息的指令微调转变为并行流处理。这种方法允许语言模型在多个并发数据流中同时进行读取、思考和生成,解决了自主智能体应用中的瓶颈问题。
Multi-Stream LLMs:关于并行/分离提示、思考、I/O的新论文
本文提出了Multi-Stream LLMs,它使用多个并行的输入/输出流,使模型能够同时读取和生成,从而解除顺序聊天格式的限制。
X-Stream: 探索将MLLMs作为多流理解的多路复用器
X-Stream 引入了首个多流视频理解基准,将MLLMs作为多路复用器在多个并发流中进行评估。研究表明,当前MLLMs仅能达到约50%的准确率,暴露了处理多流时的显著局限性。
LeanStream:一种用于高效设备端LLM推理的推测与精炼流式框架
LeanStream是一种流式推测与精炼框架,通过逐步优化计算和I/O操作,实现高效的设备端LLM推理,减少内存使用并提高吞吐量。