按年被提到
20202023 · 2 次2026
大模型与语言模型›模型表达力与计算理论·arXiv:2002.05202 · cs.LG

GLU Variants Improve Transformer

GLU 变体改进 Transformer
Noam Shazeer · 2020

用GLU门控变体替换Transformer前馈层的激活函数

开始阅读 ↗PDFalphaXiv 讨论
被提及 · 5 人首次 2023-08-09 · 最近 2026-06-21
5不同的人
4活跃月份
5讨论串
775被引(OpenAlex)

论文在 Transformer 的前馈子层中测试了 Gated Linear Units 的多种变体,即把 sigmoid 换成其他非线性(甚至线性)函数。结果发现其中一些变体比常用的 ReLU 或 GELU 带来质量提升。作者没有解释这些结构为何有效。

HN 为什么提它

HN 上的人引用它作为 SwiGLU 等门控激活的出处,还常引用其结尾那句把成功归于“神的恩赐”的名言,说明深度学习架构研究的经验性。

方法难度 3 / 5约 10 分钟经得起时间
读之前最好知道
1Transformer 前馈网络(feed-forward network)
2激活函数(ReLU、GELU、sigmoid)
3门控线性单元(GLU)

学习路径

读这篇之前,按顺序读书架上的 3 篇 · 参考文献来自 OpenAlex,顺序和要点由 Claude Code 排出

这条路径帮你理解 Transformer 前馈层的设定、激活函数的搜索与比较,以及本文所依托的 T5 实验设置。

  1. 1
    Attention Is All You Need注意力就是你所需要的一切 · 2017

    GLU 变体替换的正是 Transformer 的前馈子层。

    读位置前馈网络(FFN)的结构,两个线性层加一个激活函数。

  2. 2
    Searching for Activation Functions搜索激活函数 · 2017

    提出 Swish 激活函数,是本文要比较的一类现代激活函数。

    读Swish 的定义与它在深层模型上相对 ReLU 的表现。

  3. 3
    Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer探索迁移学习的极限:统一的文本到文本 Transformer · 2019

    本文的实验沿用 T5 的预训练与微调设置。

    读T5 的模型配置、预训练目标与下游评测任务。

  4. 4
    GLU Variants Improve TransformerGLU 变体改进 Transformer · 2020 · 就是这篇

    目标论文:用 GLU 门控变体替换 Transformer 前馈层的激活,部分变体优于 ReLU 和 GELU。

    读各变体的公式(如 GEGLU、SwiGLU)以及对比结果。

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
引用GistNoesis · 2023-08

“in the reference paper the feed forward network set beta as a constant”

指出参考论文的前馈网络里 beta 取常数
Llama from Scratch (or how to implement a paper without crying)原评论 ↗
引用lossolo · 2023-11

“We offer no explanation as to why these architectures seem to work; we attribute their success, as with all else, to divine benevolence.”

引用其坦言无法解释这些架构为何有效
Simplifying Transformer Blocks原评论 ↗
引用LarsDu88 · 2024-09

“Recent pre-print from Intel Habana labs regarding training instability they encountered when training a Llama model at FP8, traced to the use of the SwiGLU”

指出 SwiGLU 出自该文,它被认为是 FP8 训练不稳定的原因
SwiGLU activation function causes instability in FP8 LLM training原评论 ↗
引用conditionnumber · 2026-06

“Here's a lovely quote from an influential paper”

引用这篇有影响力论文的妙语:架构成功归功于神明眷顾
Don't trust large context windows原评论 ↗
引用HarHarVeryFunny · 2026-06

“There's a famous quote from Noam Shazeer:”

引用 Noam Shazeer 的名言,调侃该领域靠经验试错
Anthropic to Require ID Verification for Certain Capabilities Starting July 8原评论 ↗