DocSLM: A Small Vision-Language Model for Long Multimodal Document Understanding

Tanveer Hannan, Dimitrios Mallios, Parth Pathak, Faegheh Sardari, Thomas Seidl, Gedas Bertasius, Mohsen Fayyaz, Sunando Sengupta

TL;DR

DocSLM is a lightweight, 2B-parameter Vision-Language Model designed to process long, multi-page documents on resource-constrained edge devices. By combining hierarchical multimodal compression with a novel streaming abstention mechanism, it matches or exceeds the accuracy of models four times its size while slashing latency by 71% and maintaining a flat memory footprint.

What Problem Does This Paper Address?

Processing long, multi-page documents (like financial reports, legal briefs, or scientific papers) requires models to simultaneously parse complex visual layouts and dense text. Large Vision-Language Models (LVLMs) excel at this, but they are massive memory hogs—frequently exceeding 8B parameters and requiring thousands of tokens per page. This high computational overhead makes them impractical to deploy on edge hardware like mobile GPUs.

Existing workarounds fall short: Retrieval-Augmented Generation (RAG) frameworks introduce significant latency and fragment context, while smaller models either rely on dense visual encodings that quickly saturate memory or use aggressive compression that destroys text readability. DocSLM aims to bridge this gap by delivering high-accuracy document understanding within a strict token and memory budget.

Methods

DocSLM introduces two core architectural innovations to handle page-level and document-level efficiency bottlenecks:

  1. Hierarchical Multimodal Compression: Instead of feeding raw dense visual tokens and long OCR text strings directly into the language model, DocSLM uses a two-stage fusion process. First, Local OCR Compression uses cross-attention to map region-specific OCR text directly onto corresponding visual patches. Second, Global Visual Compression condenses these features into a fixed budget of just 576 tokens per page, regardless of how text-heavy the page actually is.
  2. Streaming Abstention: To handle arbitrarily long documents without running out of memory, DocSLM breaks the document into sequential segments. Crucially, it avoids passing massive Key-Value (KV) caches between segments. Instead, it processes each segment independently, computes a text prediction, and calculates an entropy-based uncertainty score. An Uncertainty Calibrator then reviews all segment predictions and selects the one with the highest confidence (lowest uncertainty). If a segment doesn't contain the answer, the model learns to output a "Not Answerable" token.
Figure 4. Streaming Abstention. To process long documents efficiently, DocSLM divides the input into shorter segments that can be handled sequentially or in parallel. Each segment produces an intermediate prediction that can either (Left) correctly answer the query with low uncertainty, (Middle) abstain when the answer is not present, or (Right) produce an incorrect answer with high uncertainty. A Uncertainty Calibrator aggregates all valid segment predictions and selects the final document-level answer corresponding to the lowest uncertainty. In memory-limited settings, segments are processed sequentially, with memory from previous segments released before processing the next one.

The model is trained using a multi-stage curriculum that progressively transitions from low-level image-OCR alignment to multi-document finetuning with negative-pair supervision to calibrate its uncertainty scores.

Datasets

The authors trained and evaluated DocSLM across several diverse benchmarks:

  • Training & Finetuning: DocStruct4M, MP-DocStruct1M, DocDownstream 1.0 & 2.0, DocGenome12K, and MP-DocReason51K.
  • Evaluation:
  • MMLongDocBench: Features long documents averaging 47.5 pages (up to 120 pages) to test long-context capabilities.
  • MP-DocVQA & DUDE: Standard multi-page document question-answering datasets spanning industrial, medical, legal, and financial domains.
  • NewsVideoQA: A text-rich broadcast video dataset used to evaluate how well the model generalizes to temporally varying, text-centric visual content.

Key Insights and Ideas

  • The Constant Memory Plateau: Traditional transformers suffer from linear memory growth as document length increases. DocSLM's streaming mechanism completely flattens this curve, capping peak GPU memory usage at ~14 GB whether the document is 10 pages or 120 pages long. DocSLM flattens peak GPU memory usage to a constant plateau.

  • Ditching the KV Cache Safely: Retaining KV caches across long contexts is a major memory bottleneck. DocSLM proves that you can discard intermediate activations entirely between document segments, provided you have a well-calibrated uncertainty mechanism to pick the best answer post-hoc.

  • Local Alignment Before Global Compression: Aggressive downsampling usually ruins text recognition. The "aha moment" here is that by aligning OCR text tokens to local visual patches before global compression, the model retains fine-grained semantic fidelity even with a 5.6× reduction in total tokens.
Figure 2. Peak GPU memory usage vs. number of document pages. We evaluate all models using their official implementa- tions under identical inference settings, progressively increasing the number of document pages. Peak GPU memory is measured using PyTorch profiling tools. DocSLM achieves the lowest mem- ory footprint among all methods, maintaining a constant plateau of ∼14 GB beyond 10 pages due to its streaming mechanism, en- abling scalable inference on resource-constrained devices.

Key Results

  • Efficiency & Speed: DocSLM operates with just 576 tokens per image and 2B parameters, yet it runs 3.5× faster than RAG-based alternatives (32.1 ms vs 113.4 ms latency).
  • Performance Gains: On the MMLongDoc benchmark, DocSLM achieves 22.7% accuracy, outperforming the 8B-parameter DocOwl2 by +9.3% and the similarly sized Docopilot-2B by +0.9%, despite Docopilot using a significantly larger token budget. DocSLM accuracy vs token efficiency on MMLongDoc.

  • Robustness to Length: On MP-DocVQA, while baseline models collapsed when documents exceeded 10 pages (dropping to 0.7 ANLS), DocSLM maintained a strong score of 61.2 ANLS.

  • Cross-Modal Generalization: Despite being trained primarily on static documents, DocSLM achieved a state-of-the-art ANLS score of 66.2 on NewsVideoQA, outperforming much larger models like Idefics3 and LLaVA-Next.
Figure 1. Model accuracy versus token efficiency on MMLong- Doc [28]. DocSLM achieves a +9.3% gain over DocOwl2 [17] with a comparable Tokens/Image budget, while using 75% fewer parameters than large RAG-based models such as InternVL2- RAG [38], and outperforming the similarly sized Docopilot- 2B [12] by +0.9% despite its significantly larger token budget.

Limitations and Future Work

The authors note that future work will focus on creating a more balanced training regime that unifies document and video understanding into a single foundation model for edge deployment. While not explicitly detailed as a failure mode, the segment-wise streaming approach inherently relies on the answer being localized within specific segments; synthesizing answers that require aggregating information spread across multiple distinct segments remains an open challenge for future exploration.

Summary updated

BibTeX
@inproceedings{hannan2026docslm,
  author = {Tanveer Hannan and Dimitrios Mallios and Parth Pathak and Faegheh Sardari and Thomas Seidl and Gedas Bertasius and Mohsen Fayyaz and Sunando Sengupta},
  title = {{DocSLM: A Small Vision-Language Model for Long Multimodal Document Understanding}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=6INdaNeqt0},
}
Figure