mally的技术笔记mally的技术笔记
AIGC相关
关于作者
AIGC相关
关于作者
  • AIGC相关
  • 长文

    • 长文
    • MoE 梳理
    • Tokenization 分词
    • VERL 框架看 GRPO 过程
  • 细碎大模型知识

    • 细碎大模型知识
    • clip-higher 为什么有效
    • F1 分数是什么
    • 温度 temperature 是什么
    • 分词和嵌入的关系
    • SwiGLU 激活函数
    • 拒绝采样微调是什么
    • 策略熵和交叉熵
    • GRPO 流程
    • DPO 公式推导
  • 论文阅读

    • 论文阅读
    • Demons in the Detail: On Implementing Load Balancing Loss for Training Specialized Mixture-of-Expert
    • Scaling Relationship on Learning Mathematical Reasoning with Large Language Models
    • switch transfomer 论文
    • RAGEN: Understanding Self-Evolution in LLM Agents via Multi-Turn Reinforcement Learning
    • Mixture of Experts Explained
    • Demons in the Detail: On Implementing Load Balancing Loss for Training Specialized Mixture-of-Expert

      • Demons in the Detail: On Implementing Load Balancing Loss for Training Specialized Mixture-of-Expert
      • 背景知识

SwiGLU 激活函数

6.16

SwiGLU 激活函数长什么样?

Swish-Gated Linear Unit(SwiGLU)的表达式如下:

SwiGLU(x)=A⋅B⋅σ(βB)

其中 A 和 B 是线性变换后的结果,β 是可学习参数。

  • A=WA⋅x+bA
  • B=WB⋅x+bB
  • σ(z)=11+e−z

或者,可以写成另外一种形式:SwiGLU(x)=A⋅Swish(B)

其中Swishβ(z)=z⋅σ(βz)

Swish 函数长什么样?

Swish 比 ReLU 激活函数更好,因为它在 0 附近提供了更平滑的转换。

Swish 激活函数在参数 β 不同取值下的形状:

Prev
分词和嵌入的关系
Next
拒绝采样微调是什么