R53 · 其他现代部件,按位置形成阅读地图
归一化位置已经完整走过问题、改动与证据。其他现代部件先放回熟悉的算子位置,建立进一步阅读的入口。
状态 b0
按算子位置辨认RMSNorm、RoPE、SwiGLU与MoE;每项改变的是现有通路中的一个部分。
RoPE改变匹配中的位置关系,不替代mask给出的合法可见范围。
状态 b1
同图新增阅读问题:先定位改动与动机,再去原设置查代价和证据。名称本身不足以确定收益或实验指标。
公式与算例详情
在已知 block 上定位改动
R49 已比较归一化的位置;这里进一步区分各部件改变的对象。RMSNorm 省去均值中心化,SwiGLU 通过门控激活改造逐位置前馈层,RoPE 旋转 Q/K 的分量对,使相对位置进入匹配,MoE 则把部分前馈计算路由给专家。这些选择不是所有现代模型共同遵循的一张清单。
对象与代价不能只靠名字判断
QK normalization 原论文采用逐头 L2 归一化与可学习缩放,处理的是匹配分数的尺度,不能直接等同于任意 RMSNorm(Q/K) 实现,更不是对词表概率归一化。RoPE 处理位置关系,不能替代因果 mask。MoE 的活跃计算、总参数存储和路由/通信成本应分别计算;一次激活少量专家并不表示全部成本同时下降。
学生讲义第六章 §6.15 按各原论文保留目标、代价与证据。选择变体时,应从当前模型的具体问题出发,说明改变哪个计算环节,再用同一任务与资源口径验证。
参考与采用
- On Layer Normalization in the Transformer Architecture:Pre-LN moves normalization inside the residual branch; paper analyzes initialization gradients and warm-up behavior. 复核位置:Primary abstract read.
- Root Mean Square Layer Normalization:RMSNorm drops recentering and rescales by root mean square, followed by learned scale: y_i=gamma_i*x_i/sqrt(eps+mean_j x_j^2). 复核位置:Primary abstract read; source-slide formula inspected at full size and checked mathematically.
- GLU Variants Improve Transformer:SwiGLU FFN=(SiLU(XW_g) elementwise-multiplied by XW_u)W_d for beta=1; three matrices. A 2/3 hidden width relative to ordinary two-matrix FFN approximately matches parameter count. 复核位置:Full formula sections read: equations 5–6 and parameter/compute matching discussion.
- RoFormer: Enhanced Transformer with Rotary Position Embedding:Apply position-dependent rotations to Q/K so their inner product depends on relative position: (R_i q)^T(R_j k)=q^T R_(j-i) k. 复核位置:Primary abstract read; Q/K relative-rotation identity checked mathematically.
- Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer:Learned sparse gating activates selected feed-forward experts for each example/token, increasing parameter capacity with limited active expert computation. 复核位置:Primary abstract read.
- Query-Key Normalization for Transformers:Historical QKNorm L2-normalizes Q and K along the head dimension and uses a learnable scale instead of dividing by sqrt(d_k). 复核位置:Primary abstract read.
原课页采用记录:M32 现代归一化与 FFN 变体。页码均按PDF物理页计。
继续学习
若某个现代部件的用途不清楚,读在已经认识的 block 上读懂现代部件中对应的 RMSNorm、QK normalization、SwiGLU、MoE 或 RoPE 小节,与部件位置与成本边界对照。CLS 02同题段落解释选择理由,LAB 03 F 只能先核对前向路径;要决定投入,结合两种时间尺度的路线判断与受约束的实验设计先指定瓶颈、控制条件及质量/资源指标。