Files
myWiki/concepts/temperature-sampling.md

42 lines
1.5 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: "温度采样Temperature Sampling"
created: 2026-06-21
updated: 2026-06-21
type: concept
tags:
- sampling
- decoding
- diversity
- spiral-of-silence
sources:
- data派THU 2026
---
# 温度采样Temperature Sampling
LLM 解码阶段的关键参数,通过调整 softmax 分布的锐度来控制输出的随机性。温度 T 越高,输出分布越平滑,低概率 token 被选中的概率越大。
## 在沉默螺旋治理中的应用
温度采样是打破 AI 沉默螺旋的**技术层治理手段**之一:
- **低温度T < 1.0**输出高度确定总是选择高概率 token **放大沉默螺旋**
- **高温度T > 1.0**:输出更随机,小众 token 更可能被选中 → **缓解沉默螺旋**
- **top-p / top-k 联合采样**:在保留多样性的同时避免输出质量失控
## 权衡
高温度采样的代价是可能引入更多噪声、降低输出质量。需要在**多样性 vs 质量**之间寻找平衡点。这是 [[rlhf-alignment-amplification|RLHF 对齐放大]] 问题的镜像——RLHF 压低熵增加安全性但降低多样性,温度采样抬高熵增加多样性但可能降低质量。
## 治理建议
- 对小模型适配更高温度(因其统计偏好更强)
- 结合 top-p 截断防止极端噪声
- 多候选择优时加入多样性奖励机制
## 参考
- [[content-diversity-decay|内容多样性衰减]]
- [[pretraining-statistical-bias|预训练统计偏好]]
- [[llm-spiral-of-silence-2026|LLM 沉默螺旋]]