<meta charset="utf-8" /><meta http-equiv="content-security-policy" content=""><meta name="hf:doc:metadata" content="{&quot;local&quot;:&quot;&quot;,&quot;title&quot;:&quot;“解码器”模型&quot;}" data-svelte="svelte-1phssyn">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/assets/pages/__layout.svelte-048423b6.css">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/start-8ddee7b8.js">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/chunks/vendor-bb19ac22.js">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/chunks/paths-4b3c6e7e.js">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/pages/__layout.svelte-18b13d10.js">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/pages/chapter1/6.mdx-91b0c718.js">
	<link rel="modulepreload" href="/docs/course/pr_92/zh-CN/_app/chunks/Youtube-f2abbd90.js"> 





<h1 id="">“解码器”模型</h1>
<iframe class="w-full xl:w-4/6 h-80" src="https://www.youtube-nocookie.com/embed/d_ixlCubqQw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p>“解码器”模型通常指仅使用解码器的Transformer模型。在每个阶段，对于给定的单词，注意力层只能获取到句子中位于将要预测单词前面的单词。这些模型通常被称为自回归模型。</p>
<p>“解码器”模型的预训练通常围绕预测句子中的下一个单词进行。</p>
<p>这些模型最适合于涉及文本生成的任务。</p>
<p>该系列模型的典型代表有：</p>
<ul><li><a href="https://huggingface.co/transformers/model_doc/ctrl.html" rel="nofollow">CTRL</a></li>
<li><a href="https://huggingface.co/transformers/model_doc/gpt.html" rel="nofollow">GPT</a></li>
<li><a href="https://huggingface.co/transformers/model_doc/gpt2.html" rel="nofollow">GPT-2</a></li>
<li><a href="https://huggingface.co/transformers/model_doc/transformerxl.html" rel="nofollow">Transformer XL</a></li></ul>


		<script type="module" data-hydrate="7m2t15">
		import { start } from "/docs/course/pr_92/zh-CN/_app/start-8ddee7b8.js";
		start({
			target: document.querySelector('[data-hydrate="7m2t15"]').parentNode,
			paths: {"base":"/docs/course/pr_92/zh-CN","assets":"/docs/course/pr_92/zh-CN"},
			session: {},
			route: false,
			spa: false,
			trailing_slash: "never",
			hydrate: {
				status: 200,
				error: null,
				nodes: [
					import("/docs/course/pr_92/zh-CN/_app/pages/__layout.svelte-18b13d10.js"),
						import("/docs/course/pr_92/zh-CN/_app/pages/chapter1/6.mdx-91b0c718.js")
				],
				params: {}
			}
		});
	</script>
