解析文本生成乐谱模型的内在机制,揭示音乐结构如何被建模与控制。
MI-MIDI: Mechanistic Interpretability of Text-to-MIDI Generation Models via Probing, Lenses and Steering

- 通过探针、透镜和激活扰动,解码模型中音乐概念的线性表示
- 发现两个模型在音高、乐器、和声与织体上均能有效解码,但演化路径不同
- 提供可操作的干预工具,适合研究音乐生成逻辑或可控创作的开发者
音乐生成的机制可解释性研究长期聚焦于音频模型,符号化模型仍待探索。本文分析两种设计迥异的公开文本到乐谱系统:专用编码器-解码器 text2midi 和基于 Llama~3.2~1B 扩展 MIDI token 的 MIDI-LLM。采用线性探针、对数概率透镜、激活修补及均值差异控制等方法,发现音高、乐器、和声与织体在两模型中均可线性解码。text2midi 预测随深度逐步优化,而 MIDI-LLM 主要依赖原有文本基础,后期才发生剧烈旋转进入音乐词汇;修补实验揭示了提示驱动的乐器转移在后期被抑制。控制实验显示双向调节音域与复调程度,在 MIDI-LLM 中还可调节速度/能量。双方向协议表明,所有层干预在 text2midi 中稳健,但在 MIDI-LLM 中会累积干扰。结果形成一套实用工具,用于追踪与操控符号生成器中的音乐概念。音频示例可在演示网站获取。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。