Practical Secure Aggregation For Federated Learning On User Held Data
Practical Secure Aggregation For Federated Learning On User Held Data
1 Introduction
Secure Aggregation is a class of Secure Multi-Party Computation algorithms wherein a group of
mutually distrustful parties u ∈ P U each hold a private value xu and collaborate to compute an
aggregate value, such as the sum u∈U xu , without revealing to one another any information about
their private value except what is learnable from the aggregate value itself. In this work, we consider
training a deep neural network in the Federated Learning model, using distributed gradient descent
across user-held training data on mobile devices, using Secure Aggregation to protect the privacy of
each user’s model gradient. We identify a combination of efficiency and robustness requirements
which, to the best of our knowledge, are unmet by existing algorithms in the literature. We proceed to
design a novel, communication-efficient Secure Aggregation protocol for high-dimensional data that
tolerates up to 1/3 of users failing to complete the protocol. For 16-bit input values, our protocol offers
1.73× communication expansion for 210 users and 220 -dimensional vectors, and 1.98× expansion
for 214 users and 224 -dimensional vectors.
30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain.
Although each update h|Du |, δut i is ephemeral and contains less information then the raw Du , a
user might still wonder what information remains. There is evidence that a trained neural network’s
parameters sometimes allow reconstruction of training examples [8, 17, 1]; might the parameter
updates be subject to similar attacks? For example, if the input x is a one-hot vocabulary-length
vector encoding the most recently typed word, common neural network architectures will contain
∂L
at least one parameter θw in Θ for each word w such that ∂θwf is non-zero only when x encodes w.
Thus, the set of recently typed words in Du would be revealed by inspecting the non-zero entries of
δut . The
Pserver does not Pneed to inspect any individual user’s update, however; it requires only the
sums u∈U |Du | and u∈U δut . Using a Secure Aggregation protocol would ensure that the server
learns only that one or more users in U wrote the word w, but not which users.
Federated Learning systems face several practical challenges. Mobile devices have only sporadic ac-
cess to power and network connectivity, so the set U participating in each update step is unpredictable
and the system must be robust to users dropping out. Because Θ may contain millions of parameters,
updates δut may be large, representing a direct cost to users on metered network plans. Mobile devices
also generally cannot establish direct communications channels with other mobile devices (relying on
a server or service provider to mediate such communication) nor can they natively authenticate other
mobile devices. Thus, Federated Learning motivates a need for a Secure Aggregation protocol that:
(1) operates on high-dimensional vectors, (2) is communication efficient, even with a novel set of
users on each instantiation, (3) is robust to users dropping out, and (4) provides the strongest possible
security under the constraints of a server-mediated, unauthenticated network model.
Protocol 0 guarantees perfect privacy for the users; because the su,v factors that users add are
P sampled, the yu values appear uniformly random to the server, subject to the constraint that
uniformly
x̄ = u∈U yu (mod R). In fact, even if the server can access the memory of some users, privacy
holds for those remaining. 3
1
Federated Learning updates δu ∈ Rk can be mapped to [0, R)k through a combination of clipping/scaling,
linear transform, and (stochastic) quantization.
2
We do not analyze security against arbitrarily malicious servers and users that may collude. We defer this
case and a more formal security analysis to the full version.
3
A more complete and formal argument is deferred to the full version of this paper.
2
Protocol 1: Dropped User Recovery using Secret Sharing Unfortunately, Protocol 0 fails several
of our design criteria, including robustness: if any user u fails to complete the protocol by sending her
yu to the server, the resulting sum will be masked by the perturbations that yu would have cancelled.
To achieve robustness, we first add an initial round to the protocol in which user u generates a
public/private keypair, and broadcasts the public key over the pairwise channels. All future messages
from u to v will be intermediated by the server but encrypted with v’s public key, and signed by u,
simulating a secure authenticated channel. This allows the server to maintain a consistent view of
which users have successfully passed each round of the protocol. (We assume here, temporarily, that
the server faithfully delivers all messages between users.)
We also add a secret-sharing round between users after su,v values have been selected. In this round,
each user computes n shares of each perturbation pu,v using a (t, n)-threshold scheme 4 , such as
Shamir’s Secret Sharing [16], for some t > n2 . For each secret user u holds, she encrypts one share
with each user v’s public key, then delivers all of these shares to the server. The server gathers shares
from a subset of the users U1 ⊆ U of size at least t (e.g. by waiting a for a fixed period), then
considers all other users dropped. The server delivers to each user v ∈ U1 the secret shares that were
encrypted for that user; all the users in U1 now infer a consistent view of the surviving user set U1
from the set of received shares. When a userPcomputes yu , she only includes those perturbations
related to surviving users; that is, yu = xu + v∈U1 pu,v (mod R).
After the server has received yu from at least t users U2 ⊆ U1 , it proceeds to a new unmasking round,
considering all other users to be dropped. From the remaining users in U2 , the server requests all
shares of secrets generated by the dropped users in U1 \ U2 . As long as |U2 | > t, each user will
respond with those shares. Once the server receives shares from Pat least t users,
P it reconstructs
P the
perturbations for U1 \U2 and computes the aggregate value: x̄ = u∈U2 yu − u∈U2 v∈U1 \U2 pu,v
(mod R). Correctness is guaranteed for Ū = U2 as long as at least t users complete the protocol. In
this case, the sum x̄ includes the values of at least t > n2 users, and all perturbations cancel out:
!
X X X X X X X X X
x̄ = xu + pu,v − pu,v = xu + pu,v = xu (mod R).
u∈U2 u∈U2 v∈U1 u∈U2 v∈U1 \U2 u∈U2 u∈U2 v∈U2 u∈U2
However, security has been lost: if a server incorrectly omits u from U2 , either inadvertently (e.g. yu
arrives slightly too late) or by malicious intent, the honest users in U2 will supply the server with all
the secret shares needed to remove all the perturbations that masked xu in yu . This means we cannot
guarantee security even against honest-but-curious servers (Threat Model T1).
Protocol 3: Exchanging Secrets Efficiently While Protocol 2 is robust and secure with the right
choice of t, it requires O(kn2 ) communication, which we address in this refinement of the protocol.
4
A (t, n) secret-sharing scheme allows splitting a secret into n shares, such that any subset of t shares is
sufficient to recover the secret, but given any subset of fewer than t shares the secret remains completely hidden.
5
The security argument involves bounding the number of shares the server can recover by forging dropouts.
3
computation User Server
Generate DH keypairs <cu�� ,cu�� > and <su��,su��>
User O(n2 + kn) Round 0: Send public keys cu�� and s�� u
Wait for enough users
Server 6
O(kn2 ) Advertise Keys
Compute u1
Broadcast list of received public keys to all users in u1
communication Generate bu and compute su,v
Round 1:
User O(n + k) Share Keys
Compute t-out-of-n secret shares for bu and su��
Send encrypted shares of bu and su��
Server O(n2 + kn) Forward received encrypted shares
Round 2:
storage Masked Input Compute masked input yu
Send yu
User O(n + k) Collection Wait for enough users
Compute u2
Server O(n2 + k) Send a list of dropped users: u1 \ u2
Round 3: Validate that number of live users is at least t ��
Unmasking Send shares of bu for alive users and su for dropped
Table 1: Protocol 4 Cost Summary Reconstruct secrets
(derivations deferred to the full pa- Compute x (the final aggregated value)
4 Related work
The restricted case of secure aggregation in which all users but one have an input 0 can be expressed
as a dining cryptographers network (DC-net), which provide anonymity by using pairwise blinding
of inputs [3, 9], allowing to untraceably learn each user’s input. Recent research has examined the
communication efficiencly and operation in the presence of malicious users [5]. However, if even one
user aborts too early, existing protocols must restart from scratch, which can be very expensive [13].
Pairwise blinding in a modulo addition-based encryption scheme has been explored, but existing
schemes are neither efficient for vectors nor robust to even single failure [2, 12]. Other schemes (e.g.
based on Paillier cryptosystem [15]) are very computationally expensive.
6
We reconstruct n secrets from aligned (t, n)-Shamir shares in O(t2 + nt) by caching Lagrange coefficients.
7
This can be viewed as bootstrapping a SSL/TLS connection between each pair of users
8
Taking R = n(RU − 1) + 1 to ensure no overflow
4
References
[1] Martín Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar,
and Li Zhang. Deep learning with differential privacy. arXiv preprint arXiv:1607.00133, 2016.
[2] Gergely Ács and Claude Castelluccia. I have a DREAM! (DiffeRentially privatE smArt
Metering). In International Workshop on Information Hiding, pages 118–132. Springer, 2011.
[3] David Chaum. The dining cryptographers problem: unconditional sender and recipient untrace-
ability. Journal of Cryptology, 1(1):65–75, 1988.
[4] Jianmin Chen, Rajat Monga, Samy Bengio, and Rafal Jozefowicz. Revisiting distributed
synchronous sgd. In ICLR Workshop Track, 2016. URL https://arxiv.org/abs/1604.
00981.
[5] Henry Corrigan-Gibbs, David Isaac Wolinsky, and Bryan Ford. Proactively accountable anony-
mous messaging in verdict. In Proceedings of the 22nd USENIX Conference on Security, pages
147–162. USENIX Association, 2013.
[6] Victor Costan and Srinivas Devadas. Intel SGX explained. Cryptology ePrint Archive, Report
2016/086, 2016. http://eprint.iacr.org/2016/086.
[7] Victor Costan, Ilia Lebedev, and Srinivas Devadas. Sanctum: Minimal hardware extensions for
strong software isolation. Technical report, Cryptology ePrint Archive, Report 2015/564, 201 5.
http://eprint. iacr. org.
[8] Matt Fredrikson, Somesh Jha, and Thomas Ristenpart. Model inversion attacks that exploit
confidence information and basic countermeasures. In Proceedings of the 22nd ACM SIGSAC
Conference on Computer and Communications Security, pages 1322–1333. ACM, 2015.
[9] Philippe Golle and Ari Juels. Dining cryptographers revisited. In International Conference on
the Theory and Applications of Cryptographic Techniques, pages 456–473. Springer, 2004.
[10] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. Book in preparation for
MIT Press, 2016.
[11] Joshua Goodman, Gina Venolia, Keith Steury, and Chauncey Parker. Language modeling for
soft keyboards. In Proceedings of the 7th international conference on Intelligent user interfaces,
pages 194–195. ACM, 2002.
[12] Slawomir Goryczka and Li Xiong. A comprehensive comparison of multiparty secure additions
with differential privacy. 2015.
[13] Young Hyun Kwon. Riffle: An efficient communication system with strong anonymity. PhD
thesis, Massachusetts Institute of Technology, 2015.
[14] H. Brendan McMahan, Eider Moore, Daniel Ramage, and Blaise Agüera y Arcas.
Communication-efficient learning of deep networks from decentralized data. arXiv preprint
arXiv:1602.05629, 2016.
[15] Vibhor Rastogi and Suman Nath. Differentially private aggregation of distributed time-series
with transformation and encryption. In Proceedings of the 2010 ACM SIGMOD International
Conference on Management of data, pages 735–746. ACM, 2010.
[16] Adi Shamir. How to share a secret. Communications of the ACM, 22(11):612–613, 1979.
[17] Reza Shokri and Vitaly Shmatikov. Privacy-preserving deep learning. In Proceedings of the
22nd ACM SIGSAC Conference on Computer and Communications Security, pages 1310–1321.
ACM, 2015.
[18] G Edward Suh, Dwaine Clarke, Blaise Gassend, Marten Van Dijk, and Srinivas Devadas. Aegis:
architecture for tamper-evident and tamper-resistant processing. In Proceedings of the 17th
annual international conference on Supercomputing, pages 160–171. ACM, 2003.