Skip to main content
QUICK REVIEW

[Paper Review] Compound Word Transformer: Learning to Compose Full-Song Music over Dynamic Directed Hypergraphs

Wen-Yi Hsiao, Jen-Yu Liu|arXiv (Cornell University)|Jan 7, 2021
Music and Audio ProcessingComputer Science31 references19 citations
TL;DR

This paper proposes the Compound Word Transformer, a novel Transformer architecture that groups related musical tokens (e.g., pitch, duration, onset) into compound words to model full-song pop piano music more efficiently. By using type-specific feed-forward heads and dynamic hypergraph modeling, the model trains 5–10× faster than state-of-the-art models while generating music of comparable perceptual quality.

ABSTRACT

To apply neural sequence models such as the Transformers to music generation tasks, one has to represent a piece of music by a sequence of tokens drawn from a finite set of pre-defined vocabulary. Such a vocabulary usually involves tokens of various types. For example, to describe a musical note, one needs separate tokens to indicate the note's pitch, duration, velocity (dynamics), and placement (onset time) along the time grid. While different types of tokens may possess different properties, existing models usually treat them equally, in the same way as modeling words in natural languages. In this paper, we present a conceptually different approach that explicitly takes into account the type of the tokens, such as note types and metric types. And, we propose a new Transformer decoder architecture that uses different feed-forward heads to model tokens of different types. With an expansion-compression trick, we convert a piece of music to a sequence of compound words by grouping neighboring tokens, greatly reducing the length of the token sequences. We show that the resulting model can be viewed as a learner over dynamic directed hypergraphs. And, we employ it to learn to compose expressive Pop piano music of full-song length (involving up to 10K individual tokens per song), both conditionally and unconditionally. Our experiment shows that, compared to state-of-the-art models, the proposed model converges 5--10 times faster at training (i.e., within a day on a single GPU with 11 GB memory), and with comparable quality in the generated music.

Motivation & Objective

  • To address the limitation of treating all musical tokens equally in sequence models, as in natural language processing.
  • To improve training efficiency and modeling fidelity in symbolic music generation by explicitly accounting for token type heterogeneity.
  • To enable effective generation of full-length, expressive pop piano music (up to 10K tokens) using a compressed, compound-word representation.
  • To explore whether modeling multiple token types simultaneously at each time step can enhance both speed and quality in music generation.

Proposed method

  • Grouping neighboring tokens of different types (e.g., pitch, duration, onset) into compound words to reduce sequence length and capture co-occurrence dependencies.
  • Using a modified Transformer decoder with type-specific feed-forward heads to predict multiple token types simultaneously at each time step.
  • Applying an expansion-compression trick to map compound words back into individual tokens during training and inference.
  • Representing the music generation process as a dynamic directed hypergraph, where each hyperedge corresponds to a compound word connecting multiple token nodes.
  • Employing a linear Transformer architecture with a larger context window (5,120) to model long-range dependencies in full-song compositions.
  • Training the model on a large-scale pop piano dataset using both conditional (lead sheet-conditioned) and unconditional generation settings.

Experimental results

Research questions

  • RQ1Can modeling multiple musical token types (e.g., pitch, duration, dynamics) simultaneously at each time step improve training efficiency and generation quality?
  • RQ2Does the use of compound words—grouped token sequences—enable better long-range modeling and reduced sequence length in music generation?
  • RQ3How does the proposed model compare to state-of-the-art models in terms of training speed, inference quality, and perceptual music quality?
  • RQ4Can the model generate full-song, expressive pop piano music that matches the structural and harmonic complexity of real compositions?
  • RQ5Is the dynamic hypergraph interpretation valid and useful for understanding the model’s inductive bias and generalization capability?

Key findings

  • The proposed model trains 5–10 times faster than state-of-the-art models like REMI + Transformer-XL, achieving convergence within a day on a single GPU with 11 GB memory.
  • The model generates full-song pop piano music of up to 10,000 tokens with perceptual quality comparable to REMI + XL, as confirmed by user studies.
  • In unconditional generation, the CP + linear model outperforms REMI + XL in perceived richness, humanness, and structureness, suggesting stronger compositional generalization.
  • Quantitative evaluation shows that both models achieve melody and chord matchness values close to the training set, significantly outperforming random baselines.
  • The model’s compound word representation enables effective modeling of co-occurring musical features (e.g., pitch and duration) within a single time step, improving efficiency.
  • User study results (n=18) indicate that while REMI + XL performs slightly better in conditional settings, CP + linear shows consistent advantages in unconditional generation across all perceptual metrics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.