[论文解读] Museformer: Transformer with Fine- and Coarse-Grained Attention for Music Generation
Museformer 引入了细粒度与粗粒度注意力机制到 Transformer 基于的符号音乐生成中,使长序列建模成为可能,提升音乐结构并降低复杂度。它选择与结构相关的小节进行细粒度注意力,对其他小节使用小节摘要以实现高效与高质量。
Symbolic music generation aims to generate music scores automatically. A recent trend is to use Transformer or its variants in music generation, which is, however, suboptimal, because the full attention cannot efficiently model the typically long music sequences (e.g., over 10,000 tokens), and the existing models have shortcomings in generating musical repetition structures. In this paper, we propose Museformer, a Transformer with a novel fine- and coarse-grained attention for music generation. Specifically, with the fine-grained attention, a token of a specific bar directly attends to all the tokens of the bars that are most relevant to music structures (e.g., the previous 1st, 2nd, 4th and 8th bars, selected via similarity statistics); with the coarse-grained attention, a token only attends to the summarization of the other bars rather than each token of them so as to reduce the computational cost. The advantages are two-fold. First, it can capture both music structure-related correlations via the fine-grained attention, and other contextual information via the coarse-grained attention. Second, it is efficient and can model over 3X longer music sequences compared to its full-attention counterpart. Both objective and subjective experimental results demonstrate its ability to generate long music sequences with high quality and better structures.
研究动机与目标
- 解决符号音乐生成中长序列建模的问题,超越全自注意力的极限。
- 更有效地建模如重复和远程依赖等音乐结构。
- 在保持生成关键信息的同时,降低计算和内存复杂度。
提出的方法
- 提出 FC-Attention:在结构相关的小节上进行细粒度注意力,在其他小节的摘要上进行粗粒度注意力。
- 在每个小节后插入一个摘要标记,以便实现局部聚合。
- 使用来自人类创作音乐的小节之间的相似性统计来选择结构相关的小节。
- 通过 FC-Attention 内的两步摘要与聚合过程更新标记表示。
- 用小节和拍子嵌入来表示小节,并应用带有 FC-Attention 的类似 Transformer 的架构。
- 在 Lakh MIDI 数据集上使用困惑度和相似性误差进行评估,并进行主观听感测试。
实验结果
研究问题
- RQ1双重注意力方案(细粒度和粗粒度)是否能比全注意力或其他长序列 Transformer 更好地建模长音乐序列?
- RQ2通过相似性统计选定的结构相关小节是否改善音乐结构的生成和困惑度?
- RQ3在内存、速度和质量方面,Museformer 如何扩展到整首歌长度?
主要发现
| Model | PPL (1024) | PPL (5120) | PPL (10240) | SE (%) |
|---|---|---|---|---|
| Music Transformer | 1.66 | 1.77 | 2.55 | 2.49 |
| Transformer-XL | 1.64 | 1.45 | 1.43 | 15.66 |
| Longformer | 1.65 | 1.46 | 1.45 | 5.25 |
| Linear Transformer | 1.86 | 1.67 | 1.64 | 1.97 |
| Museformer (ours) | 1.64 | 1.41 | 1.35 | 0.95 |
| w/o coarse-grained | 1.65 | 1.42 | 1.38 | 1.08 |
| w/o bar selection | 1.65 | 1.43 | 1.39 | 6.39 |
- Museformer 在 1024、5120、10240 token 序列中实现了最佳困惑度。
- 它产生的相似性误差最低,表明生成的音乐结构与人类创作的音乐高度相似。
- 主观评估显示 Museformer 在音乐性、短期结构、长期结构以及整体偏好方面得分最高。
- 消融研究表明粗粒度注意力和小节选择对性能有贡献,其中结构相关小节选择在更长序列中变得更为重要。
- Museformer 能在比全注意力基线更高的效率下构建整首歌长度的音乐(内存增长几乎线性,序列长度超过 3 倍)。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。