FedVSSAM: Mitigating Flatness Incompatibility in Sharpness-Aware Federated Learning

Bingnan Xiao, Yuan Gao, Bingcong Li, Wei Ni, Xin Wang, Tony QuekNeurIPS 2026

TL;DR

Imagine a team of blindfolded hikers trying to find a wide, flat valley to set up camp, except each hiker is walking on a slightly different terrain map. In Federated Learning, devices often seek "flat" regions of the loss landscape to generalize better, but differing local datasets cause them to find local valleys that don't align globally—a newly identified failure mode called flatness incompatibility. This paper introduces FedVSSAM, an algorithm that anchors local searches and global updates to a shared, smoothed compass direction, resulting in faster training and better generalization without extra upload costs.

What Problem Does This Paper Address?

Federated Learning (FL) trains a shared model across decentralized devices (like phones or IoT sensors) without moving private data to a central server. Because each user's data is unique (non-IID, or heterogeneous), local models tend to drift apart during training.

To help the global model generalize well across diverse users, researchers borrowed Sharpness-Aware Minimization (SAM) from centralized deep learning. Instead of just finding a single point with low loss (which might sit in a narrow, brittle canyon), SAM perturbations probe the surrounding neighborhood to find wide, flat basins where small parameter shifts don't ruin performance.

However, applying SAM locally on each device creates a structural problem the authors call flatness incompatibility. Because devices hold different data, a flat basin on Device A might correspond to a steep cliff on the global landscape.

Figure 1: Visualization of local and global loss landscapes for FedSAM on CIFAR-10. Setup includes 100 devices, 10% UAR sam- pling, Dirichlet-0.1, and a 3-layer CNN.

The authors mathematically trace this incompatibility to two culprits:

  1. Data heterogeneity (inter-device): Local gradients naturally point away from the true global gradient.
  2. The "friendly adversary" phenomenon (intra-device): SAM works by taking an "adversarial" step uphill on a mini-batch before stepping downhill. Due to noisy batch sampling, a step that goes uphill on Batch 1 might accidentally go downhill (become "friendly") on Batch 2, making local flatness probes erratic.

Because SAM uses its uphill perturbation to decide where to compute the downhill update, these errors compound across local steps and corrupt the aggregated global model.

Methods

Standard SAM-based FL fixes usually try to patch isolated parts of the pipeline (like adding server momentum or sending extra control variables). Instead, FedVSSAM (Federated Learning with Variance-Suppressed SAM) introduces a single, stable "adjusted direction" ($h^t$) maintained by the server and weaves it consistently through all three stages of training:

  1. Local Flatness Search: Instead of probing uphill using only the noisy local batch gradient, each device blends its local gradient with the server's global direction $h^t$ (controlled by a mixing weight $\gamma_l$). This keeps the neighborhood probe anchored to the global landscape.
  2. Local Descent Update: Once at the perturbed point, the device computes its downhill gradient and again blends it with $h^t$ using the exact same mixing weight $\gamma_l$. Sharing $h^t$ ensures the uphill probe and downhill step stay aligned.
  3. Global Update: Devices send only their updated model weights back to the server. The server computes the aggregate update, smooths it into $h^{t+1}$ using an Exponential Moving Average (EMA), updates the global model, and broadcasts both the new model and $h^{t+1}$ to the next round's devices.

Crucially, unlike methods such as SCAFFOLD or FedGAMMA, devices do not upload extra auxiliary or control vectors—saving precious uplink bandwidth.

Datasets

The authors evaluate FedVSSAM across vision, text, and sensor tasks—introducing no new benchmarks, but testing across both synthetic and natural heterogeneity:

  • CIFAR-10 & CIFAR-100: Standard image classification benchmarks, partitioned artificially across 100 or 200 devices using Dirichlet ($\alpha \in \{0.1, 0.5\}$) and Pathological class-split distributions to simulate moderate and severe non-IID settings.
  • DBpedia-14: A text topic classification dataset (evaluated with TextCNN).
  • UCI HAR: A human activity recognition sensor dataset that is naturally federated (partitioned by real human subjects).

Key Insights and Ideas

  • Orthogonal Noise Sources: The authors prove (Lemma 2) that inter-device drift (data heterogeneity) and intra-device batch noise ("friendly adversary") are mathematically orthogonal in expectation. They are distinct, additive sources of flatness incompatibility that must be suppressed together.
  • Fixing One Stage Isn't Enough: In SAM, the perturbation chooses the evaluation point for the descent gradient. Correcting only the descent step leaves it evaluating gradients at the wrong location; correcting only the perturbation leaves local descent vulnerable to drift. Ablation studies confirm that suppressing variance across local search, local descent, and global aggregation simultaneously yields the biggest gains.
  • Linear Speedup Without Uplink Bloat: Theoretical proofs for non-convex objectives show FedVSSAM achieves linear convergence speedup with respect to participating devices and local steps—matching or beating state-of-the-art rates while keeping device-to-server communication strictly to model weights.

Key Results

Across 12 baselines (including FedAvg, SCAFFOLD, FedSAM, MoFedSAM, and FedSMOO), FedVSSAM consistently leads in both final accuracy and communication efficiency:

  • Higher Accuracy: On CIFAR-10 (100 devices, 10% participation), FedVSSAM hits 83.56% accuracy under moderate heterogeneity ($\alpha=0.5$) and 79.57% under severe heterogeneity ($\alpha=0.1$), beating the runner-up methods by ~1.2% to 1.4% (and improving by 1.7% on CIFAR-100).
  • Faster Convergence: To reach 75% accuracy on CIFAR-10 ($\alpha=0.5$, 100 devices), FedVSSAM requires just 111 communication rounds—64.8% fewer rounds than FedAvg (315 rounds) and fewer than vanilla FedSAM (266 rounds).
  • Robustness to Low Participation: Even when scaling to 200 devices with only 5% participating per round, FedVSSAM maintains an 83.14% accuracy ($\alpha=0.5$), whereas standard FedAvg and FedSAM drop to 74.86% and 76.17%, respectively.

Limitations and Future Work

The authors note several boundaries to the current study:

  • Theoretical Assumptions: Convergence guarantees rely on standard mathematical assumptions—smooth loss functions, bounded gradient variance, and Uniform-at-Random (UAR) device participation (real-world devices often drop out or participate based on battery/Wi-Fi availability).
  • Simulation Scope: Experiments are simulated on vision (ResNet-18, WRN-28-4), text, and sensor tasks rather than deployed on physical edge hardware.
  • Future Directions: Extending FedVSSAM to larger foundation model families, testing on real-world hardware testbeds, and integrating formal privacy mechanisms (such as Differential Privacy, which injects additional gradient noise) remain open avenues for future work.

Summary updated

Abstract

Sharpness-aware minimization (SAM) is an effective method for improving the generalization of federated learning (FL) by steering local training toward flat minima. Under data heterogeneity, however, device-side SAM searches for locally flat basins that are incompatible with the flat region preferred by the global objective. We identify this structural failure mode as flatness incompatibility, which explains why improving local flatness alone may provide limited training and generalization improvement for the global model. We reveal that flatness incompatibility arises from data heterogeneity and the friendly adversary phenomenon, and is further amplified by local updates and partial device participation. To mitigate this issue, we propose Federated Learning with variance-suppressed sharpness-aware minimization (FedVSSAM), which constructs a variance-suppressed adjusted direction and uses it consistently in local flatness search, local descent, and global update. FedVSSAM anchors both perturbation and update directions to a more stable global direction, instead of correcting only an isolated local perturbation. We establish non-convex convergence guarantees of FedVSSAM and prove that the mean-square deviation between the adjusted direction and the global gradient is effectively controlled. Experiments demonstrate that FedVSSAM mitigates flatness incompatibility and outperforms the baselines across diverse FL settings.
BibTeX
@inproceedings{xiao2026fedvssam,
  author = {Bingnan Xiao and Yuan Gao and Bingcong Li and Wei Ni and Xin Wang and Tony Quek},
  title = {{FedVSSAM: Mitigating Flatness Incompatibility in Sharpness-Aware Federated Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=OB02U98b9E},
}
Figure