Piano Transcription by Hierarchical Language Modeling with Pretrained Roll-based Encoders

Dichucheng Li, Yongyi Zang, Qiuqiang Kong · DOI

Abstract

Automatic Music Transcription (AMT) remains a challenging task in music information retrieval, traditionally split between frame-level "piano-roll" systems and sequence-to-sequence language models (LMs). While frame-level systems are efficient, they require complex post-processing; conversely, LM-based systems provide direct symbolic output but suffer from computational "sequence explosion." This paper introduces a hybrid architecture that leverages pre-trained roll-based encoders and a novel hierarchical LM decoder. By decomposing note attributes into sub-hierarchies—onset/pitch, velocity, and offset—the proposed method significantly reduces computational complexity and improves performance on long audio segments. Our results on the Maestro dataset demonstrate state-of-the-art performance, achieving an On-Off-Velocity F1 score of 0.832.

Introduction

Automatic Music Transcription (AMT) is the process of converting raw acoustic signals into symbolic notation, such as MIDI. This task is foundational for music analysis, search, and education. Historically, the field has been divided into two primary methodologies. Frame-level systems predict a grid of note probabilities over time, which are efficient but require manual thresholding and heuristic post-processing to resolve discrete note events. Language Model (LM)-based systems treat transcription as a translation task, directly outputting note events. However, representing a single note in a standard LM requires multiple tokens (onset, pitch, duration, velocity), leading to extremely long sequences that are computationally expensive and difficult to model over extended durations.

This research addresses the "sequence length wall" by proposing a hybrid model that combines the acoustic strength of roll-based encoders with the structured output of a hierarchical language model.

Methodology

Hybrid Architecture

The proposed system consists of two main components: a pre-trained roll-based encoder and a decoder-only language model.

  1. Encoder Selection: The authors utilize benchmark encoders, specifically CRNN and HPPNet, pre-trained on traditional piano-roll objectives. These encoders serve as the acoustic front-end, extracting high-resolution features from the audio input.
  2. Decoder Architecture: Moving away from standard encoder-decoder frameworks like T5, the system employs a LLaMA-style decoder-only architecture. To better capture the temporal relationships between notes over long windows, the model incorporates Rotary Position Embeddings (RoPE).

Hierarchical Prediction Strategy

The core innovation of this work is the hierarchical decomposition of the note-generation process. Instead of flattening all note attributes into a single linear sequence, the task is split into three distinct sub-hierarchies:

  1. Onset and Pitch: The model first identifies the timing and frequency of the note.
  2. Velocity: Conditioned on the onset and pitch, a secondary model predicts the striking intensity.
  3. Offset: Finally, a third model predicts the note's termination.

This strategy reduces the time complexity from $O((T+3N)^2 D)$ to $O(3(T+N)^2 D)$. Given that the number of notes ($N$) typically exceeds the number of time steps ($T$) in dense piano music, this approach yields a nearly threefold reduction in computational overhead, allowing the model to process longer audio segments (up to 10 seconds) without performance degradation.

Experimental Setup and Results

Dataset

The models were trained and evaluated on the Maestro dataset, which contains approximately 200 hours of virtuosic piano performances paired with high-fidelity MIDI data. This dataset is the industry standard for evaluating high-resolution AMT systems.

Performance Metrics

The HPPNet-based hierarchical model achieved a state-of-the-art On-Off-Velocity F1 score of 0.832, representing a 0.022 improvement over traditional roll-based outputs. A critical finding was the model's robustness to sequence length. On 10-second audio segments, the hierarchical approach maintained high accuracy (On-Off F1 of 0.852), whereas traditional "flattened" sequence models collapsed, dropping to an F1 of 0.390.

Discussion

Encoder vs. Decoder Scaling

A significant insight from the ablation studies is that the quality of the audio encoder has a far greater impact on transcription accuracy than the size of the language model. Scaling the LM from "Tiny" to "Large" configurations yielded diminishing returns, suggesting that the current bottleneck in AMT lies in acoustic feature extraction rather than the complexity of the sequence modeling.

The Challenge of Velocity

The authors noted that velocity modeling is particularly susceptible to overfitting. While onset and pitch losses stabilized during training, velocity loss began to increase after 100,000 steps. This suggests that note dynamics may require specialized loss functions or more robust data augmentation strategies to generalize effectively.

Conclusion

This paper demonstrates that a hierarchical approach to language modeling can effectively overcome the sequence length limitations inherent in traditional LM-based transcription. By combining pre-trained acoustic encoders with a structured, three-tier decoder, the system achieves superior accuracy and computational efficiency. Future work will focus on refining velocity modeling and extending this hierarchical framework to multi-instrumental contexts and continuous-pitch instruments.

Summary updated

BibTeX
@inproceedings{li2025piano,
  author = {Dichucheng Li and Yongyi Zang and Qiuqiang Kong},
  title = {{Piano Transcription by Hierarchical Language Modeling with Pretrained Roll-based Encoders}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2025},
  doi = {10.1109/icassp49660.2025.10890508},
}
Figure