Text2midi-InferAlign: Improving Symbolic Music Generation with Inference-Time Alignment
2025
Read Text2midi-InferAlign: Improving Symbolic Music Generation with Inference-Time Alignment (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-12669.txt.
Introduction
Abhinaba Roy, Geeta Puri, and Dorien Herremans presented a method in 2025 to improve music made by computer models from text prompts. The base model writes music as symbols, note by note, from a short caption. Its output can drift from the caption in rhythm or stray from the stated key.
Their add-on, Text2midi-InferAlign, scores each draft as it forms. One score checks how well the rhythm fits the caption, and the other fines notes that clash with the key. Guiding the search with those scores yields music that tracks the prompt more closely. The add-on works at run time, so any like model can use it with no fresh training.
Catalog record
| YEAR | 2025 |
|---|---|
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 27 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2505-12669
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Text2midi-InferAlign: Improving Symbolic Music Generation with Inference-Time Alignment Abstract We present Text2midi-InferAlign , a novel technique for improving symbolic music generation at inference time. Our method leverages text-to-audio alignment and music-structural alignment rewards during inference to encourage the generated music to be consistent with the input caption. Specifically, we introduce two objectives scores: a text-audio consistency score that measures rhythmic alignment between the generated music and the original text caption, and a harmonic-consistency score that penalizes generated music containing notes inconsistent with the key. By optimizing these alignment-based objectives during the generation process, our model produces symbolic music that is more closely tied to the input captions, thereby improving the overall quality and coherence of the generated compositions. Our approach can extend any existing autoregressive model without requiring further training or fine-tuning. We evaluate our work on top of Text2midi - an existing text-to-midi generation model, demonstrating significant improvements in both objective and subjective evaluation metrics. 1 Introduction The field of multimodal generative models has witnessed remarkable progress, particularly in tasks involving text and images [ 1 ] . However, generation of symbolic music from textual descriptions remains a relatively unexplored challenge, requiring models to understand the intricate relationships between language and music. Recently, the Text2midi model [ 2 ] was introduced, representing the first end-to-end approach for generating midi files from text captions using large language models. Such models leverage the availability of textual data and the success of large language models (LLMs), using a pretrained LLM encoder to process captions and an autoregressive transformer decoder to produce midi sequences that reflect the provided descriptions [ 2 ] . Figure 1 : Overview of Text2midi-InferAlign , using Text2midi for inference and reward score(s) for alignment. While autoregressive models are adept at reducing the cross-entropy between music and text embeddings in the decoder, this approach does not always guarantee adherence to music-structural integrity [ 3 ] . Musicality, which determines if a piece of music sounds "nice" (i.e., expressive and aesthetically pleasing) to the listener, is not explicitly optimized for or even measured in these models. Additionally, during generation, it is crucial that the symbolic music aligns with the input text caption, yet current models often lack explicit mechanisms to ensure this alignment during inference. The concept of "niceness" is an important consideration in music generation and could be measured through user preference. In the field of large language models (LLM), this is often addressed through reinforcement learning based on human feedback, where evaluators directly judge the quality and relevance of the generated content and provide rewards accordingly [ 4 ] . These reward scores are then used to fine-tune the language model, making its responses more human-like. Although LLMs have explored related ideas, only [ 5 ] have applied this human preference feedback to fine-tune text-to-music generation models. However, the reliance on human input imposes significant cost and limits the model’s ability to adapt to diverse user preferences. This also requires expensive re-training of the original model. Recent studies have demonstrated the effectiveness of inference-time alignment techniques in improving the performance of large language models on general-purpose response generation tasks [ 6 ] as well as reasoning [ 7 ] . These approaches circumvent the need for retraining the underlying model, instead generating more human-value aligned responses on the fly. Motivated by these advancements, we introduce Text2midi-InferAlign 1 1 1 code and examples are available at https://github.com/AMAAI-Lab/t2m-inferalign a novel method that aims to enhance symbolic music generation through the application of inference-time alignment. In our work, we employ a similar inference-time alignment approach as [ 6 ] , framing the problem as a reward-guided tree search. Tree search algorithms alternate between two key stages: exploration and exploitation [ 8 ] . At any given state, the exploration phase determines which potential options to investigate further, while the exploitation phase selects the most promising options based on a pre-defined objective and corresponding reward metric. Motivated by this approach, we employ a two-pronged methodology to enhance the tree search process. Firstly, we incorporate an "instruction mutation" technique that leverages language models to generate variations of the original caption. This promotes exploratory behavior by expanding the search space to encompass potentially more relevant textual descriptions. Secondly, we utilize reward-guided beam replacement [ 6 ] to encourage exploitative behavior, wherein we select the most promising options based on pre-defined objective functions and corresponding reward metrics. Here, we introduce two distinct objectives: a text-audio consistency score that measures alignment between the generated music and the original text caption, and a harmonic-consistency score that penalizes generated music containing notes inconsistent with the key. By optimizing these alignment-based rewards during the generation process, our approach aims to improve the overall quality and coherence of the symbolic music produced by Text2midi [ 2 ] . In summary, the key contributions of our work are: 1. We propose Text2midi-InferAlign , a novel inference-time alignment method that enhances the quality of symbolic music generation. 2. We incorporate caption mutation to promote exploration, generating variations of the original caption to expand the search space. 3. We introduce two objectives scores - text-audio consistency and harmonic-consistency to encourage exploitation, selecting the most promising options. 4. We demonstrate that Text2midi-InferAlign can significantly improve both objective and subjective evaluation metrics for symbolic music generation. 2 Related Work Our work builds upon research in several key areas: automatic music generation, text-to-music generation, and inference-time alignment. Music generation has a rich history, with early approaches relying on rule-based systems and Markov models [ 9 , 10 , 11 ] to generate musical sequences. In recent times, with the advent of deep learning, automatic music composition has seen great interest. Researchers have found that models based on recurrent neural networks, such as long short-term memory models (LSTM), can effectively capture long-term structure in the generated music sequences [ 12 ] . Prominent examples of LSTM-based models include BachBot [ 13 ] and DeepBach [ 14 ] , which demonstrate proficiency in generating music in the style of Bach. Furthermore, the introduction of the Transformer architecture, coupled with the availability of expanding midi datasets, has enabled the development of more powerful and expressive models, such as Music Transformer [ 15 ] and Museformer [ 16 ] . The Museformer model, in particular, leverages the fine-grained and coarse-grained attention mechanisms of Transformers to produce high-quality and relatively lengthy music sequences. Recently, a number of of works have proposed approaches for music generation from text [ 17 , 18 , 19 ] . These models consider a free-form text prompt and leverage pretrained large language text encoders, such as FLAN-T5 [ 20 ] , and feed the resulting embedded text representation as input to an audio decoder. Some models generate shorter fragments using diffusion [ 17 ] , whereas others allow longer fragments through an autoregressive transformer approach [ 18 ] . Generative approaches for symbolic music generation also has seen recent developments in recent times [ 21 , 2 , 22 ] . MuseCoco [ 22 ] generates symbolic music from text descriptions using a two stage framework: 1) text-to-attribute understanding and 2) attribute-to-music generation - provides more control over music elements. Moreover, chatGPT4o 2 2 2 https://chatgpt.com