Hugging Face Papers ↗ · 2026-11-23
Escriba-OCR: A 1B Vision-Language Model for Error-Preserving Transcription of Handwritten Portuguese Essays
Media reports Hugging Face Papers Source language: Chinese
To preserve errors in handwritten Portuguese essays, researchers fine-tuned Escriba-OCR-1B. It achieves 2.06% CER on BRESSAY and runs on CPUs after quantization.
Full text
Escriba-OCR: A 1B Vision-Language Model for Error-Preserving Transcription of Handwritten Portuguese Essays
Tardelli Ronan Coelho Stekel Affiliation: Federal Institute of São Paulo (IFSP), Brazil
November 2026
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. Paleographers call this a diplomatic transcription. Vision-language models (VLMs) read handwriting well, but they also tend to rewrite it into correct language. We measure this behaviour on BRESSAY, a dataset of 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 that compares systems with paired bootstrap confidence intervals. Because schools need models they can run on their own hardware, we restrict the study to open-weight systems.
We evaluate 22 open baselines: 16 general-purpose VLMs from 2B to 400B parameters and five OCR-specialised VLMs, all without task-specific training, and a recogniser trained on BRESSAY lines. The best of them, 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 that are absent from a Portuguese dictionary with dictionary words, including general VLMs whose prompt explicitly asks them not to.
We then fine-tune LightOnOCR-3-1B on the 647 training pages in 85 minutes on one GPU. The resulting model, Escriba-OCR-1B, reaches 2.06% CER, 3.5 points below the best zero-shot baseline (95% CI [−4.2,−2.9][-4.2,-2.9]), with 1.63% CER on the text alone. Under the case-sensitive metric of the ICDAR 2024 BRESSAY competition it reaches 2.1% CER, below the best published page-level results (2.2–2.4%). It recovers 77% of illegible deletions and 67% of insertions and reproduces the line structure of 97% of the pages, but it still replaces 60% of the likely misspellings with dictionary words. Three training seeds agree to within 0.04 CER points, and quantised to 4 bits the model runs on an ordinary CPU at about one minute per page, with CER within 0.1 points of the GPU model. On 40 letters from another handwriting corpus it reads as well as its base model overall (5.1% against 4.9% CER once the base model’s appended comments are removed), but misreads words that never occur in BRESSAY, such as first-person verbs and proper nouns, more often (40% against 30%); interpolating its weights with the base model’s recovers about half of this gap and lowers BRESSAY test CER to 2.00%, at the cost of edit-markup recall.
A teacher’s review of 96 apparent corrections finds that 45% of the 89 judgeable ones (95% CI 35–55%) are errors in the BRESSAY ground truth, so dictionary-based scores likely understate error preservation. We report what did not reduce normalisation (contrastive decoding against the text-only prior, over-sampling misspelled words, higher input resolution), analyse error types, per-page behaviour and data scaling, and release the model, the benchmark code and the review data.
1 Introduction
Handwritten essays are the norm in Brazilian schools and in the ENEM, the national university-entrance exam, whose essay (redação) millions of students write every year. Automatic transcription would let teachers use digital feedback tools and let researchers study learner writing at scale, and pipelines that score ENEM essays already digitise handwriting with language-model-based OCR followed by text normalisation [38]. For feedback and research, however, a clean text is the wrong target. A teacher giving spelling feedback needs caza where the student wrote caza, not the corrected casa, and a researcher counting orthographic errors needs every one of them.
Paleography calls a transcription that reproduces a document exactly as written a diplomatic transcription: original spelling and mistakes, line breaks and end-of-line hyphenation, deletions and insertions. Its opposite is a normalised transcription, which corrects and modernises the text. In this paper we use error-preserving transcription for the diplomatic case.
Modern VLMs read handwriting remarkably well [7, 16], but they are also strong language models, and strong language models normalise. Recent work shows that VLM-based OCR rewrites perturbed or implausible text toward plausible forms [23, 27, 17], that many handwriting errors of multimodal LLMs come from language priors [46], and that a low CER can hide orthographic normalisation [11]. Learner text is where this matters most, because its “errors” are the signal. To our knowledge, the extent of the problem has not been measured on handwritten learner essays in Portuguese, and no error-preserving recogniser is available for them.
Schools also face a practical constraint. Student essays are personal data under Brazil’s data-protection law (LGPD), so a transcription system should run on hardware the school controls. We therefore restrict this study to open-weight models, which can be audited, fine-tuned and deployed locally; proprietary APIs are outside its scope. This restriction need not cost quality: on a native benchmark of Brazilian Portuguese text embeddings, an openly licensed, self-hostable model reaches the leading tier [40], and we ask whether the same holds for transcription.
Figure 1: Escriba-OCR-1B against the 22 open baselines on the 199 BRESSAY test pages. (a) Page CER against model size; MoE models are plotted at their total parameter count. Fine-tuning puts the 1B model far below zero-shot VLMs up to 400 times larger, including its own base model. (b) The features of a diplomatic transcription, one dot per system. The best zero-shot deletion recall (29%) belongs to Gemma 3 4B at 0.5% precision. HTR-Flor reads ground-truth line crops, so its line structure is not shown. Error preservation, the last row, remains the open problem for every system (§8.4).
We study the problem on BRESSAY [33], 1,000 handwritten Brazilian Portuguese essays transcribed with their errors and edit markup, and make four contributions:
1.
a benchmark for error-preserving transcription that reports page-level CER and WER, error preservation and invented errors, edit-markup precision and recall and line structure, with paired bootstrap confidence intervals (§4);
2.
an evaluation of 22 open baselines, 21 VLMs from 0.8B to 400B parameters used without task-specific training and a trained HTR model, which shows that none reproduces the markup reliably and that the VLMs normalise most misspellings (§7);
3.
Escriba-OCR-1B, a 1B model fine-tuned in 85 minutes that reduces CER by a factor of 2.7 relative to the best zero-shot baseline, improves on the best published page-level BRESSAY result under our reconstruction of the competition’s metric, reproduces edit markup and runs on a single GPU or, quantised, on a CPU (Figure 1; §6, §7);
4.
an analysis of what helps and why, including error decomposition, per-page behaviour, data scaling, negative results on decoding and sampling remedies, a human review showing that the BRESSAY ground truth itself explains almost half of the apparent corrections, and an out-of-domain test on a second corpus with weight interpolation as a remedy for the vocabulary that fine-tuning narrows (§8).
2 Related Work
Handwritten text recognition.
Line-level CRNN/CTC models such as HTR-Flor [32], trained on benchmarks like IAM [28], were the standard until page-level, segmentation-free models such as DAN [6] and transformer recognisers such as TrOCR [25]. BRESSAY [33] was the basis of an ICDAR 2024 competition [34], won by the PERO system from Brno [19, 21] with 3.77% page CER, and segmentation-free models of the DAN family later reported 2.33–2.43% in their main results and 2.24% in their best ablation setting [5]. Neto et al. [35] train four line recognisers on BRESSAY with handwriting synthesised by a conditional GAN; averaged over the four, line CER on the full training set is about 12% (11.5–12.2% across their training regimes, and 6.4% for their best model), and they note that none of their models was designed for the edit markup. All of these systems are trained on the BRESSAY training split, and Table 6 compares Escriba with them under the competition’s metric. Earlier work by the BRESSAY authors applied language-model spelling correction to HTR output [31], the opposite of our goal, and LHTR.br [39] is another Brazilian Portuguese handwriting dataset.
OCR with vision-language models.
End-to-end document models [18, 3] and VLM-based OCR systems [36, 41, 8, 9] transcribe whole pages, mostly printed ones, into Markdown, and general VLMs [2, 1, 12] read handwriting when prompted. Zero-shot evaluations of multimodal LLMs on handwriting [7, 16, 4] report strong accuracy on historical and modern documents. A growing body of work studies faithfulness: VLMs “read or rewrite” [23], lean on linguistic crutches [27], lose visual grounding on unusual text [17] and hallucinate plausible words behind a low CER [11]. We bring this question to learner writing, where unfaithfulness erases exactly the information users need.
Learner handwriting.
Gold et al. [14] proposed annotation guidelines for transcripts that retain orthographic features, with double transcription and high agreement. Gold et al. [13] re-transcribed 1,350 pages of German learner writing accordingly and showed that the decoding dictionary strongly affects whether errors survive. Yasin and Zesch [45] study visual error feedback on handwriting, find that neither modular nor end-to-end systems yet reach acceptable quality, and note that recognisers over-correct learner errors. We follow this line for Brazilian Portuguese, measure how modern open VLMs behave, and release a model trained for the task.
3 Data
BRESSAY [33] contains 1,000 pages of Brazilian Portuguese argumentative essays, one writer per page, collected from online essay platforms and transcribed line by line with the student’s spelling. Edits are marked as --text-- (struck through, legible), --xxx-- (struck through, illegible), ##text## and $$text$$ (inserted above or below the line) and @@???@@ (illegible). We use the official page-level splits (Table 1).
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×\times556 18.4 1,823 / 902 / 930 1,820
Validation 154 4,609 63,957 2,724 525×\times584 19.5 376 / 184 / 140 382
Test 199 5,916 81,118 2,669 538×\times618 20.8 590 / 259 / 379 496
Table 1: BRESSAY statistics. Image sizes are medians; px/line is the median image height divided by the mean number of lines per page. A page holds about 30 lines and 410 words. The last column counts reference words absent from a pt-BR dictionary (§4).
Three properties of these data shape our results. Pages are cropped to the text, so a handwritten line is only about 19 px tall, and OCR-specialised processors such as LightOnOCR’s only downscale images, so upscaling is necessary. ALL-CAPS handwriting is transcribed in sentence case, a convention that a fine-tuned model can learn and a prompted model cannot. Finally, the transcriptions themselves contain mistakes, which we quantify in §8.4. Model selection for Escriba used only the validation split, and the test split was used only to evaluate the selected configuration. For the zero-shot baselines, image upscaling and a repetition penalty were set after an early test run showed repetition loops (§5). BRESSAY’s terms restrict its use to non-commercial research and teaching.
4 Benchmark and Metrics
For page pp with reference rpr_{p} and hypothesis hph_{p}, both are first normalised: Unicode NFC, visually identical glyphs merged (curly to straight quotes, ° to º, dashes to -), whitespace collapsed. The micro-averaged character error rate is then
CER=∑pmin(d(rp,hp),|rp|)∑p|rp|,\mathrm{CER}=\frac{\sum_{p}\min\big(d(r_{p},h_{p}),\,|r_{p}|\big)}{\sum_{p}|r_{p}|}, (1)
where dd is the Levenshtein distance. Each page is capped at 100% so that a single runaway generation, such as a repetition loop, cannot dominate the average. We report three variants, all capped: CER (case-insensitive, markup included, our main metric), CERcase{}_{\text{case}} (case-sensitive) and CERtext{}_{\text{text}} (case-insensitive, with struck-through and illegible spans removed and insertions unwrapped, which measures reading of the text alone). Markup is parsed line by line, as in BRESSAY, so an unclosed marker in a model’s output affects only its own line. WER is computed in the same way at the word level, without the cap.
Handling of student errors.
Let 𝒟\mathcal{D} be the Hunspell pt-BR dictionary. After rejoining words split across lines and removing markup, reference words that are lowercase-initial, at least three letters long and not in 𝒟\mathcal{D} form the set SS of likely misspellings; the test split has |S|=496|S|=496. With a word-level Levenshtein alignment a(⋅)a(\cdot) between reference and hypothesis, we report
Pres\displaystyle\mathrm{Pres} =|{w∈S:a(w)=w}||S|,\displaystyle=\frac{\left|\{w\in S:a(w)=w\}\right|}{|S|}, Corr\displaystyle\mathrm{Corr} =|{w∈S:a(w)≠w,a(w)∈𝒟}||S|,\displaystyle=\frac{\left|\{w\in S:a(w)\neq w,\ a(w)\in\mathcal{D}\}\right|}{|S|}, (2)
together with the shares of words misread (replaced by another non-word) and deleted. Conversely, the invented-error rate is the share of reference dictionary words aligned to a non-dictionary word. Preservation alone would reward a recogniser that misreads everything, so we always report it together with invented errors. SS approximates the true misspellings: it also contains foreign words, proper nouns and transcription errors, which we quantify in §8.4. With about 2.5 such words per page, preservation has a 95% interval of roughly ±4\pm 4 points.
Markup and structure.
Each marked span is reduced to a (type, content) pair, and precision and recall are computed on the multiset intersection of reference and hypothesis pairs per page. Matching ignores position, and for illegible deletions (--xxx--) the content is empty, so for that type we report precision next to recall. Lines is the share of pages whose output has exactly as many non-empty lines as the reference.
Significance.
We compare systems with a paired page-level bootstrap [20]: the 199 test pages are resampled with replacement B=2,000B=2{,}000 times, both systems’ metrics are recomputed on each sample, and we report the 2.5th and 97.5th percentiles of the difference Δ\Delta. The bootstrap captures variation over pages but not over training runs. From two decoder-only runs on validation that differ only in the seed we estimate seed-to-seed variation at about 0.6 CER points, and two vLLM evaluations of identical weights differed by about 0.5 points because of batched-inference non-determinism (one page looped in one of them). We therefore read differences below about 1 point between decoder-only variants as inconclusive. Training the full model, vision encoder included, is far more stable: three seeds differ by at most 0.04 CER points on the test set (§7), so we treat smaller differences between full-model variants as tentative rather than inconclusive.
5 Systems
All baselines are open-weight models evaluated without task-specific training, except HTR-Flor, which we train on BRESSAY. Table 2 summarises their settings.
General-purpose VLMs.
Thirteen instruction-tuned VLMs are queried through OpenRouter with an error-preserving instruction in Portuguese. The prompt asks the model to copy exactly, to leave spelling, accents, agreement, punctuation and casing uncorrected, to keep line breaks and end-of-line hyphens and to use the BRESSAY markup; the full prompt is released with the code. The models are Gemma 3 4B, 12B and 27B [12], Gemma 4 31B [15], Qwen2.5-VL 72B [2], Qwen3-VL 8B, 30B-A3B and 235B-A22B [1], Qwen3.5 9B and 27B [37], Llama 4 Scout and Maverick [29] and Mistral Small 3.2 [30]. All OpenRouter queries were made in November 2026. OpenRouter routes requests to third-party providers whose quantisation we cannot control; several models were served by two to five providers (Table 13 in the appendix). Three small VLMs, Qwen3.5 2B and 4B and Qwen3-VL 2B, run locally with vLLM [22] and the same prompt.
OCR-specialised VLMs.
LightOnOCR-3 0.8B, 1B and 4B [41, 42], PaddleOCR-VL 1.6 [8, 47] and GLM-OCR [9] run locally with their native prompts, since they do not follow instructions. Local models decode greedily with a repetition penalty of 1.05. These settings matter: without upscaling and the penalty, Qwen3.5 2B looped on 106 of the 199 test pages.
HTR.
HTR-Flor [32] is trained on the BRESSAY training lines for 60 epochs with the authors’ code and evaluated on ground-truth line crops, which gives it perfect segmentation, an advantage over page-level systems. Its lines are assembled into pages for scoring. It produced no markup at all, although the training targets contain it; we did not investigate whether the toolkit filters these characters.
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) –
Table 2: Inference settings. Input sizes refer to the longer side after upscaling; BRESSAY pages are about 490–540 px wide (split medians). The native prompts are empty for LightOnOCR, “OCR:” for PaddleOCR-VL and “Text Recognition:” for GLM-OCR; the error-preserving instruction is given in Appendix B.
6 Escriba-OCR-1B
Model.
We fine-tune LightOnOCR-3-1B [42], which keeps the LightOnOCR-2 architecture [41]: a Pixtral vision encoder (24 layers, patch size 14, 2×22\times 2 spatial merge) and a Qwen3 decoder (28 layers, hidden size 1024). The model transcribes a page from an image-only prompt, and we keep that interface.
Training data and objective.
Training examples are pages, paragraph crops and line crops of the 647 training pages, sampled with probabilities 0.4, 0.3 and 0.3. The target is the BRESSAY transcription verbatim, including errors, hyphenation and markup, followed by the end-of-turn token. The loss is token-level cross-entropy on target tokens only, summed over the micro-batches of an optimiser step and divided by their total number of target tokens, so that a short line does not weigh as much as a page; logits are computed only at target positions. Every image is resized to 1200 px on its longer side, which yields about 1,700 visual tokens per page, and a light “phone-photo” augmentation (rotation ±1∘\pm 1^{\circ}, perspective, scaling, blur, shadow, JPEG compression) is applied.
Optimisation.
All parameters are trained, the vision encoder at 0.1×0.1\times the learning rate, with AdamW (β=0.9,0.95\beta=0.9,0.95, no weight decay), learning rate 6×10−56\times 10^{-5} with 3% warm-up and cosine decay, gradient clipping at 1.0, effective batch 8 and 12,000 examples (1,500 steps). Weights are bf16 with fp32 master copies in the optimiser, since pure-bf16 updates vanish at this learning rate. Training takes 85 minutes on one A100 40 GB (loss curve in Figure 6, appendix); the whole study, including screening runs and baselines, used about 28 GPU-hours. Table 11 in the appendix lists all hyperparameters.
Implementation notes.
With transformers 5.22, the reference model class silently leaves all decoder weights of this checkpoint randomly initialised because of a key-prefix mismatch: the base model’s loss on a ground-truth page is 12.1 instead of 0.35. A save–load round trip through vLLM and an overfitting test on 16 pages expose the problem; we ran both before any experiment and recommend them when fine-tuning recent VLM checkpoints. Gradient checkpointing makes training 2.8 times slower on an NVIDIA L4, and training the vision encoder without it requires a 40 GB GPU.
7 Results
Error rates (%) ↓\downarrow Markup recall (%) ↑\uparrow
System Params CER CERcase{}_{\text{case}} CERtext{}_{\text{text}} 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
LightOnOCR-3 1B (base) 1B 8.97 9.83 7.74 20.5 0 0 (–) 0 12
HTR-Flor (trained)† <<1M 10.33 10.43 9.48 30.6 0 0 (–) 0 100
Table 3: BRESSAY test set (199 pages), the fine-tuned model and the strongest open baselines (Table 5 lists all 22). All CER variants are capped per page (Eq. 1). Precision for --xxx-- is in parentheses; “–” means the system never produced the markup. †Evaluated on ground-truth line crops, so its line structure is correct by construction.
Table 3 and Figure 1 summarise the test results, and Table 4 gives bootstrap intervals. Escriba-OCR-1B reaches 2.06% CER, against 5.60% for the best zero-shot baseline, Qwen3-VL 235B-A22B (Δ=−3.54\Delta=-3.54, [−4.19,−2.94][-4.19,-2.94]), and 8–10% for the other strong baselines. The gap is similar on the text alone (1.63% against 4.61%), so it does not come from markup. Two further training runs with different seeds reach 2.05% and 2.03%; over the three seeds, CER is 2.05±0.022.05\pm 0.02, CERtext{}_{\text{text}} 1.64±0.021.64\pm 0.02 and error preservation 24.9±1.324.9\pm 1.3 (mean ±\pm SD). The released model is thus typical of the recipe, and the spread across seeds is about a hundredth of the gap to the best baseline. Markup recall varies by at most 2 points across seeds (Table 12 in the appendix). Fine-tuning also teaches the transcription conventions that zero-shot models cannot follow: Escriba recovers 38% of legible deletions, 77% of illegible deletions (with 68% precision) and 67% of insertions, whereas no zero-shot model recovers more than 16% of insertions (Qwen3.5 27B) or any deletions with useful precision. Escriba also reproduces the line structure of 97% of the pages.
Escriba-OCR-1B minus … Δ\Delta CER [95% CI] Δ\Delta CERtext{}_{\text{text}} [95% CI] Δ\Delta Pres. [95% CI]
Qwen3-VL 235B-A22B −3.54-3.54 [−4.19-4.19, −2.94-2.94] −2.98-2.98 [−3.58-3.58, −2.44-2.44] +2.2+2.2 [−0.8-0.8, +5.1+5.1]
Qwen3.5 27B −5.95-5.95 [−8.38-8.38, −4.05-4.05] −5.03-5.03 [−7.14-7.14, −3.37-3.37] +5.2+5.2 [+1.9+1.9, +8.4+8.4]
LightOnOCR-3 4B −6.38-6.38 [−7.49-7.49, −5.43-5.43] −5.51-5.51 [−6.61-6.61, −4.55-4.55] +8.7+8.7 [+5.7+5.7, +11.8+11.8]
Qwen2.5-VL 72B −6.45-6.45 [−7.77-7.77, −5.35-5.35] −5.95-5.95 [−7.26-7.26, −4.90-4.90] +1.4+1.4 [−2.6-2.6, +5.4+5.4]
LightOnOCR-3 1B (base) −6.91-6.91 [−7.64-7.64, −6.20-6.20] −6.11-6.11 [−6.82-6.82, −5.39-5.39] +10.7+10.7 [+7.4+7.4, +13.9+13.9]
HTR-Flor −8.27-8.27 [−9.22-9.22, −7.34-7.34] −7.85-7.85 [−8.75-8.75, −6.98-6.98] +4.4+4.4 [−1.4-1.4, +10.1+10.1]
Table 4: Paired page-level bootstrap on the test set (B=2,000B=2{,}000), in percentage points. Negative Δ\Delta CER and positive Δ\Delta Pres. favour Escriba. The intervals reflect variation over pages, not over training seeds; across three seeds the CER of Escriba varies by ±0.02\pm 0.02 points.
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
Qwen3-VL 8B 8B 9.18 19.8 15.7 0 19 2
Qwen3-VL 30B-A3B 30B (3B) 10.01 23.7 17.3 0 42 4
HTR-Flor (trained)† <<1M 10.33 30.6 19.2 0 100 –
Qwen3.5 9B 9B 10.82 24.1 16.5 1 20 9
Gemma 4 31B 31B 16.30 35.0 15.1 11 70 9
Qwen3.5 2B 2B 17.01 32.0 13.1 0 6 8
LightOnOCR-3 0.8B 0.8B 17.58 32.6 10.7 0 1 5
Llama 4 Maverick 400B (17B) 18.47 34.8 17.7 0 22 0
GLM-OCR 0.9B 18.84 43.7 13.7 0 20 6
Mistral Small 3.2 24B 20.74 49.4 12.7 0 9 12
PaddleOCR-VL 1.6 0.9B 24.49 49.4 7.3 0 9 10
Llama 4 Scout 109B (17B) 29.55 69.8 11.3 0 5 17
Qwen3-VL 2B 2B 38.61 69.5 10.3 0 2 55
Gemma 3 27B 27B 40.48 65.3 7.7 0 17 6
Gemma 3 12B 12B 61.40 139.0 5.0 0 3 43
Gemma 3 4B 4B 85.23 223.5 1.6 0 1 125
Table 5: All 22 open baselines on the BRESSAY test set (%, except Loops), sorted by CER. Pres.: error preservation; Ins. rec.: insertion recall; Loops: pages whose generation hit the token limit, which was 3,000 tokens for OpenRouter models and 2,048 for local ones. MoE models list total (active) parameters. WER is not capped, so looping models can exceed 100%. †Trained on BRESSAY and evaluated on ground-truth line crops, so its line structure is correct by construction. For comparison, Escriba-OCR-1B: 2.06 / 5.9 / 23.6 / 67 / 97 / 0.
Table 5 lists all 22 open baselines. Among the general-purpose VLMs, the Qwen family leads at every size, while Gemma 3 and Llama 4 Scout frequently stop transcribing and start paraphrasing, or loop until the token limit; Gemma 3 4B loops on 125 of the 199 pages. Only Qwen3-VL 235B (79%), Gemma 4 31B (70%) and Qwen3.5 27B (53%) get the line structure right on more than half of the pages. The OCR-specialised LightOnOCR-3 1B and 4B are as accurate as general VLMs 7 to 70 times larger, which motivated our choice of base model.
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
MT-DAN Coquenet [5] 2.33 8.28
Escriba-OCR-1B this work 2.14 6.24
Table 6: The best published page-level results on the BRESSAY test set (199 pages), case-sensitive with edit markup and without a per-page cap. Competition results from Neto et al. [34], with team names and the LITIS and Demokritos results from Vossos [43]; DAN-family results are the main results of Coquenet [5] with the FCN-M encoder (an ablation setting of MT-DAN reaches 2.24% CER). Escriba’s CER ranges from 1.99% to 2.14% across the readings of the competition’s scoring that we computed (Section 7); the table gives the highest.
Comparison with published BRESSAY results.
Published results on BRESSAY use the metric of the ICDAR 2024 competition [34]: CER and WER are case-sensitive, the edit markup is part of the text, and pages are not capped. The competition’s scoring script is not public, so we score Escriba under several readings of it: line breaks kept or replaced by spaces, errors micro-averaged or averaged over pages, and markup kept verbatim or, with line breaks kept, mapped to single symbols as in the BRESSAY authors’ toolkit. Escriba reaches 2.14% CER and 6.24% WER with line breaks kept and micro-averaging, and 1.99–2.14% CER across these variants; over the three seeds, CER is 2.12±0.022.12\pm 0.02 and WER 6.20±0.046.20\pm 0.04. This is below all published page-level results we know of (Table 6), including the DAN family, whose main results reach 2.33% and whose best ablation setting reaches 2.24%, and its WER is about 1.6 points lower than the best published one. The comparison is not fully controlled: the other systems were trained by their authors under their own settings, and the scoring details may differ slightly. At line level, where systems receive ground-truth line crops, the competition winner reached 2.88% CER.
Efficiency.
Escriba transcribes a page in 2.3 s on an A100 when pages are processed one at a time and at 1.6 pages per second in a vLLM batch, or about $0.35 per 1,000 pages at an on-demand price of $1.99 per GPU-hour. The strongest zero-shot baselines served through OpenRouter took 14–16 s per page, including network and provider queueing, and cost $1.8–3.2 per 1,000 pages there; served locally, the largest of them would need one or several 80 GB GPUs.
CPU inference.
We converted the model to GGUF for llama.cpp and quantised the language model and the vision projector separately. On 30 test pages drawn at random, the mean page CER of every variant is within 0.05 points of the unquantised model served by vLLM (2.54–2.60% against 2.56%; Table 7), well within page-to-page noise. CER on the text alone is about 0.2 points higher for every llama.cpp variant, F16 included (2.04–2.09% against 1.85%), so this small gap comes from the runtime rather than from quantisation. On a 4-vCPU cloud VM (AMD EPYC Turin, 16 GB RAM), the 4-bit language model with a 4-bit vision projector, 0.66 GB in total, transcribes a page in a median of 53 s with under 3 GB of RAM, provided that the server’s prompt cache is disabled (--cache-ram 0); otherwise memory grows by about 0.3 GB per page. Two thirds of that time (35 s) is spent encoding the roughly 1,700 visual tokens, and the text is then generated at 45 tokens per second. Encoding time depends mainly on the projector and generation speed on the language model; on this CPU the 8-bit projector encodes the image more slowly than the 16-bit one (48 against 37 s). A class set of 40 essays takes about 35 minutes on an ordinary computer, without a GPU and without sending the essays anywhere.
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
Table 7: GGUF variants in llama.cpp (commit b019be0) on one 4-vCPU VM (AMD EPYC Turin, 16 GB RAM), 30 random test pages processed one at a time with the prompt cache disabled. CER is the mean of capped page CER. Image is the median time to encode the page image (about 1,700 visual tokens), Text the median generation speed, and Time per page the median end-to-end latency; Peak RAM is the server’s peak resident memory over the 30 pages.
8 Analysis
8.1 Where the remaining errors are
Table 8 decomposes the character errors. Accents contribute little: stripping all diacritics lowers CER by only 0.07–0.29 points for every system. Punctuation contributes more, 0.3 points for Escriba and 1.1–1.5 points for the strongest zero-shot models. The edit counts show the main difference between the fine-tuned model and the baselines: Escriba’s errors are mostly letter substitutions, with insertions and deletions of similar size, while the zero-shot models make as many deletions as substitutions, because they drop words and whole lines. Escriba makes 2.2 times fewer substitutions and 5 times fewer deletions than Qwen3-VL 235B.
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
LightOnOCR-3 1B (base) 8.97 9.83 8.76 7.56 23,308 5,422 18,928
HTR-Flor† 10.33 10.43 10.15 9.02 28,434 3,705 22,724
Table 8: Decomposition of test errors (all CER values capped per page). “w/o accents” and “w/o punct.” recompute CER after stripping diacritics or punctuation from both sides. Edit counts are summed over the 531k reference characters (case-insensitive). †Ground-truth line crops.
8.2 Per-page behaviour
Figure 2a shows the distribution of page CER. Escriba transcribes 30% of the pages with less than 1% CER and 83% with less than 3%, with a median of 1.52% and a worst page of 8.7%. The best zero-shot model has a median of 3.87% and a long tail up to 39.8%, and the 27B and 72B models fail completely on some pages. Compared page by page with Qwen3-VL 235B, Escriba is better on 170 pages, worse on 5 and within 0.5 points on 24. Fine-tuning reduces CER on every one of the 199 pages relative to the base model (Figure 2b), and the gain is largest on the pages the base model found hardest.
Figure 2: (a) Cumulative distribution of page CER on the test set. (b) Page CER of Escriba against that of its base model. Every point lies below the diagonal: fine-tuning improves every page.
8.3 What models do with misspellings
Figure 3a shows what each system outputs for the 496 likely misspellings. All 21 zero-shot VLMs replace 39–78% of them with a dictionary word. The strongest readers tend to sit at the top of that range (Qwen3-VL 235B normalises 71%, Qwen3.5 27B 73% and LightOnOCR-3 4B 78%), and the lowest rates mostly belong to weak readers, which misread rather than normalise; Qwen2.5-VL 72B, fourth on CER, is an exception at 55%. Fine-tuning raises Escriba’s verbatim copies from 13% for the base model to 24% (Δ=+10.7\Delta=+10.7, [+7.4,+13.9][+7.4,+13.9]) and lowers its invented errors from 3.7% to 1.4%, but Escriba still replaces 60% of the likely misspellings with dictionary words. Against the best zero-shot readers, its preservation advantage is small and partly within noise (+2.2 points against Qwen3-VL 235B, [−0.8,+5.1][-0.8,+5.1]), and several of them invent fewer errors: 0.7% for Qwen3-VL 235B and 0.4% for Qwen3.5 27B and LightOnOCR-3 4B. HTR-Flor behaves differently: without a strong language model it replaces only 25% of the likely misspellings with dictionary words, but it misreads 53% of them and turns 24% of correctly spelled words into non-words. A strong language prior thus improves reading and erases errors, while a weak one keeps errors and invents new ones. Figure 4 shows typical cases.
Figure 3: (a) Output for the 496 test words that are absent from the pt-BR dictionary. (b) A teacher’s verdict on 89 judgeable cases where Escriba replaced such a word with a dictionary word.
(a) Edit markup 0248-040-04-08
Reference sada e, assim, --xxx-- a acessibilidade será democratizada ##em## --a todos os-- todo o Brasil. Escriba-OCR-1B sada e, assim, --xxx-- a acessibilidade será democratizada ##em## --a todos os-- todo o Brasil. Qwen3-VL 235B-A22B sada e, assim, #␣ a acessibilidade será democratizada ␣em␣ todo o Brasil. Qwen2.5-VL 72B sada e␣ assim␣ ␣a acessibilidade será democratizada ␣em␣ todo o Brasil.
(b) A preserved misspelling (esteriotipando) 7870-046-02-04
Reference dição e para conscientizar os indivíduos, os quais permanecem esteriotipando e minimizando o sofrimento Escriba-OCR-1B dição e para conscientizar os indivíduos, os quais permanecem esteriotipando e minimizando o sofrimento Qwen3-VL 235B-A22B dição e para conscientizar os indivíduos, os quais permanecem estereotipando e minimizando o sofrimento Qwen2.5-VL 72B con dição e para conscientizar os indivíduos, os quais permanecem estereotipando e minimizando o sofrimento
(c) A normalised misspelling (entreternimento) 7605-061-01-03
Reference bastante valorizada. Entretanto, o acesso a esse meio de entreternimento no Brasil ainda Escriba-OCR-1B bastante valorizada. Entretanto, o acesso a esse meio de entrete␣nimento no Brasil ainda Qwen3-VL 235B-A22B bastante valorizada. Entretanto, o acesso a esse meio de entrete␣nimento no Brasil ainda Qwen2.5-VL 72B bastante valorizada. Entretanto, o acesso a esse meio de entrete␣nimento no Brasil ainda
Figure 4: Test lines (image upscaled 4×4\times) with the reference and three transcriptions; differences from the reference are highlighted and ␣ marks deleted text. (a) Escriba reproduces the illegible deletion, the insertion and the legible deletion, while both zero-shot models drop the markup. (b) Escriba keeps the misspelling esteriotipando, which both zero-shot models correct to estereotipando. (c) A failure case, representative of the 60% of likely misspellings that Escriba still normalises: all three systems correct entreternimento to entretenimento; our human review (§8.4) confirmed that the student wrote it. Qwen2.5-VL writes these pages without the original line breaks, so its closest span is shown.
8.4 Human review of apparent corrections
A teacher, the author, reviewed a random sample of 96 test cases in which Escriba wrote a dictionary word in place of a non-dictionary reference word. For each case the review tool showed the line image, the reference, Escriba’s output and, for context, a second system’s output, and the reviewer decided whether the student had really written the misspelling. The review was not blind to which output came from Escriba. Seven cases could not be judged, because the tool showed only the first half of a word hyphenated across lines. Seven others had been answered as “other” with a free-text note and were assigned to a category from that note.
Of the 89 judgeable cases (Figure 3b), 38 (43%, Wilson 95% CI 33–53%) were genuine misspellings normalised by the model. Another 40 (45%, 35–55%) were errors in the BRESSAY transcription: the student had written the correct form, and in 38 of these the model’s output matched it, while in the other two the model was wrong as well (e.g. catástrofe read as amnistia). The remaining 11 (12%, 7–21%) were ambiguous.
Dictionary-based preservation therefore likely understates every system, although we reviewed only Escriba’s outputs. For Escriba, |S|=496|S|=496 contains about 297×40/89≈134297\times 40/89\approx 134 ground-truth errors among the words it “corrected”. Removing them from SS raises its preservation from 117/496 (24%) to 117/362≈32%117/362\approx 32\% (30–35% over the confidence interval of the 45% share), or to 36% if the ambiguous cases are removed as well. We release the 40 confirmed corrections as an erratum to BRESSAY.
8.5 Remedies for normalisation that did not work
In the spirit of contrastive decoding [26, 24], we penalised tokens that the decoder favours without the image, scoring each token with
s(t)=logp(t∣I,y<k)−αlogp(t∣y<k)subject to p(t∣I,y<k)≥0.1maxt′p(t′∣I,y<k).s(t)=\log p(t\mid I,y_{<k})-\alpha\log p(t\mid y_{<k})\quad\text{subject to }p(t\mid I,y_{<k})\geq 0.1\max_{t^{\prime}}p(t^{\prime}\mid I,y_{<k}). (3)
With α=0.5\alpha=0.5, preservation on 50 validation pages moved from 23.1% to 22.3%, invented errors rose from 2.2% to 2.8% and decoding was twice as slow, in line with findings that decoding-time interventions do not reliably restore visual grounding [17]. Sampling training crops that contain a likely misspelling four times as often changed preservation by +2+2 points, within noise, and 1540 px input by +1.3+1.3 points. Together with the human review, these negative results suggest that a sizeable part of the residual normalisation is visual rather than a pure language-model prior: at about 19 px per line, accents, doubled letters and letter pairs such as n/u are often genuinely ambiguous.
8.6 Ablations, data scale and robustness
Table 9 summarises the screening study on the validation split. Training the vision encoder is the largest single gain: −1.9-1.9 and −2.0-2.0 points at matched learning rates of 3×10−53\times 10^{-5} and 6×10−56\times 10^{-5}, and still −1.6-1.6 points ([−1.9,−1.3][-1.9,-1.3]) against the best decoder-only run, which used the higher rate. This is consistent with the domain shift from printed documents to small handwriting. Raising the learning rate from 1×10−51\times 10^{-5} to 3×10−53\times 10^{-5} helped the decoder-only runs; further increases changed CER by less than the noise. Line crops, photo augmentation on clean scans, 1540 px input and misspelling over-sampling all changed CER by less than the seed-to-seed variation, and repetition penalties of 1.0 and 1.05 gave identical results.
Configuration (validation, 154 pa