TL;DR

The paper benchmarks a fixed-parameter two-layer feed-forward neural network under both FHE (Microsoft SEAL with CKKS) and Garbled Circuits (TinyGarble2.0), comparing round-trip time, memory, communication volume, rounds, and output deviation against a plaintext baseline on a single VM [§I, §IV]. GC is faster and far lighter on memory but interactive and leaks model structure; FHE is non-interactive and preserves full model privacy but ~20,912x slower than plaintext [§IV-A, §V].

Problem and motivation

PPML for two-party inference: a Client holds private input x and a Server holds a pre-trained model f(x); the Client must learn y=f(x) without disclosing x, while the Server’s parameters must remain confidential [§I]. Threat model is semi-honest (honest-but-curious) for both parties in both the FHE and GC settings [§I]. The paper targets the gap that prior frameworks (SecureML, CHET, ABY, Sigma, Iron, MPCFormer, CrypTen, SecureGPT, East) focus on protocol optimization or hybrid MPC for large models and rarely give a fine-grained, like-for-like FHE vs GC comparison under a shared task and environment [§II].

Key contributions

FHE setup

ML setup

Datasets

Dataset Task Size (train/test) Modality Notes
Synthetic 3-dim input vectors Inference benchmarking 12 input vectors used for deviation scatter plot (Fig. 7); each measurement repeated five times Tabular / numeric vector Inputs chosen randomly to span a diverse set of activation patterns and stress-test non-linearities [§IV-D]

Pipeline diagram

flowchart LR
    subgraph ClientFHE [Client - FHE]
        A1[Generate CKKS keys] --> A2[Encode + encrypt x]
    end
    subgraph ServerFHE [Server - FHE]
        S1[Hom. matmul W1] --> S2[Square ReLU]
        S2 --> S3[Hom. matmul W2]
        S3 --> S4[Poly sigmoid]
    end
    subgraph ClientDec [Client - FHE]
        D1[Decrypt + decode y]
    end
    A2 -. enc_x + keys .-> S1
    S4 -. enc_y .-> D1

    subgraph ServerGC [Server - GC]
        G1[Encode params fixed-pt] --> G2[Garble netlist circuits]
    end
    subgraph ClientGC [Client - GC]
        H1[Encode x fixed-pt] --> H2[Get input labels via OT]
        H2 --> H3[Eval garbled ops]
        H3 --> H4[Decode output labels]
    end
    G2 -. garbled tables .-> H3
    H2 -. OT .-> G1

Pipeline steps (text)

FHE path:

  1. Client generates CKKS public, secret, relinearization, and Galois keys [§III-B, Alg. 1].
  2. Client encodes input x ∈ R^3 (padded into 8192 slots) and encrypts to ciphertext enc_x [§III-B].
  3. Client sends enc_x and evaluation keys to Server [§III-B].
  4. Server performs row-wise plaintext-ciphertext multiply, slot rotations and additions to realize matrix-vector product, adds b1 [§III-B].
  5. Server applies ReLU ≈ z^2 [§III-B, Alg. 1].
  6. Server multiplies by W2, adds b2, then applies sigmoid ≈ 0.5 + 0.197z − 0.004z^2 [§III-B].
  7. Server returns enc_y; Client decrypts and decodes to recover y [§III-B].

GC path:

  1. Server scales floats (e.g., by 1000) to signed integers and encodes W1, W2, b1, b2 as Alice inputs [§III-C, Alg. 2].
  2. Server generates input labels for all (client + server) inputs and exchanges Bob’s input labels with Client via Oblivious Transfer [§III-C, Fig. 3].
  3. For each operation (add, mult, divscale, matmul, etc.) Server loads a precompiled netlist, garbles it, and sends garbled tables + metadata to Client [§III-C, Alg. 2].
  4. Client evaluates each operation sequentially using TinyGarble2.0’s sequential_2pc_exec_sh(), forwarding output labels into the next layer [§III-C].
  5. Final output labels exchanged with decoding table; Client reveals and decodes to float [§III-C, Fig. 3].

Architecture diagram

This is a comparison paper; the diagram below depicts the comparison axes between FHE (SEAL-CKKS) and GC (TinyGarble2.0) for the shared 2-layer NN.

flowchart LR
    NN([2-layer NN: Sigmoid W2 ReLU W1 x + b1 + b2]) --> FHE[FHE / CKKS SEAL]
    NN --> GC[GC / TinyGarble2.0]

    FHE --> F1[ReLU approx x^2]
    FHE --> F2[Sigmoid poly deg-2]
    FHE --> F3[1 round, non-interactive]
    FHE --> F4[RTT 5.08 s, x20912]
    FHE --> F5[Peak mem 1053.75 MB]
    FHE --> F6[Comm 151.5 MiB, x4.4e6]
    FHE --> F7[Full model privacy]
    FHE --> F8[Output dev up to 121.69%]

    GC --> G1[ReLU exact]
    GC --> G2[Sigmoid poly fixed-point]
    GC --> G3[7 rounds, interactive]
    GC --> G4[RTT 0.039 s, x161]
    GC --> G5[Peak mem 11.15 MB]
    GC --> G6[Comm 3.76 MiB, x1.1e5]
    GC --> G7[Leaks model structure]
    GC --> G8[Output dev up to 23.46%]

Results

All experiments on a Proxmox VM (Ubuntu 24.04 64-bit, 8 vCPUs x86_64-v2 with AES-NI, 32 GB RAM) hosted on an Intel i5-10400T bare-metal machine; both Client and Server on the same VM to minimize network overhead; each benchmark repeated five times with no observed variance [§IV].

Metric Plaintext GC (TinyGarble2.0) FHE (SEAL-CKKS)
Mean round-trip time 0.00024 s (0.24 ms) 0.03909 s (×161 vs plain) 5.07723 s (×20,912 vs plain) [§IV-A, Fig. 4]
Peak memory (MaxRSS) ~5.6 MB (×1 baseline) ~11.15 MB (×2) 1053.75 MB server / 705 MB client (×182) [§IV-B, Fig. 5]
Total communication 0.027 KiB (Alice) / 0.008 KiB (Bob) 3,538.8 KiB Alice + 268.8 KiB Bob ≈ 3.76 MiB (×1.1e5) 256.1 KiB Bob + ciphertext/keys total ~151.5 MiB → 154,825.7 KiB (×4.4e6) [§IV-C, Fig. 6]
Communication rounds N/A 7 (6 OT + 1 reveal) 1 [§IV-C]
Output deviation vs plaintext (worst case) 0% 23.46% 121.69% [§IV-D, Fig. 7]

Extrapolation note: under CKKS, setup dominates (~4.8 s) and each additional layer adds ~0.02 s, so 5–10 layer CNNs would land in the 20–60 s range under comparable parameters [§IV-F]. GC adds ~1.7 MiB per layer; 5–10 layer GC inference projected at 8.5–17 MiB one-way per inference [§IV-F].

Limitations and assumptions

SecureML [12], CHET [13], ABY [14], Sigma [15], Iron [16], MPCFormer [17], CrypTen [18], SecureGPT [19], East [20], CryptoNets [24], Hesamifard et al. PPMLaaS [3], Mann et al. survey [7], Chandran survey [6], Rahman et al. FHE-library benchmarks [21], Zhu et al. HElib/SEAL/OpenFHE CNN comparison [22], FLUENT [23], Rosulek & Roy half-gates [32].

Code and artifacts

Public GitHub repository: https://github.com/kalyancheerla/snni-fhe-gc — two-layer NN implementations under Microsoft SEAL (CKKS) and TinyGarble2.0 with benchmarking for runtime, memory, and communication; accessed 2025-04-23 [§III-C, ref 28]. A modified EMP-tool with communication-stat instrumentation is also released: https://github.com/kalyancheerla/emp-tool [ref 31]. License not stated in the paper.

Extra diagrams (optional)

Threat model

flowchart LR
    C[Client / Bob - data x] -- enc_x + eval keys (FHE) --> S[Server / Alice - model f]
    S -- enc_y (FHE) --> C
    S -- garbled tables + metadata (GC) --> C
    C -- OT requests for input labels (GC) --> S

Both parties semi-honest (honest-but-curious): follow protocol but may attempt to learn extra information from messages [§I].

Activation approximation

ReLU is approximated by x^2 under FHE — preserves non-negativity but diverges sharply for x > 1 (Fig. 8) [Appendix B]. Sigmoid is approximated by 0.5 + 0.197x − 0.004x^2 under both FHE and GC — retains S-shape for small inputs but diverges for large positive values (Fig. 9) [Appendix B, Table I].

Open questions