NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compound Tokenization for Symbolic Music Transformers

30 concepts20 papers1 proposal

When language models process text, a token is typically a word or a subword. But defining a token for symbolic music is fundamentally more challenging. A single musical note is inherently multi-dimensional: it possesses a pitch, a duration, a velocity (volume), an onset time, and an instrument assignment.

Early adaptations of Transformer architectures to symbolic music flattened these attributes into a linear sequence of individual tokens—for example, sequencing a note as [Pitch: C4] -> [Duration: Quarter] -> [Velocity: Forte]. As noted by Ren et al., this linearization causes a massive sequence length explosion. Because the computational complexity of self-attention scales quadratically ($O(L^2)$) with sequence length ($L$), standard models quickly exhaust their context windows. This constraint severely limits their ability to capture long-term musical structures like motifs, themes, and repetitions.

To overcome this bottleneck, a prominent research direction focuses on compound tokenization (also framed as multi-attribute token grouping or composite tokenization). Instead of spreading a single musical event across multiple sequential time steps, this paradigm bundles related attributes into a single multi-slot "super-token" processed at a single time step.

The Mechanism of Multi-Attribute Compound Tokens

Architecturally, instead of a single embedding layer mapping a flat token ID to a vector, a compound token architecture uses parallel embedding layers for each attribute slot.

For instance, Hsiao et al. developed the Compound Word Transformer, which groups pitch, duration, and velocity into distinct slots of a single compound token. At each time step, the model looks up the embeddings for all active slots simultaneously, aggregates them (often via concatenation or summation followed by a linear projection), and feeds the unified vector into the Transformer layers.

Linearized Stream (Standard):
[Pitch: C4] -> [Duration: Quarter] -> [Velocity: Forte]  --> (3 time steps)

Compound Token (Octuple/Multi-slot):
┌────────────────────────┐
│ Pitch: C4              │
│ Duration: Quarter      │  --> Combined into 1 vector via parallel embeddings
│ Velocity: Forte        │      (1 time step)
└────────────────────────┘

This strategy has been extended to capture highly detailed musical contexts. Zeng et al. introduced OctupleMIDI for MusicBERT, which packs eight distinct attributes—including time signature, tempo, bar, position, instrument, pitch, duration, and velocity—into an 8-element tuple. By consolidating these features, the representation drastically reduces sequence length while retaining full expressivity.

Why It Works: Synchronicity and Receptive Fields

The success of compound tokenization relies on two core intuitions:

  1. Native Attribute Binding: In a linearized sequence, the self-attention mechanism must expend significant representational capacity simply learning that a specific velocity token modifies the immediately preceding pitch token. It must reconstruct the basic concept of a "note" from fragmented pieces. Compound tokens preserve this synchronous relationship natively; the attributes of a note are bound together before attention is even calculated.
  2. Quadratic Computational Relief: As demonstrated by Hsiao et al., grouping related attributes reduces total sequence length by 50% to 70%. Because attention scales quadratically, a 3x reduction in sequence length yields a roughly 9x reduction in computational overhead and memory consumption.

This dramatic compression effectively expands the model's receptive field. As Ren et al. point out, doubling or tripling the effective temporal window allows the model to maintain structural coherence over much longer musical passages.

Scaling to Multi-Track Arrangements

This representational efficiency becomes critical when moving from single-melody lines to complex multi-instrument arrangements. Dong et al. leveraged multi-dimensional tuples in the Multitrack Music Transformer (MMT) to encode timing, pitch, and instrument simultaneously. This allowed the model to generate multi-track music segments significantly faster and with longer context spans than flattened baselines.

In a broader synthesis of generative audio architectures, Dong notes that compound tokens allow models to simultaneously capture relationships between pitch, duration, and instrumentation, leading to faster inference and more coherent long-form compositions. This paradigm has been successfully adapted across various specialized musical tasks, including:

  • Controllable Generation: Mapping visual features to musical compound tokens for video background music synchronization (Di et al.).
  • Score Infilling: Bridging gaps between musical segments using compound tokens to ensure synchronized attribute processing (Chang et al.).
  • Rhythmic Accompaniment: Generating complex drum patterns that groove in sync with other instruments (Makris et al.).
  • Arrangement Pipelines: Transcribing and arranging piano covers via intermediate symbolic compound representations (Tan et al.).

Alternative Paths: Frequency-Based Token Merging

While compound words group attributes vertically (at the exact same time step), another complementary strategy compresses sequences horizontally (across time steps) or harmonically (across concurrent notes) using frequency-based token merging.

Instead of relying on fixed multi-slot tuples, Fradet et al. adapted Byte Pair Encoding (BPE)—the standard for subword tokenization in natural language processing—to symbolic music. By iteratively identifying and combining the most frequent adjacent musical attributes into single vocabulary entries, they compressed sequences while transforming discrete character-like labels into representations of musical sub-phrases.

Similarly, Tian et al. introduced Unsupervised Compoundation (UCW), which merges co-occurring musical events based on frequency, reducing sequence length by 20-30% and eliminating redundant padding tokens.

Rather than merging sequential events, Liu et al. applied BPE to concurrent data points in SymphonyNet. This approach merges notes played at the exact same time into single tokens, representing complex harmonic structures like chords as discrete vocabulary units.

Summary

A comprehensive survey by Le et al. underscores that tokenization is a foundational pillar of symbolic music AI. Whether through multi-attribute compound tokens or frequency-based subword merging, compressing the sequence length while preserving multi-dimensional dependencies is what allows modern Transformers to move past short, fragmented melodies and generate full-scale, structurally coherent musical compositions.

Key Foundational Work

Compound Word Transformer: Learning to Compose Full-Song Music over Dynamic Directed Hypergraphs (2021) — contributed 2 concept elements to this direction.
PopMAG: Pop Music Accompaniment Generation (2020) — contributed 2 concept elements to this direction.
MusicBERT: Symbolic Music Understanding with Large-Scale Pre-Training (2021) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_multi_attribute_token_grouping_62586900,
  title = {multi-attribute token grouping},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/multi-attribute-token-grouping/rdr_62586900de304397b8a3d45e65896822},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-30},
}

This exact version (version 1, frozen text):

@misc{lacuna_multi_attribute_token_grouping_62586900_v1,
  title = {multi-attribute token grouping},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/multi-attribute-token-grouping/rdr_62586900de304397b8a3d45e65896822/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-30},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake