Seesaw: Compensating for Nonlinear Reduction with Linear Computations for Private Inference

Fabing Li, Yuanhao Zhai, Shuangyu Cai, Mingyu GaoICML 2024

With increasingly serious data privacy concerns and strict regulations, Privacy-Preserving Machine Learning (PPML) has emerged as a crucial technology. It allows a server to execute machine learning tasks on a user's private data (like medical records or financial history) without ever exposing the raw information. This is typically achieved using cryptographic techniques such as Multi-Party Computation (MPC) and Homomorphic Encryption (HE).

However, the computational cost to securely execute these models remains a massive hurdle. Seesaw is a novel Neural Architecture Search (NAS) framework designed to make Private Inference (PI) significantly faster without sacrificing accuracy. By exploiting the unique cost structure of cryptographic protocols, Seesaw replaces expensive nonlinear operations with "cheaper" linear ones and maximizes the reuse of nonlinear results.

The Bottleneck of Private Inference

The primary challenge in PPML is latency, which stems from an asymmetry in how different mathematical operations are handled cryptographically:

  • Linear Operations: Computations like convolutions and matrix multiplications are relatively efficient. Much of their heavy lifting can be done "offline" before the user even provides their data.
  • Nonlinear Operations: Activation functions like ReLUs are a cryptographic nightmare. They require complex, multi-round "online" communication between the user and the server, making them up to 300× slower than their plaintext counterparts.

Previous research focused on simply pruning ReLUs to save time, but this inevitably degrades the model's accuracy. The core challenge is finding a way to reduce these "expensive" ReLUs while maintaining the model's representation capacity.

The Seesaw Architecture: Balancing the Scales

The authors propose a "Seesaw" effect: as you decrease nonlinearities to save online latency, you increase linear computations to compensate and maintain accuracy.

The micro-architecture of Seesaw, featuring Sampling blocks with parallel linear branches and Aggregation blocks for ReLU reuse.

To achieve this balance, the framework introduces two specialized architectural components:

  1. Sampling Blocks: Instead of a standard single convolution, Seesaw uses a block with multiple parallel branches (e.g., 1x1, 3x3, 5x5, dilated convolutions, and skip connections). These extra linear layers increase the model's "representation capacity" without adding much to the online latency.
  2. Aggregation Blocks: To get the most out of the few ReLUs that remain, Seesaw reuses their outputs. It uses dense, residual-style connections to feed previous ReLU results into later stages of the network, ensuring no "nonlinear information" is wasted.

Finding the perfect combination of these blocks is complex. Seesaw utilizes a One-Shot NAS "supermodel" approach. It trains a massive network containing all possible branch options and then uses a specialized search algorithm to prune away the least useful parts based on a target latency budget.

Crucially, the search is guided by a Latency-Aware Loss Function. This function doesn't just look at accuracy; it specifically balances online latency (what the user experiences) and offline latency (pre-computation time) to ensure the offline phase doesn't become a new bottleneck.

Key Insights

  • The Online/Offline Asymmetry: The core realization is that in PPML, linear operations are essentially "subsidized." We can afford to make the model much "wider" with linear branches if it allows us to cut even a few expensive ReLUs.
  • Addition over Concatenation: Unlike many NAS methods that use concatenation (which increases the data size and thus the cost of the next ReLU), Seesaw uses element-wise addition. This keeps the input size to nonlinear layers constant, controlling downstream costs.
  • Strategic ReLU Placement: The search discovered that ReLUs are more critical in the later stages of a network. Seesaw tends to keep ReLUs at the end while using heavy linear compensation at the beginning.

Performance and Results

The authors evaluated Seesaw on standard image classification benchmarks, including ImageNet and CIFAR-100, demonstrating significant improvements over prior state-of-the-art methods like SENet, SNL, and Sphynx.

Accuracy vs. Latency comparison showing Seesaw's Pareto dominance over prior state-of-the-art methods.
  • ImageNet Speedup: At 71% iso-accuracy, Seesaw is 1.68× faster in online latency and 1.55× faster in total latency (online + offline) than the previous best design.
  • Accuracy Gains: At a fixed online latency of 190 seconds, Seesaw provides a substantial 3.65% accuracy boost over existing methods.
  • Search Efficiency: The search process is remarkably efficient, requiring only 45 GPU hours for ImageNet, making it comparable to or faster than many non-private NAS frameworks.

Limitations and Future Work

While Seesaw effectively manages offline costs, there is a theoretical limit. If the linear compensation becomes too massive, the offline pre-processing time could eventually exceed the online time, breaking the pipeline's efficiency. Additionally, the current results are optimized for the DELPHI cryptographic framework. While the core principles hold, the specific architectural balance found by the NAS might shift if deployed on protocols based purely on Homomorphic Encryption.

Future work may explore "hybrid pruning"—combining Seesaw’s macro-architectural search with pixel-level pruning of specific ReLU layers—to push the boundaries of private inference efficiency even further.

Summary updated

BibTeX
@inproceedings{li2024seesaw,
  author = {Fabing Li and Yuanhao Zhai and Shuangyu Cai and Mingyu Gao},
  title = {{Seesaw: Compensating for Nonlinear Reduction with Linear Computations for Private Inference}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=jklD0TV5Hw},
}
Figure