Differential Privacy Mechanisms for Federated Learning
Differential Privacy Mechanisms for FL
While federated learning avoids direct sharing of raw data, the model updates themselves can still leak sensitive information about the client's underlying dataset. An adversary observing these updates might infer properties about the data or even reconstruct parts of it. To provide mathematically sound privacy guarantees against such threats, we turn to Differential Privacy (DP).
Differential Privacy offers a strong standard for privacy protection. It ensures that the outcome of an analysis (like computing an aggregate model update in FL) is statistically similar whether any particular individual's data is included in the dataset or not. This prevents an adversary from confidently inferring the presence or specific details of any single participant's data by observing the output.
Defining Differential Privacy
Formally, a randomized algorithm M satisfies (ϵ,δ)-differential privacy if, for any two adjacent datasets D1 and D2 that differ by only one individual's data, and for any possible set of outputs S, the following inequality holds:
P[M(D1)∈S]≤eϵP[M(D2)∈S]+δ
Let's break down the components:
M: The randomized algorithm. In FL, this could be the entire process of clients computing updates and the server aggregating them. Randomness is typically introduced by adding noise.
Adjacent Datasets D1,D2: Two datasets where one can be formed from the other by adding or removing the data of a single individual (or a single data point, depending on the granularity of protection).
ϵ (Epsilon): The privacy loss parameter, often called the "privacy budget". It's a non-negative value that bounds how much the probability of any given output can change when a single individual's data is modified. A smaller ϵ implies stronger privacy, meaning the output distribution changes less drastically, making it harder to distinguish between D1 and D2. If ϵ=0, the output distribution must be identical, providing perfect privacy but likely no utility.
δ (Delta): Represents the probability that the strict ϵ-privacy guarantee might be broken. It should typically be a very small number, often less than the inverse of the dataset size (e.g., 1/N where N is the number of participants). When δ=0, the algorithm satisfies pure ϵ-differential privacy. When δ>0, it's often referred to as approximate (ϵ,δ)-differential privacy.
The intuition is that if ϵ and δ are small, an observer seeing the output M(D) cannot confidently determine whether any specific individual's data was used in the computation.
Achieving Differential Privacy via Noise Addition
The most common way to make an algorithm differentially private is to inject carefully calibrated random noise into its output. The amount of noise required depends on how much the output could change if one individual's data were different. This maximum possible change is called the sensitivity of the function.
For example, a function f that maps datasets to real-valued vectors (like computing an average gradient).
L1 Sensitivity (Δ1f): The maximum possible change in the L1 norm of the output when one individual's data is changed:
Δ1f=D1,D2max∥f(D1)−f(D2)∥1
L2 Sensitivity (Δ2f): The maximum possible change in the L2 norm of the output:
Δ2f=D1,D2max∥f(D1)−f(D2)∥2
To ensure the sensitivity is bounded, a common prerequisite in FL is gradient clipping. Before noise is added, each client's update vector ui is scaled down if its norm exceeds a predefined threshold C: ui←ui/max(1,∥ui∥2/C). This ensures that the maximum influence of any single client's update on the sum is bounded (e.g., the L2 sensitivity of the sum is at most C when adding/removing one client's entire clipped update).
Two primary noise-adding mechanisms are widely used:
Laplace Mechanism: Adds noise drawn from a Laplace distribution Lap(b), where the scale parameter b is set based on the L1 sensitivity and the desired ϵ. To achieve ϵ-DP for a function f, noise with scale b=Δ1f/ϵ is added to each component of the output f(D).
Gaussian Mechanism: Adds noise drawn from a Gaussian distribution N(0,σ2I), where the standard deviation σ depends on the L2 sensitivity, ϵ, and δ. To achieve (ϵ,δ)-DP for a function f, noise with σ≥ϵΔ2f2ln(1.25/δ) is added to the output f(D). This is often preferred for high-dimensional outputs like model gradients.
Application Models in Federated Learning
Differential privacy can be applied in FL in two main ways, differing in where the noise is added:
Central Differential Privacy (CDP):
Clients compute their updates (e.g., gradients or model weights) based on their local data.
These exact, sensitive updates are sent to the central server (potentially protected during transit by standard encryption like TLS).
The server aggregates the updates (e.g., by averaging).
Before using the aggregate or sharing it (e.g., to update the global model), the server adds calibrated noise (Laplace or Gaussian) to the aggregated result. The amount of noise depends on the sensitivity of the aggregation function with respect to a single client's entire contribution.
Trust Assumption: Requires trusting the central server not to misuse the individual, un-noised updates it receives before aggregation and noise addition.
Noise Level: Generally requires less noise compared to Local DP for the same privacy level, as noise is added only once to the sum, leading to potentially higher model utility. Often combined with Secure Aggregation (SMC) to protect updates before they reach the server for aggregation.
Local Differential Privacy (LDP):
Each client computes its update based on its local data.
Before sending the update to the server, each client individually adds calibrated noise to its own update to make it differentially private with respect to its own local data. The sensitivity here relates to changes within a single client's dataset.
The noisy updates are sent to the server.
The server aggregates these already-noisy updates. No further noise is needed by the server for privacy.
Trust Assumption: Does not require trusting the server; privacy is enforced at the client level before data leaves the device. Offers stronger protection against a malicious or compromised server.
Noise Level: Requires significantly more noise per client. The aggregation of many noisy updates can lead to a very noisy overall result, often substantially impacting model convergence and final accuracy. The "noise cancels out" effect is less pronounced than the accumulation of noise variance.
The choice between Central and Local DP involves a fundamental trade-off between the strength of the privacy guarantee (especially regarding trust in the server) and the impact on model performance.
Comparison of Central DP and Local DP workflows in Federated Learning. In CDP, noise is added centrally after aggregation. In LDP, noise is added locally by each client before sending updates.
Understanding these DP mechanisms and application models is foundational for building FL systems that offer quantifiable privacy protections alongside collaborative model training. The next sections will explore applying these concepts, specifically adding noise to gradient updates and managing the privacy budget over multiple training rounds.
The Algorithmic Foundations of Differential Privacy, Cynthia Dwork and Aaron Roth, 2014 (Now Publishers) - Provides a comprehensive theoretical introduction to differential privacy, covering definitions, privacy parameters, sensitivity, and core mechanisms like Laplace and Gaussian noise.
Deep Learning with Differential Privacy, Martín Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, Li Zhang, 2016Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security (Association for Computing Machinery)DOI: 10.1145/2976749.2978318 - Introduces differentially private stochastic gradient descent (DPSGD), detailing techniques such as gradient clipping and Gaussian noise addition for training deep neural networks with privacy guarantees, highly relevant to FL.
Federated Learning with Differential Privacy: A Survey, Kang Wei, Junyi Zhang, Yushun Fan, Yonggang Wen, Han Hu and Qiang Yang, 2022ACM Transactions on Intelligent Systems and Technology (TIST), Vol. 13 (Association for Computing Machinery (ACM))DOI: 10.1145/3501704 - Offers a survey specifically on differential privacy in federated learning, comparing Central DP and Local DP, and discussing various noise addition strategies and their impact on model utility and privacy guarantees.