[Paper Review] Anticipatory Music Transformer
The paper introduces the Anticipatory Music Transformer, a generative model that conditions symbolic music generation on asynchronous control sequences—such as melodies—by interleaving events and controls in a way that positions controls just before relevant events, enabling efficient autoregressive modeling. It achieves human-level musicality in accompaniment generation, matching autoregressive baselines while enabling powerful infilling tasks like harmonization.
We introduce anticipation: a method for constructing a controllable generative model of a temporal point process (the event process) conditioned asynchronously on realizations of a second, correlated process (the control process). We achieve this by interleaving sequences of events and controls, such that controls appear following stopping times in the event sequence. This work is motivated by problems arising in the control of symbolic music generation. We focus on infilling control tasks, whereby the controls are a subset of the events themselves, and conditional generation completes a sequence of events given the fixed control events. We train anticipatory infilling models using the large and diverse Lakh MIDI music dataset. These models match the performance of autoregressive models for prompted music generation, with the additional capability to perform infilling control tasks, including accompaniment. Human evaluators report that an anticipatory model produces accompaniments with similar musicality to even music composed by humans over a 20-second clip.
Motivation & Objective
- To develop a controllable generative model for temporal point processes in symbolic music, where events are conditioned on asynchronous control sequences like melodies.
- To address the challenge of conditioning autoregressive models on distant or asynchronous controls without relying on long-context modeling.
- To enable practical music infilling tasks such as harmonization, where partial melodies are completed with musically coherent accompaniments.
- To maintain high model performance while introducing bidirectional context from future controls through a novel interleaving mechanism.
- To demonstrate that anticipatory modeling yields human-perceptible musical quality in generated accompaniments.
Proposed method
- The method introduces 'anticipation'—a sequence interleaving strategy where each control is placed at a stopping time in the sequence, ensuring it appears in the model's context when predicting nearby events.
- Controls are shifted forward in time by a hyperparameter δ, so a control at time s_k appears as if at s_k - δ, enabling the model to anticipate its influence.
- The joint sequence of events and anticipated controls is fed into an autoregressive causal Transformer, allowing the model to attend to both recent events and upcoming controls.
- The model is trained using a likelihood objective on the joint distribution of events and controls, with controls incorporated via a prior distribution over control sequences.
- Sampling is tractable because each control's position in the sequence is a stopping time, preserving the autoregressive factorization.
- The approach enables efficient training and inference by maintaining a coherent, prefix-based context structure, even with asynchronous inputs.

Experimental results
Research questions
- RQ1Can a generative model effectively condition on asynchronous control sequences in symbolic music generation while maintaining computational tractability?
- RQ2How does anticipation—placing controls before relevant events—improve performance on music infilling tasks compared to standard autoregressive or Seq2Seq approaches?
- RQ3To what extent can an anticipatory model generate accompaniments that are perceptually indistinguishable from human-composed music?
- RQ4Does the use of bidirectional context (past events and near-future controls) improve generation quality without compromising training efficiency?
- RQ5Can the model generalize to complex music generation tasks like harmonization without requiring long-context modeling?
Key findings
- The Anticipatory Music Transformer achieves perplexity scores comparable to standard autoregressive models, indicating no performance degradation from the anticipation mechanism.
- Human evaluators rated the musicality of generated accompaniments as similar to human-composed music over 20-second clips, demonstrating strong perceptual quality.
- The model successfully performs infilling tasks, including harmonization, by generating coherent and musically plausible completions of partial melodies.
- The model maintains a context length of 1024 tokens (approximately 331 events), corresponding to about 15 seconds of music, with only the most recent context used for prediction.
- The approach enables efficient training and sampling by ensuring that control positions in the sequence are stopping times, preserving the autoregressive factorization.
- The model does not explicitly generate or model metadata such as key signature, tempo, or dynamics, which limits its expressivity in certain musical dimensions.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.