R52.md · 可读全文

这里保留原文的中文、公式标记、代码和链接。可直接交给 Agent 读取,也可选取下方原文复制。此入口返回 HTML;原始 .md / .py 文件仍保留,完整候选包同时包含 UTF-8 原件。

# R52 · 任务不同,保留的可见范围也不同

将模型迁到图像之前,先要选输出目标和合法信息来源。用已完成的翻译母图辨认哪些部分可以拆用,避免把架构名字当成任务答案。

<span id="r52-b0"></span>

## 状态 b0

在同一母图上辨认源全可见、目标因果读取和cross条件读取,先回答当前行能看谁。

<span id="r52-b1"></span>

## 状态 b1

三类家族分别保留不同组件。decoder-only去掉独立源侧时,也去掉原来读取它的cross。

<span id="r52-b2"></span>

## 状态 b2

把目标、可见范围、条件来源拆成三项选择;同一预测目标可由不同骨干实现,不能由家族名直接推出全部能力。

## 公式与算例详情

### 从信息来源区分结构与目标

Encoder-only在输入内做双向self-attention,适合完整输入上的表示、分类或标注;BERT预训练的masked language modeling利用被遮盖位置的上下文。Decoder-only使用因果self-attention,以前缀预测下一token,是GPT式自回归生成的常见形式。Encoder–decoder让编码器双向处理源输入,解码器因果处理目标前缀,再用cross-attention读取源侧表示;T5以文本到文本形式组织多种任务。

这些是结构与常见目标的搭配,不是任务能力的绝对边界。不要把BERT的掩码预测与GPT式next-token目标混成同一训练信号;也不要把encoder–decoder中的cross-attention画成目标端未来信息可见。

### 参考与采用

- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/html/1810.04805v2):Bidirectional Transformer encoder; reconstruct selected masked input tokens, plus the original NSP pretraining task. 复核位置:Abstract, introduction, Model Architecture and masked-language-model description read.
- [Language Models are Unsupervised Multitask Learners](https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf):Autoregressive Transformer language modeling; GPT-2 moves layer norm to each sub-block input and adds a final layer norm. 复核位置:Section 2 language-model factorization and section 2.3 model read from official PDF.
- [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/html/1910.10683v4):Encoder-decoder text-to-text framework: full source visibility, causal decoder and cross-attention; span-denoising uses sentinel tokens and predicts removed spans. 复核位置:Sections 2.1/3.2 architecture and Figure 4 caption; section 3.3.4 span corruption and Table 3 examples read.

原课页采用记录:[M29 从 block 到 LM 训练](sources.html#M29)。页码均按PDF物理页计。

### 继续学习

要从目标而非名字区分模型,读[同一段文本,三种预训练问题](https://codingai-lec05.pages.dev/course/knowledge/model-objectives.html),分别写 BERT 选中位置、GPT 合法前缀和 T5 删除跨度的输入/目标。[CLS 02](https://deepnote.com/workspace/ise3309jingao-5ba66b0a-4283-4f5a-ae06-3f68d3201e99/project/Fall-26-Lecture-05-841ec8e7-e352-4840-b628-d3742b03d6d0/notebook/CLS-02-Attention-Transformer-2d44adcb6f3d409aa7dfb25c21a748a3?utm_content=2d44adcb6f3d409aa7dfb25c21a748a3&utm_source=openai&utm_medium=mcp&utm_campaign=openaimcp&utm_term=get_notebook)同题段落保存三种目标的完整说明;用[三类信息流](lecture.html#read-R52)核对可见范围,再在[LAB 03](https://deepnote.com/workspace/ise3309jingao-5ba66b0a-4283-4f5a-ae06-3f68d3201e99/project/Fall-26-Lecture-05-841ec8e7-e352-4840-b628-d3742b03d6d0/notebook/LAB-03-Transformer-9c5b3d45acdb438a8e7df1dc6cb97e40?utm_content=9c5b3d45acdb438a8e7df1dc6cb97e40&utm_source=openai&utm_medium=mcp&utm_campaign=openaimcp&utm_term=get_notebook) F 中对应 encoder 与 causal 局部计算。局部算子相似不表示三种监督目标相同。