Escriba-OCR: A 1B Vision-Language Model for Error-Preserving Transcription of Handwritten Portuguese Essays
Organizations: Federal Institute of São Paulo (IFSP), Brazil
Abstract
Feedback tools and research on learner writing need transcriptions of handwritten essays that keep exactly what the student wrote: misspellings, line breaks, struck-through words and insertions. Vision-language models (VLMs) read handwriting well, but they also tend to rewrite it into correct language. We measure this on BRESSAY, 1,000 handwritten Brazilian Portuguese essays, with a benchmark that adds error preservation, invented errors, edit-markup precision and recall and line structure to the character error rate (CER) and uses paired bootstrap confidence intervals. We restrict the study to open-weight models that schools can run on their own hardware. Of 22 open baselines, the best, Qwen3-VL 235B-A22B, reaches 5.6% CER on the 199 test pages; none reproduces the edit markup reliably, and every VLM replaces 39-78% of the words absent from a Portuguese dictionary with dictionary words. We fine-tune LightOnOCR-3-1B on the 647 training pages in 85 minutes on one GPU. The resulting Escriba-OCR-1B reaches 2.06% CER, 3.5 points below the best baseline (95% CI [-4.2, -2.9]); under the ICDAR 2024 competition metric it reaches 2.1% CER, below the best published page-level results (2.2-2.4%). It recovers 67% of insertions and 77% of illegible deletions, and reproduces the line structure of 97% of the pages, but still normalises 60% of likely misspellings. Three seeds agree within 0.04 CER points, and quantised to 4 bits the model runs on an ordinary CPU at about one minute per page. On 40 letters of another corpus it matches its base model (without that model's appended comments) but misreads unseen words more often; weight interpolation recovers half the gap. A teacher's review finds that 45% of the judgeable apparent corrections are errors in the BRESSAY ground truth, so dictionary-based scores likely understate preservation. We release the model, the benchmark code and the review data.
Figures & tables
| Split | Pages | Lines | Words | Chars/page | Image (px) | px/line | --t-- / --xxx-- / ##t## | Non-dict. words |
|---|---|---|---|---|---|---|---|---|
| Train | 647 | 19,565 | 267,588 | 2,712 | 492 556 | 18.4 | 1,823 / 902 / 930 | 1,820 |
| Validation | 154 | 4,609 | 63,957 | 2,724 | 525 584 | 19.5 | 376 / 184 / 140 | 382 |
| Test | 199 | 5,916 | 81,118 | 2,669 | 538 618 | 20.8 | 590 / 259 / 379 | 496 |
| Systems | Run via | Input | Prompt | Decoding | Max new tokens |
|---|---|---|---|---|---|
| Escriba-OCR-1B | vLLM 0.34, A100 | 1200 px PNG | image only | greedy, rep. penalty 1.05 | 2,048 |
| 13 general VLMs | OpenRouter | 1540 px JPEG (q92) | error-preserving instruction | temperature 0, reasoning off | 3,000 |
| 3 small general VLMs | vLLM 0.34, L4 | 1600 px PNG | error-preserving instruction | greedy, rep. penalty 1.05 | 2,048 |
| 5 OCR-specialised VLMs | vLLM 0.34, L4 | 1600 px PNG | native (empty or task tag) | greedy, rep. penalty 1.05 | 2,048 |
| HTR-Flor | authors’ toolkit | GT line crops | – | CTC beam search (width 32) | – |
| Error rates (%) | Markup recall (%) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| System | Params | CER | CER | CER | WER | --t-- | --xxx-- (prec.) | ##t## | Lines (%) |
| Escriba-OCR-1B (ours) | 1B | 2.06 | 2.13 | 1.63 | 5.9 | 38 | 77 (68) | 67 | 97 |
| Qwen3-VL 235B-A22B | 235B | 5.60 | 6.44 | 4.61 | 11.2 | 1 | 1 (100) | 3 | 79 |
| Qwen3.5 27B | 27B | 8.01 | 8.40 | 6.66 | 16.4 | 2 | 1 (100) | 16 | 53 |
| LightOnOCR-3 4B | 4B | 8.44 | 8.52 | 7.14 | 18.2 | 0 | 0 (–) | 0 | 0 |
| Qwen2.5-VL 72B | 72B | 8.51 | 9.12 | 7.58 | 21.5 | 0 | 0 (100) | 0 | 42 |
| Escriba-OCR-1B minus … | CER [95% CI] | CER [95% CI] | Pres. [95% CI] |
|---|---|---|---|
| Qwen3-VL 235B-A22B | [ , ] | [ , ] | [ , ] |
| Qwen3.5 27B | [ , ] | [ , ] | [ , ] |
| LightOnOCR-3 4B | [ , ] | [ , ] | [ , ] |
| Qwen2.5-VL 72B | [ , ] | [ , ] | [ , ] |
| LightOnOCR-3 1B (base) | [ , ] | [ , ] | [ , ] |
| HTR-Flor | [ , ] | [ , ] | [ , ] |
| Model | Params | CER | WER | Pres. | Ins. rec. | Lines | Loops |
|---|---|---|---|---|---|---|---|
| Qwen3-VL 235B-A22B | 235B (22B) | 5.60 | 11.2 | 21.4 | 3 | 79 | 0 |
| Qwen3.5 27B | 27B | 8.01 | 16.4 | 18.3 | 16 | 53 | 4 |
| LightOnOCR-3 4B | 4B | 8.44 | 18.2 | 14.9 | 0 | 0 | 1 |
| Qwen2.5-VL 72B | 72B | 8.51 | 21.5 | 22.2 | 0 | 42 | 1 |
| LightOnOCR-3 1B (base) | 1B | 8.97 | 20.5 | 12.9 | 0 | 12 | 0 |
| Qwen3.5 4B | 4B | 9.11 | 18.0 | 15.3 | 1 | 32 | 1 |
| System | Source | CER (%) | WER (%) |
|---|---|---|---|
| LITIS | ICDAR 2024 competition | 8.80 | 17.66 |
| Demokritos | ICDAR 2024 competition | 6.62 | 19.49 |
| PERO (competition winner) | ICDAR 2024 competition | 3.77 | 10.08 |
| DAN | Coquenet [5] | 2.43 | 7.85 |
| Meta-DAN | Coquenet [5] | 2.38 | 8.46 |
| Faster DAN | Coquenet [5] | 2.34 | 8.03 |
| Language model + projector | Size | CER (%) | Image | Text | Time per page | Peak RAM |
|---|---|---|---|---|---|---|
| bf16, vLLM on A100 (reference) | 2.0 GB | 2.56 | – | – | 2.3 s | – |
| F16 + F16 | 2.0 GB | 2.60 | 41 s | 28 tok/s | 69 s | 3.6 GB |
| Q8_0 + Q8_0 | 1.1 GB | 2.60 | 49 s | 38 tok/s | 70 s | 2.9 GB |
| Q4_K_M + F16 | 1.2 GB | 2.55 | 37 s | 47 tok/s | 55 s | 3.0 GB |
| Q4_K_M + Q8_0 | 0.85 GB | 2.54 | 48 s | 45 tok/s | 66 s | 2.8 GB |
| Q4_K_M + Q4_K_M | 0.66 GB | 2.60 | 35 s | 45 tok/s | 53 s | 2.7 GB |
| CER (%) | Character edits | ||||||
|---|---|---|---|---|---|---|---|
| System | CER | with case | w/o accents | w/o punct. | Subst. | Ins. | Del. |
| Escriba-OCR-1B | 2.06 | 2.13 | 1.99 | 1.77 | 5,877 | 2,489 | 2,593 |
| Qwen3-VL 235B-A22B | 5.60 | 6.44 | 5.45 | 4.49 | 12,999 | 3,690 | 13,076 |
| Qwen3.5 27B | 8.01 | 8.40 | 7.90 | 6.61 | 15,636 | 6,276 | 13,464 |
| LightOnOCR-3 4B | 8.44 | 8.52 | 8.30 | 6.99 | 17,279 | 10,598 | 18,625 |
| Qwen2.5-VL 72B | 8.51 | 9.12 | 8.22 | 7.17 | 20,278 | 4,187 | 17,796 |
| Configuration (validation, 154 pages) | Examples | CER | Pres. | Ins. rec. |
|---|---|---|---|---|
| Base model, zero-shot | – | 10.01 | 14.1 | 0 |
| Decoder only, lr | 2.4k | 6.12 | 19.6 | 49 |
| Decoder only, lr (seed 0 / seed 1) | 2.4k | 4.70 / 5.33 | 21.5 / 20.7 | 57 / 53 |
| Decoder only, lr | 2.4k | 4.44 | 21.7 | 57 |
| Full model (vision at lr), lr | 2.4k | 2.81 | 25.7 | 64 |
| pages + paragraphs only (no line crops) | 2.4k | 3.39 | 25.4 | 63 |
| BRESSAY | BFL (40 letters) | |||||
|---|---|---|---|---|---|---|
| Val. CER | Test CER | Del. rec. | Lines | CER | Unseen words | |
| 0 (Escriba) | 2.05 | 2.09 | 77.6 | 97.5 | 5.12 | 39.6 |
| 0.1 | 1.98 | 1.99 | 70.3 | 97.5 | 4.70 | 36.5 |
| 0.2 (selected) | 1.99 | 2.00 | 61.4 | 93.5 | 4.46 | 34.6 |
| 0.3 | 2.16 | 2.11 | 50.6 | 93.0 | 4.34 | 33.2 |
| 0.4 | 2.39 | 2.42 | 37.8 | 85.9 | 4.20 | 31.4 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Base model | lightonai/LightOnOCR-3-1B (Pixtral encoder, Qwen3 decoder) |
| Trainable | all parameters; vision encoder at learning rate |
| Optimiser | AdamW, , , no weight decay, gradient clipping 1.0 |
| Learning rate | , 3% linear warm-up, cosine decay to 0 |
| Batch | micro-batch 1, 8 accumulation steps; 1,500 steps (12,000 examples) |
| Data mixture | pages / paragraphs / lines = 0.4 / 0.3 / 0.3 (training split only) |
| Input | longer side resized to 1200 px (LANCZOS); maximum sequence 4,608 tokens |
| Metric (test, %) | Seed 0 (released) | Seed 1 | Seed 2 | Mean SD |
|---|---|---|---|---|
| CER | 2.06 | 2.05 | 2.03 | |
| CER | 2.13 | 2.11 | 2.10 | |
| CER | 1.63 | 1.67 | 1.63 | |
| WER | 5.88 | 5.83 | 5.83 | |
| Error preservation | 23.6 | 26.2 | 25.0 | |
| Invented errors | 1.40 | 1.37 | 1.33 |
| Model | Providers (number of the 199 test pages) |
|---|---|
| Qwen3-VL 235B-A22B | Parasail 121, Venice 78 |
| Qwen3.5 27B | Chutes 91, DeepInfra 57, AtlasCloud 26, Alibaba 25 |
| Qwen3.5 9B | PrimeIntellect 87, Parasail 70, Together 39, DeepInfra 3 |
| Gemma 4 31B | NextBit 80, KT 75, CoreWeave 39, DeepInfra 4, ModelRun 1 |
| Gemma 3 27B | Nebius 81, Parasail 53, DeepInfra 46, NextBit 19 |
| Gemma 3 12B | DeepInfra 166, NextBit 33 |
Online Handwriting Recognition
Online Handwriting Recognition turns time-ordered pen movements or sensor signals into characters and words.
See all 19 papers