每日基础课

← 返回日报
基础知识 第一则

Softmax 与温度系数:今天真正弄懂

先记住

先记住:一句话定义 + 一句记忆口诀

通俗讲解

一句话定义:Softmax 把一组“原始分数”变成一组“加起来等于 1 的概率”;温度系数控制这组概率是“更尖锐”还是“更平滑”。

记忆口诀:Softmax 管归一,温度管脾气;温度低更自信,温度高更犹豫。

生活类比:

你在看三个说话人谁最像当前这段音频。

模型给了三个分数:

  • 说话人 A:3.0
  • 说话人 B:1.0
  • 说话人 C:0.5

这些分数本身不好直接读。

3.0 不是“3 倍概率”。

1.0 也不是“100%”。

它们只是模型的“偏好分”。

Softmax 就像一个裁判。

它把这些偏好分变成概率:

  • A:最可能
  • B:次可能
  • C:较不可能

而且三者加起来正好是 1。

温度系数像“裁判的性格”。

温度低:裁判很果断。最高分会被放大,概率更集中。

温度高:裁判更谨慎。大家概率更接近。

必要公式:

普通 Softmax:

\[ p_i = \frac{e^{z_i}}{\sum_j e^{z_j}} \]

带温度系数的 Softmax:

\[ p_i = \frac{e^{z_i / T}}{\sum_j e^{z_j / T}} \]

逐个解释符号:

  • \(z_i\):第 \(i\) 个类别的原始分数。也叫 logit。
  • \(p_i\):第 \(i\) 个类别最后得到的概率。
  • \(e\):自然指数函数。它会把分数变成正数,并放大分数差距。
  • \(\sum_j\):对所有类别求和。
  • \(T\):temperature,温度系数。必须大于 0。
  • \(i\):当前看的那个类别。
  • \(j\):遍历所有类别。

举个小例子:

logits 是:

\[ [3.0, 1.0, 0.5] \]

Softmax 后可能类似:

\[ [0.82, 0.11, 0.07] \]

意思是:

模型认为第一个类别概率最大。

注意:

这不是“真实世界一定 82%”。

这是“模型根据当前参数给出的相对置信度”。

温度怎么影响?

同样的 logits:

\[ [3.0, 1.0, 0.5] \]

如果 \(T = 0.5\):

先变成:

\[ [6.0, 2.0, 1.0] \]

差距变大。

Softmax 后更尖锐。

最高类别概率更高。

如果 \(T = 2.0\):

先变成:

\[ [1.5, 0.5, 0.25] \]

差距变小。

Softmax 后更平滑。

几个类别概率更接近。

它解决什么问题:

第一,解决“分数不能直接当概率”的问题。

神经网络最后一层常输出 logits。

比如音频分类:

  • 狗叫:2.1
  • 音乐:0.8
  • 说话:4.6

这些值可能是负数,也不加和为 1。

Softmax 把它们转成概率分布。

第二,解决“多类别只能选一个”的训练问题。

很多任务是单标签分类:

  • 这帧音频属于哪个音素?
  • 这张图属于哪个类别?
  • 当前语音段最像哪个说话人?
  • 当前视频片段属于哪个动作?

Softmax 给每个类别一个概率。

再配合交叉熵损失,让正确类别概率变大。

第三,解决“模型输出需要可比较”的问题。

不同类别的 logit 不好直接解释。

Softmax 后,可以说:

“模型在这些候选里更偏向谁”。

没有 Softmax 会怎样:

  • 输出可能是负数。
  • 输出不加和为 1。
  • 很难解释成概率。
  • 多类别分类训练不方便。
  • 推理时只能看最大 logit,但不知道相对差距。
  • 做阈值判断、置信度过滤、后处理会更难。

不过也要注意:

训练时在 PyTorch 里,常用 `CrossEntropyLoss`。

它内部已经包含了 `LogSoftmax + NLLLoss`。

所以训练分类模型时,不要在 `CrossEntropyLoss` 前手动加 Softmax。

否则容易训练变差。

资料怎么学:

  • Dive into Deep Learning 的 Softmax 部分,适合从概率直觉、线性分类到实现一步步学。
  • PyTorch Softmax 文档,适合确认 `dim` 参数怎么写,以及 API 行为。
先想再展开答案
Softmax 输入的原始分数通常叫什么?
logits
PyTorch 中 logits 形状是 [batch, classes] 时,Softmax 通常沿哪个维度做?
dim=1
温度 T 变大时,Softmax 输出会怎样?
更平滑,各类别概率更接近
发展脉络 · 现状 · 未来

发展流程:

第一阶段:直接用分数。

早期或最简单的分类想法是:

哪个类别分数最大,就选哪个。

比如:

\[ [3.0, 1.0, 0.5] \]

直接选第一个。

这能做决策。

但问题是:

分数不是概率。

分数尺度也不稳定。

一个模型输出 10,另一个模型输出 100,不能直接比较。

第二阶段:需要概率。

很多任务不只要“选谁”。

还要知道“有多确定”。

比如说话人日志 diarization:

系统可能要判断:

  • 这段是不是同一个说话人?
  • 是否需要新建说话人?
  • 当前段属于哪个聚类?
  • 这个预测能不能信?

这时概率比原始分数更好用。

Softmax 就出现了。

它把任意实数分数变成概率分布。

第三阶段:和交叉熵结合。

现代分类模型常这样训练:

输入 → 编码器 → 分类头 → logits → 交叉熵损失。

交叉熵会鼓励正确类别的概率变大。

在数学实现上,常把 Softmax 和 log 结合起来算。

因为这样更稳定。

PyTorch 的 `CrossEntropyLoss` 就是典型做法。

第四阶段:温度系数加入。

后来大家发现:

模型的概率有时不准。

比如模型说 0.95,但实际只对了 0.75。

这叫置信度不校准。

温度系数可以调节概率分布形状。

常见用途:

  • 训练后概率校准。
  • 蒸馏学习中让 teacher 的分布更柔和。
  • 生成模型采样时控制随机性。
  • 对比学习中控制相似度分布的尖锐程度。

现在怎么用:

在主流模型里,Softmax 很常见。

  • 分类头里。

比如音频事件分类:

音频 → CNN/Transformer 编码器 → 线性层 → logits → Softmax 概率。

  • 注意力机制里。

Transformer 里有 attention。

它会算 query 和 key 的相似度分数。

然后用 Softmax 变成注意力权重。

这些权重加起来等于 1。

再对 value 加权求和。

所以 Softmax 不只用于分类。

也用于“分配注意力”。

  • 说话人识别里。

训练说话人分类器时:

语音片段 → speaker embedding → 分类层 → 每个训练说话人的 logits → 交叉熵。

这里通常训练时用 `CrossEntropyLoss`。

推理时可能不再用这个分类头,而是拿 embedding 做相似度比较。

  • 说话人日志中。

说话人日志经常不是简单 Softmax 一步完成。

但 Softmax 会出现在很多子模块里:

  • 语音活动检测:speech / non-speech 分类。
  • 重叠语音检测:overlap / non-overlap 分类。
  • 说话人变化检测:change / no-change 分类。
  • 神经聚类或端到端 diarization 的帧级说话人概率。
  • Transformer 模块内部的 attention 权重。
  • 音视频理解中。

Softmax 可用于:

  • 视频动作分类。
  • 音频事件分类。
  • 音视频同步判断。
  • 多模态融合时的权重分配。
  • attention 模块中的归一化。

与相近概念的区别:

  • Softmax vs Sigmoid。

Sigmoid:

\[ \sigma(z)=\frac{1}{1+e^{-z}} \]

它把一个数压到 0 到 1。

常用于二分类或多标签分类。

多标签的意思是:

一个样本可以同时属于多个类别。

比如一段音频里可以同时有:

  • 说话声
  • 音乐
  • 背景噪声

这时每个标签独立判断。

用 Sigmoid 更合适。

Softmax:

一组类别之间互相竞争。

概率总和为 1。

适合单标签多分类。

比如一段音频只选一个主类别。

  • Softmax vs Argmax。

Argmax 只选最大的位置。

比如:

\[ [0.7, 0.2, 0.1] \]

Argmax 输出第 1 类。

它不给完整概率。

也不可导。

训练神经网络时,通常不能直接用 Argmax 做损失。

Softmax 给完整概率分布。

可以参与梯度计算。

  • Softmax vs LogSoftmax。

Softmax 输出概率。

LogSoftmax 输出概率的对数。

\[ \log(p_i) \]

训练时常用 LogSoftmax,因为数值更稳定。

PyTorch 的 `CrossEntropyLoss` 内部就用到了这个思路。

  • Softmax vs 归一化。

普通归一化可能是:

把一组数除以总和。

但如果有负数,会出问题。

Softmax 先用指数变正数,再归一。

而且指数会强调高分。

  • 温度系数 vs 学习率。

温度控制输出分布形状。

学习率控制参数更新步子大小。

两者不是一回事。

温度不直接决定模型学多快。

当前局限:

事实部分:

  • Softmax 概率不一定等于真实概率。

模型输出 0.9,不代表现实中一定有 90% 的频率正确。

它可能过度自信。

  • Softmax 会强制类别竞争。

如果任务本来是多标签,Softmax 不合适。

比如音频里同时有说话和音乐。

用 Softmax 会逼模型二选一。

  • Softmax 对大 logit 差距很敏感。

最高分稍微大一些,概率可能就很集中。

这会让模型看起来很自信。

  • 类别很多时,Softmax 计算成本更高。

因为要对所有类别求指数和求和。

大词表语言模型尤其明显。

  • 维度容易写错。

在 PyTorch 里,`dim` 很关键。

如果 logits 形状是 `[batch, classes]`,通常用 `dim=1`。

如果写成 `dim=0`,就会在 batch 维度上归一化,含义错了。

未来可能作用:

事实部分:

温度系数现在已经常用于:

  • 概率校准。
  • 知识蒸馏。
  • 生成模型采样。
  • 对比学习。
  • 注意力分布控制。

推测部分:

未来在音视频和说话人日志里,温度可能更多用于动态置信度控制。

比如:

噪声大时,提高温度,让模型别太自信。

语音清晰时,降低温度,让决策更果断。

这属于合理推测,不是所有系统都已经这样做。

推测部分:

多模态系统可能会按模态质量调温度。

比如视频模糊时,降低视频分支权重;音频清晰时,提高音频分支影响。

但具体做法依赖模型设计。

不能说这是统一标准。

最后再压缩一遍:

Softmax 做三件事:

  • 指数化:把分数变正,并拉开差距。
  • 求总和:算总票数。
  • 除总和:变成概率。

温度做一件事:

  • 调分布尖锐程度。

温度小于 1:

  • 更尖。
  • 更自信。
  • 更接近 argmax。

温度大于 1:

  • 更平。
  • 更保守。
  • 更接近平均分布。

温度趋近 0:

  • 几乎只选最大项。

温度趋向无穷大:

  • 各类别接近均匀概率。

口诀:

Softmax 把分数变概率;温度低,赢家通吃;温度高,大家都有戏。

自测
  • Softmax 的输出为什么一定加起来等于 1?
  • 如果一个音频片段可以同时有“说话声”和“音乐”,应该用 Softmax 还是 Sigmoid?为什么?
  • 温度系数从 1 改成 0.5,概率分布会更尖锐还是更平滑?这对模型置信度有什么影响?
类比
Softmax 像把评委给选手的原始打分换算成“支持率”;温度像评委的性格,低温评委偏爱冠军,高温评委更愿意给其他人机会。
动手练习 第二则

Softmax 与温度系数:动手实现

练习目标

10-20分钟小练习目标、输入输出和验收标准

参考实现

小练习目标:

用 PyTorch 观察同一组 logits 在不同温度下的 Softmax 输出。

你会看到:

  • Softmax 输出是概率。
  • 每一行概率加起来等于 1。
  • 温度低,分布更尖锐。
  • 温度高,分布更平滑。
  • `dim` 写错会导致归一化方向错。

输入:

一批模拟 logits。

形状是:

[batch_size, num_classes] = [3, 4]

含义:

3 个样本。

每个样本有 4 个候选类别。

可以想象成:

3 段音频。

每段音频要在 4 个说话人候选中选一个。

输出:

程序会打印:

  • 原始 logits。
  • 不同温度下的 Softmax 概率。
  • 每一行概率之和。
  • 每个样本预测的类别。
  • 错误 `dim=0` 的示例。

验收标准:

你运行代码后应能确认:

  • `dim=1` 时,每个样本的类别概率和为 1。
  • `T=0.5` 比 `T=1.0` 更尖锐。
  • `T=2.0` 比 `T=1.0` 更平滑。
  • `argmax` 的类别通常不因正温度变化而改变。
  • `dim=0` 会让每一列加起来为 1,不符合“每个样本在类别上归一化”的需求。

思路:

  • 准备一个 logits 张量。
  • 写一个 `softmax_with_temperature` 函数。
  • 分别测试 `T=0.5、1.0、2.0、5.0`。
  • 打印概率、行和、预测类别。
  • 演示 `dim=0` 的常见错误。

完整可运行代码:

import torch
import torch.nn.functional as F

torch.set_printoptions(precision=4, sci_mode=False)


def softmax_with_temperature(logits, temperature=1.0, dim=1):
    """
    logits: 原始分数张量
    temperature: 温度系数,必须大于 0
    dim: 沿哪个维度做 Softmax
    """
    if temperature <= 0:
        raise ValueError("temperature 必须大于 0")
    return F.softmax(logits / temperature, dim=dim)


def print_result(logits, temperature):
    probs = softmax_with_temperature(logits, temperature=temperature, dim=1)
    row_sums = probs.sum(dim=1)
    pred_classes = probs.argmax(dim=1)

    print("=" * 70)
    print(f"Temperature T = {temperature}")
    print("Softmax probabilities:")
    print(probs)
    print("每个样本的概率和,也就是 probs.sum(dim=1):")
    print(row_sums)
    print("每个样本预测类别,也就是 probs.argmax(dim=1):")
    print(pred_classes)

    max_probs = probs.max(dim=1).values
    print("每个样本的最大概率,观察置信度变化:")
    print(max_probs)


def main():
    # 模拟 3 段音频,每段音频有 4 个候选类别/说话人
    # shape: [batch_size, num_classes] = [3, 4]
    logits = torch.tensor([
        [3.0, 1.0, 0.5, -1.0],   # 样本 0:类别 0 明显最高
        [1.2, 1.1, 1.0, 0.9],    # 样本 1:四个类别很接近
        [-0.5, 0.0, 2.0, 1.0],   # 样本 2:类别 2 最高
    ])

    print("原始 logits,shape =", logits.shape)
    print(logits)
    print()
    print("含义:3 个样本,每个样本 4 个类别分数。")
    print("正确做法:对类别维度做 Softmax,也就是 dim=1。")

    for temperature in [0.5, 1.0, 2.0, 5.0]:
        print_result(logits, temperature)

    print("=" * 70)
    print("演示常见错误:dim=0")
    wrong_probs = F.softmax(logits, dim=0)
    print("F.softmax(logits, dim=0) 的结果:")
    print(wrong_probs)

    print("wrong_probs.sum(dim=0),每一列加起来为 1:")
    print(wrong_probs.sum(dim=0))

    print("wrong_probs.sum(dim=1),每一行不一定加起来为 1:")
    print(wrong_probs.sum(dim=1))

    print()
    print("解释:")
    print("logits 的形状是 [batch, classes]。")
    print("我们希望每个样本内部的 4 个类别概率加起来为 1。")
    print("所以应该写 dim=1,而不是 dim=0。")

    print("=" * 70)
    print("训练时提醒:")
    print("如果使用 torch.nn.CrossEntropyLoss,输入应该是 logits,不要先手动 Softmax。")

    labels = torch.tensor([0, 1, 2])  # 三个样本的真实类别
    loss = F.cross_entropy(logits, labels)
    print("示例 labels:", labels)
    print("F.cross_entropy(logits, labels) =", loss.item())


if __name__ == "__main__":
    main()
代码拆解与真实用法

逐段解释代码:

第一段:

import torch
import torch.nn.functional as F

导入 PyTorch。

`F.softmax` 是函数式 API。

`F.cross_entropy` 是交叉熵函数。

第二段:

torch.set_printoptions(precision=4, sci_mode=False)

控制打印格式。

让输出更好读。

保留 4 位小数。

不用科学计数法。

第三段:

def softmax_with_temperature(logits, temperature=1.0, dim=1):
    if temperature <= 0:
        raise ValueError("temperature 必须大于 0")
    return F.softmax(logits / temperature, dim=dim)

这是带温度的 Softmax。

核心只有一行:

logits / temperature

然后再 Softmax。

温度必须大于 0。

如果温度是 0,会除以 0。

如果温度是负数,会改变类别顺序,含义不对。

第四段:

logits = torch.tensor([
    [3.0, 1.0, 0.5, -1.0],
    [1.2, 1.1, 1.0, 0.9],
    [-0.5, 0.0, 2.0, 1.0],
])

张量形状是:

[3, 4]

意思是:

  • 3 个样本。
  • 每个样本 4 个类别。

在说话人日志里,可以想象成:

  • 3 个语音片段。
  • 4 个候选说话人。

在音视频分类里,可以想象成:

  • 3 个片段。
  • 4 个事件类别。

第五段:

probs = softmax_with_temperature(logits, temperature=temperature, dim=1)

这里 `dim=1` 很关键。

因为类别维度是第 1 维。

也就是每一行内部做 Softmax。

每一行代表一个样本的类别概率分布。

第六段:

row_sums = probs.sum(dim=1)

检查每个样本的概率和。

正确情况下,应该接近:

tensor([1.0000, 1.0000, 1.0000])

因为浮点数误差,可能显示成非常接近 1。

第七段:

pred_classes = probs.argmax(dim=1)

取每个样本概率最大的类别。

这是推理时常见的分类决策。

Softmax 给概率。

Argmax 给最后选择。

第八段:

max_probs = probs.max(dim=1).values

看最大概率。

这可以观察模型置信度。

你会发现:

  • T=0.5 时,最大概率变大。
  • T=2.0 或 5.0 时,最大概率变小。

也就是:

低温更自信。

高温更保守。

第九段:

wrong_probs = F.softmax(logits, dim=0)

这是故意写错。

`dim=0` 表示沿 batch 维度归一化。

也就是:

同一个类别在不同样本之间加起来为 1。

这通常不是分类任务想要的。

分类任务一般希望:

每个样本内部,不同类别加起来为 1。

所以 `[batch, classes]` 常用 `dim=1`。

常见错误:

错误 1:把 `dim` 写错。

如果 logits 是 `[batch, classes]`,通常写:

F.softmax(logits, dim=1)

如果 logits 是 `[batch, time, classes]`,通常写:

F.softmax(logits, dim=-1)

`dim=-1` 表示最后一维。

这在序列模型里很常用。

错误 2:训练时先 Softmax 再 CrossEntropyLoss。

不要这样:

probs = F.softmax(logits, dim=1)
loss = F.cross_entropy(probs, labels)

通常应该这样:

loss = F.cross_entropy(logits, labels)

因为 `cross_entropy` 需要 logits。

它内部会做稳定版本的 LogSoftmax。

错误 3:以为 Softmax 概率一定可靠。

Softmax 输出 0.99,只表示模型很自信。

不保证模型真的有 99% 正确率。

真实系统中,还可能需要校准和验证集评估。

错误 4:多标签任务误用 Softmax。

如果一段音频同时有多个标签:

  • speech
  • music
  • noise

这时常用 Sigmoid。

因为每个标签可以独立为真。

Softmax 更适合互斥类别。

它在真实模型中的对应位置:

  • 音频事件分类:
waveform / log-mel
→ encoder
→ pooling
→ linear classifier
→ logits
→ softmax probabilities
  • 说话人分类训练:
speech segment
→ speaker encoder
→ speaker embedding
→ linear classifier over training speakers
→ logits
→ CrossEntropyLoss

训练时不需要手动 Softmax。

评估或可视化时可以 Softmax 看概率。

  • Transformer 注意力:
QK^T / sqrt(d)
→ attention logits
→ softmax
→ attention weights
→ weighted sum of V

这里 Softmax 不是分类概率。

而是注意力权重。

但数学形式一样:

把一组分数变成和为 1 的权重。

  • 音视频融合:

有些模型会对不同模态打分:

  • audio score
  • video score
  • text score

然后 Softmax 成融合权重。

表示当前更信任哪个模态。

这和“评委分配支持率”很像。

再练一步
  • 把 logits 改成 shape=[2, 3, 4],表示 2 个样本、3 个时间帧、4 个类别,然后用 dim=-1 做 Softmax。
  • 增加一个 temperature=0.1,观察输出是否几乎变成 one-hot,并解释原因。
类比
代码记忆法:`probs = softmax(logits / T, dim=类别维度)`,先调脾气,再分概率。

往期记录 163 条记录

2026年08月13日残差连接:今天真正弄懂foundationresidual connectiongradient flowResNet
2026年08月13日残差连接:动手实现practicePythonPyTorch残差连接
2026年08月12日LayerNorm 与 Pre-Norm:今天真正弄懂foundationLayerNormPre-Normresidual
2026年08月12日LayerNorm 与 Pre-Norm:动手实现practicePythonPyTorchLayerNorm 与 Pre-Norm
2026年08月11日信息粒缓存编排interviewPrefixDAGMinCostFlowSemanticHash
2026年08月11日表示一个折线图的最少线段数codeGeometryArrayMath
2026年08月11日RMSNorm:今天真正弄懂foundationRMSNormnormalizationLLaMA
2026年08月11日RMSNorm:动手实现practicePythonPyTorchRMSNorm
2026年08月10日长上下文块复用interviewPrefixCachingDynamicProgrammingIntervalScheduling
2026年08月10日到达终点数字codeMathParityGreedy
2026年08月10日多教师蒸馏调度interviewMinCostFlowDynamicProgrammingParetoFrontier
2026年08月10日定长子串中元音的最大数目codeStringSliding WindowTwo Pointers
2026年08月06日长窗注意力稳健化interviewNumericalStabilitySoftmaxPositionBias
2026年08月06日执行操作使数据元素之和大于等于 KcodeGreedyMathEnumeration
2026年08月05日必须拿起的最小连续卡牌数codehashmaparrayslidingwindow
2026年08月04日绝对差不超过限制的最长连续子数组codesliding windowmonotonic queuedeque
2026年08月03日证据路由与采样优化interviewRoutingSubmodularLatency
2026年08月01日查询引导长视频采样interviewSubmodularKnapsackTemporalCoverage
2026年08月01日边界元素是最大值的子数组数目codeStackArrayMonotonicStack
2026年07月30日受限内存推理调度interviewLLM-servingKV-cacheScheduling
2026年07月29日技能感知词元压缩interviewTokenCompressionMultimodalKnapsack
2026年07月27日递归验证预算分配interviewAStarBanditSubmodular
2026年07月26日推理早停预算分配interviewOptimalStoppingSequentialTestCalibration
2026年07月26日二叉树中所有距离为 K 的结点codeTreeBFSDFS
2026年07月25日流式同传轨迹调度interviewStreamingMonotonicAlignmentLatencyControl
2026年07月25日分割回文串codepalindromebacktrackingdynamicprogramming
2026年07月24日最大节点价值之和codeGreedyBitManipulationTree
2026年07月23日长音视频工具调度interviewTool RoutingDAG SchedulingSubmodular Maximization
2026年07月20日流式多模态记忆检索interviewStreaming MemoryMultimodal RetrievalTemporal Indexing
2026年07月20日T 秒后青蛙的位置codeTreeDFSProbability
2026年07月20日约束预算模型路由interviewModel RoutingConstrained OptimizationContextual Bandit
2026年07月20日匹配模式数组的子数组数目 IIcodeArrayKMPStringMatching
2026年07月20日受限显存解码调度interviewLLMCompilerKVCacheScheduling
2026年07月20日填充每个节点的下一个右侧节点指针 IIcodeTreeBFSLinkedList
2026年07月02日变分信息瓶颈Information BottleneckVariational BoundRate-Distortion
2026年07月01日CTC序列对齐算法CTCForward-Backward AlgorithmBlank Token
2026年07月01日故障流行病学Core DumpStatistical DebuggingFault Localization
2026年06月30日哈希嵌入压缩Hash EmbeddingFeature HashingEmbedding Compression
2026年06月29日一致性蒸馏Consistency ModelsProgressive DistillationODE Trajectory
2026年06月29日原生推理引擎Native RuntimeggmlInference Engine
2026年06月28日无分类器引导Classifier-Free GuidanceGuidance ScaleScore Interpolation
2026年06月25日MVDR波束成形MVDR BeamformingSpatial FilteringCovariance Estimation
2026年06月24日神经缩放定律Scaling LawsCompute-Optimal TrainingPower Law
2026年06月23日最小贝叶斯风险解码Minimum Bayes RiskDecision TheoryHypothesis Selection
2026年06月23日PID控制与生成调控PID ControllerFeedback ControlClosed-loop Generation
2026年06月22日生成模型评估度量Frechet Inception DistanceGenerative EvaluationFeature Statistics
2026年06月21日浮点量化收缩偏差FP4 TrainingShrinkage BiasLow-Precision Arithmetic
2026年06月21日模型上线仿真Deployment SimulationShadow TestingOffline Evaluation
2026年06月20日现代联想记忆Hopfield NetworkAssociative MemoryEnergy-Based Model
2026年06月19日离散扩散语言模型Discrete DiffusionAbsorbing StateConcrete Score
2026年06月18日循环变换器架构Looped TransformerWeight TyingAdaptive Computation
2026年06月17日韵律建模演进Prosody PredictionF0 ModelingDuration Prediction
2026年06月16日说话人日志Speaker DiarizationSpeaker EmbeddingEEND
2026年06月15日偏好对齐优化Preference OptimizationDPOReward Modeling
2026年06月14日多令牌并行预测Multi-Token PredictionSpeculative DecodingParallel Decoding
2026年06月13日流匹配生成模型Flow MatchingRectified FlowOptimal Transport Path
2026年06月13日实时管线延迟预算Latency BudgetPipeline OrchestrationTime-to-First-Token
2026年06月12日MoE路由机制Mixture of ExpertsSparse GatingRouter Design
2026年06月11日连续自回归生成Continuous AutoregressiveLatent PredictionAudioVAE
2026年06月10日KV缓存压缩KV Cache CompressionToken EvictionAttention Sparsity
2026年06月09日浏览器端模型推理WebGPUBrowser InferenceClient-side ML
2026年06月02日残差向量量化Residual Vector QuantizationAudio TokenizationNeural Codec
2026年05月31日彩色噪声扩散采样Colored NoiseSpectral BiasSDE Solver
2026年05月31日算子融合编译原理Kernel FusionOperator Fusiontorch.compile
2026年05月20日AI生成内容溯源 (7 chars) ✓Content ProvenanceC2PASynthID
2026年05月19日推理委托设计模式 (8 chars) ✓ Let me now write the full content for both topics. Actually, I realize I should double-check: is "Runtime Abstraction" or "Delegate Pattern" too close to any covered keyword? Looking at the list: Cluster Scheduling, Co-design, Collective Communication, Computational Expressiveness, CUTLASS... No, none of these overlap. OK, let me finalize and write everything out. Let me reconsider the engineering topic one more time. The title "推理委托设计模式" is good but maybe I should make it even more specific and interesting. What about focusing on the "graph partitioning" aspect - how ML runtimes decide which operations to delegate to which backend? This is a more specific and technically interesting angle. No, I think the broader "delegate pattern" is better because it covers the full picture and is more useful to the reader. Let me write it all out now. For the engineering topic, let me think about the history: - Early days: frameworks were monolithic (Caffe, early TensorFlow) - TensorRT (2017): NVIDIA's specialized inference engine, initially standalone - ONNX Runtime (2019): Microsoft introduced "Execution Providers" - the first major delegate-like abstraction - TFLite delegates (2018-2019): TensorFlow Lite introduced delegate API for GPU, NNAPI, etc. - ExecuTorch (2023-2024): PyTorch's answer to edge inference with a clean delegate API - 2025-2026: MLX delegate, Qualcomm AI Engine Direct delegate, etc. This is a rich history. Let me write it up. Actually, I want to make sure I have the dates right: - TensorRT was first released around 2016-2017 - ONNX was announced in 2017 - ONNX Runtime was open-sourced in 2018-2019 - TFLite was released in 2017, delegates came later - ExecuTorch was announced at PyTorch Conference 2023 OK, let me write everything now. I'll be thorough. One more thought: for the MATH section of the engineering topic, I could discuss the graph partitioning problem formally, or I could discuss the cost model for deciding whether to delegate. Let me think... The graph partitioning for delegation can be formalized as: - Given a computation graph $G = (V, E)$ where $V$ is the set of operations and $E$ is data dependencies - And a set of delegates $D = \{d_1, ..., d_m\}$ where each delegate supports a subset of operations $S_i \subseteq V$ - Find a partition $P = \{P_0, P_1, ..., P_m\}$ (where $P_0$ is the fallback/CPU partition) that minimizes total execution time - Subject to: each $
2026年05月17日连续批处理异步化
2026年05月10日连续潜在扩散语言模型Continuous Latent DiffusionNon-autoregressive LMDiffusion Language Model
2026年05月10日零样本跨语言语音克隆Zero-shot Voice CloningCross-lingual TTSIPA Phoneme Representation
2026年05月09日最优传输音频距离Optimal TransportFréchet Audio DistanceRiemannian Metric
2026年05月09日推荐系统推理核内广播优化Intra-kernel BroadcastEmbedding TableRecommendation Inference
2026年05月08日扩散Transformer异常值令牌Outlier TokensDiffusion TransformerAttention Sink
2026年05月08日WebRTC低延迟语音工程WebRTCReal-time AudioJitter Buffer
2026年05月07日音素级深度伪造检测原理Phoneme-level Deepfake DetectionSelf-supervised Speech EmbeddingEmotional Speech Synthesis
2026年05月07日AI训练网络协议工程哲学Multi-path Reliable ConnectionRDMA over EthernetCollective Communication
2026年05月05日对抗解纠缠说话人验证Speaker DisentanglementAdversarial TrainingCross-lingual Verification
2026年05月05日LLM推理为何用语言Chain-of-ThoughtLatent ReasoningToken Space
2026年05月01日跨架构知识蒸馏原理Cross-Architecture DistillationDiffusion LMAutoregressive Teacher
2026年05月01日AI评估计算瓶颈工程LLM Evaluation InfrastructureBenchmark SaturationEval Compute Bottleneck
2026年04月29日平衡传输语音增强Schrödinger BridgeStochastic Differential EquationSpeech Enhancement
2026年04月29日深度学习理论形成Deep Learning TheoryLoss LandscapeNeural Tangent Kernel
2026年04月28日语义进度函数原理Semantic Progress FunctionDiffusion TrajectoryNonlinear Denoising
2026年04月28日大模型OCR选型认知OCR BenchmarkModel Selection BiasCost-Performance Tradeoff
2026年04月27日说话人验证核心原理Speaker Verificationd-vectorECAPA-TDNN
2026年04月27日GPU核函数语言选型GPU Kernel EngineeringCuTe DSLCUTLASS
2026年04月26日时长控制TTS原理Duration ModelingProsody ControlAutoregressive TTS
2026年04月26日AI研究价值评估困境Research EvaluationPublication BiasPeer Review
2026年04月25日全双工对话建模原理Full-Duplex DialogueTurn-TakingVoice Activity Detection
2026年04月25日流式TTS文本规范化Text NormalizationStreaming TTSInverse Text Normalization
2026年04月24日离散扩散语言模型原理Discrete DiffusionMasked Diffusion Language ModelAbsorbing Diffusion
2026年04月24日跟进ML研究的认知工程Information OverloadResearch TriageSpaced Repetition
2026年04月23日一致性正则化ASR原理Consistency RegularizationUnified ASRTransducer
2026年04月23日流式TTS文本规范化工程Text NormalizationStreaming TTSInverse Text Normalization
2026年04月22日神经编码器伪影检测Neural Audio CodecArtifact DetectionForensic Residual
2026年04月22日AI研究复现危机工程Reproducibility CrisisML EngineeringExperimental Rigor
2026年04月21日扩散SNR偏差校正原理Signal-to-Noise RatioDiffusion Timestep BiasScore Matching
2026年04月21日论文复现危机根治工程Reproducibility CrisisAblation StudyExperimental Rigor
2026年04月20日音频时序定位原理Temporal GroundingAudio Event DetectionCross-modal Alignment
2026年04月20日论文复现危机根因Reproducibility CrisisBenchmark OverfittingEvaluation Validity
2026年04月19日流匹配对齐原理Flow Matching AlignmentReward Gradient BackpropagationTrajectory Optimization
2026年04月19日分布式训练任务编排Distributed Training OrchestrationCluster SchedulingFault Tolerance
2026年04月18日最优传输信号融合Optimal TransportWasserstein BarycenterTime-Frequency Resolution
2026年04月18日分布式训练任务调度Distributed Training OrchestrationJob SchedulingCluster Resource Management
2026年04月17日扩散语音识别原理Masked Diffusion Language ModelDiscrete DiffusionASR Decoding
2026年04月17日Mel尺度跨文化偏差Mel ScalePsychoacousticsCultural Bias
2026年04月16日音频水印对抗原理Audio WatermarkingSemi-FragilePsychoacoustic Masking
2026年04月16日推测解码草稿树工程Speculative DecodingDraft TreeBlock Diffusion
2026年04月15日对抗流模型原理Continuous Normalizing FlowAdversarial TrainingFlow Matching
2026年04月15日代理状态可观测性工程Agent ObservabilityDistributed TracingState Machine Debugging
2026年04月14日过程奖励模型原理Process Reward ModelStep-level SupervisionReasoning Chain
2026年04月13日离散令牌音源分离Discrete Token ModelingSource SeparationConditional Generation
2026年04月13日超算API工程哲学Distributed Training OrchestrationSupercomputer API DesignFault Tolerance
2026年04月12日信息瓶颈原理演进Information BottleneckVariational IBDisentanglement
2026年04月12日Safetensors格式工程哲学SafetensorsModel SerializationMemory-Mapped IO
2026年04月11日归一化层演进原理Layer NormalizationRMS NormalizationBatch Normalization
2026年04月11日GEMM自调优后端工程GEMM AutotuningTorchInductorCuteDSL
2026年04月10日多令牌预测原理Multi-Token PredictionSpeculative DecodingMedusa Heads
2026年04月10日ML从业者认知校准Calibration BiasCapability IllusionBenchmark Overfitting
2026年04月09日编码器-解码器LM原理Encoder-Decoder LMCross-Attention ConditioningSequence-to-Sequence
2026年04月09日torch.compile归一化优化torch.compileLayerNormRMSNorm
2026年04月08日KV缓存压缩原理KV Cache CompressionRoPE Position EncodingAttention Score Estimation
2026年04月08日音效基础模型工程Sound Effect GenerationFoundation ModelFoley Synthesis
2026年04月07日可验证奖励强化学习Verifiable RewardRLVRProcess Reward Model
2026年04月07日LLM技能退化认知机制Cognitive OffloadingSkill AtrophyDesirable Difficulty
2026年04月06日音素可解释说话人验证Phoneme-aware Speaker VerificationInterpretable BiometricsLocal Acoustic Evidence
2026年04月06日音频幻觉攻击评估Hallucination AttackAudio Language Model ReliabilityAdversarial Probing
2026年04月05日潜在空间推理原理Latent Space ReasoningContinuous RepresentationToken-Free Inference
2026年04月05日mRNA模型极低成本训练Biology Foundation ModelCross-Species TransferLow-Budget Training
2026年04月04日编码器-解码器TTS原理Encoder-Decoder TTSText ConditioningPositional Capacity
2026年04月04日大模型训练的MXFP8工程MXFP8MicroscalingMixed Precision Training
2026年04月03日在线知识蒸馏原理Online DistillationKnowledge TransferStudent-Teacher
2026年04月03日MoE专家并行调度工程Expert ParallelismMixture of ExpertsAll-to-All Communication
2026年04月02日波形潜空间扩散TTSwaveform latent diffusionnon-autoregressive TTSlatent space acoustic modeling
2026年04月02日波形隐空间扩散原理waveform latent spacediffusion TTSVAE audio codec
2026年04月02日LLM量化权重工程weight quantizationLLM compression4-bit quantization
2026年04月02日扩散语言模型离散生成Discrete DiffusionMasked Diffusion Language ModelNon-autoregressive TTS
2026年04月02日LLM后训练库工程演进RLHF engineeringPPO training stabilityreward hacking
2026年04月02日声学证据瓶颈原理Audio Evidence BottleneckAcoustic GroundingAudio Language Model
2026年04月02日状态空间模型音频建模State Space ModelMambaSelective Scan
2026年04月02日实时语音增强工程选型Real-time Speech EnhancementNoise SuppressionStreaming Inference
2026年04月02日对话上下文压缩原理Context CompressionAbstractive SummarizationCross-Attention Fusion
2026年04月02日说话人匿名化工程Speaker AnonymizationVoice ConversionStreaming Inference
2026年04月02日视听语音识别融合Audio-Visual Speech RecognitionLip ReadingViseme
2026年04月02日GPU训练吞吐加速工程MXFP8MoE TrainingExpert Parallelism
2026年04月01日熵驱动多样性生成diversity samplingtypicality biasrepulsion in latent space
2026年04月01日说话人分割工程选型speaker diarizationbenchmark methodologystreaming ASR pipeline
2026年03月31日转向检测联合建模turn-taking detectionvoice activity detectionjoint acoustic-linguistic modeling
2026年03月31日基准测试的系统性失效benchmark contaminationevaluation validityLLM judge reliability
2026年03月31日扩散模型声学生成diffusion modelscore matchingstochastic differential equation
2026年03月31日TTS开源生态竞争open-weight TTStime-to-first-audiomultilingual speech synthesis
2026年03月30日注意力机制变体演进Multi-Head AttentionGrouped Query AttentionMulti-head Latent Attention
2026年03月30日设备端语音推理架构on-device inferenceExecuTorchvoice agent pipeline
2026年03月29日混合自回归流匹配TTSautoregressive semantic tokensflow matching acoustic decoderhybrid TTS architecture
2026年03月29日NCCL超时诊断方法论NCCL watchdog timeoutdistributed training debuggingcollective communication
2026年03月29日混合架构音频表示Mambastate space modelaudio representation learning
2026年03月29日DeepSeek预训练加速工程MXFP8 trainingexpert parallelismMoE pretraining
2026年03月27日说话人验证度量学习speaker verificationmetric learningcurriculum learning
2026年03月27日MX浮点格式加速训练MXFP8microscalingmixed precision training
2026年03月26日TTS模型极限压缩model compressionknowledge distillationTTS on-device
2026年03月26日小模型极限压缩哲学model compressionknowledge distillationquantization
2026年03月25日流匹配生成原理flow matchingrectified flowODE
2026年03月25日神经音频编解码器neural audio codecresidual vector quantizationEnCodec
2026年03月25日推测解码加速推理speculative decodingdraft modeltoken verification