Federated learning, where many parties train one model without pooling their data, has two separate fixes for its two main costs, and nobody has combined them. One line of work sums model updates inside the network: a programmable switch adds the integer gradient vectors from all clients as packets pass through, so no server has to receive and add them. The other line encrypts the updates so the party doing the summing never sees an individual update. Each fix leaves the other cost in place. In-network systems such as FediAC aggregate plaintext integers, so the switch and anyone on the path see every update. Encrypted systems such as BatchCrypt run Paillier-style homomorphic encryption, meaning encryption that allows sums to be computed on hidden values, on host servers. There it still consumes most of the training time and network bytes.
The usual assumption is that encryption cannot run in a switch because homomorphic arithmetic needs polynomial multiplication, number-theoretic transforms and bootstrapping. Those operations fail the nanosecond timing of a packet pipeline. Our claim is that aggregation needs none of them. Take an encryption based on learning-with-errors (LWE, a lattice problem in which a secret is hidden by adding small random noise). If its modulus is $2^{32}$ and every client derives the random half of its ciphertext from a shared per-round seed, then adding two ciphertexts is exactly the 32-bit wrap-around integer addition that switch registers already perform. The switch runs the same program it would for plaintext aggregation. Each client gains privacy for its update, and the system tolerates clients that drop out. The cost is a bounded increase in bytes per gradient value and a small key-recovery message from the clients, not new hardware.
Core Claim
Each client $i$ holds a secret ring element $s_i$. In round $t$, every client expands a public seed into the same random element $a_t$. Client $i$ sends only
$$b_i = a_t s_i + e_i + \Delta m_i \pmod{2^{32}},$$
where $m_i$ is its quantized gradient packed into the ring's $N$ coefficients, $e_i$ is small noise, and $\Delta$ is a scaling factor that leaves room for the sum. Because $a_t$ is shared, the switch's coefficient-wise sum $\sum_{i\in S} b_i$ over the clients $S$ that actually reported equals $a_t \sum_{i \in S} s_i + \sum_i e_i + \Delta \sum_i m_i$. The clients then decrypt with the key sum $\sum_{i\in S} s_i$ and nothing else.
This key sum is reconstructed from threshold secret shares of the keys that the clients hold, and it never reveals any single $s_i$. The construction behaves like a "key-homomorphic" mask: the masks add up because the keys add up. That is the property separating it from pairwise masking. Dropouts are handled by summing the keys of whoever is present, so the switch never needs to know the participant set in advance.
Bandwidth expands by $32/b$ for $b$-bit quantized gradients, since the $a_t$ half of the ciphertext is never sent. The constraint on the message comes from requiring the summed message plus summed noise to stay under $2^{32}$, which gives roughly $b + \log_2 K + \text{noise bits} < 32$ for $K$ clients.
Relation to Prior Work
Prior work plays three roles here: it motivates the gap, it supplies the method, or it constrains the design.
Two papers motivate the gap. BatchCrypt quantizes gradients and packs several into one long integer for additive encryption on host servers. It reports that unoptimized encryption takes over 80% of training time and inflates traffic over 150x, and it cuts this to a 23x–93x speedup over stock FATE with under 1% accuracy loss. We reuse its quantization and clipping ideas but move the summation off the host. We also replace Paillier, whose ciphertext multiplication no switch can do, with an LWE scheme whose addition a switch already does. OARF similarly finds that encryption stretches federated training to hundreds of hours and leaves hardware co-design open.
Two papers supply the datapath. FediAC streams $b$-bit integer updates through switch registers and compares against SwitchML. It cuts traffic by up to 69.91% but sends everything in plaintext. Our scheme keeps that streaming-add datapath and its memory model under the roughly 1 MB of switch state, changing only what the integers mean. PsPIN and the BlueField-3 collective offload show line-rate reduction handlers on SmartNIC RISC-V cores. Both operate on plaintext buffers, and they are our second deployment target.
The fully homomorphic accelerator literature constrains the design. The SoK on FHE accelerators shows that even dedicated chips are bound by memory for twiddle factors and evaluation keys. Circuit Bootstrapping identifies bootstrapping, the costly noise-reset step, as the main cost. Taurus gets per-packet ML only by restricting itself to 8-bit fixed-point arithmetic. Together these rule out putting multiplication, number-theoretic transforms or bootstrapping in the data plane. We therefore restrict the in-network operation to addition, which is the one homomorphic operation that grows noise only linearly and needs no keys at the aggregator.
Research Program
The work has three parts.
The first part is the scheme. We pick the ring dimension $N$ and noise width for an LWE/RLWE instance at modulus $2^{32}$ that targets standard security levels. We fix the bit budget that splits the 32 bits among message, client-count headroom and accumulated noise. We specify the threshold sharing of the $s_i$ and the key-sum reconstruction.
One design point is genuinely open. Releasing $\sum_{S} s_i$ for two different participant sets would reveal the difference between them, which can expose an individual key. Keys must therefore be refreshed per round, or key sums released only for sets controlled by a committee. We will implement and cost both options and report the per-round key-management bytes honestly.
The second part is the datapath. We port the SwitchML/FediAC-style streaming aggregation program unchanged except for register width and overflow semantics. Wrap-around is now intended, not an error. We run it on a P4 software target for correctness and as a PsPIN handler on its open-source cycle-level model for line-rate and latency numbers. The per-packet work matches plaintext aggregation, so we expect the reported 400 Gbit/s handler rates to hold. Verifying that is part of the evaluation, not an assumption.
The third part is the training study. It measures how the extra noise and the quantization headroom forced by $\log_2 K$ affect convergence, and whether BatchCrypt-style analytical clipping still keeps accuracy loss under 1%.
Baselines
The naive reference point is plaintext in-network aggregation, a SwitchML-style $b$-bit integer sum on the same switch program. It bounds speed and bytes from below and offers no privacy. We run it with identical quantization, client count and round schedule, and we report our overhead as a ratio to it. The target is round time and bytes within the $32/b$ expansion factor and accuracy within noise.
The strongest existing encrypted method is BatchCrypt. It reports a 23x–93x training speedup and 66x–101x communication reduction over FATE, with under 1% accuracy loss, on FMNIST, CIFAR-10/AlexNet and Shakespeare/LSTM with 9 clients. We rerun it on the same models, client count and network emulation, giving it the same quantization bit-width and the same clipping-tuning budget. Beating it means lower wall-clock time per round and fewer bytes per client at matched accuracy. Its host aggregator is a separate machine, so we also report host CPU-seconds saved.
The strongest non-cryptographic privacy competitor is pairwise-mask secure aggregation run through the same switch adders. Each pair of clients derives cancelling masks from shared seeds. It needs no noise headroom, so its expansion may be smaller. No reported result found on Lacuna for in-network pairwise masking, so we implement it ourselves with the same seed-expansion code and dropout-recovery protocol budget.
Two ablations isolate the key ingredients. The first runs the identical LWE scheme aggregated on a host server instead of the switch, which isolates the contribution of in-network placement. The second uses a single shared key, as BatchCrypt's clients do, which isolates the value of per-client keys. Per-client keys stop clients from reading each other's updates.
Why not just…?
Why not just keep BatchCrypt on host servers? Its own numbers show the remaining cost is real but much smaller than stock FATE, so the question is quantitative. Host aggregation still makes every client send its full ciphertext to one machine, and that machine adds them in software. The host-aggregated ablation of our scheme measures exactly the gap that placement creates. If that gap is small at 9 cross-silo clients, we will say the in-network benefit appears only at larger client counts or higher link rates, and we will sweep $K$ to locate the crossover.
Why not just use pairwise masking in the switch? This is the real threat. Masking uses the same adders, adds no noise and keeps updates hidden from other clients. With no dropouts it may well match or beat us on bytes. Our scheme can only win under dropout and dynamic participation. Masking must then reconstruct the cancelling masks of every absent client, at roughly quadratic seed work, before the sum is usable. We need one key-sum message of size $N$. The dropout-rate sweep settles this. If masking's recovery cost stays small at realistic dropout rates, the honest conclusion is that the switch datapath, not the cipher, is the contribution, and masking is the recommended instantiation.
Why not just put an FHE accelerator next to the aggregator? The SoK reports large speedups for multiplication-heavy kernels, such as up to 20546.9x for number-theoretic transforms on F1. Aggregation contains no such kernels; it is addition bound by input/output. An accelerator also does nothing to cut the many-to-one traffic into the aggregator. We expect the host-aggregated ablation to bound what any co-processor could achieve, and we will report that bound.
Why not just rely on network isolation and FediAC in plaintext? That fits within the existing performance numbers but gives no protection against a curious operator or a compromised switch. Our plaintext baseline gives the exact price of adding encryption, so readers can judge whether it is worth paying.
Proposed Experiments
We use BatchCrypt's workloads (FMNIST with a 3-layer fully connected network, CIFAR-10 with AlexNet, Shakespeare with an LSTM) and FediAC's (CIFAR-10, CIFAR-100, FEMNIST). We sweep 9 to 128 clients, $b \in \{4, 8, 12\}$, and dropout rates from 0% to 30% per round. For every system we measure test accuracy and rounds to target accuracy, wall-clock per round, bytes on the wire per client, host CPU-seconds, switch register and stage use, and PsPIN handler throughput and latency.
There are three decisive checks. First, final accuracy must match the plaintext $b$-bit in-network baseline within seed variance at every $K$ where the bit budget holds. Where it does not, we report the predicted failure point $b + \log_2 K + \text{noise bits} \approx 32$ and check whether accuracy collapses there. Second, per-round time and bytes must beat the rerun BatchCrypt at matched accuracy. Third, at nonzero dropout, our recovery cost must grow more slowly in $K$ than pairwise masking's. If the second check fails the proposal is wrong. If the third fails, the result narrows to "switch-native secure aggregation with masking", and we would report it as such.
References
- BatchCrypt: Efficient Homomorphic Encryption for Cross-Silo Federated Learning
- The OARF Benchmark Suite: Characterization and Implications for Federated Learning Systems
- Expediting In-Network Federated Learning by Voting-Based Consensus Model Compression
- A RISC-V in-network accelerator for flexible high-performance low-power packet processing
- Network-Offloaded Bandwidth-Optimal Broadcast and Allgather for Distributed AI
- SoK: Fully Homomorphic Encryption Accelerators
- Circuit Bootstrapping: Faster and Smaller
- Taurus: a data plane architecture for per-packet ML