[论文解读] Music Transformer
一种具备内存高效相对注意力的 Transformer 模型,能够捕捉长期音乐结构,支持长序列并提升质量,在 JSB Chorales 与 Piano-e-Competition 上进行评估。
Music relies heavily on repetition to build structure and meaning. Self-reference occurs on multiple timescales, from motifs to phrases to reusing of entire sections of music, such as in pieces with ABA structure. The Transformer (Vaswani et al., 2017), a sequence model based on self-attention, has achieved compelling results in many generation tasks that require maintaining long-range coherence. This suggests that self-attention might also be well-suited to modeling music. In musical composition and performance, however, relative timing is critically important. Existing approaches for representing relative positional information in the Transformer modulate attention based on pairwise distance (Shaw et al., 2018). This is impractical for long sequences such as musical compositions since their memory complexity for intermediate relative information is quadratic in the sequence length. We propose an algorithm that reduces their intermediate memory requirement to linear in the sequence length. This enables us to demonstrate that a Transformer with our modified relative attention mechanism can generate minute-long compositions (thousands of steps, four times the length modeled in Oore et al., 2018) with compelling structure, generate continuations that coherently elaborate on a given motif, and in a seq2seq setup generate accompaniments conditioned on melodies. We evaluate the Transformer with our relative attention mechanism on two datasets, JSB Chorales and Piano-e-Competition, and obtain state-of-the-art results on the latter.
研究动机与目标
- 展示 Transformers 可以在多个时间尺度上生成具有长距离、重复结构的音乐。
- 扩展 Transformer,使其具备相对时序信息(以及可选的音高信息),以改进对音乐关系的建模。
- 降低相对注意力的内存成本,使其能够在长序列上进行训练。
- 展示用于音乐的序列表示(类似乐谱数据与演奏数据),并评估无条件生成与由旋律条件限定的伴奏。
提出的方法
- 引入一种内存高效的相对自注意力机制,将中间内存从 O(L^2 D) 降低为 O(LD);并加入一个倾斜过程以对齐相对对数。
- 使用适合数据集的编码将音乐表示为令牌序列(JSB Chorales 以 16 分音符网格表示;Piano-e-Competition 以 MIDI 风格的事件为单位的令牌)。
- 扩展相对注意力以包含位置之间的时序(以及可选的音高)关系,产生整合到注意力中的 S^rel 对数。
- 在 JSB Chorales 与 Piano-e-Competition 上对比全局与局部相对注意力,比较基线和现有模型。
- 进行人工听感测试并通过旋律的前导/条件分析来评估连贯性与音乐性。
实验结果
研究问题
- RQ1相对自注意力是否在符号音乐数据集上提升负对数似然和样本质量,相对于基线 Transformer?
- RQ2模型是否能够生成比训练序列更长的连贯长期音乐结构与续写?
- RQ3引入时序(和音高)关系是否带来更好的性能与泛化?
- RQ4在序列到序列的设定下,生成以旋律为条件的伴奏时模型表现如何?
主要发现
- 相对注意力在 JSB Chorales 数据集上对负对数似然和样本连贯性优于基线 Transformer。
- 在 Piano-e-Competition 上,采用相对注意力的 Transformer 达到最先进的困惑度并优于基线模型。
- 记忆高效实现通过降低中间内存使用,使在长序列(数千步)上的训练成为可能,从而实现更长的作曲。
- 相对注意力模型在前导与持续动机方面表现出更好的前导性与动机延续,能够保持长期结构与规律性的乐句。
- 在旋律条件设定中,相对 Transformer 的条件 NLL 优于基线。
- 人类评估显示相对于基线,具备相对注意力的模型在音乐性方面有感知上的改进。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。