Gradient Compression May Hurt Generalization: A Remedy by Synthetic Data Guided Sharpness Aware Minimization

Yujie Gu, Richeng Jin, Zhaoyang Zhang, Huaiyu Dai

TL;DR

While gradient compression is a staple for making Federated Learning (FL) communication-efficient, this paper reveals a hidden cost: it induces "sharper" loss landscapes that hurt the model's ability to generalize. To fix this, the authors introduce FedSynSAM, a method that distills a tiny synthetic dataset from the global model’s history to help clients navigate toward flatter, more robust minima—even under heavy compression and data heterogeneity.

What Problem Does This Paper Address?

In Federated Learning, hundreds or thousands of devices (clients) train a model together without sharing their raw data. Because sending massive model updates over the air is slow and expensive, researchers use gradient compression (like quantization or sparsification) to shrink the data.

The prevailing wisdom was that compression offers a "free lunch"—massive bandwidth savings with negligible accuracy loss. However, this paper argues that compression introduces noise that pushes models into "sharp" regions of the loss landscape. In deep learning, sharp minima are notorious for poor generalization; a tiny shift in data distribution can lead to a huge jump in error.

While Sharpness-Aware Minimization (SAM) is a popular technique to find "flat" minima by perturbing the model during training, it struggles in FL. In a decentralized setting, a client’s local data is often biased (non-IID), making their local estimate of the "global" perturbation direction highly inaccurate. Existing fixes try to use the previous round's update as a guide, but when that update is compressed, the guide becomes too noisy to be useful.

Methods

The authors propose FedSynSAM, which stands for Synthetic Data Guided Sharpness Aware Minimization. The core innovation is a three-stage process:

  1. Trajectory Tracking: For the first few rounds, the server simply records the path (trajectory) the global model takes.
  2. Dataset Distillation: The server uses "trajectory matching" to create a very small synthetic dataset. It optimizes this synthetic data so that a model trained on it would follow the same path as the actual global model. Crucially, this doesn't require seeing any client's private data.
  3. Guided SAM: The server sends this tiny synthetic dataset to all clients. When a client performs a SAM update, they calculate their perturbation vector using a weighted combination of their local (biased) data and the synthetic (globally-representative) data.

By using the synthetic data as a "global anchor," clients can estimate the true global gradient direction much more accurately, leading to flatter minima even when their own updates are being aggressively compressed.

Datasets

The researchers evaluated FedSynSAM on three standard computer vision benchmarks:

  • Fashion-MNIST: Using a two-layer MLP.
  • CIFAR-10: Using a ConvNet architecture.
  • CINIC-10: A more diverse dataset used to test the limits of the synthetic data generation.

To simulate real-world FL, they used Dirichlet and Pathological splits to create highly heterogeneous (non-IID) data distributions across 10 to 50 clients.

Key Insights and Ideas

  • Compression as a Sharpness Inducer: The paper provides empirical evidence (via Hessian eigenvalue analysis) that more aggressive compression directly correlates with sharper loss landscapes.
  • The "Aha" Moment for Synthetic Data: You don't need a perfect reconstruction of the global data to improve SAM. You just need a proxy that captures the direction of the global gradient. Distilling this from the model's own history is a clever way to bypass privacy concerns and data silos.
  • Robustness to Noise: Unlike previous methods (like FedLESAM) that rely on the previous round's compressed update, FedSynSAM's synthetic data provides a stable, uncompressed reference point that remains effective even at very low bit-rates (e.g., 4-bit quantization).

Key Results

  • Flatter Landscapes: Visualizations of the loss surfaces (Figure 4) clearly show that FedSynSAM produces much wider, smoother "valleys" compared to vanilla FedAvg or standard FedSAM.
  • Superior Accuracy: On CIFAR-10 with 4-bit quantization, FedSynSAM achieved 71.56% accuracy, significantly outperforming vanilla FedAvg (68.55%) and the previous state-of-the-art FedLESAM (69.69%).
  • Efficiency: Even when FedSynSAM was given only half the computation budget (5 local steps vs 10) of its competitors, it still maintained higher test accuracy, proving that the quality of the gradient update matters more than the quantity.
  • Communication Neutral: Unlike some other "correction" methods that require sending extra control variables (doubling the uplink cost), FedSynSAM only requires a one-time download of a tiny synthetic dataset.

Limitations and Future Work

  • Warm-up Period: The method requires an initial "R" rounds of standard training to collect enough trajectory data before the synthetic dataset can be distilled.
  • Generative Dependencies: For more complex datasets like CIFAR-10, the authors used StyleGAN-generated samples as a starting point for their synthetic features. While effective, this adds a dependency on pre-trained generative models.
  • Scaling to LLMs: The experiments focused on CNNs and MLPs. Testing whether trajectory matching scales efficiently to Large Language Models (LLMs) in a federated setting remains an open question.

Summary updated

Abstract

It is commonly believed that gradient compression in federated learning (FL) enjoys significant improvement in communication efficiency with negligible performance degradation. In this paper, we find that gradient compression induces sharper loss landscapes in federated learning, particularly under non-IID data distributions, which suggests hindered generalization capability. The recently emerging Sharpness Aware Minimization (SAM) effectively searches for a flat minima by incorporating a gradient ascent step (i.e., perturbing the model with gradients) before the celebrated stochastic gradient descent. Nonetheless, the direct application of SAM in FL suffers from inaccurate estimation of the global perturbation due to data heterogeneity. Existing approaches propose to utilize the model update from the previous communication round as a rough estimate. However, its effectiveness is hindered when model update compression is incorporated. In this paper, we propose FedSynSAM, which leverages the global model trajectory to construct synthetic data and facilitates an accurate estimation of the global perturbation. The convergence of the proposed algorithm is established, and extensive experiments are conducted to validate its effectiveness.
BibTeX
@misc{gu2026gradient,
  author = {Yujie Gu and Richeng Jin and Zhaoyang Zhang and Huaiyu Dai},
  title = {{Gradient Compression May Hurt Generalization: A Remedy by Synthetic Data Guided Sharpness Aware Minimization}},
  year = {2026},
  eprint = {2602.11584},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.11584},
}
Figure