Paper: 2607.26001 Authors: Wenzhi Zhong, Edward Milsom, Michael Murray Categories: cs.LG, stat.ML

The Gap

SAM’s core promise is simple: find parameters that stay good even when slightly perturbed. But “slightly” is doing a lot of work here — it depends entirely on which geometry you use to measure perturbations. Prior work has explored ℓ₂ balls, ℓ∞ balls, per-layer normalizations, and various adaptive geometries (ASAM, LookSAM, etc.). Yet no principled framework tells us which geometry actually respects the structure of neural network weights.

Separately, the Muon optimizer has shown strong empirical results by treating hidden-layer weight matrices as matrices rather than flattened vectors — applying orthogonal updates via Newton-Schulz iterations. This matrix-aware perspective hasn’t been connected to SAM’s perturbation geometry.

This paper bridges that gap: what happens when you apply spectral-norm-aware geometry to SAM’s inner perturbation step and pair it with a matrix-aware outer optimizer?

SAM variants use ad-hoc        Muon optimizer respects
perturbation geometries         matrix structure of weights
(no consensus on best)          (strong empirically)
        |                               |
        +---------> GAP <--------------+
                   |
        What if SAM's perturbation
        geometry also respected
        matrix structure?
                   |
          Spectral inner perturbation
          + Muon outer update
                   |
          Consistent wins on ViT-Small,
          ResNet-50 across ImageNet-1K

The Increment

One sentence: Before this paper, SAM treated weight perturbation geometry as a design choice disconnected from the optimizer’s own structural awareness; after this paper, we know that aligning SAM’s inner-perturbation geometry (spectral norm) with the outer optimizer’s matrix-awareness (Muon) yields the strongest and most consistent generalization gains.

Core Mechanism

SAM has two stages. The inner step computes an adversarial perturbation: find the parameter direction that maximizes loss within some neighborhood. The outer step then updates parameters to minimize loss at that worst-case point. The geometry — how you measure “small” — matters in both stages.

This paper’s contribution focuses on the inner perturbation. Standard SAM uses Euclidean (ℓ₂) perturbation uniformly across all parameters. The authors instead compute perturbations layerwise for matrix-valued hidden-layer weights using the spectral norm (the largest singular value). Concretely: they compute the spectral gradient of the loss with respect to each weight matrix, scale the perturbation by the spectral norm, and use this to define the adversarial direction. For the outer update, they plug in either AdamW, SGDW, or Muon.

Input data
    |
    v
[Forward pass] --> compute loss L(theta)
    |
    v
[Inner step: spectral perturbation]
    |  For each weight matrix W_i:
    |    compute grad_i = dL/dW_i
    |    project onto spectral direction
    |    epsilon_i = rho * grad_i / ||grad_i||_spectral
    |    theta_adv = theta + epsilon
    |
    v
[Outer step: update rule]
    |  Compute loss L(theta_adv)
    |  Compute grad at theta_adv
    |  Apply Muon (or AdamW/SGDW) update
    |
    v
[Updated theta]

Here’s a structural metaphor. Imagine you’re a military strategist fortifying a castle (the model). SAM says: “Before you decide where to reinforce walls, first send scouts to find the weakest point an attacker could exploit, then shore up against that.” The geometry is the terrain your scouts patrol. Standard SAM sends scouts on flat ground (Euclidean ball). This paper sends scouts along the natural joints and hinges of the castle — the directions where the structure is most vulnerable *given how it’s actually built. The spectral norm identifies exactly those joints: the directions of maximum stretch in each weight matrix. And the Muon outer update is like the master builder who understands how each wall segment (matrix) connects, so reinforcements are applied structurally, not haphazardly.

Key Concepts

  • Sharpness-Aware Minimization (SAM): Think of your loss landscape as a mountain range. Most optimizers find the lowest valley they can. SAM finds the valley that’s *also flat — because if the valley is narrow and steep, a tiny shift in data will catapult you uphill. Concretely, SAM perturbs parameters by a small amount in the direction that increases loss the most, then updates to reduce loss at that worst-case point. The result: solutions that generalize better because they aren’t memorizing narrow valleys.

  • Spectral Norm: Every matrix has a “maximum stretch factor” — the largest amount it can stretch a vector when you multiply by it. This is the spectral norm (the largest singular value). For a weight matrix in a neural layer, the spectral norm tells you the most extreme direction that layer can amplify a signal. Using spectral geometry for SAM’s perturbation means you’re probing along exactly that most-amplifying direction, which is precisely where the model is most sensitive.

  • Muon Optimizer: Standard optimizers like Adam treat all parameters as a flat list of numbers. Muon instead recognizes that hidden-layer weights are *matrices with structure. It computes updates that respect this matrix geometry — specifically, it uses Newton-Schulz iterations to approximate an orthogonal update (one that preserves the matrix’s singular vectors). Think of it as updating each weight matrix in a way that rotates it toward better solutions rather than just nudging individual entries.

Framework Shift

Before (mainstream approach):        After (this paper):

SAM with uniform perturbation        SAM with spectral perturbation
across all params                    per weight matrix

  [param vec]                          [matrix W_1]
       |                                    |
  [flat L2 ball]                       [spectral ball]
       |                                (singular direction)
  [Adam/SGD outer]                         |
                                      [Muon outer update]
                                      (matrix-aware)

From treating SAM’s perturbation geometry as a flat, uniform design choice to aligning it with the intrinsic matrix structure of neural network layers, the core shift is that the geometry of the perturbation and the geometry of the update should speak the same language.

Expert Assessment

Problem choice: This is a real gap. The question of which geometry SAM should use has been lingering since the original SAM paper, and the Muon optimizer’s empirical success has created a natural bridge to explore. The paper is well-positioned at the intersection of two active threads. Not a paradigm shift, but a legitimate and timely investigation.

Method maturity: The spectral inner perturbation is a clean, principled idea — not brute force. However, the paper is essentially a systematic combination of two known ingredients rather than a fundamentally new algorithm. The Newton-Schulz iteration cost for Muon and the spectral decomposition for the inner step add computational overhead that isn’t deeply analyzed. Simpler per-layer normalizations (like in ASAM) might close some of the gap at lower cost.

Experimental integrity: The baselines are reasonable — they compare SAM, ASAM, and other variants with different outer optimizers. ImageNet-1K with ViT-Small/16 and ResNet-50 is standard and credible. The gains are consistent but modest in absolute terms (we’re talking about validation accuracy differences on the order of fractions of a percent). The paper would benefit from ablation studies separating the spectral perturbation contribution from the Muon contribution more cleanly, and from testing on tasks beyond image classification to assess generality.

Writing quality: The paper reads clearly but cuts corners on the theoretical motivation — why *should spectral geometry be the right choice beyond empirical results? The related work section could be tighter. The experimental section would benefit from error bars or confidence intervals across multiple seeds; without them, it’s hard to judge whether the differences are statistically meaningful.

Verdict: weak accept — Clean combination of two strong ideas with consistent empirical gains, but the contribution is incremental rather than foundational, and the experiments need more rigor to fully convince.

Takeaways

Three concrete things a practitioner can steal:

  1. Spectral perturbation for SAM is easy to implement and worth trying. If you’re already using SAM, replace the uniform ℓ₂ perturbation with a layerwise spectral perturbation on weight matrices. Compute the top singular vector (one power iteration is usually enough), scale by the spectral norm, and use that as your adversarial direction. This is a low-cost upgrade.

  2. Match your perturbation geometry to your optimizer geometry. The paper’s key insight is structural: if your optimizer is matrix-aware (Muon), your SAM perturbation should be too (spectral). More generally, don’t treat SAM’s geometry as independent of the rest of your training pipeline.

  3. Muon is worth a look as a drop-in outer optimizer for SAM. Even if you don’t adopt the spectral perturbation, swapping AdamW for Muon in the outer step of SAM may yield free gains on vision tasks with weight matrices. The Muon library is increasingly accessible.

论文: 2607.26001 作者: Wenzhi Zhong, Edward Milsom, Michael Murray 分类: cs.LG, stat.ML

缺口

SAM 的核心承诺很简单:找到即使被微小扰动也能保持良好的参数。 但”微小”这个词承担了全部重量——它完全取决于你用什么几何来度量扰动。 此前的工作探索了 ℓ₂ 球、ℓ∞ 球、逐层归一化、以及各种自适应几何(ASAM、LookSAM 等), 但没有任何原则性的框架告诉我们哪种几何真正尊重了神经网络权重的结构。

另一方面,Muon 优化器通过把隐藏层权重视为矩阵而非展平向量, 用牛顿-舒尔茨迭代实现正交更新,在实践中取得了强劲表现。 这种矩阵感知的视角还没有与 SAM 的扰动几何产生联系。

本文弥合了这一缺口:当你把谱范数感知的几何应用到 SAM 的内扰动步, 并搭配一个矩阵感知的外优化器,会发生什么?

SAM 变体使用临时的           Muon 优化器尊重
扰动几何(无共识)           权重的矩阵结构
        |                        |
        +-------> 缺口 <--------+
                  |
       如果 SAM 的扰动几何
       也尊重矩阵结构呢?
                  |
         谱范数内扰动
         + Muon 外更新
                  |
         在 ViT-Small、ResNet-50
         ImageNet-1K 上稳定领先

增量

一句话: 在这篇论文之前,SAM 的扰动几何被视为与优化器自身的结构感知无关的设计选择; 在它之后,我们知道将 SAM 内扰动几何(谱范数)与外优化器的矩阵感知(Muon)对齐, 能带来最强且最稳定的泛化增益。

核心机制

SAM 有两个阶段。 内步计算对抗扰动:找到在某个邻域内最大化损失的参数方向。 外步然后更新参数,以降低在那个最坏情况点上的损失。 几何度量——你如何衡量”小”——在两个阶段都至关重要。

本文的核心贡献聚焦在内扰动上。 标准 SAM 对所有参数统一使用欧几里得(ℓ₂)扰动。 作者改为对矩阵值的隐藏层权重逐层计算扰动,使用谱范数(最大奇异值)。 具体做法:计算损失相对于每个权重矩阵的谱梯度, 用谱范数缩放扰动,以此定义对抗方向。 对于外更新,他们分别插入 AdamW、SGDW 或 Muon。

输入数据
    |
    v
[前向传播] --> 计算损失 L(theta)
    |
    v
[内步:谱范数扰动]
    |  对每个权重矩阵 W_i:
    |    计算 grad_i = dL/dW_i
    |    投影到谱方向
    |    epsilon_i = rho * grad_i / ||grad_i||_spectral
    |    theta_adv = theta + epsilon
    |
    v
[外步:更新规则]
    |  计算 L(theta_adv) 的梯度
    |  应用 Muon(或 AdamW/SGDW)更新
    |
    v
[更新后的 theta]

用一个结构性比喻来理解: 想象你是一位加固城堡(模型)的军事战略家。 SAM 说:“在你决定加固哪面墙之前,先派侦察兵找到攻击者可能利用的最弱点,然后针对那里加固。” 几何就是你的侦察兵巡逻的地形。 标准 SAM 在平坦地形上派侦察兵(欧几里得球)。 本文则沿着城堡的天然关节和铰链派侦察兵—— 那些根据实际构造最脆弱的方向。 谱范数恰好识别了这些关节: 每个权重矩阵中最大拉伸的方向。 而 Muon 外更新就像一位理解每段墙体(矩阵)如何连接的建筑师, 所以加固是结构性的,而不是随意的。

关键概念

  • 锐度感知最小化(SAM): 把损失景观想象成一片山脉。 大多数优化器找到能到达的最低山谷。 SAM 找的是同时平坦的山谷——因为如果山谷狭窄陡峭, 数据的微小偏移就会把你弹上山坡。 具体来说,SAM 先沿着最能增加损失的方向扰动参数一小步, 然后在那个最坏情况下更新以降低损失。 结果:泛化更好,因为没有在狭窄山谷里记忆。 实现时,SAM 先算当前梯度方向的单位向量,乘以步长 ρ,得到扰动 ε; 在 θ+ε 处再算一次梯度,用这个梯度做最终更新。

  • 谱范数: 每个矩阵都有一个”最大拉伸因子”—— 它乘以向量时能把向量拉伸的最大倍数。 这就是谱范数(最大奇异值)。 对于神经网络中的一层权重矩阵,谱范数告诉你该层能放大信号的最极端方向。 用谱几何做 SAM 扰动意味着你恰好沿着最放大方向进行探测, 而这正是模型最敏感的地方。 计算上,可以通过幂迭代近似最大奇异向量,不需要完整的 SVD。

  • Muon 优化器: 标准优化器如 Adam 把所有参数当作一列数字。 Muon 则认识到隐藏层权重是有结构的矩阵。 它计算尊重这种矩阵几何的更新——具体来说, 用牛顿-舒尔茨迭代近似正交更新(保持矩阵奇异向量的旋转)。 可以理解为:对每个权重矩阵,朝更好的解旋转它, 而不是简单地逐元素微调。

框架转变

之前(主流方法):                之后(本文方法):

SAM 统一扰动                    SAM 按权重矩阵谱扰动
                               

  [参数向量]                       [矩阵 W_1]
       |                               |
  [平坦 L2 球]                    [谱范数球]
       |                           (奇异方向)
  [Adam/SGD 外步]                      |
                                  [Muon 外更新]
                                  (矩阵感知)

从把 SAM 的扰动几何当作平坦的、统一的设计选择, 到将其与神经网络层的内在矩阵结构对齐, 核心转变是扰动的几何和更新的几何应该说同一种语言

专家评审

选题眼光: 这是一个真实的缺口。 SAM 该用什么几何这个问题从原论文起就悬而未决, Muon 的实绩又提供了天然的桥梁。 论文站在两条活跃线索的交叉点上,定位恰当。 不是范式转移,但是正当且及时的探索。

方法成熟度: 谱内扰动是干净、有原则的想法,不是蛮力。 但本文本质上是两个已知成分的系统组合,而非根本性的新算法。 Muon 的牛顿-舒尔茨迭代成本和谱分解的计算开销没有被深入分析。 更简单的逐层归一化(如 ASAM)可能以更低代价缩小部分差距。

实验诚意: 基线合理——比较了 SAM、ASAM 和其他变体搭配不同外优化器的表现。 ImageNet-1K 上用 ViT-Small/16 和 ResNet-50 是标准且可信的。 增益一致但绝对幅度不大(验证精度差异在零点几个百分点量级)。 论文需要更好的消融实验来分离谱扰动和 Muon 各自的贡献, 也需要在图像分类之外的任务上测试泛化性。

写作功力: 读起来清晰,但在理论动机上偷了懒—— 为什么谱范数应该是对的选择,除了实证结果之外缺乏深入论证。 相关工作部分可以更紧凑。 实验部分需要多次种子的误差条或置信区间; 没有这些,很难判断差异是否统计显著。

判决: 弱接收 —— 两个强想法的干净组合,实验增益一致, 但贡献是增量式的而非奠基性的,实验需要更多严谨性才能完全说服。

要点总结

实践者可以从这篇论文”偷”走三样东西:

  1. SAM 的谱扰动容易实现,值得尝试。 如果你已经在用 SAM,把统一的 ℓ₂ 扰动替换为对权重矩阵的逐层谱扰动。 算出最大奇异向量(一次幂迭代通常就够了), 用谱范数缩放,作为对抗方向。 这是一个低成本升级。

  2. 让扰动几何与优化器几何匹配。 本文的核心洞察是结构性的: 如果你的优化器是矩阵感知的(Muon), 你的 SAM 扰动也应该如此(谱范数)。 更一般地说,不要把 SAM 的几何与训练管线的其他部分割裂开来。

  3. Muon 值得作为 SAM 外优化器试一试。 即使你不采用谱扰动, 把 SAM 外步中的 AdamW 换成 Muon, 在视觉任务的权重矩阵上可能带来免费增益。 Muon 库越来越容易上手了。