MidiBERT-Piano
A 12-layer BERT-style encoder pre-trained on piano MIDI tokens for note-level and sequence-level classification.
Audio and speech · 532 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Audio and speech
- Parameters
- 111.1M
- Operations
- 532
- Framework
- PyTorch
- Recurrent
- No
- Published
- Journal of Creative Music Systems (arXiv 2021)
- Cited by
- 19 (as of 29 October 2026)
- Authors
- Yi-Hui Chou, I-Chun Chen, Chin-Jui Chang and others
- Source
- GitHub: wazenmai/MIDI-BERT
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m18447
- Graph hash
- 7ce4d5550158c11197d2ff0290da80291d85e2501541cfe46a0567504c5a4e09
- Skeleton hash
- bc67a84ff05cbb1591adc4381568c78c4ec10b2aaa8e5cc82c792bb7ab361d91
- Architecture hash
- 76ef5053a1771d44fb0383afd9203c2583cc93db2c3dd3b5d665b4d729be4b17
- Diagram SHA-256
- 165e9bf8444ae397d5b5f27db5ecd142ca8f36ff8d5f59b7447af629d3a3fd54
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
MidiBERT-Piano is the name the first version of the paper gave to its pre-trained model, a Transformer encoder for piano MIDI music. The paper is a benchmark study of symbolic piano music classification using the masked language modeling approach of BERT. The pre-trained encoder is fine-tuned for two note-level classification tasks (melody extraction and velocity prediction) and two sequence-level classification tasks (style classification and emotion classification).
The backbone is the BERT base model: a bi-directional Transformer encoder with 12 layers of multi-head self-attention, each with 12 heads, and a hidden dimension of 768. The music is tokenized with the compound word (CP) representation, in which each time step is a super token that assembles four tokens. Grouping tokens this way much reduces the number of time steps needed to represent a piece compared with the REMI representation. Each token embedding is augmented by addition with a relative positional encoding before the self-attention stack. Pre-training randomly masks 15% of the tokens of an input sequence, and with CP a whole super token is masked and its four tokens are reconstructed by different output heads.
Each piece is divided into sequences of length 512. The paper describes the encoder as having 111M parameters and reports higher classification accuracy than recurrent neural network baselines on its four tasks. The code repository provides checkpoints only for models in the CP representation.
Key idea. The paper pre-trains a 12-layer BERT-style Transformer on piano MIDI with masked language modeling and benchmarks it on four symbolic music classification tasks.
- MidiBERT-Piano
- MidiBERT
- MIDI-BERT
- symbolic music
- piano MIDI
- symbolic music understanding
- compound word representation
- melody extraction
- music pre-training
- emotion classification
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{chou2024bertlikepretrainingsymbolicpiano,
title={BERT-like Pre-training for Symbolic Piano Music Classification Tasks},
author={Yi-Hui Chou and I-Chun Chen and Chin-Jui Chang and Joann Ching and Yi-Hsuan Yang},
year={2024},
eprint={2107.05223},
archivePrefix={arXiv},
primaryClass={cs.SD},
url={https://arxiv.org/abs/2107.05223},
}