GPT原理

核心基于Transformer 架构

英文原文

​ Transformers are based on theattention mechanism,” which allows the model to pay more attention to some inputs than others, regardless of where they show up in the input sequence. For example, let’s consider the following sentence:
在这里插入图片描述

​ In this scenario, when the model is predicting the verbbought,” it needs to match the past tense of the verb “went.” In order to do that, it has to pay a lot of attention to the token “went.” In fact, it may pay more attention to the token “went” than to the tokenand,” despite the fact that “went” appears much earlier in the input sequence.

​ 它允许模型处理输入序列能够同时关注输入列中各个位置的信息,从而更好捕捉距离依赖关系

​ Transformer架构通常由编码器encoder)和解码器decoder)组成,其中编码器用于将输入序列映射为一系列隐藏表示,解码器则利用这些隐藏表示生成输出序列每个编码器解码器由多个相同的层(layer堆叠而成,每个层都包含注意力子层前馈神经网络子层。

​ 在自注意力子层中,输入列中的每个元素可以与其他元素进行交互通过学习注意力权重确定不同位置之间关联程度。这种机制使得模型能够更好处理距离依赖关系,从而在翻译摘要生成等任务中取得了很好的效果

​ 除了自注意力机制外,Transformer架构使用残差连接residual connections)和层归一化(layer normalization)等技术来加速训练过程提高模型性能。此外,Transformer架构支持并行计算,使得模型能够更高效地处理大规模数据

原文链接建议多读读:How GPT Models Work. Learn the core concepts behind OpenAI’s… | by Beatriz Stollnitz | Towards Data Science

原文地址:https://blog.csdn.net/weixin_46190208/article/details/134752623

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_39818.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注