arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.02684cs.CLcs.AIcs.LG
收藏

面向线性成本推理 Transformer 的跨架构迁移学习

Cross-Architecture Transfer Learning for Linear-Cost Inference Transformers

Department of CSE, HKUST(香港科技大学计算机科学与工程系)

Sehyun Choi

AI总结:

针对线性成本推理架构需从头预训练的问题,本文提出 XATL,将自注意力 Transformer 的共享权重直接迁移至新架构,最高节省 2.5 倍训练时间并提升 2.6% 基准性能。

摘要:

近来,已有多种架构被提出,通过改变自注意力模块的设计,使 Transformer 语言模型具备线性成本推理(LCI)能力,从而提升效率。这一领域中一个值得注意的方法是 State-Space Machines(SSMs,状态空间机)架构,它在语言建模任务上表现出与基于自注意力的 Transformer 相当的性能。然而,这种架构变更需要从头开始对权重进行完整预训练,给希望使用这些新架构的研究人员和从业者带来巨大成本。在更传统的线性注意力研究中,已有工作通过 swap-and-finetune(交换并微调)框架,提出用线性注意力近似完整注意力。受该方法启发,我们提出跨架构迁移学习(Cross-Architecture Transfer Learning,XATL):将 LCI 与基于自注意力的 Transformer 之间共享组件的权重,例如 layernorm、MLP、输入/输出嵌入,从已经预训练好的模型参数直接迁移到新架构中。我们在不同模型规模和替代注意力架构上实验了该方法的有效性,结果表明 XATL 显著减少训练时间,最高可达 2.5 倍,并在相同计算预算内收敛到更优极小值,在 LM 基准上模型性能最高增强 2.6%。

英文摘要:

Recently, multiple architectures has been proposed to improve the efficiency of the Transformer Language Models through changing the design of the self-attention block to have a linear-cost inference (LCI). A notable approach in this realm is the State-Space Machines (SSMs) architecture, which showed on-par performance on language modeling tasks with the self-attention transformers. However, such an architectural change requires a full pretraining of the weights from scratch, which incurs a huge cost to researchers and practitioners who want to use the new architectures. In the more traditional linear attention works, it has been proposed to approximate full attention with linear attention by swap-and-finetune framework. Motivated by this approach, we propose Cross-Architecture Transfer Learning (XATL), in which the weights of the shared components between LCI and self-attention-based transformers, such as layernorms, MLPs, input/output embeddings, are directly transferred to the new architecture from already pre-trained model parameters. We experimented the efficacy of the method on varying sizes and alternative attention architectures and show that \methodabbr significantly reduces the training time up to 2.5x times and converges to a better minimum with up to 2.6% stronger model on the LM benchmarks within the same compute budget.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑