صفرthe sifr prize

Honorable mention · The Sifr Prize 2026

A Script-Conditioned Reader for Maghrebi-Andalusi Scientific Manuscripts

Published
On this page

The folio and the edition

In May 2026 I ran GPT-4o on a folio of Ibn al-Bannāʾ al-Marrākushī’s Talkhīṣ aʿmāl al-ḥisāb written in a Maghrebi mabsūṭ hand. The model returned a clean, confident Arabic transcription. At three loci the transcription was not what the folio said. It was what Mohamed Souissi’s 1969 Tunis edition says (Ibn al-Bannāʾ, Talkhīṣ aʿmāl al-ḥisāb, ed./tr. Souissi, Publications de l’Université de Tunis, 1969). The model had silently substituted ف for ڢ and ق for ڧ throughout, collapsing the Maghrebi dot convention into Mashriqī orthography.

It had linearized a marginal sharḥ into the main text. The four numeral systems in play on the folio (abjad, eastern Indic, fāsī, ghubār) came back as ASCII digits, because ghubār has no Unicode codepoint at all.

None of this is misreading in the OCR sense. It is something else, and the field does not yet have stable language for it.

What is missing

Two things do not exist and should. The first is a handwritten-text-recognition system conditioned on script tradition (Maghribī mabsūṭ, mujawhar, musnad, thuluth maghribī, Andalusī, and adjacent scientific hands) rather than on “Arabic” as a single visual class. The second is a public benchmark that measures, on Maghrebi-Andalusi scientific witnesses specifically, the rate at which a multimodal large language model emits the printed-edition reading at exactly those loci where the witness diverges from the edition. Both gaps are tractable in twelve to eighteen months by one small team. The pilot below is 100 folios. The 500-page corpus is the planned extension.

Why this script and this content are the hard case

Maghrebi-Andalusi scientific manuscripts compress every failure mode that current Arabic HTR struggles with into the same page. The dot convention is inverted relative to the Mashriqī standard documented in every introductory paleography: fāʾ carries a single dot below (ڢ) and qāf a single dot above (ڧ), and a model trained on Mashriqī or modern print will silently regularize. The ductus runs along a different rhythm; Bongianino’s 2022 The Manuscript Tradition of the Islamic West: Maghribī Round Scripts and the Andalusī Identity (EUP, ISBN 978-1-4744-9958-3) is the current synthesis on why the round-script family is a coherent paleographic object and not a regional accent. Octave Houdas’s 1886 article “Essai sur l’écriture maghrébine” in Nouveaux mélanges orientaux (Publications de l’École des Langues Orientales vivantes, vol. XIX, 1886) still supplies the working taxonomy that downstream catalogues use. Gacek’s 2009 Arabic Manuscripts: A Vademecum for Readers (Brill, HdO I/98) gives the descriptive vocabulary an HTR pipeline needs to encode in its label schema.

On top of the script: scientific content layers. Marginal sharḥ keyed to the matn by sigla. Tables whose cells use mixed numeral systems. Astronomical and arithmetical notation that no Arabic OCR training set has seen at scale. Colophons saturated with religious-scientific register: basmala variants, ḥamdala, taṣliya, duʿāʾ formulae, isnād-style chains of transmission for the witness itself.

State of the art, named precisely

The serious corpus work on Maghrebi handwriting is RASAM. RASAM-1 (~7,540 lines across 300 page images from 3 BULAC manuscripts) and RASAM-2 (~3,750 lines across 250 images from 15 BULAC manuscripts), with the TariMa extension (~120 manually transcribed pages), together cover on the order of 11,000 lines across roughly 670 pages. Vidal-Gorène, Salah, Lucas, Decours-Perez, and Perrier, “Enhancing Arabic Maghribi Handwritten Text Recognition with RASAM 2,” CHR 2024 (CEUR Vol-3834, pp. 200-216), is the most recent line-level result. Lucas, Salah, and Vidal-Gorène, “New Results for the Text Recognition of Arabic Maghribī Manuscripts” (arXiv:2211.16147, 2022), is the immediate predecessor. Kiessling, Stökl Ben Ezra, and Miller’s BADAM (HIP@ICDAR 2019, 10.1145/3352631.3352648) is the baseline historical Arabic dataset against which RASAM is usually compared.

The general-Arabic side has moved. Muharaf (Saeed et al., NeurIPS 2024, arXiv:2406.09630) released over 1,600 historical handwritten Arabic page images with expert transcription and polygon annotation, the closest published analogue to RASAM in scale and care. Qalam (Bhatia et al., arXiv:2407.13559) is a SwinV2 plus RoBERTa Arabic OCR and HTR foundation model trained on 4.5M images and is the current reference point for tuned Arabic vision-language models. HATFormer (Chan, Mijar, Saeed, Wong, Khater, arXiv:2410.02179, 2024 preprint) is a transformer-native architecture aimed specifically at historic Arabic HTR. On the benchmark side, KITAB-Bench (Heakl et al., ACL 2025, arXiv:2502.14949) gives the cleanest current numbers on its HistoryAr subset: Gemini-2.0-Flash at CER 0.28, GPT-4o at CER 0.51, Qwen2.5-VL at CER 3.48, Surya at CER 10.32, with PDF-to-Markdown topping out at 65.65% (Gemini). AIN-7B (Heakl et al., arXiv:2502.00094) is the strongest open-source model on HistoryAr at CER 0.47, beating GPT-4o. HistoryAr is historical Arabic handwriting drawn from HADARA80P (Pantke et al. 2014), not specifically Maghrebi, and conflating the two has produced confused claims in the secondary literature.

A CER above one is striking. It can arise from runaway insertion loops, repetition collapse, or output-length blow-up, and not only from invented content. The Qwen2.5-VL failure mode on KITAB-Bench, per Heakl et al.’s discussion, looks specifically like prior-driven generation: the model writing what it thinks an Arabic page says rather than what this Arabic page says. That is the failure I want to measure directly.

MAGHREB-VAR: a Variant-Apparatus Recovery benchmark

I am not claiming to falsify hallucination in any Popperian sense. The construct does not admit it. What can be done is a decomposition study with three conditions over the same set of variant loci.

Condition A: a Maghrebi-script page of a text whose printed edition is in CommonCrawl and likely in pre-training (Ibn al-Bannāʾ’s Talkhīṣ with Souissi 1969 as the canonical edition). Same textual prior available to the model, real manuscript image.

Condition B: a Maghrebi-script page of a witness whose text has no printed edition (an unedited fragment from a scientific majmūʿa). No prior leakage possible, real manuscript image.

Condition C: a synthetic Maghrebi-script rendering of the Condition A text, generated by a controlled font and layout pipeline. Same textual prior, controlled visual.

The delta between A and C isolates prior leakage; both share the prior, only A has the real visual. The delta between B and C isolates pure script out-of-distribution behavior; both have controlled or absent prior, B has the real visual. The benchmark is called MAGHREB-VAR for Variant-Apparatus Recovery.

The metric set is not just CER. Variant Fidelity Rate (VFR): at human-annotated variant loci on Condition A and Condition B, what fraction of model outputs match the witness rather than the edition (Condition B has no edition, so VFR reduces to image-faithfulness there)? Canonical Bleed Rate (CBR): defined only on Condition A and Condition C, where a printed edition exists, what fraction of model outputs match the edition at loci where the witness disagrees? Prior-Strength Correlation: per-locus logistic regression of CBR against the 3-gram frequency of the edition reading in the OpenITI corpus (release 2025.1.9, Zenodo 17767721, 30 December 2025, ~9,000 books, ~2 billion tokens, mARkdown format) controlling for locus position in the line and witness clarity. Plus two structural metrics the scientific content forces: gloss-attachment accuracy (does the marginal sharḥ end up attached to the matn locus it actually glosses, or linearized into running text?) and sigla-preservation rate.

A worked failure, named

Take one folio of the Talkhīṣ in Maghrebi mabsūṭ. On the run I described in the opening, GPT-4o produced the Souissi 1969 reading at three of five known variant loci (prior leakage). It silently flipped ڢ to ف and ڧ to ق across the page (dot-pattern inversion). It absorbed the marginal sharḥ on the qibla calculation into the matn (gloss-flattening). It rendered the abjad, eastern-Indic, fāsī, and ghubār numerals on the same folio as a single ASCII run (numeral-system collapse). It dropped the catchword and the sigla linking matn to gloss (sigla loss).

Five named failure modes on one folio, all invisible to CER aggregated over the page because the surface Arabic looks plausible at every step.

The script-conditioned baseline I am proposing does not solve all of this. It targets the first two failure modes directly and the fourth partially.

Script-tradition conditioning, not dataset ID

Al-azzawi et al. (arXiv:2605.02089, 3 May 2026, Luleå University, preprint) handle cross-language transfer within the Arabic script family (Arabic, Persian, Urdu). I want cross-tradition transfer within Arabic itself: a learned script-tradition embedding fused at the visual encoder, conditioned on a paleographer-tagged taxonomy of script families (Maghribī mabsūṭ, mujawhar, musnad, thuluth maghribī, Andalusī, alongside Mashriqī naskh as the contrastive class) derived from Bongianino and Houdas, not on a dataset identifier. The taxonomy carries the inductive bias; the dataset ID would just memorize source. These labels exist already in the paleographic literature.

Encoding: PUA as internal representation, TEI for archive

Private Use Area codepoints for ڢ-as-fāʾ, ڧ-as-qāf, and the ghubār digits are an anti-pattern in digital humanities for good reasons: PUA is not interoperable and decays the moment it leaves the producing pipeline. The defensible architecture is PUA as the internal model-output representation, with a documented round-trip to TEI elements for archival release. That preserves the inductive separability inside the model and the archival accessibility outside it.

Who should do this, and why I am writing the proposal

Vidal-Gorène, Stökl Ben Ezra, Bongianino, and the wider European paleography community have done most of the serious work on Maghribī HTR and codicology, and they are not Muslim. Muslim annotators are not faster at line transcription as a class; that claim is essentialist and false. The defensible claims are narrower.

Religious-scientific register fluency (Qurʾānic citation conventions, isnād formulae, basmala variants, ḥamdala, taṣliya, duʿāʾ formulae embedded in colophons) speeds annotation of those specific tokens, which are dense in Maghrebi scientific manuscripts and frequently misread by general models. Access to certain waqf and zāwiya collections runs on terms a non-Muslim researcher cannot easily meet. The downstream users, working editors of the post-classical Arabic scientific corpus in Tunis, Rabat, and Cairo, are overwhelmingly Muslim, and user proximity matters for interface and label-schema design. I have done Umrah, not paleography fieldwork, and my background on the religious-text side is one undergraduate’s reading (Jonathan Brown, Hadith: Muhammad’s Legacy in the Medieval and Modern World, Oneworld 2009). Complementarity and standing, not throughput.

I am a CS undergraduate. I have not handled a manuscript. The proposal stands or falls on the benchmark and the code, both of which can be checked.

What I will deliver, and what I will not

The pilot is 100 folios, drawn from RASAM-2 and TariMa where licensing allows, plus a small set of Condition B unedited witnesses negotiated through institutional contacts. The script-tradition embedding fuses into a HATFormer or Qalam backbone with the conditioning ablation as the main experiment. MAGHREB-VAR ships with the three condition sets, the variant-locus annotations, and the five metrics (VFR, CBR, PSC, gloss-attachment, sigla-preservation). Critical-edition work on al-Zahrāwī’s Taṣrīf remains incomplete (Spink and Lewis 1973 covers the surgical books only; the Arabic critical work by al-Ḥaddād and others is still in progress), so Taṣrīf is not in the pilot. The Opus geographicum of al-Idrīsī (Bombaci, Rizzitano, Rubinacci, Veccia Vaglieri et al., Naples IUO, Rome IsMEO, Leiden Brill, 1970-1984, 9 fascicles) is the obvious Condition A candidate for geography and is in scope for the 500-page extension.

On the 100 pilot folios, the script-conditioned baseline should achieve low CBR on Conditions A and C by construction, because the conditioning bias targets exactly the dot-pattern and ductus features a printed-edition prior would otherwise overwrite. Frontier multimodal LLMs are unlikely to. That delta is the contribution this work claims. Whether closing it changes anything depends on whether the field decides to stop quoting LLM transcriptions of these texts as evidence. The hundred folios will be public. The benchmark, the variant annotations, and the labels will be too, with errors I have not yet seen welcome.