On the Local Cache Update Rules in Streaming Federated Learning

Heqiang Wang, Jieming Bian, Jie Xu

In the world of machine learning, Federated Learning (FL) has become a go-to for training models on decentralized data without compromising privacy. But most FL research assumes a "perfect" world where data sits statically on a device. In reality, edge devices—like your smartphone or an industrial IoT sensor—are constantly bombarded by a stream of new data and have very little room to store it.

A recent paper titled "On the Local Cache Update Rules in Streaming Federated Learning" tackles this head-on, proposing a framework for Streaming Federated Learning (SFL) that manages the tug-of-war between limited storage and ever-changing data distributions.

TL;DR

This paper introduces Streaming Federated Learning (SFL), where clients must train on a continuous data stream with limited local storage. The authors propose three cache update rules—FIFO, SRSR, and DRSR—to minimize the gap between the currently stored data and the true long-term data distribution, providing a theoretical convergence bound and demonstrating superior performance on network traffic and image classification tasks.

What Problem Does This Paper Address?

Traditional FL assumes that each client has a fixed, static dataset. However, real-world edge devices face two major constraints:

  1. Streaming Data: Data arrives on-the-fly and its distribution can shift over time (e.g., a router sees different types of traffic during the day vs. at night).
  2. Limited Storage: Devices can’t save everything. They have a small "cache" for training data, meaning they must constantly decide which old samples to delete to make room for new ones.

The core challenge is distribution discrepancy. If the small slice of data currently in a device's cache doesn't look like the "long-term" distribution the model is trying to learn, the global model will struggle to converge. The authors aim to find the best "cache update rule" to ensure the local training set remains a faithful representative of the data stream.

Methods

The authors formalize the SFL workflow and introduce three strategies for managing the local cache:

  • First-In First-Out (FIFO): The simplest approach. When new data arrives, the oldest data in the cache is evicted. While easy to implement, it makes the cache highly sensitive to "noisy" short-term bursts in the data stream.
  • Static Ratio Selective Replacement (SRSR): This rule uses a moving average approach. It calculates a target number of samples for each class based on a weighted average of the current cache and the new incoming data. This "smooths" the distribution, preventing the cache from swinging too wildly based on a single batch of new data.
  • Dynamic Ratio Selective Replacement (DRSR): An evolution of SRSR where the weighting factor changes over time. The goal is to make the cache represent the time-average of all data seen so far. Theoretically, this allows the SFL process to eventually converge to a stationary point as if it had access to the entire data history.

Theoretical Contribution: The authors derive a new convergence bound for SFL. They show that the model's performance is directly tied to the "cumulative gap" between the cached data distribution and the true underlying distribution.

Datasets

The researchers evaluated their algorithms on two distinct types of data:

  • NTC (Network Traffic Classification): Extracted from the ISCXVPN2016 dataset. This represents a practical SFL use case where routers must classify encrypted traffic (e.g., YouTube vs. Skype) from a continuous stream.
  • FMNIST (Fashion MNIST): A standard image classification benchmark used to test the robustness of the update rules in a more traditional CV context.

To simulate the "streaming" nature, they generated 10 different short-term distributions for each client and used a transition matrix (based on K-L divergence) to determine how the data distribution shifts over time.

Key Insights and Ideas

  • The "Virtual Gradient" Trick: To prove convergence, the authors introduced the concept of a "virtual local gradient"—the gradient the client would have calculated if it knew the true long-term distribution. This allowed them to quantify the error introduced by the cache.
  • Smoothing is Essential: FIFO performs poorly because it lacks "memory." By using selective replacement (SRSR/DRSR), clients can retain knowledge of past data distributions even after those specific samples are deleted.
  • DRSR is the Winner: While SRSR is good, it requires tuning a static parameter ($\theta$). DRSR automates this by gradually reducing the weight of new data, effectively "cooling" the cache update process as the model matures.

Key Results

  • Accuracy Gains: On the NTC dataset, DRSR and SRSR achieved performance very close to the "Full Information" scenario (where clients have infinite storage).
  • Stability: DRSR significantly reduced the variance in test accuracy compared to SRSR and FIFO, especially in the later stages of training.
  • Superiority over Baselines: All three proposed rules outperformed "Lazy Updates" (where the cache is never refreshed). In the NTC task, DRSR and SRSR showed a massive lead over FIFO, which suffered from high fluctuations due to the non-stationary nature of the traffic stream.
  • Convergence: The experiments confirmed the theoretical prediction: under the DRSR rule, the distribution discrepancy decreases over time at a rate of $O(1/t)$.

Limitations and Future Work

  • Parameter Sensitivity: While DRSR helps, the initial performance of these rules can still be sensitive to the ratio of incoming data ($B_s$) to total cache size ($B$).
  • Label Requirement: The current study assumes that incoming streaming data is labeled. In many real-world edge scenarios, data is unlabeled, suggesting a need for Streaming Semi-Supervised Federated Learning.
  • Communication Efficiency: The paper focuses on cache rules but doesn't deeply explore how these rules interact with communication compression or partial client participation, which are common hurdles in FL.

The authors suggest that future research should explore even more sophisticated update rules and apply the SFL framework to other complex, real-time scenarios like autonomous driving or live video analytics.

Summary updated

BibTeX
@article{wang2024local,
  author = {Heqiang Wang and Jieming Bian and Jie Xu},
  title = {{On the Local Cache Update Rules in Streaming Federated Learning}},
  journal = {IEEE Internet of Things Journal},
  year = {2024},
  doi = {10.1109/jiot.2023.3327316},
}
Figure