ELVIA.Evidence Atlas
ICML 2025ELVIA assessment Major

Avoiding spurious sharpness minimization broadens applicability of SAM

Sidak Pal Singh, Hossein Mobahi, Atish Agarwala, Yann Nicolas Dauphin

ELVIA analysis

Independent review pending

The assessment is Major for an invalid quantitative derivation directly used to motivate the preconditioned method: Appendix B mixes trace normalizations and gives an incorrect matrix-product ratio. A corrected, non-strict comparison is proved here and preserves the intended trend under the toy model’s assumptions. The core first-order Functional-SAM decomposition remains valid. Separate Minor findings concern reversed gradient/auxiliary unpacking in the illustrative implementation and the radius needed for Angle-SAM to match SAM. The reported language-model improvements are not refuted or reproduced; causal transfer from the matrix model, full implementation provenance, and some experimental details remain unresolved.

Problem 1. Inconsistent trace normalization invalidates the quantitative preconditioning derivation

Major
Evidence and reasoning

Problem statement

Write g=∇θL,g=\nabla_\theta L, u=g/∥g∥,u=g/\|g\|, and let J=∂F/∂θJ=\partial F/\partial\theta have outputs as rows. For a smooth loss composed with F,F, HL=HG+HF,HG=J⊤HℓJ,HF=∑a(∂FaL)∇θ2Fa,H_L=H_G+H_F,\qquad H_G=J^\top H_\ell J,\qquad H_F=\sum_a(\partial_{F_a}L)\nabla_\theta^2F_a, including the paper’s sample averaging. At nonzero gg and under the smoothness needed for Taylor expansion, ∇L(θ+ρu)=g+ρ(HG+HF)u+O(ρ2).\nabla L(\theta+\rho u) =g+\rho(H_G+H_F)u+O(\rho^{2}). Holding the output-loss cotangent v=∇FL(θ)v=\nabla_F L(\theta) fixed while perturbing only the Jacobian gives J(θ+ρu)⊤v=g+ρHFu+O(ρ2),J(\theta+\rho u)^\top v =g+\rho H_Fu+O(\rho^{2}), which verifies the first-order interpretation of Equation (11). These are positive gradient conventions; an optimizer applies descent.

A direct smooth binary cross-entropy check with logits (θ2,0),(\theta^{2},0), first-class target, and θ=1\theta=1 gives g=−0.53788284,g=-0.53788284, HG=0.78644773,H_G=0.78644773, and HF=−0.53788284.H_F=-0.53788284. For this example the displayed Functional-SAM expansion is exact because the Jacobian is affine in θ.\theta. This confirms the intended isolation of the functional term locally, without claiming that it always decreases total sharpness or improves generalization.

Equations (4) and (7) omit a common ρ\rho relative to SP=ρ∥g∥;\mathrm{SP}=\rho\|g\|; the correct derivative is ∇SP=ρHLu.\nabla\mathrm{SP}=\rho H_Lu. This is treated as a scaling clarification: it cancels from Equation (9)’s normalized composition if used consistently and does not invalidate the explicit-ρ\rho update above. Also, the squared-norm terms in Equation (9) sum to one only together with the cross term; individual terms need not be probabilities or fractions bounded by one.

Section 4.2, p. 5, cites Appendix B.1 to argue that inverse-GGN preconditioning amplifies the functional path relative to the logit path, motivating preconditioned SAM and its combination with Functional-SAM. Appendix B.1, p. 16, assumes symmetric invertible, freely independent matrices A,BA,B and a random unit vector v.v. It defines w=A−1vw=A^{-1}v and compares r1=E∥Bv∥2E∥Av∥2,r2=E∥Bw∥2E∥Aw∥2.r_1=\frac{\mathbb E\|Bv\|^{2}}{\mathbb E\|Av\|^{2}}, \qquad r_2=\frac{\mathbb E\|Bw\|^{2}}{\mathbb E\|Aw\|^{2}}. Equation (14)’s factor 1/N1/N uses ordinary trace. But Equation (13) factors ordinary traces without 1/N,1/N, Equation (16) sets E∥Aw∥2=1/N,\mathbb E\|Aw\|^{2}=1/N, and Equation (17) gives an incompatible product of trace moments, followed by a strict r2>r1r_2>r_1 conclusion.

Use symmetric invertible freely independent random matrices A,B,A,B, and an independent isotropic unit vector v.v. Define w=A−1v.w=A^{-1}v. The corrected moment comparison also requires finite second and inverse-second moments and the stated normalized-trace mixed-moment factorization.

Proof

Assessment: Major; a core motivating derivation is invalid.

Take N=2,N=2, A=B=I2,A=B=I_2, and vv uniformly distributed on the unit circle. These matrices are symmetric and invertible, are valid degenerate random matrices, and their scalar algebras satisfy freeness: every centered scalar polynomial is zero. The same construction works as a sequence for every N,N, so it is not a finite-size approximation issue.

Here w=vw=v exactly and E∥Av∥2=E∥Bv∥2=E∥Aw∥2=E∥Bw∥2=1.\mathbb E\|Av\|^{2}=\mathbb E\|Bv\|^{2} =\mathbb E\|Aw\|^{2}=\mathbb E\|Bw\|^{2}=1. Thus r1=r2=1.r_1=r_2=1. Equation (13), at powers one, instead gives 2=4;2=4; Equation (16) gives 1=1/2;1=1/2; and Equation (17)’s middle trace equals two while its final factorized expression equals four. Most directly, Aw=vAw=v proves that the printed 1/N1/N norm is wrong for every invertible AA and unit v.v.

This is not only an equality-edge case for the numerical ratio. With A=Qdiag⁡(1,2)Q⊤,A=Q\operatorname{diag}(1,2)Q^\top, QQ an independent uniform random rotation, and B=I2,B=I_2, scalar BB is still free from A.A. For independent uniform v,v, r1=1(1+4)/2=25,r2=1+1/42=58.r_1=\frac1{(1+4)/2}=\frac25,\qquad r_2=\frac{1+1/4}{2}=\frac58. The middle and final expressions printed in Equation (17) give 5/45/4 and 5/2,5/2, respectively, instead of 5/8.5/8. The calculations are recorded in `check.json` and follow exactly from isotropy.

Assume vv is independent and isotropic on the unit sphere, the necessary moments are finite, and the stated free mixed-moment factorization holds with normalized trace τ(C)=tr⁡(C)/N.\tau(C)=\operatorname{tr}(C)/N. Set α=Eτ(A2),β=Eτ(B2),γ=Eτ(A−2).\alpha=\mathbb E\tau(A^{2}),\quad \beta=\mathbb E\tau(B^{2}),\quad \gamma=\mathbb E\tau(A^{-2}). Then E∥Aw∥2=1,r1=βα,r2=βγ,r2r1=αγ≥1.\mathbb E\|Aw\|^{2}=1,\qquad r_1=\frac{\beta}{\alpha},\qquad r_2=\beta\gamma,\qquad \frac{r_2}{r_1}=\alpha\gamma\ge1. Indeed, cyclicity and normalized factorization give Eτ(A−1B2A−1)=βγ.\mathbb E\tau(A^{-1}B^2A^{-1})=\beta\gamma. Applying Cauchy–Schwarz to the absolute eigenvalue and its reciprocal, with an eigenvalue drawn uniformly and averaged over matrix randomness, gives αγ≥1.\alpha\gamma\ge1. Equality is possible, including A=aI;A=aI; strict inequality needs nonconstant squared spectral scale.

With ordinary trace, the corrected ratio is r2=Etr⁡(B2) Etr⁡(A−2)N2.r_2=\frac{\mathbb E\operatorname{tr}(B^{2})\, \mathbb E\operatorname{tr}(A^{-2})}{N^{2}}. Interpreting every printed trace as normalized does not reconcile all equations, because Equation (14) and the unit-vector norm in Equation (16) then remain wrong.

The wrong quantitative derivation is directly invoked for a core proposed method, supporting Major under the assigned calibration. The correction preserves nondecrease in the idealized model; it does not establish failure of preconditioning in Transformers. The paper explicitly acknowledges that actual gradients and Hessian components do not satisfy its toy calculation exactly. Adam’s diagonal second-moment preconditioner, normalized perturbations, and coupled training dynamics require additional justification or measurements. This report neither transfers the corrected theorem to those settings automatically nor claims that the empirical improvements disappear.

□\square

Possible revision

Use normalized trace consistently and retain E∥AA−1v∥2=1.\mathbb E\|AA^{-1}v\|^{2}=1. Equivalently, ordinary traces give r2=Etr⁡(B2) Etr⁡(A−2)N2.r_2=\frac{\mathbb E\operatorname{tr}(B^{2})\,\mathbb E\operatorname{tr}(A^{-2})}{N^{2}}. Replace universal strictness with the non-strict result and its equality condition. This proof does not establish transfer to the full practical method.

Problem 2. Illustrative JAX code uses an invalid keyword and reverses gradient/auxiliary outputs

Minor
Evidence and reasoning

Problem statement

Write g=∇θL,g=\nabla_\theta L, u=g/∥g∥,u=g/\|g\|, and let J=∂F/∂θJ=\partial F/\partial\theta have outputs as rows. For a smooth loss composed with F,F, HL=HG+HF,HG=J⊤HℓJ,HF=∑a(∂FaL)∇θ2Fa,H_L=H_G+H_F,\qquad H_G=J^\top H_\ell J,\qquad H_F=\sum_a(\partial_{F_a}L)\nabla_\theta^2F_a, including the paper’s sample averaging. At nonzero gg and under the smoothness needed for Taylor expansion, ∇L(θ+ρu)=g+ρ(HG+HF)u+O(ρ2).\nabla L(\theta+\rho u) =g+\rho(H_G+H_F)u+O(\rho^{2}). Holding the output-loss cotangent v=∇FL(θ)v=\nabla_F L(\theta) fixed while perturbing only the Jacobian gives J(θ+ρu)⊤v=g+ρHFu+O(ρ2),J(\theta+\rho u)^\top v =g+\rho H_Fu+O(\rho^{2}), which verifies the first-order interpretation of Equation (11). These are positive gradient conventions; an optimizer applies descent.

A direct smooth binary cross-entropy check with logits (θ2,0),(\theta^{2},0), first-class target, and θ=1\theta=1 gives g=−0.53788284,g=-0.53788284, HG=0.78644773,H_G=0.78644773, and HF=−0.53788284.H_F=-0.53788284. For this example the displayed Functional-SAM expansion is exact because the Jacobian is affine in θ.\theta. This confirms the intended isolation of the functional term locally, without claiming that it always decreases total sharpness or improves generalization.

Equations (4) and (7) omit a common ρ\rho relative to SP=ρ∥g∥;\mathrm{SP}=\rho\|g\|; the correct derivative is ∇SP=ρHLu.\nabla\mathrm{SP}=\rho H_Lu. This is treated as a scaling clarification: it cancels from Equation (9)’s normalized composition if used consistently and does not invalidate the explicit-ρ\rho update above. Also, the squared-norm terms in Equation (9) sum to one only together with the cross term; individual terms need not be probabilities or fractions bounded by one.

Listing 11 uses hax_aux=True and assigns the returned pair to dL_dlogits, dL_dtheta as its Functional-SAM implementation.

Use the official JAX grad convention actually consulted: has_aux=True returns the parameter gradient first and auxiliary data second. The auxiliary value is explicitly the unperturbed logit-loss cotangent. The scalar diagnostic uses F(θ)=θ2,F(\theta)=\theta^{2}, ℓ(z)=z2/2,\ell(z)=z^{2}/2, and θ=2;\theta=2; no missing helper or historical runtime is assumed.

Proof

Assessment: Minor; implementation illustration only.

Listing 1,1, p. 17, calls `grad(loss_fn,hax_aux=True)` and binds the result as dL_dlogits, dL_dtheta = grad(...)(params).\texttt{dL\_dlogits,\ dL\_dtheta = grad(...)(params)}. The consulted official JAX API uses `has_aux` and returns the parameter gradient before auxiliary data [jax]. Thus correcting the keyword alone still reverses the two spaces: the logit cotangent is used to perturb parameters, and the parameter gradient is supplied to the output VJP.

A finite calculation shows that this is substantive even when shapes happen to agree. Take scalar F(θ)=θ2,F(\theta)=\theta^{2}, loss ℓ(z)=z2/2,\ell(z)=z^{2}/2, and θ=2,\theta=2, with the auxiliary value defined as ∂ℓ/∂z.\partial\ell/\partial z. The correct pair is (16,4).(16,4). Both entries normalize to positive one, so the perturbed parameter is 2+ρ2+\rho even after the mistaken swap. The intended VJP is 4⋅2(2+ρ)=16+8ρ,4\cdot2(2+\rho)=16+8\rho, whereas the swapped cotangent yields 16⋅2(2+ρ)=64+32ρ.16\cdot2(2+\rho)=64+32\rho. At ρ=0.1\rho=0.1 these are 16.816.8 and 67.2.67.2. This uses a smooth generic loss accepted by the illustration and tests the return-order issue without author-code execution. With unequal logit and parameter structures the mismatch can instead prevent evaluation.

The local correction is dL_dtheta, dL_dlogits = grad(loss_fn,has_aux=True)(params),\texttt{dL\_dtheta,\ dL\_dlogits = grad(loss\_fn,has\_aux=True)(params)}, provided the auxiliary value is explicitly the unperturbed logit-loss cotangent. The remaining VJP then matches Equation (11). This API/formula correspondence is verified statically; a complete runnable implementation is not certified. JAX was absent from both checked runtimes, and the helper and loss wrapper were missing. The illustration is not proven to be the code that produced historical runs, and the mathematical update itself survives.

□\square

Possible revision

Use dL_dtheta, dL_dlogits = grad(loss_fn, has_aux=True)(params), with the auxiliary value explicitly defined as the unperturbed logit-loss cotangent. The remaining VJP then matches Equation (11). Only the API/formula correspondence was checked; no runnable JAX repair is claimed.

Problem 3. Angle-SAM at pi/4 matches a rescaled SAM radius

Minor
Evidence and reasoning

Problem statement

Write g=∇θL,g=\nabla_\theta L, u=g/∥g∥,u=g/\|g\|, and let J=∂F/∂θJ=\partial F/\partial\theta have outputs as rows. For a smooth loss composed with F,F, HL=HG+HF,HG=J⊤HℓJ,HF=∑a(∂FaL)∇θ2Fa,H_L=H_G+H_F,\qquad H_G=J^\top H_\ell J,\qquad H_F=\sum_a(\partial_{F_a}L)\nabla_\theta^2F_a, including the paper’s sample averaging. At nonzero gg and under the smoothness needed for Taylor expansion, ∇L(θ+ρu)=g+ρ(HG+HF)u+O(ρ2).\nabla L(\theta+\rho u) =g+\rho(H_G+H_F)u+O(\rho^{2}). Holding the output-loss cotangent v=∇FL(θ)v=\nabla_F L(\theta) fixed while perturbing only the Jacobian gives J(θ+ρu)⊤v=g+ρHFu+O(ρ2),J(\theta+\rho u)^\top v =g+\rho H_Fu+O(\rho^{2}), which verifies the first-order interpretation of Equation (11). These are positive gradient conventions; an optimizer applies descent.

A direct smooth binary cross-entropy check with logits (θ2,0),(\theta^{2},0), first-class target, and θ=1\theta=1 gives g=−0.53788284,g=-0.53788284, HG=0.78644773,H_G=0.78644773, and HF=−0.53788284.H_F=-0.53788284. For this example the displayed Functional-SAM expansion is exact because the Jacobian is affine in θ.\theta. This confirms the intended isolation of the functional term locally, without claiming that it always decreases total sharpness or improves generalization.

Equations (4) and (7) omit a common ρ\rho relative to SP=ρ∥g∥;\mathrm{SP}=\rho\|g\|; the correct derivative is ∇SP=ρHLu.\nabla\mathrm{SP}=\rho H_Lu. This is treated as a scaling clarification: it cancels from Equation (9)’s normalized composition if used consistently and does not invalidate the explicit-ρ\rho update above. Also, the squared-norm terms in Equation (9) sum to one only together with the cross term; individual terms need not be probabilities or fractions bounded by one.

Appendix D claims that ϕ=π/4\phi=\pi/4 recovers SAM to first order at the same nominal radius ρ.\rho.

Use a smooth loss, nonzero gradient, normalized direction u=g/∥g∥,u=g/\|g\|, and the same nominal radius ρ\rho for both methods.

Proof

Assessment: Minor; optional extension.

Appendix D, p. 18, states that ϕ=π/4\phi=\pi/4 recovers SAM to first order in ρ.\rho. Equation (20) instead gives Gangle=g+ρ2(HG+HF)u+O(ρ2),G_{\rm angle}=g+\frac{\rho}{\sqrt2}(H_G+H_F)u+O(\rho^{2}), whereas standard SAM has coefficient ρ.\rho. Their difference is generally order ρ,\rho, not order ρ2.\rho^{2}.

For an admissible binary cross-entropy example with logits (θ,0),(\theta,0), first-class target, and θ=0,\theta=0, one has g=−1/2,g=-1/2, u=−1,u=-1, HG=1/4,H_G=1/4, HF=0.H_F=0. Writing σ\sigma for the logistic function, GSAM=−σ(ρ),Gangle=−12+−σ(ρ)+1/22.G_{\rm SAM}=-\sigma(\rho),\qquad G_{\rm angle}=-\frac12+ \frac{-\sigma(\rho)+1/2}{\sqrt2}. At ρ=0.1\rho=0.1 these equal −0.5249791875-0.5249791875 and −0.5176629529.-0.5176629529. Moreover, lim⁡ρ→0Gangle−GSAMρ=1−1/24≠0.\lim_{\rho\to0}\frac{G_{\rm angle}-G_{\rm SAM}}{\rho} =\frac{1-1/\sqrt2}{4}\ne0. The corrected statement is that Angle-SAM at radius ρ\rho matches SAM at radius ρ/2\rho/\sqrt2 to first order; equivalently use Angle-SAM radius 2ρ\sqrt2\rho to match SAM radius ρ.\rho. This does not assert exact finite-radius equality. The ϕ=0\phi=0 Functional-SAM endpoint is unaffected. The paper presents this interpolation as future work rather than the method used in its main experiments, so the supported impact is local.

□\square

Possible revision

Angle-SAM radius ρ\rho corresponds to SAM radius ρ/2.\rho/\sqrt2. Equivalently, use Angle-SAM radius 2ρ\sqrt2\rho to match SAM radius ρ,\rho, only to first order. The analytic rescaling is checked; exact finite-radius equality is not claimed.

Supporting record & provenance

Work status

Current version

Version 1

Minhao Liu · Initial report · Version 1

Independent review pending

Original claim and review scope

Also, from this figure we can see that the performance gained imparted by FUNCTIONAL -SAM over ADAMW is equivalent to setting about 25%25\% parameters of zero, and is thus significant.

Published ICML 2025 proceedings PDF (PMLR 267); PDF p. 16

Actual review scope

The recorded inspection concerns these source locations: Section 4.2, p. 5 Appendix B.1, p. 16, Equations 13–17; Appendix C, p. 17, Listing1; Appendix D, p. 18, Equation20.

Submit an author revisionContribute a review