Scaling State-Space Models from Lines to Paragraphs: An Ablation of Mamba-based OCR
- URL: http://arxiv.org/abs/2606.23524v1
- Date: Mon, 22 Jun 2026 16:07:40 GMT
- Title: Scaling State-Space Models from Lines to Paragraphs: An Ablation of Mamba-based OCR
- Abstract summary: State-Space Models (SSMs) offer linear-time decoding and have been shown to match Transformer accuracy on printed historical lines.<n>We study how a Mamba-based OCR recognizer scales from lines to paragraphs.<n>Our study clarifies when SSMs are a practical choice for large-scale document transcription and when they are not.
- Score: 4.247423625723054
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: End-to-end OCR increasingly relies on autoregressive sequence models, where the quadratic cost of Transformer attention limits efficient transcription of long, paragraph-level text. State-Space Models (SSMs) such as Mamba offer linear-time decoding and have recently been shown to match Transformer accuracy on printed historical lines, but their behavior as sequences grow from short lines to full paragraphs, and their generalization to handwriting, remain poorly understood. We study how a Mamba-based OCR recognizer scales from lines to paragraphs. We first conduct a systematic exploration of its four core hyperparameters (decoder depth, state dimension, expansion factor, and connector depth) on synthetic paragraphs from 100 to 1,000 characters, identifying the recurrent state dimension and the expansion factor as the dominant levers for long-sequence accuracy. We then compare the recognizer against a Transformer baseline trained under an identical protocol. On clean synthetic paragraphs, both models stay below 1% CER at every length while the SSM runs 1.4 to 4.5 times faster, the speedup growing with sequence length. On real handwriting, however, the SSM lags clearly behind: it reaches 8.2% CER on IAM lines and 10.0% on IAM paragraphs, against 4.2% and 3.5% for the Transformer baseline. Through controlled experiments we show that a substantial part of this gap stems from data scarcity rather than from an intrinsic architectural limit: the autoregressive SSM decoder is markedly data-hungry on long sequences. Our study clarifies when SSMs are a practical choice for large-scale document transcription and when they are not.
Related papers
- TongGuOCR: A Layout-Aware and Token-Augmented OCR MLLM for Chinese Historical Documents [50.64307290680222]
TongGuOCR is a layout-aware and token-augmented multimodal large language model (MLLM) for OCR of Chinese historical documents.<n>TongGuOCR achieves 93.76 AR and reduces NED from 10.43 to 6.15 and RO-ED from 7.53 to 3.49 relative to the best competing score for each metric.
arXiv Detail & Related papers (2026-08-08T04:50:00Z) - Looped SSMs: Depth-Recurrence and Input Reshaping for Time Series Classification [50.994194925685434]
We show that a looped SSM with $k$ parameters iterated $L$ times consistently closely matches or outperforms a standard SSM.<n>We also show that input reshaping is an equally neglected design axis.
arXiv Detail & Related papers (2026-05-15T15:18:12Z) - CAWN: Continuous Acoustic Wave Networks for Autoregressive Language Modeling [46.16066322190728]
We introduce the Continuous Acoustic Wave Network (CAWN), a fully continuous sequence-mixing architecture.<n>Instead of discrete matrix-based attention, CAWN projects hidden states into multi-headed complex-domain phasors.<n>To prevent signal degradation over ultra-long contexts, we introduce a dual-gated Selective Phase Resonance mechanism.
arXiv Detail & Related papers (2026-04-05T20:13:22Z) - A Benchmark of State-Space Models vs. Transformers and BiLSTM-based Models for Historical Newspaper OCR [4.247423625723055]
Linear-time State-Space Models (SSMs) are a scalable alternative to Transformer-based sequence modeling for OCR.<n>We present the first OCR architecture based on SSMs, combining a CNN visual encoder with bi-directional and autoregressive Mamba sequence modeling.<n>We show that Mamba-based models maintain competitive accuracy while halving inference time and exhibiting superior memory scaling.
arXiv Detail & Related papers (2026-04-01T10:33:33Z) - PP-OCRv5: A Specialized 5M-Parameter Model Rivaling Billion-Parameter Vision-Language Models on OCR Tasks [21.41974664575541]
"OCR 2.0" and large-scale vision-language models (VLMs) have set new benchmarks in text recognition.<n>This paper introduces PP-OCRv5, a meticulously optimized, lightweight OCR system with merely 5 million parameters.
arXiv Detail & Related papers (2026-03-25T14:54:40Z) - BTZSC: A Benchmark for Zero-Shot Text Classification Across Cross-Encoders, Embedding Models, Rerankers and LLMs [0.0]
Zero-shot text classification (ZSC) offers the promise of eliminating costly task-specific annotation.<n>Recent advances in text-embedding models, rerankers, and instruction-tuned large language models (LLMs) have challenged the dominance of NLI-based architectures.<n>We introduce BTZSC, a comprehensive benchmark of 22 public datasets spanning sentiment, topic, intent, and emotion classification.
arXiv Detail & Related papers (2026-03-12T14:43:20Z) - GLM-OCR Technical Report [65.42028025507491]
GLM-OCR is an efficient compact model designed for real-world document understanding.<n>It combines a CogViT visual encoder with a GLM language decoder, achieving a strong balance between computational efficiency and recognition performance.<n>Extensive evaluations on public benchmarks and industrial scenarios show that GLM-OCR achieves competitive or state-of-the-art performance.
arXiv Detail & Related papers (2026-03-11T15:55:47Z) - On-the-Fly Adaptive Distillation of Transformer to Dual-State Linear Attention [53.22963042513293]
Large language models (LLMs) excel at capturing global token dependencies via self-attention but face prohibitive compute and memory costs on lengthy inputs.<n>We first propose dual-state linear attention (A), a novel design that maintains two hidden states-one for preserving historical context and one for tracking recencythereby mitigating the short-range bias typical of linear-attention architectures.<n>We introduce DSLA-Serve, an online adaptive distillation framework that progressively replaces Transformer layers DSLA layers at inference time, guided by a sensitivity-based layer ordering.
arXiv Detail & Related papers (2025-06-11T01:25:06Z) - Length-Aware Multi-Kernel Transformer for Long Document Classification [4.796752450839119]
Lengthy documents pose a unique challenge to neural language models due to substantial memory consumption.
We propose a Length-Aware Multi- Kernel Transformer (LAMKIT) to address the new challenges for the long document classification.
arXiv Detail & Related papers (2024-05-11T16:48:06Z) - LOCR: Location-Guided Transformer for Optical Character Recognition [55.195165959662795]
We propose LOCR, a model that integrates location guiding into the transformer architecture during autoregression.
We train the model on a dataset comprising over 77M text-location pairs from 125K academic document pages, including bounding boxes for words, tables and mathematical symbols.
It outperforms all existing methods in our test set constructed from arXiv, as measured by edit distance, BLEU, METEOR and F-measure.
arXiv Detail & Related papers (2024-03-04T15:34:12Z) - Repeat After Me: Transformers are Better than State Space Models at Copying [53.47717661441142]
We show that while generalized state space models are promising in terms of inference-time efficiency, they are limited compared to transformer models on tasks that require copying from the input context.
arXiv Detail & Related papers (2024-02-01T21:44:11Z) - Rethinking Text Line Recognition Models [57.47147190119394]
We consider two decoder families (Connectionist Temporal Classification and Transformer) and three encoder modules (Bidirectional LSTMs, Self-Attention, and GRCLs)
We compare their accuracy and performance on widely used public datasets of scene and handwritten text.
Unlike the more common Transformer-based models, this architecture can handle inputs of arbitrary length.
arXiv Detail & Related papers (2021-04-15T21:43:13Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.