Joint CTC/Attention Decoding and Repertoire Priors for Staff-Level Recognition of Medieval Plainchant

Robert KlugsederarXiv 2026

TL;DR

Reading medieval music manuscripts is notoriously difficult due to centuries of varied handwriting and fading ink, yet scholars have a secret weapon: most plainchant books draw from the same shared pool of melodies. This paper investigates whether giving an Optical Music Recognition (OMR) system "musical street smarts"—specifically, a database of how a chant goes in other manuscripts—helps it read unfamiliar medieval staves. Surprisingly, a nimble 14-million-parameter model armed with joint decoding and musical priors not only deciphers tricky musical keys on unseen manuscripts, it goes toe-to-toe with a modern billion-parameter vision-language model.

What Problem Does This Paper Address?

Imagine trying to build an OCR system for medieval music, where every monastery had its own style of notation, scribal hand, and parchment wear-and-tear, and labeled training data is scarce. However, medieval plainchant has a unique quirk: thousands of surviving manuscripts largely repeat a shared repertoire of melodies, extensively cataloged in the modern Cantus Database. Human paleographers constantly use their memory of a melody to puzzle out smudged ink. The author asks: Can an OMR model use this repertoire knowledge too, and how much of its success comes from musical priors versus raw visual architecture and training data?

Figure 1: A staff of the fixed test set (CH-E 611, fol. 223v, staff 11) with its target. The C clef on the fourth line (c4) is followed by notes on lines (l) and spaces (z), separators between syllable groups (,) and a division mark (L).

Crucially, instead of predicting musical pitches directly, the system transcribes raw visual facts: the clef written at the start of the line, and each note's physical position on the staff (lines and spaces counted from the bottom). Why? Because if a model misreads a clef, every single pitch on that line shifts. Separating visual positions from musical interpretation makes clef errors explicitly visible—and fixable.

Methods

The core architecture borrows a classic trick from speech recognition: joint CTC/attention decoding.

  • Standard foundation: A Convolutional Recurrent Neural Network (CRNN) acts as the visual eye, feeding both a Connectionist Temporal Classification (CTC) head—which enforces strict left-to-right visual alignment—and a 6-layer Transformer decoder that learns sequential grammar (14.3M parameters total).
  • Novel chant adaptations: First, the Transformer decoder isn't initialized from scratch; it's pre-trained as a causal "melody language model" on nearly 200,000 chant lines. Second, at reading time, the model generates candidate transcriptions (including variants where the initial clef is swapped out) and rescores them using two repertoire priors:
  • Melody Model Score: Does this sequence of notes sound like plausible plainchant?
  • Concordance Score: Knowing which chants appear on this page from catalog inventories, how closely does the resulting pitch sequence match other manuscripts' versions of the same song?
Figure 2: Model and decoding. Upper row: the recogniser; the melody model initialises the decoder. Lower row: candidates and their score at reading time; the melody model and the concordance score are the repertoire priors.

Datasets

  • Cantus-Aligned Ground Truth: ~32,500 staves across 10 medieval manuscripts (11th–15th centuries), split strictly by folio (page) to prevent data leakage.
  • Reviewed Transkribus Ground Truth: 3,628 manually reviewed staves from 22 chant books (mostly German Gothic notation), plus 200 staves from five completely held-out manuscripts.
  • AMNLT Benchmark: Three real-world plainchant datasets (Einsiedeln, Salzinnes, and Solesmes) converted to staff-position tokens (carefully controlling for manuscript overlap with the training folios).
  • Melody Corpus: 36,567 melody records (193,479 line sequences) from the Cantus Database used to train the melody prior.

Key Insights and Ideas

  • Priors fix clefs, not notes: Musical priors barely nudge individual note recognition. Instead, their superpower lies in fixing the initial clef on unfamiliar manuscripts. When the visual model is baffled by a strange scribe's clef, checking how the melody goes in other books immediately reveals the right musical transposition.
  • When "helping" hurts: On manuscripts whose scribal style the model already saw during training, applying repertoire priors actually caused more clef errors than it fixed—often by hallucinating a standard clef on staves where the scribe hadn't written one at all! This led to a clean deployment heuristic: only let musical priors override clefs on unfamiliar sources.
  • Data beats parameter count: A specialized 14M-parameter CRNN—when fed reviewed training data in the target notation—performs virtually identically on known sources to a fine-tuned 1B-parameter Vision-Language Model (LightOnOCR-3-1B), while running roughly an order of magnitude faster.

Key Results

  • Architecture & Pre-training: On the 3,084-staff test set, moving from a CTC-only baseline to the hybrid CTC/attention model drops Token Symbol Error Rate (SER) from 7.10% to 5.84%. Initializing the decoder with the Cantus melody model trims it further to 5.65%.
  • Unseen Manuscripts: In leave-one-source-out tests on three early manuscripts, repertoire priors cut Melody SER by 1.10 to 3.67 percentage points. Blind checks against the actual manuscript images confirmed 41 genuine clef corrections versus just 2 introduced errors on the two earliest unseen sources (compared to 5 corrections vs. 9 errors on known sources).
  • Small Specialist vs. Giant VLM: Evaluated on pitch-position SER, the 14M CRNN tied LightOnOCR-3-1B on known manuscripts (4.50% vs. 4.47%). On five unseen Gothic manuscripts, the VLM edged ahead (1.31% vs. 1.82% mean), though without the Gothic training data, the CRNN's error ballooned to 8.2–10.3%. Inference took ~6.7 ms (greedy CTC) or 194 ms (beam-6 + melody rescoring) per staff for the CRNN, versus 1.75 seconds for the VLM (which also transcribes lyrics).

Limitations and Future Work

  • Catalog Dependency: The concordance score requires knowing which chants are on a given folio via the Cantus Database; unindexed manuscripts must rely on the weaker melody model alone.
  • Simplified Encoding & Reference Noise: The token vocabulary ignores certain expressive medieval symbols (liquescence and custodes), and spot-checks show the Cantus-aligned ground truth itself harbors minor alignment and editorial errors.
  • Validation Ahead: The "source familiarity" heuristic (locking clefs on known sources, freeing them on unseen ones) was formulated after inspecting test results, so validating it on fresh manuscripts is an important next step.

Summary updated

BibTeX
@misc{klugseder2026joint,
  author = {Robert Klugseder},
  title = {{Joint CTC/Attention Decoding and Repertoire Priors for Staff-Level Recognition of Medieval Plainchant}},
  year = {2026},
  eprint = {2611.38029},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.38029},
}
Figure