LEGATO: Large-scale End-to-end Generalizable Approach to Typeset OMR

Guang Yang, Victoria Ebert, Nazif Tamer, Luiza Pozzobon, Noah A. Smith

Abstract: We propose Legato, a new end-to-end model for optical music recognition (OMR), a task of converting music score images to machine-readable documents. Legato is the first large-scale pretrained OMR model capable of recognizing full-page or multi-page typeset music scores and the first to generate documents in ABC notation, a concise, human-readable format for symbolic music. Bringing together a pretrained vision encoder with an ABC decoder trained on a dataset of more than 214K images, our model exhibits the strong ability to generalize across various typeset scores. We conduct comprehensive experiments on a range of datasets and metrics and demonstrate that Legato outperforms the previous state of the art. On our most realistic dataset, we see a 68% and 47.6% absolute error reduction on the standard metrics TEDn and OMR-NED, respectively.

Introduction

Optical Music Recognition (OMR) is the specialized task of converting images of sheet music into digital, machine-readable formats such as MusicXML, MIDI, or ABC notation. While it is often compared to Optical Character Recognition (OCR) for text, OMR is significantly more complex due to the non-linear, two-dimensional nature of musical notation. Music involves multiple simultaneous "voices," overlapping symbols, and hierarchical structures like staves and systems that are spread across a page.

Historically, OMR systems have been "brittle," often optimized for specific formats like single-line melodies or standard piano scores. These systems frequently fail when confronted with the intricate layouts of full-page orchestral scores or chamber music. Furthermore, the scarcity of large-scale training data and the verbosity of standard output formats have hindered the development of robust, generalizable models. We address these challenges with Legato, a large-scale pretrained OMR model.

Methodology

Legato is an encoder-decoder model inspired by modern Multimodal Large Language Models. The architecture consists of a frozen pretrained vision encoder (from Llama-3.2-11B-Vision) that extracts high-level visual features from music scores. These features are mapped via a linear projector to a transformer decoder with 101 million parameters, which generates the musical transcription autoregressively.

The Legato architecture processes music score images through a frozen vision encoder and a transformer decoder to produce ABC notation.

To handle high-resolution full-page images without losing detail, Legato employs a specific image processing pipeline. Images are cropped into overlapping segments with a 1:4 aspect ratio, which are then processed as patches. This allows the model to maintain the necessary resolution to distinguish small musical symbols across a large page.

A pivotal design choice was the use of ABC notation as the target format. ABC is a concise, ASCII-based representation that is much more efficient for models to generate than the industry-standard MusicXML. By applying Byte-Pair Encoding (BPE) to the ABC notation, the model learns to treat frequent musical patterns—such as common chords or rhythmic figures—as single tokens, effectively discovering elements of music theory through data.

Training was conducted on PDMX-Synth, a new synthetic dataset of over 214,000 images rendered from the PDMX symbolic music collection. We used multiple rendering engines and heavy visual augmentations (randomized margins, fonts, and resolutions) to ensure the model generalizes to real-world scans.

Results and Key Insights

Legato significantly outperforms previous state-of-the-art systems and general-purpose VLMs. On the IMSLP piano scores—a challenging set of real-world scans from the Project Petrucci library—Legato achieved a Tree Edit Distance with Note Flattening (TEDn) score of 29.7, a massive improvement over the 97.7 achieved by the previous best model (where lower scores indicate better performance).

A comparison between a musical score and its corresponding ABC notation, illustrating how Legato maps visual symbols to a concise digital format.

Our results highlight three major findings:

  1. General-Purpose Vision Foundations: A vision encoder trained on general imagery provides a robust foundation for OMR. Keeping this encoder frozen while training the decoder is sufficient to achieve state-of-the-art results.
  2. Efficiency of ABC Notation: The compactness of ABC notation reduces the computational burden and the likelihood of sequence drift or "hallucinations" during long transcriptions.
  3. BPE for Music: Data-driven tokenization allows the model to represent complex musical concepts as discrete units, mirroring the way human musicians read and group notes.

Conclusion

Legato represents a significant advancement in OMR, being the first end-to-end model capable of transcribing full-page typeset scores with high accuracy. While the current version focuses on musical notation and uses placeholder tokens for text elements like lyrics, future work will integrate full OCR capabilities. We also aim to address sequence length limitations for extremely long scores and explore fine-tuning the vision encoder to further improve performance on handwritten manuscripts.

Summary updated

Abstract

We propose Legato, a new end-to-end model for optical music recognition (OMR), a task of converting music score images to machine-readable documents. Legato is the first large-scale pretrained OMR model capable of recognizing full-page or multi-page typeset music scores and the first to generate documents in ABC notation, a concise, human-readable format for symbolic music. Bringing together a pretrained vision encoder with an ABC decoder trained on a dataset of more than 214K images, our model exhibits the strong ability to generalize across various typeset scores. We conduct comprehensive experiments on a range of datasets and metrics and demonstrate that Legato outperforms the previous state of the art. On our most realistic dataset, we see a 68\% and 47.6\% absolute error reduction on the standard metrics TEDn and OMR-NED, respectively.
BibTeX
@inproceedings{yang2026legato,
  author = {Guang Yang and Victoria Ebert and Nazif Tamer and Luiza Pozzobon and Noah A. Smith},
  title = {{LEGATO: Large-scale End-to-end Generalizable Approach to Typeset OMR}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=RdtQiM9gyB},
}
Figure