Paper deep dive
MI-MIDI: Mechanistic Interpretability of Text-to-MIDI Generation Models via Probing, Lenses and Steering
Jakub PoÄwiardowski, Mateusz Modrzejewski
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 91%
Last extracted: 8/10/2026, 2:50:49 AM
Summary
This paper presents MI-MIDI, a mechanistic interpretability study of two text-to-MIDI generation models: text2midi (an encoder-decoder) and MIDI-LLM (a Llama 3.2 1B model extended with MIDI tokens). The authors employ linear probing, logit/tuned lenses, activation patching, and steering to analyze how musical concepts like pitch, harmony, and texture are encoded and formed. Key findings include that both models linearly decodable musical structure, but text2midi refines predictions gradually across layers, while MIDI-LLM maintains a textual basis until a sharp late rotation into musical vocabulary. Steering interventions are robust in text2midi but can be disruptive in MIDI-LLM when applied across all layers.
Entities (11)
Relation Signals (13)
text2midi â hasarchitecture â Encoder-Decoder
confidence 95% · text2midi, a dedicated encoder-decoder model
MIDI-LLM â hasarchitecture â decoder-only
confidence 95% · MIDI-LLM [31], a general-purpose Llama 3.2 1B language model ... decoder-only
MIDI-LLM â isbasedon â Llama 3.2-1B
confidence 95% · MIDI-LLM, a general-purpose Llama 3.2 1B language model
text2midi â exhibitsrefinementpattern â gradual refinement
confidence 92% · text2midi refines predictions gradually across depth
MIDI-LLM â exhibitsrefinementpattern â late rotation
confidence 92% · MIDI-LLM works largely in its inherited textual basis before a sharp late rotation into the musical vocabulary
linear probing â detects â musical concepts
confidence 90% · Pitch, instrumentation, harmony and texture are linearly decodable in both models.
all-layer interventions â isdisruptivein â MIDI-LLM
confidence 90% · accumulate disruptively in MIDI-LLM
all-layer interventions â isrobustin â text2midi
confidence 90% · all-layer interventions are robust in text2midi
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Mechanistic interpretability of music generation has concentrated on audio models, leaving symbolic models largely unexplored. We analyze two public text-to-MIDI systems of contrasting design: the purpose-built encoder--decoder text2midi and MIDI-LLM, a Llama~3.2~1B model extended with MIDI tokens using linear probing, the logit and tuned lenses, activation patching and difference-in-means steering. Across these methods, we recover musically meaningful structure and show how architecture shapes its formation and control. Pitch, instrumentation, harmony and texture are linearly decodable in both models. text2midi refines predictions gradually across depth, whereas MIDI-LLM works largely in its inherited textual basis before a sharp late rotation into the musical vocabulary; patching identifies a matching late attenuation of prompt-driven instrument transfer. Steering produces bidirectional changes in register and polyphony in both systems, and in tempo/energy in MIDI-LLM. Our two-orientation protocol isolates directional control and shows that all-layer interventions are robust in text2midi but accumulate disruptively in MIDI-LLM. Together, the results provide a practical toolkit for tracing and controlling musical concepts in symbolic generators. Audio examples are available on a demo website.
Tags
Links
- Source: https://arxiv.org/abs/2608.06638v1
- Canonical: https://arxiv.org/abs/2608.06638v1
Trouble viewing inline? Open PDF directly â
Full Text
48,372 characters extracted from source content.
Expand or collapse full text
MI-MIDI: Mechanistic Interpretability of Text-to-MIDI Generation Models via Probing, Lenses and Steering Jakub PoÄwiardowski, Mateusz Modrzejewski Institute of Computer Science Warsaw University of Technology Warsaw, Poland jakub.pocwiardowski.stud@pw.edu.pl, mateusz.modrzejewski@pw.edu.pl Abstract Mechanistic interpretability of music generation has concentrated on audio models, leaving symbolic models largely unexplored. We analyze two public text-to-MIDI systems of contrasting design: the purpose-built encoderâdecoder text2midi and MIDI-LLM, a Llama 3.2 1B model extended with MIDI tokens using linear probing, the logit and tuned lenses, activation patching and difference-in-means steering. Across these methods, we recover musically meaningful structure and show how architecture shapes its formation and control. Pitch, instrumentation, harmony and texture are linearly decodable in both models. text2midi refines predictions gradually across depth, whereas MIDI-LLM works largely in its inherited textual basis before a sharp late rotation into the musical vocabulary; patching identifies a matching late attenuation of prompt-driven instrument transfer. Steering produces bidirectional changes in register and polyphony in both systems, and in tempo/energy in MIDI-LLM. Our two-orientation protocol isolates directional control and shows that all-layer interventions are robust in text2midi but accumulate disruptively in MIDI-LLM. Together, the results provide a practical toolkit for tracing and controlling musical concepts in symbolic generators. Audio examples are available on a demo website111https://jpocwiar.github.io/MI-MIDI-Demo/. Keywords Music information retrieval â · mechanistic interpretability â · symbolic music â · activation steering â · probing Figure 1: Activation steering as a control panel for text-to-MIDI: shifting residual-stream activations allows steering the generated score. We locate such concepts in two public models and ask when interventions remain safe. 1 Introduction Generative models of symbolic music have been present in the literature for a long time, including models that generate scores from text descriptions, yet how they internally represent musical structure remains largely unknown. Mechanistic interpretability has produced a mature toolbox in the language domain with approaches such as probing classifiers [2, 13], the logit lens [18, 4], activation steering [26, 24], and sparse autoencoders [14]. Many of these approaches have recently been transferred to text-to-audio music models, especially MusicGen [27, 12, 23]. Symbolic models, however, have until very recently been left out of this line of work, even though they offer a methodological advantage: the relations between notes can be easily measured in contrast to audio processing. This paper fills that gap. We study two public text-to-MIDI models of contrasting architectures: text2midi [5], a dedicated encoder-decoder model with REMI+ tokenization, and MIDI-LLM [31], a general-purpose Llama 3.2 1B language model with a vocabulary extended by MIDI tokens. We ask three questions along the classic interpretability axes: what musical information is encoded in their activations, where and when the output prediction is formed, and whether the encoded information can be used to causally steer generation. Our main contributions are: 1. One of the first mechanistic-interpretability studies of symbolic music generation and, to our knowledge, the first centered on text-to-MIDI models, spanning probing, the logit and tuned lenses, activation patching, and activation steering. 2. A comparative account of prediction formation in two contrasting designs, revealing gradual refinement in a native encoderâdecoder and a sharp textual-to-musical basis transition in a language model repurposed by vocabulary extension. 3. A bidirectional evaluation protocol for identifying robust concept control, decomposing each steering response into directional and symmetric components. 4. An architecture-dependent recipe for intervention: targeted single-layer steering remains stable in both models, while text2midi also supports highly specific all-layer steering. Audio renditions of steered generations are available on the demo website, and code for all experiments will be released. 2 Related Work Text-conditioned music generation. Music generation is traditionally split into the audio and symbolic domains. Recent attention has focused on text-to-audio models such as Jukebox [9], MusicLM [1] and MusicGen [7]. In the symbolic domain, progress was long limited by the lack of captioned data; the MIDICaps dataset [16] enabled the first end-to-end text-to-MIDI models, including text2midi [5] and MIDI-LLM [31], the two systems studied here. Mechanistic interpretability. Interpretability can be understood as the ability to explain a modelâs decisions in human-comprehensible terms [10, 17]. Of the four senses of mechanistic distinguished by Saphra and Wiegreffe [22], we adopt the narrowest: the direct study of, and intervention on, a modelâs internal activations. The specific techniques we build on are linear probing [2, 13, 3], the logit lens [18] and its trained extension, the tuned lens [4], and steering via activation additions [24, 26]. Interpretability of music models. Existing work concentrates on audio models, most of it on MusicGen. VĂĄsquez et al. [27] decode intermediate layers and steer instrumentation and genre; Facchiano et al. [12] steer tempo and brightness with difference-in-means vectors; Zhang et al. [32] adapt instruction tuning; Singh et al. [23] train sparse autoencoders on MusicGen activations; Wei et al. [30] probe music-theory concepts on the synthetic SynTheory dataset. For symbolic music, prior interpretability work concerns latent dimensions of VAE-based models [6, 29, 19], which does not involve intervention on internal activations of autoregressive generators. Concurrently with this work, Prokopiou et al. [21, 20] steer pitch and duration in an unconditional symbolic transformer with difference-in-means directions. To the best of our knowledge, no prior work applies the broader mechanistic toolbox to text-conditioned symbolic models. 3 Models and Notation Table 1: The two studied text-to-MIDI models. Both generate multi-track MIDI from a free-form text description but differ in nearly every design choice. text2midi [5] MIDI-LLM [31] Architecture encoder-decoder decoder-only (Llama 3.2 1B) Text conditioning frozen Flan-T5 encoder + cross-attention text prompt in context Analyzed layers 18 (decoder) 16 Hidden size dmodeld_model 768 2048 Tokenization REMI+ [28] AMT [25] Time encoding metrical (bars, positions) absolute (10 ms grid) Two architectural differences organize the analysis: cross-attended encoder memory versus a shared promptâmusic residual stream, and metrical REMI+ versus absolute-time AMT tokenization. Throughout the paper, the activation (residual-stream state) of sample i at layer â and token position t is denoted hâ,t(i)ââdmodel.h_ ,t^(i) ^d_model. (1) Activations are recorded in predictive alignment: hâ,th_ ,t is the state from which the model predicts token t, not the state after consuming it. Causal masking makes a single hooked forward pass over the full sequence equivalent to capturing activations at every generation step. 4 Linear Probing Generative music models are not explicitly supervised on concepts such as key, chords or intervals, yet it is reasonable to expect that they encode such knowledge internally. We test this with linear probes [2]: following Hewitt and Liang [13], we deliberately restrict probes to logistic regression, so that high accuracy indicates good linear representation of the concept rather than capacity of the probe itself [3]. Unlike prior music probing work on isolated synthetic examples [30], we probe both full, realistic generations, where many concepts interfere, and the controlled SynTheory setting (Section 4.3). 4.1 Method We fit one L2L_2-regularized multinomial logistic-regression probe per layer (C=1.0C=1.0, L-BFGS, 200 iterations, feature scaling fitted on the training fold only) on activation-label pairs (hâ,t,yt)(h_ ,t,y_t), and report accuracy, the majority-class baseline, and their difference, the lift. Token-level concepts are probed on a fixed random subsample of 200 sequences, since linear probes saturate well below the full corpus. The sequence-level key variants use all usable sequences. To avoid leakage, all tokens from one sequence are kept in the same cross-validation fold (for SynTheory, all tokens from one sample), so that no probe is tested on a sequence it partly saw in training. We use 5-fold grouped cross-validation stratified by label, and report accuracy as the mean and standard deviation over folds. As a selectivity control [13] we retrain each probe on labels shuffled between tokens (group split preserved); the control probe collapses to the majority baseline for every concept (lift â0.068-0.068 to +0.001+0.001 for MIDI-LLM, â0.044-0.044 to â0.002-0.002 for text2midi), confirming that the accuracies below reflect information in the activations rather than probe capacity. For sequence-level concepts (estimated key) we also aggregate token activations into one vector per sample, either as the activation of the last labeled melodic token (last token) or as the mean over all labeled melodic positions (mean). 4.2 Probing full generations Data and labels. We construct 1 0001\,000 random music descriptions combining key, meter, tempo, mood and instrumentation, generate one sequence per description by ancestral sampling at temperature 1.01.0, with a per-sample seed and a budget of 1024 tokens, and capture activations on all layers. Labeled musical-token positions receive properties derived from the decoded MIDI as listed in Table 2. Labels are taken from the generated music rather than from the prompt, because generations do not always reliably follow the requested attributes. In particular, the key is estimated from the produced pitch classes with the KrumhanslâSchmuckler method [15, 8]. Table 2: Probed concepts and labels derived from each modelâs symbolic output. Simultaneity uses a 0.050.05 s tolerance for MIDI-LLM and adjacent REMI positions for text2midi; rhythmic-density windows and bins are tokenizer-specific. Concept Label Pitch class pitch mod 12 \ 12 Octave â /12â/12 Instrument family General MIDI family of the noteâs instrument, drums separate Interval size semitone distance to the previous melodic note, binned from unison to octave++ Melodic contour direction over the last five pitches: rising, falling, flat Chord root root pitch class of the notes sounding together Chord quality major, minor, diminished, augmented, dominant 7th, other Harmonic function chord root as a scale degree of the estimated key: I, IV, V, other Texture density simultaneous-note count, binned into four classes Local rhythmic density local onset count, binned into four classes Estimated key KrumhanslâSchmuckler over the last 20 melodic pitches Results. Table 3 reports the post-hoc best layer per concept, and Figure 2 plots the full per-layer accuracy profile behind each best-layer entry. The results reveal a clear representational hierarchy. Local concepts are strongly decodable in both models: instrument family, pitch class, chord root, octave and texture density reach lifts of 0.360.36 to 0.630.63 in MIDI-LLM and 0.220.22 to 0.420.42 in text2midi. Key information is modest at individual tokens (lift 0.060.06 to 0.110.11) but becomes substantially stronger at last token, when evidence is aggregated across a sequence. How is key represented? We probe key at three scales: a single token, the final melodic token, and the mean over all melodic positions. Readout strengthens in that order, showing that key-relevant evidence accumulates across the sequence. A pitch-class histogram control yields lifts of 0.4750.475 for MIDI-LLM and 0.4860.486 for text2midi, against 0.5450.545 and 0.4010.401 from mean-pooled activations, respectively. It therefore nearly accounts for the MIDI-LLM readout and exceeds the text2midi readout, indicating that much of the sequence-level signal summarizes the note distribution from which the KrumhanslâSchmuckler label is computed. We treat MIDI-LLMâs additional 0.0700.070 lift as suggestive rather than conclusive. Table 3: Probing on full generations: best layer per concept. Acc. is probe accuracy (mean ± std over 5 CV folds), Base the majority-class accuracy, Lift their difference. Rows sorted by MIDI-LLM lift. Estimated-key labels (bottom rows) are a running KrumhanslâSchmuckler estimate over a sliding window of the last 20 melodic pitches except the mean variant (*) which instead pools activations over all melodic tokens of the sequence and is labeled by its majority key. text2midi MIDI-LLM Concept Layer Acc. Base Lift Layer Acc. Base Lift Instrument family 10 0.680±0.0080.680± 0.008 0.260 0.419 14 0.940±0.0090.940± 0.009 0.310 0.630 Pitch class 16 0.505±0.0230.505± 0.023 0.134 0.372 13 0.619±0.0190.619± 0.019 0.107 0.512 Texture density 11 0.560±0.0100.560± 0.010 0.339 0.221 8 0.705±0.0100.705± 0.010 0.319 0.386 Octave 16 0.704±0.0100.704± 0.010 0.378 0.326 14 0.750±0.0120.750± 0.012 0.370 0.380 Chord root 16 0.501±0.0110.501± 0.011 0.155 0.346 13 0.473±0.0240.473± 0.024 0.117 0.356 Local rhythmic density 10 0.468±0.0170.468± 0.017 0.325 0.143 8 0.618±0.0170.618± 0.017 0.271 0.348 Melodic contour 12 0.551±0.0100.551± 0.010 0.354 0.197 11 0.530±0.0120.530± 0.012 0.336 0.194 Interval size 14 0.521±0.0150.521± 0.015 0.353 0.168 10 0.486±0.0190.486± 0.019 0.339 0.147 Chord quality 12 0.469±0.0150.469± 0.015 0.372 0.098 11 0.483±0.0080.483± 0.008 0.385 0.098 Harmonic function 11 0.465±0.0150.465± 0.015 0.401 0.065 11 0.465±0.0090.465± 0.009 0.386 0.079 Estimated key (per token) 17 0.161±0.0120.161± 0.012 0.106 0.055 10 0.185±0.0060.185± 0.006 0.070 0.114 Estimated key (last token) 17 0.362±0.0280.362± 0.028 0.094 0.268 11 0.336±0.0370.336± 0.037 0.073 0.263 Estimated key (mean)* 16 0.533±0.0120.533± 0.012 0.131 0.401 12 0.623±0.0210.623± 0.021 0.078 0.545 Figure 2: Per-layer probe accuracy for each token-level concept, in text2midi and MIDI-LLM; dashed lines mark each modelâs majority-class baseline, so a curveâs gap above its baseline is the lift. Every best-layer entry in Table 3 is the peak of the corresponding curve. 4.3 Controlled probing on SynTheory in MIDI form To complement ecologically valid full generations with isolated musical structure, we run a controlled experiment on SynTheory [30], a synthetic dataset of short examples targeting single music-theory concepts (notes, intervals, scales, chords, chord progressions). Unlike the original audio study, we use the MIDI representation directly, removing the timbre dimension, which leaves N=1 080N=1\,080 samples. For each sample we record the modelâs activations and train one linear probe per layer with 5-fold cross-validation, with feature scaling fitted on each foldâs training split only. Both models are probed in their native input regime, as required for in-distribution activations: for MIDI-LLM the music tokens are preceded by the official prompt format (an empty, neutral description) and the MIDI_BOS token, and activations are extracted from musical positions only; for text2midi we use the modelâs original REMI tokenizer. Table 4: Probing SynTheory (MIDI form, mean pooling, 5-fold CV): best layer per concept. Acc. is the mean accuracy over folds ± its standard deviation. Base the majority-class accuracy, Lift their difference. text2midi MIDI-LLM Concept Layer Acc. Base Lift Layer Acc. Base Lift Note pitch class 0 0.806±0.0720.806± 0.072 0.083 0.723 9 0.908±0.0640.908± 0.064 0.083 0.825 Register 2 0.991±0.0180.991± 0.018 0.333 0.658 1 0.991±0.0190.991± 0.019 0.333 0.657 Interval 3 0.604±0.0350.604± 0.035 0.083 0.521 7 0.998±0.0050.998± 0.005 0.083 0.914 Scale mode 6 0.012±0.0150.012± 0.015 0.143 â0.131-0.131 7 0.423±0.0510.423± 0.051 0.143 0.280 Chord quality 10 0.375±0.0650.375± 0.065 0.250 0.125 7 0.855±0.0670.855± 0.067 0.250 0.605 Chord inversion 8 0.750±0.0500.750± 0.050 0.333 0.417 9 0.806±0.0340.806± 0.034 0.333 0.473 Chord root pitch class 0 0.798±0.0520.798± 0.052 0.083 0.715 1 0.777±0.0490.777± 0.049 0.083 0.694 Chord progression 11 0.728±0.0560.728± 0.056 0.053 0.675 7 1.000±0.0001.000± 0.000 0.053 0.947 Progression tonic 0 1.000±0.0001.000± 0.000 0.083 0.917 0 1.000±0.0001.000± 0.000 0.083 0.917 Each setting is probed in the readout its labels dictate: SynTheoryâs concepts are properties of a whole example and are read from pooled sequence representations, while on generations the label belongs to the note a token carries and is read per token. They therefore provide complementary views rather than directly comparable lift values. The controlled setting reveals substantial music-theory structure: intervals and chord progressions reach high lift in both models, and chord quality does so in MIDI-LLM. Scale mode provides an additional diagnostic of representational geometry. In SynTheory the seven modes are rotations of one pitch-class set, so the label is fixed by the tonic reference: under the same protocol an absolute-pitch histogram scores at or below chance, while a lowest-note-relative encoding scores perfectly. Against these oracles, text2midiâs below-baseline result is consistent with an orderless absolute-pitch representation, whereas MIDI-LLMâs positive lift is consistent with a more relative encoding. Figure 3 shows the full per-layer curves. Figure 3: Per-layer probe accuracy on SynTheory (mean pooling) for each concept, in text2midi and MIDI-LLM; dashed lines mark each modelâs majority-class baseline. Concepts already high at layer 0 (register, progression tonic, pitch-class readouts) are readable from token identity, whereas others (interval, chord quality, chord progression) build up across layers. Every best-layer entry in Table 4 is the peak of the corresponding curve. 5 Logit Lens and Tuned Lens Probing shows what information is present. The logit lens [18] shows when the modelâs output prediction is formed. Each intermediate activation is passed through the modelâs final normalization and vocabulary projection, revealing what the model would predict if it stopped at layer â . We do not assume tied embeddings, instead the architectureâs actual output components are used: zâ,t=Uâ(NormâĄ(hâ,t))+bU,pâ,t=softmaxâĄ(zâ,t),z_ ,t=U (Norm (h_ ,t ) )+b_U, p_ ,t=softmax (z_ ,t ), (2) where NormNorm is the final normalization (decoder LayerNorm for text2midi; RMSNorm for MIDI-LLM) and U and bUb_U are the vocabulary projection (768â768â REMI vocabulary; 2048â2048â joint text-music vocabulary via lm_head). Since MIDI-LLMâs vocabulary mixes text and music tokens, we evaluate the distribution restricted to the musical part. For each layer we report three quantities over the analyzed positions T: the top-1 agreement with the generated token yty_t, the mean probability the layer assigns to yty_t, and the entropy of the distribution. Because yty_t is the token actually sampled during generation rather than the argmax, even the final layerâs top-1 agreement stays below 11. In text2midi the decoder attends to the text encoding at every layer through cross-attention, so we read predictions from successive decoder layers. For MIDI-LLM this is the classic decoder-only logit lens. A related decoding of intermediate layers has been applied to MusicGen in the audio domain [27]. 5.1 Results: gradual refinement vs. late binding Table 5 exposes two qualitatively different regimes. In text2midi, accuracy and correct-class probability grow gradually, with visible jumps around layers 10 to 12, as the decoder repeatedly attends to the encoded description and refines its prediction. MIDI-LLM instead shows a compact transition: its inherited textual basis dominates the classic readout through the first half of the network, followed by a sharp rotation into musical predictions between layers 13 and 14 (vocabulary-mass analysis below). Two cautions apply when reading the columns across models: the depth axes do not start from the same point, since text2midiâs first decoder layer already sees the description fully encoded, and the entropies are on different scales, each taken over its own vocabulary of 524524 REMI+ against 55 02655\,026 musical tokens. Table 5: Logit lens results. Left: per-layer agreement with the final token (Acc.), mean correct-class probability (Prob.), entropy, and the MIDI-vocabulary mass share massâMIDImass^MIDI_ (only for MIDI-LLM). Right: the layer of peak agreement per predicted token type, with that layerâs accuracy and entropy, for text2midi (top) and MIDI-LLM (bottom), sorted by accuracy. text2midi MIDI-LLM Layer Acc. Prob. Entropy Acc. Prob. Entropy Mass 0 0.053 0.044 4.912 0.000 0.000 7.545 0.328 1 0.056 0.047 4.851 0.000 0.000 7.745 0.389 2 0.068 0.052 4.752 0.000 0.000 7.761 0.358 3 0.086 0.066 4.571 0.000 0.000 7.707 0.333 4 0.095 0.072 4.494 0.000 0.000 7.436 0.352 5 0.120 0.079 4.364 0.000 0.000 7.171 0.378 6 0.127 0.084 4.256 0.000 0.000 6.935 0.354 7 0.160 0.095 4.149 0.000 0.000 6.594 0.358 8 0.183 0.108 3.948 0.000 0.000 6.622 0.299 9 0.200 0.117 3.785 0.001 0.000 6.732 0.257 10 0.251 0.129 3.853 0.003 0.001 6.752 0.254 11 0.459 0.255 3.092 0.014 0.006 6.435 0.306 12 0.598 0.497 1.539 0.050 0.021 6.132 0.341 13 0.622 0.549 1.144 0.238 0.136 4.727 0.561 14 0.644 0.600 0.782 0.712 0.630 1.104 0.954 15 0.655 0.621 0.650 0.801 0.738 0.690 >>0.999 16 0.666 0.631 0.643 â â â â 17 0.677 0.608 0.915 â â â â text2midi Type Layer Acc. Entr. PAD 0 1.000 0.170 TimeSig 16 0.980 0.048 Duration 17 0.761 0.709 Program 17 0.751 0.700 Bar 17 0.679 0.895 Position 16 0.634 0.652 PitchDrum 17 0.622 0.991 Velocity 17 0.604 1.171 Pitch 17 0.532 1.376 Tempo 15 0.447 0.982 EOS 2 0.022 5.040 MIDI-LLM Type Layer Acc. Entr. special 15 1.000 0.040 time 15 0.861 0.434 duration 15 0.772 0.824 note 15 0.768 0.816 Crucially, the near-zero early-layer values in MIDI-LLM do not imply that early layers are uninformative. On the contrary, the probing results of Section 4 show many concepts are linearly decodable there (e.g., local rhythmic density peaks at layer 8). Rather, intermediate representations appear not to be expressed in a basis legible to the final unembedding, a known limitation of the classic logit lens [4]. We test this hypothesis in two ways. Vocabulary-mass analysis. If early MIDI-LLM representations remain in an inherited textual basis, then before restricting to VMIDIV_MIDI, the musical vocabulary should receive no more than its size-based share of the full probability mass. We measure that share as massâ,tMIDI=âvâVMIDIexpâĄ(zâ,tâ(v))âvâVexpâĄ(zâ,tâ(v)).mass^MIDI_ ,t= _vâ V_MIDI \! (z_ ,t(v) ) _vâ V \! (z_ ,t(v) ). (3) A rotation of massMIDImass^MIDI co-occurring with the accuracy jump at layers 13 to 14 would support this interpretation, and this is what we find (per-layer values in the rightmost column of Table 5, per-type curves in Figure 4). Through the first two-thirds of the network the musical share stays near the size-based share of the MIDI block in the extended vocabulary (55 026/183 282â0.3055\,026/183\,282â 0.30), then rotates almost entirely onto the musical vocabulary across layers 13 to 15, in lockstep with the accuracy jump and entropy collapse. The transition is ordered by token type: special tokens first, note tokens next, and time and duration tokens last, revealing a structured conversion from the inherited basis into an output-ready musical representation. Figure 4: MIDI share of the full-vocabulary probability mass per layer of MIDI-LLM, for all analyzed tokens and by token type. Through layers 0 to 12 the mass stays near the chance share of the MIDI block (â0.30â 0.30, dashed); the readout rotates into the musical vocabulary at layers 13 to 15 (shaded), in the type order special â note â time/duration. Tuned lens. The decisive test is the tuned lens [4]. For each layer â a small affine translator tâ:âdââdt_ :R^d ^d is trained to map the intermediate state into the final layerâs basis, with the frozen normalization and unembedding applied unchanged, pâ,ttuned=softmaxâĄ(Uâ(NormâĄ(tââ(hâ,t)))).p^tuned_ ,t=softmax (U (Norm(t_ (h_ ,t)) ) ). (4) Translators are initialized to identity and trained by distilling the modelâs own final distribution (KLâĄ(pL,tâ„pâ,ttuned)KL(p_L,t\,\|\,p^tuned_ ,t)), on sequences disjoint from the evaluation set (60 00060\,000 token positions, four epochs at learning rate 10â310^-3, with a further 50 00050\,000 positions held out for evaluation). If the tuned lens lifts early and mid-layer accuracy of MIDI-LLM toward the probing curve, the 13 to 14 jump is an artifact of basis change and information accumulates gradually; if accuracy stays low, the decision genuinely forms late. For text2midi, whose classic lens is already smooth, the tuned lens acts as a control. The two explanations contribute in sequence (Figure 5). In MIDI-LLM, the tuned lens makes the final prediction linearly readable two to three layers earlier than the classic lens suggests and reduces divergence correspondingly sooner, demonstrating that much of the sharp jump reflects a change of basis. Accuracy then continues to rise quickly through the second half, locating genuine prediction refinement after that early readout becomes available. Together with vocabulary mass, this yields a coherent two-stage account: an inherited language-model basis is progressively translated into output-ready musical states while the prediction itself is refined. For text2midi, the tuned lens lifts the early curve without changing its gradual shape, reinforcing the contrast between the architectures. Figure 5: Tuned lens (blue) vs. classic logit lens (orange), per layer, for text2midi (left) and MIDI-LLM (right): top-1 agreement with the sampled token (top row) and KL divergence to the final distribution on a log scale (bottom row). For MIDI-LLM the tuned lens makes the prediction readable several layers earlier, smoothing the layer 13 to 14 jump; for text2midi it lifts the whole first two-thirds of the curve without changing its gradual shape. 6 Activation Patching Across the Binding Transition Activation patching provides a causal counterpart to the probing and lens results. We generate from one prompt while replacing its prompt activations at the input to layer L with those captured from a contrasting instrument prompt (piano vs. violin), and measure how far the piano-note fraction moves from the original toward the contrast (0 = no transfer, 11 = full), guarded by a self-patch control (0 by construction) and a neutral-prompt control that catches nonspecific disruption. Each condition uses 10 generations with paired seeds, and confidence intervals are 95%95\% percentiles over 2 0002\,000 bootstrap resamples of complete seed triplets. In MIDI-LLM, transfer stays near full through layer 13 before falling to 0.620.62 and 0.270.27 at layers 14 and 15 (Figure 6). This sharp, graded attenuation independently aligns with the late binding transition found by the lenses; residual transfer and shifts in the neutral control make it a transition band rather than a binary boundary. For text2midi, the mirror experiment patches the cross-attention encoder memory at one decoder layer. The absence of an isolated depth peak relative to the neutral control is consistent with distributed conditioning: the decoder can re-read the original encoder memory at every other layer rather than depending on one bottleneck. Figure 6: Instrument patching (piano â violin) at each MIDI-LLM layer input: effect score with paired 95% bootstrap CIs, the exact-zero self control and the neutral-prompt control. Transfer stays near full through layer 13 and attenuates sharply at layers 14 to 15; the logit-lens transition is shaded. 7 Steering with Activation Additions Control is the strongest test of a mechanistic account. Because the output is symbolic, an interventionâs effect for some of the simpler concepts can be measured exactly on the generated score. We therefore report the three concepts that admit such a measure: tempo/energy (note density in tokenizer-native time: notes per beat for REMI+ and per second for AMT), register (mean MIDI pitch), and polyphony (mean number of non-percussive notes sharing an onset), and use the note count as a generation-stability diagnostic. We steer other attributes as well, but they are hard to quantify reliably in multi-track MIDI, so we present those only as audio on the demo page. 7.1 Difference-in-means directions Following Facchiano et al. [12], we compute steering directions as the normalized difference in means between activations of 25 contrastive prompts per pole: dâ=ÎŒâBâÎŒâAâÎŒâBâÎŒâAâ2.d_ = _ ^B- _ ^A _ ^B- _ ^A _2. (5) The poles are short free-form descriptions designed to contrast the target attribute, with associated musical cues reinforcing each pole, i.e.: âA very fast and energetic piece, presto tempo, rapid notesâ against âA very slow and calm piece, largo tempo, long sustained notesâ for tempo/energy, âA piccolo solo, extremely high and birdlikeâ against âA contrabass solo, extremely low and resonantâ for register, and âA brass section playing closed-position voicings in rhythmic unisonâ against âA solo trumpet fanfare line with no harmony padsâ for polyphony. Each model is read where its architecture puts the prompt: ÎŒâ _ is taken at the last prompt token in MIDI-LLM, the only position that has seen the whole prompt [26], and averaged over a fixed teacher-forced prefix in text2midi, whose prompt reaches every decoder position alike through cross-attention; we call these the modelsâ native readouts. We add αâdâα d_ to the residual stream during generation, either at the single layer L where it was computed (single-layer) or at every layer (one-to-all), and report the resulting change in the concept metric, Îâmâ(α)=mâ(Mα)âmâ(M0) m(α)=m(M_α)-m(M_0). 7.2 Bidirectional evaluation of steering A directional intervention has a useful symmetry: its effect should reverse when the steering vector is reversed, whereas nonspecific drift need not. We exploit this by running every configuration in both orientations, AâBA-B and BâAB-A, and jointly regressing the metric on α over run-level points. Fits use the common stable range up to the first α at which the median note count in either orientation drops below half of baseline, and seed-clustered standard errors account for repeated trajectories and pairing across orientations. We call the top of this range αmaxα . Splitting the two fitted slopes, sAâBs_AB and sBâAs_BA, into their antisymmetric and symmetric parts gives: sdir=sBâAâsAâB2,snon=sBâA+sAâB2,spec=|sdir||sdir|+|snon|,s_dir= s_BA-s_AB2, s_non= s_BA+s_AB2, = |s_dir||s_dir|+|s_non|, (6) where sdirs_dir and snons_non are the antisymmetric and symmetric components. Specificity specâ[0,1]specâ[0,1] is the antisymmetric share of the response: values near 11 are consistent with directional control, while values near 0 indicate symmetric drift. 7.3 Steering effects We apply the protocol to one balanced sweep grid per model: three concepts, both injection strategies, both orientations, nine source layers spanning the depth of each model, αâ[0,2]αâ[0,2] in steps of 0.250.25, and ten seeds per point, making up 9 7209\,720 sequences per model in the native readout. Table 6 shows bidirectional control at the best single-layer configurations: register and polyphony clear the exploratory 2âSE2\,SE rule in both models, and tempo/energy does so in MIDI-LLM. Polyphony changes by 2020 to 40%40\%, while register moves by one to five semitones across all tracks. Table 6: Steering effects at the best single-layer configuration per concept (Table 7): the unsteered metric (base), the metric at the α giving the largest shift within the range where note counts stay intact (steered), and the relative change. (â) response does not clear the exploratory |sdir|>2âSE|s_dir|>2\,SE rule (text2midi tempo/energy only). Concept Direction text2midi MIDI-LLM base steered Î base steered Î tempo/energy â higher 5.92 6.73 (α=2α=2) +13.6%â+13.6\%^* 17.58 29.97 (α=1.75α=1.75) +70.4%+70.4\% tempo/energy â lower 5.92 4.59 (α=1.5α=1.5) â22.5%â-22.5\%^* 17.58 17.04 (α=0.75α=0.75) â3.1%-3.1\% register â higher 64.49 66.34 (α=0.25α=0.25) +2.9%+2.9\% 61.14 64.33 (α=1.75α=1.75) +5.2%+5.2\% register â lower 64.49 59.34 (α=1.5α=1.5) â8.0%-8.0\% 61.14 58.34 (α=1.5α=1.5) â4.6%-4.6\% polyphony â denser 3.21 4.48 (α=2α=2) +39.6%+39.6\% 2.84 3.46 (α=1α=1) +21.6%+21.6\% polyphony â sparser 3.21 2.39 (α=2α=2) â25.7%-25.7\% 2.84 2.00 (α=1.75α=1.75) â29.8%-29.8\% Table 7 decomposes the best configuration per model, concept, and injection strategy. Single-layer interventions remain stable across the full sweep and generally keep symmetric drift small; all single-layer groups except text2midi tempo clear the exploratory 2âSE2\,SE rule. text2midi also supports clean one-to-all control, while the same strategy in MIDI-LLM reveals an architecture-specific stability limit. Table 7: Best steering configuration per model, concept, and injection strategy. |sdir||s_dir| is the directional strength, |snon||s_non| symmetric drift, spec their antisymmetric share, and αmaxα the largest stable strength (â„2â„ 2: no collapse). The most specific cell clearing the exploratory |sdir|>2âSE|s_dir|>2\,SE rule is shown (before rounding; layer 0 excluded); (*) means no cell clears it. Model Concept Strategy L |sdir||s_dir| |snon||s_non| spec αmaxα text2midi tempo/energy* single 17 0.56±0.370.56± 0.37 0.030.03 0.94 â„2â„ 2 text2midi register single 9 2.17±0.702.17± 0.70 0.870.87 0.71 â„2â„ 2 text2midi polyphony single 12 0.40±0.160.40± 0.16 0.180.18 0.70 â„2â„ 2 text2midi tempo/energy one-to-all 17 3.20±0.503.20± 0.50 1.751.75 0.65 1.75 text2midi register one-to-all 4 3.35±0.513.35± 0.51 0.060.06 0.98 â„2â„ 2 text2midi polyphony one-to-all 16 0.55±0.120.55± 0.12 0.030.03 0.94 â„2â„ 2 MIDI-LLM tempo/energy single 2 2.79±1.282.79± 1.28 1.691.69 0.62 â„2â„ 2 MIDI-LLM register single 8 1.52±0.761.52± 0.76 0.060.06 0.96 â„2â„ 2 MIDI-LLM polyphony single 12 0.22±0.110.22± 0.11 0.010.01 0.96 â„2â„ 2 MIDI-LLM tempo/energy one-to-all 7 5.13±1.565.13± 1.56 11.9011.90 0.30 0.75 MIDI-LLM register one-to-all 10 6.50±2.286.50± 2.28 18.4218.42 0.26 0.75 MIDI-LLM polyphony one-to-all 7 1.79±0.771.79± 0.77 1.161.16 0.61 0.75 The decomposition turns these responses into an actionable intervention result. In MIDI-LLM, single-layer steering keeps note counts intact and has over fifty times less median symmetric drift than all-layer injection (0.280.28 vs. 15.115.1; grid medians exclude layer 0), which reaches its stability limit near α=0.75α=0.75. In text2midi, whose decoder re-reads the prompt through cross-attention at every layer, all-layer injection remains stable and yields the most specific directions. Layer 0 provides a further validation of the protocol: large same-way shifts under both orientations are assigned to the symmetric component even when dense note clusters pass the note-count guard. The decomposition is symmetric in A and B, so we report magnitudes in Table 7 and achievable directions in Table 6. 7.4 Norm-relative steering confirms the architecture effect Because activation norms grow with depth, we test whether MIDI-LLMâs all-layer stability limit comes from overscaling its early layers. We make α a share of the local activation size, htâht+αââ„htâ„2âdh_tâ h_t+α h_t _2\,d, so that every layer receives an equal relative perturbation, and sweep αâ[0,0.2]αâ[0,0.2] in both orientations at one layer per concept (Table 8). Norm-relative scaling sharpens the same conclusion. Single-layer steering remains intact throughout the full 20%20\% range, whereas all-layer injection reaches its limit at 2%2\% per layer for tempo and 5%5\% for register and polyphony. So the problem is not that a fixed α hits early layers too hard; it is that all sixteen layers are pushed together. For MIDI-LLM, single-layer injection remains the robust choice. Table 8: Norm-relative steering in MIDI-LLM, decomposed as in Table 7. Here α is a fraction of the local activation norm and |sdir||s_dir| is per unit of that α. (â„0.2â„ 0.2: no collapse.) (*) does not clear the exploratory |sdir|>2âSE|s_dir|>2\,SE rule. Strategy Concept L |sdir||s_dir| |snon||s_non| spec αmaxα single register 8 16.1±7.416.1± 7.4 0.030.03 1.00 â„0.2â„ 0.2 single polyphony 12 5.4±1.65.4± 1.6 0.880.88 0.86 â„0.2â„ 0.2 single tempo/energy 4 32.9±13.232.9± 13.2 10.7310.73 0.75 â„0.2â„ 0.2 one-to-all register 8 140.7±40.3140.7± 40.3 46.4346.43 0.75 0.05 one-to-all polyphony* 12 37.9±25.237.9± 25.2 22.6122.61 0.63 0.05 one-to-all tempo/energy* 4 326.1±834.3326.1± 834.3 1 489.781\,489.78 0.18 0.02 8 Discussion and Limitations Injection strategy. The results yield an architecture-aware rule for steering. text2midi obtains its most specific directions from all-layer injection, consistent with Facchiano et al. [12], who favor the same strategy on cross-attention-conditioned MusicGen. MIDI-LLM instead responds most robustly to targeted single-layer injection, while repeated additions accumulate in its shared promptâmusic residual stream. With one model per architecture we cannot isolate the conditioning pathway from every other design difference, but the contrast provides a concrete hypothesis and a practical strategy to test in future models. Choosing where to steer. The most specific source layer is concept-dependent in both models, making empirical layer sweeps valuable; this contrasts with the consistent mid-layer block reported for MusicGen by Facchiano et al. [12]. Bidirectional evaluation adds a complementary safeguard to note-count stability by detecting symmetric layer-0 responses that a generation-volume check alone would retain. What the two probing settings measure. The two probing settings expose complementary capabilities. SynTheory reveals strong representations of intervals and chord progressions in both models and of chord quality in MIDI-LLM when each concept is isolated. Full generations show which information remains linearly accessible in the richer setting where musical properties co-occur. Their different readouts and distributions answer different questions, so neither is treated as a correction of the other. Further limitations. Difference-in-means directions come from text contrasts that also vary lexically and musically, so a direction is only as clean as the contrast behind it. The metrics are proxies for their concepts rather than the concepts themselves: note density stands in for tempo and energy, but rises just as well when more notes sound at once, so the tempo/energy and polyphony numbers are not fully independent. Labels for probing on generations are heuristic estimates from the decoded score, and part of the weakness of the higher-level concepts may be label noise rather than an absent representation. More complex musical concepts, whose unambiguous definition and measurement in multi-track MIDI remain difficult, stay outside the quantitative protocol altogether. 9 Conclusion and Future Work This paper establishes a mechanistic analysis pipeline for text-conditioned symbolic music. Across probing, the logit and tuned lenses, activation patching and steering, we recover internal musical structure, trace two distinct routes by which predictions are formed, causally transfer prompt conditioning, and produce bidirectional changes in register and polyphony in both models and tempo/energy in MIDI-LLM. The architecture comparison also yields a practical intervention rule: all-layer steering suits cross-attention-conditioned text2midi, while targeted layers provide robust control in MIDI-LLM. Our bidirectional protocol makes these effects measurable by separating directional response from symmetric drift. Moving beyond hand-chosen concepts, ongoing work trains sparse autoencoders [14, 11] on both models to discover and characterize musical features unsupervised. Those results will appear in a follow-up publication. Acknowledgments We gratefully acknowledge Polish high-performance computing infrastructure PLGrid (HPC Centers: ACK Cyfronet AGH) for providing computer facilities and support within computational grant no. PLG/2025/018892. References [1] A. Agostinelli, T. I. Denk, Z. Borsos, J. Engel, M. Verzetti, A. Caillon, Q. Huang, A. Jansen, A. Roberts, M. Tagliasacchi, et al. (2023) Musiclm: generating music from text. arXiv preprint arXiv:2301.11325. Cited by: §2. [2] G. Alain and Y. Bengio (2016) Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644. Cited by: §1, §2, §4. [3] Y. Belinkov (2022) Probing classifiers: promises, shortcomings, and advances. Computational Linguistics 48 (1), p. 207â219. Cited by: §2, §4. [4] N. Belrose, Z. Furman, L. Smith, D. Halawi, I. Ostrovsky, L. McKinney, S. Biderman, and J. Steinhardt (2023) Eliciting latent predictions from transformers with the tuned lens. arXiv preprint arXiv:2303.08112. Cited by: §1, §2, §5.1, §5.1. [5] K. Bhandari, A. Roy, K. Wang, G. Puri, S. Colton, and D. Herremans (2025) Text2midi: generating symbolic music from captions. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 39, p. 23478â23486. Cited by: §1, §2, Table 1. [6] N. Bryan-Kinns, B. Banar, C. Ford, C. N. Reed, Y. Zhang, S. Colton, and J. Armitage (2023) Exploring xai for the arts: explaining latent space in generative music. arXiv preprint arXiv:2308.05496. Cited by: §2. [7] J. Copet, F. Kreuk, I. Gat, T. Remez, D. Kant, G. Synnaeve, Y. Adi, and A. DĂ©fossez (2023) Simple and controllable music generation. arXiv preprint arXiv:2306.05284. Cited by: §2. [8] M. S. Cuthbert and C. Ariza (2010) Music21: a toolkit for computer-aided musicology and symbolic music data. In Proceedings of the 11th International Society for Music Information Retrieval Conference (ISMIR), p. 637â642. Cited by: §4.2. [9] P. Dhariwal, H. Jun, C. Payne, J. W. Kim, A. Radford, and I. Sutskever (2020) Jukebox: a generative model for music. arXiv preprint arXiv:2005.00341. Cited by: §2. [10] F. Doshi-Velez and B. Kim (2017) Towards a rigorous science of interpretable machine learning. External Links: 1702.08608, Link Cited by: §2. [11] N. Elhage, T. Hume, C. Olsson, N. Schiefer, T. Henighan, S. Kravec, Z. Hatfield-Dodds, R. Lasenby, D. Drain, C. Chen, et al. (2022) Toy models of superposition. arXiv preprint arXiv:2209.10652. Cited by: §9. [12] S. Facchiano, G. Strano, D. Crisostomi, I. Tallini, T. Mencattini, F. Galasso, and E. RodolĂ (2025) Activation patching for interpretable steering in music generation. arXiv preprint arXiv:2504.04479. Cited by: §1, §2, §7.1, §8, §8. [13] J. Hewitt and P. Liang (2019) Designing and interpreting probes with control tasks. In Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (emnlp-ijcnlp), p. 2733â2743. Cited by: §1, §2, §4.1, §4. [14] R. Huben, H. Cunningham, L. Smith, A. Ewart, and L. Sharkey (2024) Sparse autoencoders find highly interpretable features in language models. In International Conference on Learning Representations, Vol. 2024, p. 7827â7845. Cited by: §1, §9. [15] C. L. Krumhansl (1990) Cognitive foundations of musical pitch. Oxford University Press. Cited by: §4.2. [16] J. Melechovsky, A. Roy, and D. Herremans (2024) MidiCaps: a large-scale midi dataset with text captions. arXiv preprint arXiv:2406.02255. Cited by: §2. [17] T. Miller (2019) Explanation in artificial intelligence: insights from the social sciences. Artificial intelligence 267, p. 1â38. Cited by: §2. [18] nostalgebraist (2020) Interpreting GPT: the logit lens. Note: https://w.lesswrong.com/posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lensAccessed: 13.04.2026 Cited by: §1, §2, §5. [19] A. Pati, A. Lerch, and G. Hadjeres (2019) Learning to traverse latent spaces for musical score inpainting. arXiv preprint arXiv:1907.01164. Cited by: §2. [20] I. Prokopiou, P. Vikatos, M. Kaliakatsos-Papakostas, T. Giannakopoulos, and T. Stafylakis (2026) Closing the loop: pid feedback control for interpretable activation steering in symbolic music generation. External Links: 2606.18790 Cited by: §2. [21] I. Prokopiou, P. Vikatos, M. Kaliakatsos-Papakostas, T. Giannakopoulos, and T. Stafylakis (2026) Latent space disentanglement via activation steering for interpretable attribute control in symbolic music generation. arXiv preprint arXiv:2605.31295. Cited by: §2. [22] N. Saphra and S. Wiegreffe (2024) Mechanistic?. In Proceedings of the 7th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, p. 480â498. Cited by: §2. [23] N. Singh, M. Cherep, and P. Maes (2026) Discovering and steering interpretable concepts in large generative music models. In International Conference on Learning Representations, Vol. 2026, p. 84922â84941. Cited by: §1, §2. [24] N. Subramani, N. Suresh, and M. E. Peters (2022) Extracting latent steering vectors from pretrained language models. In Findings of the Association for Computational Linguistics: ACL 2022, p. 566â581. Cited by: §1, §2. [25] J. Thickstun, D. Hall, C. Donahue, and P. Liang (2023) Anticipatory music transformer. arXiv preprint arXiv:2306.08620. Cited by: Table 1. [26] A. M. Turner, L. Thiergart, G. Leech, D. Udell, J. J. Vazquez, U. Mini, and M. MacDiarmid (2023) Steering language models with activation engineering. arXiv preprint arXiv:2308.10248. Cited by: §1, §2, §7.1. [27] M. A. V. VĂĄsquez, C. Pouw, J. A. Burgoyne, and W. Zuidema (2024) Exploring the inner mechanisms of large generative music models. In Proceedings of the 25th International Society for Music Information Retrieval Conference (ISMIR), Cited by: §1, §2, §5. [28] D. von RĂŒtte, L. Biggio, Y. Kilcher, and T. Hofmann (2023) FIGARO: controllable music generation using learned and expert features. In The Eleventh International Conference on Learning Representations, Cited by: Table 1. [29] Z. Wang, D. Wang, Y. Zhang, and G. Xia (2020) Learning interpretable representation for controllable polyphonic music generation. arXiv preprint arXiv:2008.07122. Cited by: §2. [30] M. Wei, M. Freeman, C. Donahue, and C. Sun (2024) Do music generation models encode music theory?. arXiv preprint arXiv:2410.00872. Cited by: §2, §4.3, §4. [31] S. Wu, Y. Kim, and C. A. Huang (2025) MIDI-llm: adapting large language models for text-to-midi music generation. arXiv preprint arXiv:2511.03942. Cited by: §1, §2, Table 1. [32] Y. Zhang, Y. Ikemiya, W. Choi, N. Murata, M. A. MartĂnez-RamĂrez, L. Lin, G. Xia, W. Liao, Y. Mitsufuji, and S. Dixon (2024) Instruct-musicgen: unlocking text-to-music editing for music language models via instruction tuning. arXiv preprint arXiv:2405.18386. Cited by: §2.