摘要
本周课程深入探讨了Transformer模型中的解码器(Decoder)结构及其生成策略。课程重点介绍了自回归(Autoregressive)与非自回归(Non-Autoregressive)两种生成方式的基本原理与区别,并详细分析了编码器与解码器之间通过交叉注意力(Cross Attention)进行信息传递的机制。此外,课程还讲解了Transformer模型的训练方法,包括教学强制(Teacher Forcing)、复制机制(Copy Mechanism)、引导式注意力(Guided Attention)和束搜索(Beam Search)等实用技巧。这些内容为进一步理解与实现基于Transformer的序列生成任务(如语音识别、文本生成等)奠定了理论基础。
Abstract
This week's lesson delves into the decoder structure of the Transformer model and its generation strategies. The lecture focuses on the fundamental principles and differences between autoregressive (AR) and non-autoregressive (NAR) generation methods, and provides a detailed analysis of the information exchange mechanism between the encoder and decoder via cross-attention. Additionally, the training methods of the Transformer model are explained, including teacher forcing, copy mechanism, guided attention, and beam search. These elements establish a theoretical foundation for understanding and implementing sequence generation tasks based on Transformer, such as speech recognition and text generation.
一.解码器(Decoder)
1.自回归(Autoregressive)
上周学习并了解了Seq2Seq和Transformer模型中的编码器(Encoder),本周就开始了解转换器模型中的解码器。
但是对于解码器是有两种,我们主要了解常见的自回归(Autoregressive,AT)。对于自回归是如何运行的,下面以语音辨识为例来进行理解。
对于语音辨识,其就是输入一段语音然后输出一段文字,其中将音频输入到编码器中,然后编码器输出一组向量,接着将向量输入到解码器中,然后解码器再接着接受一个表示开始的特殊符号,之后解码器就会输出一个向量,这个向量的长度与转译成文字的词汇量一样,在向量中每一个维度对应一个文字,哪个维度的数值最高,向量就代表这个字。

然后在把第一个向量得到的字作为第二个输入,输入到解码器中从而得到第二个输出的字,由此反复便得到语音辨识的输出。

最低0.47元/天 解锁文章
2531

被折叠的 条评论
为什么被折叠?



