← Latest papers
💻 computer science

Scaling State-Space Models from Lines to Paragraphs: An Ablation of Mamba-based OCR

This paper investigates the scalability of Mamba-based OCR from short lines to full paragraphs, revealing that while State-Space Models offer significant speed advantages over Transformers on synthetic data, they currently underperform on real handwriting due to data scarcity rather than inherent architectural limitations.

Original authors: Merveilles Agbeti-Messan, Pierrick Tranouez, Stéphane Nicolas, Clément Chatelain, Thierry Paquet

Published 2026-06-23
📖 4 min read☕ Coffee break read

Original authors: Merveilles Agbeti-Messan, Pierrick Tranouez, Stéphane Nicolas, Clément Chatelain, Thierry Paquet

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to build a robot that can read handwritten and printed documents, from a single line of text to a full page of a novel. For a long time, the best robots used a "Transformer" brain. This brain is incredibly smart and accurate, but it has a major flaw: it gets slower and slower the longer the text gets. Reading a whole paragraph takes it much longer than reading a single word because it has to constantly re-read everything it just saw to understand the new words. It's like trying to solve a puzzle by looking at every single piece you've already placed every time you add a new one.

This paper introduces a new type of robot brain called Mamba (based on State-Space Models). The big promise of Mamba is that it doesn't re-read the past. Instead, it keeps a "mental summary" of what it has seen so far. This means it can read a whole paragraph just as fast as it reads a single line.

The researchers wanted to know: Is this new Mamba brain actually ready to replace the old Transformer brain for reading long documents?

Here is what they found, broken down simply:

1. The "Perfect World" Test (Synthetic Data)

First, the researchers tested the robot in a "perfect world." They fed it clean, computer-generated text (like Wikipedia articles) that looked perfect, with no smudges or weird handwriting.

  • The Result: Both the old Transformer and the new Mamba were incredibly accurate (almost perfect).
  • The Speed: Mamba was the clear winner. It was 1.4 to 4.5 times faster than the Transformer. The longer the text got, the bigger the speed gap became.
  • The Lesson: In a clean environment, Mamba is a fantastic, lightning-fast alternative that doesn't sacrifice accuracy.

2. The "Real World" Test (Handwriting)

Next, they tested the robot on messy, real-world data: actual handwritten notes from the IAM database. This is where things got tricky.

  • The Result: Mamba struggled significantly. On handwritten lines, it made many more mistakes than the Transformer. On full handwritten paragraphs, the gap was huge: Mamba was nearly three times worse at getting the words right.
  • The Analogy: Imagine the Transformer is a student who can look back at their textbook (the image) whenever they get stuck. Mamba is a student who has to memorize the entire textbook in their head before they start writing the essay. If the textbook is messy (handwriting) and the essay is long (paragraphs), the student who relies on memory (Mamba) gets overwhelmed and makes mistakes.

3. The "Why" (The Data Hunger)

The researchers dug deep to find out why Mamba failed on handwriting. They discovered it wasn't necessarily because Mamba's brain was "dumb." It was because Mamba is extremely hungry for data.

  • The Experiment: When they tried to train Mamba on a small amount of data (like the 8,000 paragraphs available in some datasets), the robot just memorized the answers instead of learning the rules. It failed to learn how to generalize.
  • The Fix: When they gave Mamba 1 million examples to train on, it suddenly started working perfectly, even on long sequences.
  • The Conclusion: The problem with handwriting wasn't that Mamba can't do it; it's that we haven't given it enough practice material yet. The Transformer is better at learning from small amounts of data, while Mamba needs a massive library of examples to work its magic.

4. The Final Verdict

The paper concludes with a clear guide on when to use which robot:

  • Use Mamba for Printed Text: If you are digitizing millions of printed historical newspapers or books, Mamba is the best choice. It is fast, accurate, and saves a lot of computing power.
  • Be Careful with Handwriting: If you are trying to read messy handwritten notes, Mamba currently lags behind the older Transformer models, especially if you don't have a massive amount of training data.
  • The Future: To make Mamba work well for handwriting, we need to either feed it much more data (like 1 million examples) or build a "hybrid" robot that combines Mamba's speed with the Transformer's ability to learn from less data.

In short: Mamba is a speed demon that works perfectly in clean, printed environments but currently needs a massive library of practice material to handle the messiness of real handwriting. It's not broken; it just needs more training.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →