Byte Pair Encoding for Symbolic Music

Nathan Fradet, Nicolas Gutowski, Fabien Chhel, Jean-Pierre Briot
1/27/2023
cs.LGcs.AIcs.SD

No official code found. Best implementation: Natooz/MidiTok (884 stars, MIT, last commit 2026-04-19). 1 more below.

Abstract

When used with deep learning, the symbolic music modality is often coupled with language model architectures. To do so, the music needs to be tokenized, i.e. converted into a sequence of discrete tokens. This can be achieved by different approaches, as music can be composed of simultaneous tracks, of simultaneous notes with several attributes. Until now, the proposed tokenizations rely on small vocabularies of tokens describing the note attributes and time events, resulting in fairly long token sequences, and a sub-optimal use of the embedding space of language models. Recent research has put efforts on reducing the overall sequence length by merging embeddings or combining tokens. In this paper, we show that Byte Pair Encoding, a compression technique widely used for natural language, significantly decreases the sequence length while increasing the vocabulary size. By doing so, we leverage the embedding capabilities of such models with more expressive tokens, resulting in both better results and faster inference in generation and classification tasks. The source code is shared on Github, along with a companion website. Finally, BPE is directly implemented in MidiTok, allowing the reader to easily benefit from this method.

View on arXivView PDF

Code Implementations(2)

Natooz/MidiTokCommunity100%
MIT

MIDI / symbolic music tokenizers for Deep Learning models 🎶

884102Python, Jupyter NotebookAug 11, 20216 months agoMIT
deep-learninggenerative-modelmachine-learningmidimusic+2 more

Code of the paper "Byte Pair Encoding for Symbolic Music" (EMNLP 2023). Better and faster music generation

452CSS, TeXJan 27, 20232 years ago
deep-learningmusic-generation

Similar Papers

Cite this paper

@article{fradet2023byte,
  title  = {Byte Pair Encoding for Symbolic Music},
  author = {Nathan Fradet and Nicolas Gutowski and Fabien Chhel and Jean-Pierre Briot},
  year   = {2023},
  eprint = {2301.11975},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.11975v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2301.11975.svg)](https://codeofpaper.com/paper/2301.11975)

Discussion