Files
myWiki/concepts/gumbel-softmax.md

51 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Gumbel-Softmax 重参数化"
created: 2026-06-17
updated: 2026-06-17
type: concept
tags: [reinforcement-learning, technique, gradient-estimation]
sources: [raw/papers/zhang-tarpo-2026.md]
confidence: high
---
# Gumbel-Softmax 重参数化
Gumbel-Softmax 是一种**将离散采样转化为可微操作**的重参数化技巧,在 [[latent-reasoning|潜在推理]] RL 中用于为连续表征引入可微的随机性。
## 原理
标准 categorical 采样 `v ~ Categorical(logits)` 是不可微的argmax 操作。Gumbel-Softmax 通过 Gumbel 噪声和温度参数构造一个连续松弛:
```
y_i = exp((log pi_i + g_i) / tau) / sum_j exp((log pi_j + g_j) / tau)
```
其中 `g_i ~ Gumbel(0, 1)``tau` 是温度参数。
`tau → 0` 时,`y` 趋近于 one-hot真正的离散采样`tau > 0` 时,`y` 是可微的连续向量。
## 在潜在推理中的应用
在潜在推理 RL 的 [[reparameterization-exploration|重参数化探索]] 路线中Gumbel-Softmax 用于:
1. **Soft token 构造**:从 logits 分布中采样近似的概率加权 embedding
2. **梯度估计**:允许 RL 梯度信号通过 soft token 回传
3. **探索引入**Gumbel 噪声在连续表征中引入了可控随机性
## 与 TARPO 的对比
| 维度 | Gumbel-Softmax 路线 | [[tarpo|TARPO]] 路线 |
|------|---------------------|---------------------|
| 随机性类型 | 表征级(向量内部) | 结构级(模式间切换) |
| 可微性 | 可微(重参数化) | 不可微REINFORCE |
| 引入位置 | 每个 soft token 内部 | 每个 token 步的模式选择 |
TARPO 论文指出两者的结合(路由探索 + 重参数化 soft token是有前景的未来方向。
## 参考
- [[reparameterization-exploration|重参数化探索]]
- [[soft-token]]
- [[latent-reasoning|潜在推理]]
- [[tarpo|TARPO]]