arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.04731cs.CL
收藏

面向语言模型的带增强位置嵌入的高效Transformer

Efficient transformer with reinforced position embedding for language models

University of Connecticut(康涅狄格大学)

Yen-Che Hsiao, Abhishek Dutta

AI总结:

本研究提出带增强位置嵌入的高效Transformer,通过拼接位置编码与可训练嵌入、归一化嵌入矩阵列等设计,在参数量约减三分之二的情况下,于葡英翻译及14个TensorFlow翻译数据集上实现更优的损失表现与训练效率。

摘要:

本文提出了一种高效Transformer架构,该架构采用增强位置嵌入,仅需一半的编码器-解码器层数即可实现更优性能。我们证明,在用于葡英翻译任务的编码器-解码器Transformer模型中,将位置编码与可训练词元嵌入拼接、对词元嵌入矩阵的列进行归一化,并将归一化后的词元嵌入矩阵用作注意力层的Value值,能够改善训练损失、验证损失并缩短训练时间;该实验设置为10个训练轮次或12小时训练时长,共开展10次试验。我们的方法与基线模型相比参数量约减少三分之二,取得了1.21的平均训练损失、1.51的平均验证损失,单轮平均训练时长为1352.27秒,性能优于采用相同嵌入维度、将位置编码与词元嵌入相加的基线模型——该基线模型的平均训练损失为1.96,验证损失为2.18,单轮平均训练时长为4297.79秒。此外,我们在来自TensorFlow的14个不同翻译数据集上评估了所提架构与基线模型。结果表明,我们的方法始终能取得更低或相当的训练与验证损失,体现出学习效率的提升。

英文摘要:

In this paper, we propose an efficient transformer architecture that uses reinforced positional embedding to obtain superior performance with half the number of encoder decoder layers. We demonstrate that concatenating positional encoding with trainable token embeddings, normalizing columns in the token embedding matrix, and using the normalized token embedding matrix as the value of the attention layer improve the training and validation loss and the training time in an encoder-decoder Transformer model for a Portuguese-English translation task with 10 epochs or 12 hours of training across 10 trials. Our method, with roughly a threefold parameter reduction compared to the baseline model, yields a mean training loss of 1.21, a mean validation loss of 1.51, and an average training time of 1352.27 seconds per epoch, surpassing the baseline model with the same embedding dimension that employs addition of positional encoding and token embeddings, which achieves a mean training loss of 1.96, a validation loss of 2.18, and an average training time of 4297.79 seconds per epoch. Additionally, we evaluated our proposed architecture and the baseline across 14 diverse translation datasets from TensorFlow. The results indicate that our method consistently achieves lower or comparable training and validation losses, suggesting enhanced learning efficiency.

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

↑