Secure Aggregation (simplified)

Intuition

The server should learn only the sum of client updates, never an individual update. Each pair of clients agrees on a random mask; one adds it, the other subtracts it. Every masked update looks like noise, but in the sum all masks cancel.

Precise explanation (core idea of Bonawitz et al., 2017)

For clients i<ji < j with a shared seed sijs_{ij}, mask mij=PRG(sij)m_{ij} = \text{PRG}(s_{ij}) (a random vector). Client i sends

yi=xi+∑j>imij−∑j<imji.y_i = x_i + \sum_{j > i} m_{ij} - \sum_{j < i} m_{ji}.

Then ∑iyi=∑ixi\sum_i y_i = \sum_i x_i because each mijm_{ij} appears once with + and once with −. Dropouts: if client d never sends ydy_d, the masks between d and the survivors no longer cancel. In the real protocol survivors reveal secret shares that let the server reconstruct sdjs_{dj}; here we simulate that by letting the server regenerate those pairwise masks and remove them. Simplifications in this exercise: seeds are derived deterministically from (base_seed, i, j) instead of Diffie–Hellman key agreement, masks are real-valued Gaussian vectors instead of integers modulo a large number, and there is no secret sharing — so this is not secure, only a faithful model of the cancellation arithmetic.

Worked example

x₀ = [1], x₁ = [2], m₀₁ = [5]: y₀ = [6], y₁ = [−3]; sum [3] = x₀ + x₁ ✓.

Common mistakes

  • Both clients adding the mask (no cancellation).
  • Seeding masks per client instead of per pair.
  • Forgetting the dropped client's pairs, leaving a random error in the sum.

Why this matters

Secure aggregation lets FL provide privacy against an honest-but-curious server and is often combined with differential privacy (FL-13).

References