Mamba模型在长文本识别中速度优势明显,但手写体上仍逊于Transformer。
Scaling State-Space Models from Lines to Paragraphs: An Ablation of Mamba-based OCR

- 用Mamba模型做端到端文字识别,研究其从短行到段落的扩展能力
- 在清晰合成文本上错误率低于1%,速度比Transformer快1.4到4.5倍
- 手写体表现较差,主要因数据不足,非模型架构本身缺陷
端到端光学字符识别(OCR)越来越多依赖自回归序列模型,而Transformer的二次计算复杂度限制了长段落文本的高效转录。状态空间模型(SSMs)如Mamba具有线性解码时间,在印刷历史文本上已达到与Transformer相当的准确率,但其在从短行到完整段落的序列扩展行为,以及对手写文本的泛化能力仍不明确。本文系统研究基于Mamba的OCR识别器从行到段落的扩展性能。首先在100至1000字符的合成段落上探索四个核心超参数(解码器深度、状态维度、扩展因子和连接器深度),发现状态维度和扩展因子是长序列准确率的关键控制变量。随后在相同训练协议下对比Transformer基线。在干净合成段落上,两模型错误率均低于1%,而SSM速度提升1.4至4.5倍,且随序列增长进一步提升。但在真实手写文本上,SSM表现明显落后:在IAM数据集上,行级错误率为8.2%,段落级为10.0%,而Transformer分别为4.2%和3.5%。通过受控实验表明,该差距主要源于数据稀缺,而非模型架构固有缺陷——自回归SSM在长序列上对数据极度敏感。本研究明确了SSM在大规模文档转录中的适用边界。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。