Music Circuit: Trace and Control Style Dynamics in Large Music Generation Model
Organizations: Mohamed bin Zayed University of Artificial Intelligence · McGill University
Abstract
Musical style, a global attribute that functions throughout a whole piece, is a lever widely used by users in modern large music generation models. Yet how style is represented inside these models, and which components drive it, remains largely unexplored. In language models, circuit analysis traces a representation to a sparse sub-network of a few key components, namely attention heads and MLP neurons, and has been used successfully to explain and control global attributes such as emotion. In this work, we use circuit analysis to study the mechanisms behind musical style. Based on YuE2, we build a dataset that pairs the same lyrics with five styles and design a three-step framework. First, stage localization shows that the style forms mainly in the score-planning stage. Second, static observation across the positions of this stage further reveals that style is not a fixed vector but a dynamic representation across tokens. Third, we therefore merge the activation differences across positions into one direction per style, and trace the neurons and attention heads that drive this direction into a sparse circuit. Without any style text, steering this circuit successfully transfers one piece into the target style, matching and even exceeding the style prompt. To our knowledge, this is the first work to analyze and control musical style at the circuit level in a large music generation model. Audio and score examples are available at https://aristo233.github.io/Music_Circuit/.
Figures & tables
| CLAP | Gemini 3.6 Flash | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Condition | Pop | Metal | Funk | Blues | Country | Total | Pop | Metal | Funk | Blues | Country | Total |
| Empty-tag baseline | 27 | 0 | 0 | 0 | 3 | 30 | 14 | 1 | 0 | 0 | 15 | 30 |
| Style prompt | 29 | 17 | 13 | 29 | 25 | 113 | 24 | 12 | 15 | 30 | 30 | 111 |
| Random circuit | 27 | 0 | 0 | 3 | 4 | 34 | 13 | 0 | 0 | 0 | 20 | 33 |
| CAA | 26 | 22 | 26 | 21 | 23 | 118 | 24 | 22 | 25 | 23 | 26 | 120 |
| Dynamic circuit (ours) | 30 | 24 | 25 | 27 | 27 | 133 | 25 | 23 | 22 | 27 | 29 | 126 |
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Group | Minor | 4/4 | 2/4 | 6/8 | Tempo, median (IQR) | Most frequent keys | |
|---|---|---|---|---|---|---|---|
| Contemporary pop | 69 | 9% | 56 | 13 | 0 | 100 (90–118) | F (14), D (13), A (9) |
| Metal rock | 69 | 100% | 40 | 29 | 0 | 90 (87–118) | D#m (51), Em (6), Dm (4) |
| Classic funk | 69 | 96% | 66 | 3 | 0 | 105 (100–118) | Gm (21), Dm (20), Em (8) |
| Electric blues | 69 | 100% | 34 | 0 | 35 | 86 (85–88) | Gm (59), Dm (8), D#m (2) |
| Country | 69 | 1% | 57 | 12 | 0 | 80 (78–85) | G (20), Bb (15), Eb (14) |
| Empty tag | 69 | 54% | 56 | 11 | 0 | 93 (85–120) | Gm (11), Dm (9), D (8) |
| Style | CLAP hits | Margin change | |
|---|---|---|---|
| Empty-tag score | Style-tag score | ||
| Contemporary pop | 48/54 | 53/54 | +0.050 |
| Metal rock | 0/54 | 33/54 | +0.305 |
| Classic funk | 0/54 | 9/54 | +0.228 |
| Electric blues | 2/54 | 34/54 | +0.179 |
| Country | 4/54 | 39/54 | +0.141 |
| Stage | Main effect (margin) | Shapley share |
|---|---|---|
| Score | +0.200 | 76% |
| Music tokens | +0.061 | 23% |
| Acoustic rendering | +0.001 | 0% |
| Full tag, all stages | +0.262 | 100% |
| Strength | CLAP hits | Complete | Mean ABC tokens | Mean audio (s) |
|---|---|---|---|---|
| 0.5 | 14/16 | 16/16 | 697 | 83 |
| 1.0 | 13/16 | 13/16 | 1378 | 143 |
| 2.0 | 11/16 | 13/16 | 915 | 175 |
| Comparison | Result |
|---|---|
| Style readout trained and tested at the same position | above chance in 79 of 80 cases |
| Style readout transferred across positions | above chance in 228 of 320 cases; 21.5% when trained at the score start and tested at step 256 |
| MLP neurons reselected after resampling lyrics (score start) | Jaccard 0.80–0.89 |
| Condition | Mean audio (s) | Whole track | First 30 s | Middle 20 s |
|---|---|---|---|---|
| Empty-tag baseline | 53 | 30 | 30 | 30 |
| Style prompt (all stages) | 66 | 113 | 123 | 93 |
| Single-position circuit | 64 | 73 | 73 | 62 |
| Mean-direction circuit | 72 | 90 | 91 | 89 |
| Random circuit | 58 | 34 | 37 | 28 |
| Dynamic circuit | 84 | 133 | 122 | 126 |
| Condition | Pop | Metal | Funk | Blues | Country | Total |
|---|---|---|---|---|---|---|
| Empty-tag baseline | 27/30 | 0/30 | 0/30 | 0/30 | 3/30 | 30/150 |
| Style prompt (AR stages) | 29/30 | 17/30 | 13/30 | 29/30 | 25/30 | 113/150 |
| Style prompt (all stages) | 29/30 | 17/30 | 13/30 | 29/30 | 25/30 | 113/150 |
| Single-position circuit | 30/30 | 5/30 | 2/30 | 15/30 | 21/30 | 73/150 |
| Mean-direction circuit | 30/30 | 10/30 | 13/30 | 17/30 | 20/30 | 90/150 |
| Random circuit | 27/30 | 0/30 | 0/30 | 3/30 | 4/30 | 34/150 |
| Condition | CLAP | Gemini | Truncated | Length (s) |
|---|---|---|---|---|
| Style prompt (all stages) | 56 | 54 | 0 | 61 |
| CAA | 52 | 54 | 12 | 185 |
| KL-weighted residual direction | 60 | 50 | 1 | 65 |
| Dense injection | 56 | 51 | 4 | 91 |
| Dynamic circuit | 65 | 58 | 0 | 73 |
| Condition | Pop | Metal | Funk | Blues | Country | Total |
|---|---|---|---|---|---|---|
| Empty-tag baseline | 14/30 | 1/30 | 0/30 | 0/30 | 15/30 | 30/150 |
| Style prompt (all stages) | 24/30 | 12/30 | 15/30 | 30/30 | 30/30 | 111/150 |
| Single-position circuit | 25/30 | 13/30 | 7/30 | 9/30 | 30/30 | 84/150 |
| Mean-direction circuit | 14/30 | 13/30 | 11/30 | 15/30 | 26/30 | 79/150 |
| Random circuit | 13/30 | 0/30 | 0/30 | 0/30 | 20/30 | 33/150 |
| CAA | 24/30 | 22/30 | 25/30 | 23/30 | 26/30 | 120/150 |
| Condition | Pop | Metal | Funk | Blues | Country | Non-pop | Picked |
|---|---|---|---|---|---|---|---|
| Empty-tag baseline | 3.64 | 1.09 | 1.45 | 1.70 | 2.55 | 1.70 | 2/43 |
| Style prompt | 4.00 | 3.82 | 4.09 | 3.40 | 3.82 | 3.79 | 27/43 |
| Dynamic circuit | 4.36 | 3.73 | 3.18 | 3.70 | 3.91 | 3.63 | 14/43 |
| Family | Label | Instrument in the description | Typical of |
|---|---|---|---|
| Guitars | distorted | distorted electric guitar | metal rock, electric blues |
| clean el. | clean electric guitar | classic funk, electric blues | |
| acoustic | acoustic guitar | country, contemporary pop | |
| pedal steel | pedal steel guitar | country | |
| Rhythm | drum kit | a loud drum kit | metal rock, classic funk |
| slap bass | slap bass | classic funk |
| Condition | CLaMP 3 cosine | Lyric advantage | Interval sim. | Rhythm sim. |
|---|---|---|---|---|
| Empty-tag resampling (reference) | 0.553 | 0.027 | 0.310 | 0.383 |
| Style prompt | 0.528 | 0.008 | 0.322 | 0.423 |
| Dynamic circuit | 0.561 | 0.022 | 0.323 | 0.436 |
| Mean-direction circuit | 0.678 | 0.099 | 0.397 | 0.508 |
| Single-position circuit | 0.645 | 0.064 | 0.361 | 0.499 |
| Random circuit | 0.747 | 0.148 | 0.483 | 0.586 |
| Condition | Male hits | Female hits | Total | Target-dir. shift |
|---|---|---|---|---|
| Empty-descriptor baseline | 11 | 21 | 32 | |
| Gender prompt | 13 | 28 | 41 | |
| Music-Start circuit | 13 | 25 | 38 | |
| First-128 circuit | 12 | 22 | 34 | |
| Music-Start components, first-128 difference | 16 | 25 | 41 | |
| Matched random circuit | 10 | 21 | 31 |
Controllable Music Generation
Controllable music generation steers composition and audio synthesis through prompts, musical structure, references, and interactive controls.
See all 97 papers