Papers
Topics
Authors
Recent
Search
2000 character limit reached

FedNSAM: Federated Nesterov SAM

Updated 4 July 2026
  • FedNSAM is a federated learning optimizer that integrates global Nesterov momentum with sharpness-aware minimization to harmonize local and global flatness.
  • It introduces a flatness distance metric to quantify the mismatch between locally flat solutions and their aggregated global counterpart under non-IID data.
  • Empirical evaluations on datasets like CIFAR-100 show that FedNSAM outperforms FedSAM with improved accuracy and communication efficiency.

Searching arXiv for FedNSAM and closely related federated SAM papers to ground the article. FedNSAM is a federated-learning optimizer introduced in “FedNSAM: Consistency of Local and Global Flatness for Federated Learning” (Liu et al., 27 Feb 2026). It addresses a specific limitation of SAM-style federated optimization: under multi-step local updates and high data heterogeneity, flatness obtained on individual clients does not necessarily translate into a flat global solution after aggregation. The method formalizes this mismatch through a flatness distance and modifies local SAM training by introducing global Nesterov momentum into both perturbation estimation and extrapolation. In the paper’s formulation, the objective is not merely to make local losses flat, but to harmonize the consistency of local and global flatness while retaining the generalization-oriented motivation of sharpness-aware minimization (Liu et al., 27 Feb 2026).

1. Problem setting and motivating failure mode

FedNSAM is posed in the standard federated setting with global objective

F(θ)=1Ni=1NFi(θ),F(\theta)=\frac{1}{N}\sum_{i=1}^N F_i(\theta),

where FiF_i is client ii’s local loss. The paper focuses on the case in which local client training uses SAM-like updates to search for flatter minima, but the client data are non-IID and local training proceeds for multiple steps between communications (Liu et al., 27 Feb 2026).

The central claim is that, in federated learning, locally flat solutions can be mutually inconsistent. When data are close to IID, client update directions are similar, local flat regions overlap, and the averaged global model may lie in a shared flat region. When data are highly heterogeneous, client updates point in different directions, each client’s flat region can be located differently, and the averaged global model may fall outside those flat regions. In that regime, minimizing the sharpness of local loss surfaces does not ensure flatness of the aggregated model, so the generalization benefit usually associated with SAM can deteriorate (Liu et al., 27 Feb 2026).

This framing places FedNSAM in direct continuity with FedSAM, which applies sharpness-aware minimization as the local optimizer in federated learning (Qu et al., 2022). FedNSAM does not reject SAM’s objective; rather, it argues that the local perturbation direction must be made globally consistent if flatness is to remain meaningful after aggregation under heterogeneity.

2. Flatness distance and the local–global consistency question

To formalize the gap between local and global flatness, the paper defines the flatness distance. If the global model at round t+1t+1 is

θt+1=1Ni=1Nθi,Kt,\theta^{t+1}=\frac{1}{N}\sum_{i=1}^N \theta_{i,K}^t,

where θi,Kt\theta_{i,K}^t is client ii’s model after KK local steps in round tt, then the flatness distance is

ΔD=1Ni=1NEθi,Ktθt+12.\Delta_{\mathcal{D}}=\frac{1}{N}\sum_{i=1}^N \mathbb{E}\left\|\theta_{i,K}^t-\theta^{t+1}\right\|^2.

This quantity measures how far the local terminal models are from the aggregated global model (Liu et al., 27 Feb 2026).

The interpretation is geometric and operational. Small FiF_i0 means that local models cluster, so their flat regions are closer and global flatness is more plausible. Large FiF_i1 indicates that local models are dispersed, so local flat regions differ and the average model is less likely to lie in a flat region. The paper uses this as the key explanation for why FedSAM can be effective under low heterogeneity yet degrade under strong heterogeneity (Liu et al., 27 Feb 2026).

The empirical narrative in the paper follows the same logic. As heterogeneity increases, FiF_i2 increases and test performance degrades. The paper explicitly reports that, on CIFAR-100 with ResNet-18, FedSAM’s accuracy drops sharply under stronger heterogeneity, whereas FedNSAM maintains a much smaller flatness distance and substantially better accuracy. This suggests that FedNSAM is best understood not simply as an accelerated SAM variant, but as a method for controlling the mismatch between client-wise flatness and server-side aggregation.

3. Algorithmic mechanism: SAM with global Nesterov momentum

FedNSAM combines SAM’s perturbation-based flatness search with Nesterov momentum, but the crucial modification is that the momentum is global rather than client-local. The server maintains

FiF_i3

where FiF_i4 is the set of selected clients, FiF_i5, and FiF_i6 is the momentum parameter (Liu et al., 27 Feb 2026).

The paper’s approximation is that the desired global perturbation direction can be estimated through this momentum: FiF_i7 This is the conceptual pivot of the algorithm. Standard FedSAM constructs perturbations from local gradients; FedNSAM replaces that with a shared direction derived from server-side momentum, so the perturbation geometry becomes aligned across clients (Liu et al., 27 Feb 2026).

The local update uses a three-stage sequence. First, a Nesterov extrapolation: FiF_i8 Second, a SAM-style perturbation along the global momentum direction: FiF_i9 Third, a local gradient step evaluated at the perturbed point: ii0 After ii1 local updates, clients transmit the model drift ii2, the server aggregates them, updates ii3, and applies

ii4

The paper emphasizes two consequences: perturbation correction, because client perturbations become globally consistent, and update acceleration, because Nesterov extrapolation improves optimization speed (Liu et al., 27 Feb 2026).

4. Theoretical analysis

The convergence analysis is carried out for non-convex objectives under three standard assumptions: each client loss is ii5-smooth,

ii6

client heterogeneity is bounded,

ii7

and stochastic gradient variance is bounded,

ii8

Under a stepsize condition

ii9

the paper proves a convergence rate and states that it is tighter than the corresponding FedSAM bound because the dominant term scales more favorably with t+1t+10, reflecting Nesterov acceleration (Liu et al., 27 Feb 2026).

A second theoretical thread concerns flatness distance itself. The paper provides upper bounds for both FedSAM and FedNSAM and states that FedNSAM achieves a better upper bound. The key technical reason is a perturbation-consistency lemma: t+1t+11 for FedNSAM, because the perturbation direction is shared across local steps within a round. In FedSAM, the corresponding term is nonzero and is bounded by a quantity proportional to t+1t+12. This is the paper’s main analytical explanation for why local–global flatness mismatch is reduced in FedNSAM (Liu et al., 27 Feb 2026).

The proof strategy introduces a transformed sequence t+1t+13, uses smoothness to track descent in t+1t+14, and bounds the effects of momentum, stochasticity, and heterogeneity. A plausible implication is that FedNSAM’s advantage is not only better search of flat regions, but more stable propagation of a shared geometry across clients.

5. Empirical evaluation

The experiments are designed to test both optimization speed and generalization under heterogeneous federated learning. On CNNs, the paper evaluates LeNet-5, VGG-11, and ResNet-18 on CIFAR-10 and CIFAR-100. Non-IID splits are generated with Dirichlet heterogeneity levels t+1t+15, t+1t+16, and t+1t+17, where Dirichlet-t+1t+18 denotes lower heterogeneity and Dirichlet-t+1t+19 denotes high heterogeneity. The paper reports that, on CIFAR-10 and CIFAR-100 with Dirichlet-0.6 and 100 clients, FedNSAM achieves the best accuracy across all three CNN architectures (Liu et al., 27 Feb 2026).

One reported example is CIFAR-100 with ResNet-18, where the paper gives

  • FedNSAM: 66.04%
  • FedSAM: 47.83%

The communication-efficiency comparison is similarly explicit. On CIFAR-100 with ResNet-18, FedNSAM reaches 55% accuracy in 316 rounds, whereas FedSAM needs 1000+ rounds. The paper interprets this as evidence of both improved optimization and improved generalization (Liu et al., 27 Feb 2026).

The transformer experiments use Tiny ImageNet with Swin-Small, Swin-Base, and ViT-Base, initialized from ImageNet-22k pre-trained weights. The reported setting is 100 communication rounds, Dirichlet-0.1, 5% participation, batch size 16, and learning rate 0.01 decayed by 0.99. FedNSAM again achieves the best reported accuracies:

  • Swin-Small: 70.12%
  • Swin-Base: 70.86%
  • ViT-Base: 71.23%

It also reaches the target threshold in 67, 42, and 26 rounds, respectively. The paper further studies participation rates of 2%, 5%, and 10%, reporting that FedNSAM remains consistently strong when fewer clients participate and when heterogeneity worsens. This supports the claim that the momentum-based global direction estimate is robust under partial participation (Liu et al., 27 Feb 2026).

6. Position within the federated-learning literature and naming issues

FedNSAM belongs to the line of federated methods that import sharpness-aware minimization into local client optimization. The immediate precursor is FedSAM, introduced as a federated method that replaces local ERM with the SAM min–max objective and, in its base form, is essentially FedAvg with SAM as the local optimizer (Qu et al., 2022). FedNSAM differs by using global Nesterov momentum as the direction of local estimation of client global perturbations and extrapolation, thereby addressing a limitation that the FedNSAM paper identifies in high-heterogeneity regimes.

The name can be confused with other federated methods whose abbreviations begin with “FedN” or “FedS.” It should be distinguished from FedNS, the Newton-sketch method in “FedNS: A Fast Sketching Newton-Type Algorithm for Federated Learning,” which communicates sketched square-root Hessians and targets second-order communication efficiency rather than sharpness-aware flatness consistency (Li et al., 2024). It should also be distinguished from pFedSAM, a personalized federated framework for Segment Anything Model adaptation in medical image segmentation, where “SAM” refers to the foundation model rather than sharpness-aware minimization (Wang et al., 19 Sep 2025).

A recurrent misconception in the broader literature is that local flatness is sufficient for global generalization in federated training. FedNSAM is centered on rejecting that assumption. Its defining contribution is the claim that, in federated learning, flatness is meaningful only if the client-side perturbation and update directions are coordinated strongly enough that the aggregated model remains within the relevant flat region. This suggests that the “N” in FedNSAM refers to the incorporation of Nesterov momentum, though the paper’s substantive contribution is not nomenclature but the consistency of local and global flatness (Liu et al., 27 Feb 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to FedNSAM.