Penguin: Parallel-Packed Homomorphic Encryption for Fast Graph Convolutional Network Inference

Ran Ran, Nuo Xu, Tao Liu, Wei Wang, Gang Quan, Wujie WenNeurIPS 2023

TL;DR

Penguin is a new framework that dramatically speeds up private Graph Convolutional Network (GCN) inference by optimizing how data is packed into Homomorphic Encryption (HE) ciphertexts. By exploiting the unique 2D computation patterns of GCNs, Penguin achieves up to a 10× speedup and a 79% reduction in memory overhead compared to state-of-the-art solutions, all while keeping both graph structures and node features fully encrypted.

What Problem Does This Paper Address?

Graph Convolutional Networks (GCNs) are powerful for analyzing relational data (like social networks or medical records), but running them on the cloud raises massive privacy concerns. Clients don't want to hand over sensitive graph structures or personal node features to a third-party provider.

Homomorphic Encryption (HE) offers a solution: it allows a cloud server to perform calculations directly on encrypted data without ever seeing the raw information. However, HE is notoriously slow and memory-hungry. The "bottleneck" in HE is often the rotation operation (shifting data within an encrypted vector) and ciphertext multiplication.

Latency and memory bottlenecks in HE-GCN inference.

Existing HE acceleration techniques are usually designed for standard matrix multiplications or Convolutional Neural Networks (CNNs). GCNs are different; they involve a unique "two-dimensional" aggregation—aggregating features within a node and then aggregating those features across neighboring nodes ($A \cdot X \cdot W$). Simply treating this as a generic matrix problem leads to "wasted slots" in the encryption and excessive, costly rotations.

Methods

The authors introduce Penguin, which focuses on "packing" data more intelligently to maximize the efficiency of Single Instruction, Multiple Data (SIMD) operations in HE.

Feature and Node Aggregation in Penguin.
  1. Two-Dimension Parallel Packing: Instead of packing ciphertexts purely by node or purely by feature, Penguin uses a hybrid approach. It partitions nodes into small blocks and interleaves features. The authors mathematically modeled the number of HE rotations as an optimization problem, proving that the total complexity is minimized when the number of nodes ($n$) and features ($f$) packed into a ciphertext are balanced (specifically $n \approx 2f$).
  2. Interleaved Assembly (IA): GCN layers often reduce the number of features (e.g., going from 1433 input features to 32 hidden units). Standard methods leave the "extra" slots in the ciphertext empty, wasting memory and compute. IA is a technique to "re-pack" these sparse ciphertexts on the fly, merging them to fill blank slots and significantly reducing the number of ciphertexts the server has to process in subsequent layers.
  3. CKKS Scheme: The framework is built on the CKKS (Cheon-Kim-Kim-Song) homomorphic encryption scheme, which is ideal for the fixed-point arithmetic used in machine learning.

Datasets

The authors evaluated Penguin using three standard benchmarks for graph learning:

  • Cora: A citation network with 2,708 nodes and 1,433 features.
  • Citeseer: A citation network with 3,327 nodes and 3,703 features.
  • Pubmed: A larger dataset with 19,717 nodes and 500 features.

They tested these on common tasks like node classification and link prediction to ensure that the encrypted inference maintained the same accuracy as unencrypted models.

Key Insights and Ideas

  • The 2D Pattern is Key: The "aha moment" is realizing that GCN inference isn't just one big matrix multiplication; it’s a sequence of operations that move in different "directions" (node-wise vs. feature-wise). Optimizing for just one direction makes the other side of the equation incredibly slow.
  • Wasted Slots = Wasted Time: In HE, you pay the same computational price for a ciphertext slot whether it contains a useful number or a zero. Penguin’s primary goal is "slot density"—keeping every part of the encrypted vector working.
  • Structure Protection: Unlike some previous works that assume the graph structure (the adjacency matrix) is public, Penguin is the first to efficiently protect both the structure and the features simultaneously.

Key Results

Penguin was compared against several state-of-the-art (SOTA) HE-matrix multiplication frameworks like Gazelle, E2DM, and uSCORE.

  • Speedup: Penguin achieved a 10.62× speedup on the Cora dataset and consistently outperformed SOTA solutions by 2.6× to 5.9× across different benchmarks.
  • Memory Efficiency: It reduced computational memory overhead by approximately 79% on Cora and 76% on Citeseer.
  • Security: While some SOTA methods only provide 98-bit security, Penguin maintains a robust 128-bit security level while still being faster.
  • Amortized Latency: For the Cora dataset, the time required for a single node's prediction was reduced to just 0.24 seconds.

Limitations and Future Work

  • Scalability to Massive Graphs: While Penguin handles the 19k-node Pubmed dataset, the latency is still significantly higher (thousands of seconds) compared to smaller graphs. For web-scale graphs with millions of nodes, further optimizations or distributed HE strategies would be needed.
  • Non-linear Activations: Like most HE work, Penguin replaces the ReLU activation function with a square function ($x^2$) to stay within the polynomial limits of HE. While this worked well for the tested datasets, some highly complex models might require more precise (and expensive) approximations.
  • Depth: The paper focuses on standard 2-layer GCNs. Deeper networks would require "bootstrapping" (a way to refresh the noise in HE ciphertexts), which is extremely computationally expensive and was not the focus of this study.

Summary updated

BibTeX
@inproceedings{ran2023penguin,
  author = {Ran Ran and Nuo Xu and Tao Liu and Wei Wang and Gang Quan and Wujie Wen},
  title = {{Penguin: Parallel-Packed Homomorphic Encryption for Fast Graph Convolutional Network Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=eXubleMT0q},
}
Figure