Gecko: fast private inference via secure offloading of the public encoderGecko: Fast Private Inference via Secure Public Encoder Offloading
The authors propose the private inference framework Gecko: the public encoder is moved out of FHE and only the private predictor is protected; the authors state that under the tested extraction attacks, reusing public components shows no consistent advantage.
Two semi-honest parties, no trusted third party. The curious server sees only the encrypted representation; the model-extraction attacker controls the user side, can submit canonical encodings of legitimate inputs, decrypt the returned class probabilities and train a surrogate model, and knows the protocol, predictor architecture, public backbone and projection, but not the private predictor parameters. The goal is not to produce model-side exposure beyond ordinary black-box queries.
- Protecting the entire model with FHE for private inference is too slow. Moving the public encoder out of FHE is fast, but the authors point out that naive offloading exposes a selective feature space, which may make model extraction easier than from the original black box (feature-space shortcut).
- Gecko extracts features with a frozen multi-layer public backbone, compresses them with a fixed Fastfood random projection, balances the layers via a private HFG gate and fuses them into a lightweight predictor, with only the predictor computed under FHE; the output is mapped back to probabilities via a centered logit bijective mapping, and two information-theoretic criteria guide the split.
- On CIFAR10, the ResNet50v2 configuration takes 0.99 s, 10.8 MB, accuracy 93.51% (baseline 93.62%). On Caltech101 at 6400 queries, extraction accuracy against Gecko is 85.71%, lower than 93.11% against the transfer-learning baseline; reusing public components shows no consistent advantage.
- The authors state that currently only CNN classification encoders are covered, and extending to transformers and generative models is future work. The extraction experiments are concrete attacks under a semi-honest threat model, with a query budget of up to 6400, and latency averaged over 16 runs in a CPU-only environment.
- Evaluated models
- ResNet50v2ResNet18MobileNetV3-LargeMobileNetV3-SmallYAMNet
- Benchmarks
- CIFAR10CIFAR100MNISTEuroSATPetsCaltech101FSDDMedMNIST v2 (Blood, Organ, Path, Breast, Skin, Pneumonia)ImageNet (substitute queries)STL10 (substitute queries)
- Metrics
- AccuracyCrypto. MACsReduced MACsCommunicationEnd-to-End TimeAttack Accuracy (surrogate task accuracy)NPMI / estimated MI
The researchers propose a private inference scheme, Gecko: it moves the public encoder outside the cryptographic protection boundary and performs encrypted computation only on a small private predictor; on image and audio tasks, inference takes 0.4-2.2 seconds, communication is at most 10.8 MB, and accuracy is comparable to transfer learning baselines. The scheme uses a frozen backbone network to provide hierarchical features, compresses these features with a fixed Fastfood projection, and then a private feature gate prepares them for prediction. The authors formalize ideal independence and information retention conditions as design guidelines, and separately evaluate attacks that reuse components for model extraction; the authors state that, in the evaluated attacks, reusing the offloaded public encoder gave extractors no significant advantage. Code and demo at https://github.com/CassiniHuy/gecko-infer。
Paper analysis
What problem does this paper attempt to solve?
Offloading the public encoder speeds up private inference but may create a feature-space shortcut; Gecko aims to limit this incremental extraction risk.
Core question: when moving the public encoder out of the FHE protection boundary to speed up private inference, how can one avoid giving a model-extraction attacker a "feature-space shortcut" that is easier than the original black box.
- Scenario and motivation: private inference must protect both the user input and the server model, but full ResNet50 inference under FHE takes about a minute (the authors cite existing systems). Public encoder offloading places a general pretrained encoder outside FHE and encrypts only a lightweight task predictor, which is attractive for efficiency.
- Shortcomings of existing approaches: the authors point out that naive offloading typically exposes the last-layer representation that the private predictor directly consumes; deep features are compact and selective, which may simplify extraction from learning the full input–output behavior to learning a simpler feature–output mapping, which the authors call a feature-space shortcut.
- Core observation: the remedy is to make the public representation richer, but this brings two challenges—richer yet not becoming task-adapted or forcing the private predictor to grow; and representation richness itself lacks principled evaluation, since task accuracy cannot indicate feature richness.
- Paper's approach: proposes the Gecko framework: a frozen backbone provides multi-layer features, a fixed Fastfood projection compresses them, and a private HFG gate balances and fuses them into a lightweight predictor; formalizes two ideal criteria (prediction-artifact independence and information preservation), and separately evaluates component-reuse extraction attacks.
- Threat model (Section 2.2):
- Parties: two semi-honest parties, no trusted third party; the curious server only receives the encrypted representation and returns encrypted predictions.
- Attacker goal: train a surrogate model to replicate the service, learning from class probability outputs.
- Knowledge and capabilities: controls the user side, can choose legitimate original inputs, submit canonical encodings, and decrypt returned results; knows all public components such as the protocol, predictor architecture, public backbone, and projection, but not the private predictor parameters.
- Out of scope: protocol deviations such as chosen-latent queries and malformed ciphertexts; class probability access is intentional API disclosure.
- Security goal: public components do not produce additional model-side exposure beyond an ordinary black-box baseline.
What related research exists?
Related work falls into three categories: cryptographic optimization, heuristic split protection, and transfer learning and model extraction; Gecko is complementary to or contrasted with them.
Cryptographic optimization (pure FHE and hybrid protocols)
- Pure FHE inference such as CryptoNets [3] protects the full model; subsequent work optimized ciphertext packing and rotation (Cheetah [20], Kim & Guyot [21], Hyena [23], Rhombus [5], etc.), or approximated nonlinear activations for arithmetic FHE (e.g., CryptoDL [39]'s quadratic polynomial ReLU).
- Hybrid protocols (e.g., PrivCirNet [61]) reduce latency but require depth-dependent interaction and high communication; precomputation-based systems (GForce [63], Panther [6], Antelope [7], etc.) reduce online cost but retain per-input overhead. The authors say Gecko changes the system partitioning and is complementary to these underlying optimizations.
Heuristic splitting and partial protection
- Protecting only a small predictor on pretrained features: LoLa-type work [8], Ruan et al. [9], CryptPEFT [10]; the authors point out that such designs place a shallow private predictor on last-layer representations, which may expose a selective feature space (Section 2.3).
- Exposing some private components: DarkneTZ [25] and SOTER [26] expose some weights or layers, PrivDNN [27] exposes selected neurons, and THE-X [28], Comet [29] and Scope [30] expose intermediate activations or statistics. The authors argue that these signals come from the private model and may directly help surrogate training; Gecko instead offloads an independently available pretrained encoder.
Transfer learning and intermediate representations
- Head2Toe [32], Visual Query Tuning [33] and Wang et al. [34] show that intermediate-layer representations have comparable or even stronger utility for downstream tasks, which is the basis for Gecko aggregating multi-layer features; Fastfood [13] provides fixed random projections, and Johnson–Lindenstrauss [37] is the motivation for random projections.
Model extraction
- Knockoff Nets [11]: trains a transfer-learning surrogate model by querying class probabilities, and is the attack paradigm followed by this paper's extraction experiments; Shwartz-Ziv & Tishby [12]'s observation on the compact selectivity of deep features is used to argue the shortcut risk.
Baselines and benchmarks: efficiency baselines are pure FHE [21] (ResNet20) and hybrid protocols Cheetah [20] and Rhombus [5] (ResNet50, LAN setting); the utility baseline is standard transfer learning training a classifier on the last layer of the same public backbone; the extraction attack is implemented per Knockoff Nets [11]. Benchmarks include CIFAR10/100, MNIST, EuroSAT, Pets, Caltech101, FSDD and six MedMNIST v2 biomedical tasks.
Authors' positioning: Gecko does not change cryptographic primitives but changes the public/private split and explicitly evaluates its incremental extraction risk, complementing underlying cryptographic optimizations.
How does the paper address this problem?
Frozen multi-layer backbone + fixed Fastfood projection + private HFG gating, with only the lightweight predictor placed in FHE, and two information-theoretic criteria guiding the split.
Overall idea: Gecko moves the task-agnostic, feature-rich public encoding out of encrypted computation, protects only the compact proprietary predictor under FHE, and uses information-theoretic criteria to constrain the public component so that it carries no task-private artifacts and does not collapse the representation.
Workflow (Figure 3)
- Public encoding: the user runs a frozen multi-layer backbone and a fixed projection on input X, obtaining representation X̃ in plaintext.
- Proprietary prediction: the user encrypts X̃, and the server evaluates the task predictor under FHE, producing encrypted centered logits Ỹ.
- Output reconstruction: the user decrypts Ỹ and applies a fixed softmax to obtain probabilities Y. HFG is private and fused into the predictor; the MI estimator runs only offline.
Design criteria (Section 3)
- Criterion 1 (prediction-artifact independence): I(Ỹ; P ∣ X̃) = 0, i.e., the public component P carries no prediction-related private artifacts; under several independence assumptions this implies I(F̃; P ) = 0.
- Criterion 2 (information preservation): normalized information loss ℓX = ℓY = 0, i.e., I(X; X̃) = H(X), I(Y; Ỹ) = H(Y), meaning the interface does not lose input/output uncertainty.
- Theorem 3.9: under the above conditions and Assumption 3.8, H(F | P ) = H(F ); the authors state this means ideal offloading and protecting the entire pipeline have the same prediction-functional uncertainty. The authors also state that these criteria characterize prediction-functional uncertainty, not a direct measure of extraction difficulty.
Key components (Section 4)
- Multi-layer feature aggregation: multiple levels (low, mid, high) of the frozen backbone all participate, avoiding exposing only a selective last-layer representation; ResNet50v2 uses L = 52 feature groups, MobileNetV3-Large/Small use L = 50/44 groups.
- Fixed Fastfood projection: each layer's features are projected to D dimensions and concatenated, X̃ = Concat(M1 E1(X), …, ML EL(X)); the main configuration uses D = 2,000, with total dimensions 104,000 (ResNet50v2) / 88,000 (MobileNetV3-Small). The projection is fixed and public; the authors describe it as a compression mechanism rather than a learned defense.
- NPMI offline diagnostic: NPMI = I(X; X̃)/I(X; X̃_lossless), interpreted relatively and capped at 1.0, used offline to select the number of layers and D; Table 2 reports estimated values for each task (e.g., Pets 104k dimensions 0.95, Caltech101 468k dimensions 0.97).
- HFG gating: a non-negative gate wi = sigmoid(qi) is learned for each group of projected features to balance the scales of different layers; after training it is absorbed into the predictor's first fully connected layer (Wnew = Wold·W_HFG), without increasing FHE depth.
- Centered logit output: Ỹi = logitsi − 1/C∑j logitsj, removing the softmax-invariant common offset, giving a one-to-one correspondence with the probability vector and achieving ℓY = 0.
FHE instantiation
- Uses Lattigo's CKKS (conjugate-invariant variant), polynomial degree N = 8192, ciphertext modulus about 2^218, plaintext scale 2^30, at least 128-bit security.
- The representation is densely packed into ciphertext slots, with a single round of interaction; the main predictor is the linear layer after HFG fusion, and the multi-layer predictor approximates ReLU with a quadratic polynomial.
What experiments did the paper conduct?
Efficiency, cross-task utility, extraction attacks and ablations: Gecko completes inference in 0.33–2.2 seconds, and the authors say reusing public components does not consistently help extraction.
Experimental setup
- Backbones tested: ResNet50v2 (default, 25.56M parameters), ResNet18, MobileNetV3-Large/Small (5.48M/1.59M), YAMNet (MobileNetV1 backbone, 3.73M, for audio).
- Datasets: CIFAR10/100, MNIST, EuroSAT, Pets, Caltech101 (images, resolution up to 224×224, up to 101 classes); FSDD (audio spectrograms); six MedMNIST v2 biomedical tasks (Blood, Organ, Path, Breast, Skin, Pneumonia, 128×128).
- Baselines: efficiency comparison with pure FHE [21] (ResNet20) and Cheetah [20], Rhombus [5] (ResNet50, LAN setting as reported in their papers); utility baseline is standard transfer learning on the same backbone's last layer.
- Metrics: Accuracy, Crypto. MACs, Reduced MACs, Communication, End-to-End Time; extraction experiments report the surrogate model's task accuracy on true labels (attacker utility).
- Protocol: trained for 100 epochs, learning rate 0.0001–0.01; latency averaged over 16 runs in a CPU-only environment (dual 2.10 GHz CPU, 128 GB memory); extraction surrogate trained for 30 epochs.
- Extraction attack setup: Caltech101 target, attacker uses ImageNet as the substitute query set and distills class probabilities following Knockoff Nets; ablation uses CIFAR10 target, STL10 substitute data; query budget 100–6400 (Figure 6) / 100–5000 (Figure 7).
Main results
According to Table 3 (CIFAR10):
Swipe horizontally to read the table
Method Architecture Accuracy Crypto. MACs Communication End-to-End Time Gecko (Pure-FHE CKKS) ResNet18 89.48% 38.01K 4.45 MB 0.33 s Gecko (Pure-FHE CKKS) ResNet50v2 93.51% 1.04M 10.8 MB 0.99 s Pure-FHE [21] ResNet20 90.39% 41.32M 3.15 MB 644 s Hybrid Cheetah [20] ResNet50 93.62% 4.13G 1,815 MB 188 s Hybrid Rhombus [5] ResNet50 93.62% 4.13G 1,152 MB 145 s - The authors state that Gecko reduces encrypted computation from 41.32M/4.13G MACs to 38.01K/1.04M, latency from hundreds of seconds to under 1 second, with accuracy comparable to the baselines.
- The authors point out that Gecko cryptographically protects fewer operations, but protects the same type of proprietary functionality (all task-specific parameters are inside the predictor).
- The authors state that naive last-layer offloading has similar or even lower efficiency but is easier to extract, so it is included only in the extraction ablation rather than as a performance baseline.
Cross-task and cross-backbone generalization (Tables 4–5)
- Image tasks: under the ResNet50v2 backbone, accuracy on five tasks is 78.41%–96.55%, within about 2 percentage points of the transfer-learning baseline (e.g., Caltech101 95.48% vs 94.54%, Pets 90.19% vs 90.92%); latency 0.97–2.20 s, communication 10.8 MB for all. MobileNetV3 backbone results are similar (e.g., MNIST 97.27% vs baseline 97.85%).
- Audio task (FSDD): YAMNet encoder 96.33% accuracy, 0.62 s; the image-pretrained ResNet50v2 as encoder still reaches 96.76%, 0.97 s.
- Biomedical tasks (Table 5, MobileNetV3-Small): accuracy on six tasks is within 1% of the baseline (e.g., PN 87.66% vs 88.62%, Breast 87.18% vs 87.82%), Crypto. MACs all below 1M, latency at most 604 ms.
Extraction risk analysis (Section 5.4, Figure 6)
- Against Gecko vs against baseline (Figure 6a): the same transfer-learning attack at 6400 queries achieves surrogate accuracy of 85.71% against the Gecko target and 93.11% against the transfer-learning baseline target; it is lower against Gecko at every budget. The authors state that switching to Gecko does not increase attacker utility, and note that 85.71% itself is a substantial ordinary extraction risk, not a security threshold.
- Component-reuse attack (Figure 6b): at 6400 queries, free tuning 85.71%, backbone reuse 83.38%, encoder reuse 55.81%; free tuning is always highest from 200 queries onward. The authors state that reusing public components shows no consistent extraction advantage, because the reuse variants freeze the exposed components and cannot optimize the entire surrogate.
Security ablations (Section 5.5, Figure 7)
- Exp. 1 incremental component reuse (Figure 7a): across the three levels same Gecko design / +same backbone / +same projection, accuracy does not consistently increase; the authors state that under this setting the public encoder has almost no exploitable deployment-specific information.
- Exp. 2 partial weight exposure (Figure 7b): the comparison "insecure baseline" exposes some neurons selected by structured pruning importance; at 5000 queries, partial exposure raises attack accuracy by about 43–44 percentage points over full protection.
- Exp. 3 naive representation (Figure 7c): at about 100k same dimensions, the naive last-layer representation target has surrogate accuracy 19–27 percentage points higher than Gecko at 200–5000 queries, which the authors state is consistent with the selective-interface risk.
- Exp. 4 feature richness (Figure 7d): the largest representation (higher estimated MI) has surrogate accuracy 26–29 percentage points lower than the smallest representation.
Other ablations and analyses
- Representation dimensions (Figure 8): total dimensions 2,000→104,000, accuracy nearly stable from about 20,000 onward, estimated MI rises from 4.01 to 11.78 nats, latency about 0.3→1.0 s, communication 1.3→10.8 MB.
- Client overhead (Figure 9): under CPU-only, the client executing the public encoder takes under 0.5 s, memory about 940–1,368 MiB.
- HFG ablation (Figure 10): on CIFAR10, final test accuracy rises from 90.10% to 92.67%; on Pets, without HFG training accuracy is 100% while test is about 70%, and with HFG test exceeds 90%; the authors state that HFG improves optimization stability and generalization.
- NPMI vs number of layers (Figure 4): on CIFAR10, estimated NPMI rises as more MobileNetV3 layers are included (the vertical axis in the figure goes to about 1.0); the caption does not give specific point-by-point values.
What are some points that can be further explored?
The authors state that currently only CNN classification encoders are covered, and extending to transformers and generative models is future work.
Limitations and future directions noted by the authors
- Model type coverage: the authors state that the evaluated system covers CNN classification encoders in image and audio applications; extending to transformers and generative models would bring richer output spaces, potentially larger private predictors, and new challenges for evaluating representation richness, which the authors call an important future direction (Section 7 Discussion and Conclusion).
- Relationship between criteria and extraction difficulty: the authors state that the formalized criteria characterize prediction-functional uncertainty, not a direct measure of model extraction difficulty; in practice, estimated mutual information is used as an offline relative diagnostic, and extraction experiments are conducted separately (Section 1).
- NPMI is only a relative diagnostic: the authors state that there is no task-agnostic threshold for determining the absence of shortcuts, and NPMI can only be interpreted relatively and used offline (Section 4.1).
- Idealization of Assumption 3.8: the authors state that this assumption only requires lossless endpoints and does not constrain the approximation rate, i.e., the quantitative relationship between richness and functional uncertainty is not characterized (Section 3.3).
Experimental coverage
- Backbones tested: ResNet50v2, ResNet18, MobileNetV3-Large/Small, YAMNet, 5 public encoders in total, all CNN-type (Section 5.1).
- Task coverage: 7 image/audio classification tasks plus 6 MedMNIST v2 biomedical tasks, resolution up to 224×224, up to 101 classes (Section 5.1).
- Extraction evaluation: Caltech101 target, ImageNet substitute data, budget up to 6400 (Figure 6); CIFAR10 target, STL10 substitute data, budget up to 5000 (Figure 7); attacks follow Knockoff Nets, surrogate trained for 30 epochs.
- Threat model boundaries: semi-honest both parties; protocol deviations such as chosen-latent queries and malformed ciphertexts are out of scope (Section 2.2).
- Efficiency measurement: CPU-only environment, average of 16 runs; the paper does not report end-to-end numbers under GPU, nor the number of repetitions or variance of the extraction experiments.
Summarize the main content of the paper
Gecko moves the public encoder out of FHE and uses multi-layer features plus gating to limit the extraction shortcut; the authors state it achieves both efficiency and security.
Gecko is a private inference framework addressing the problem that "public encoder offloading is fast but may create a feature-space extraction shortcut."
- Problem: FHE private inference protecting the whole model is too slow; after moving the general encoder out of FHE, naive designs expose a selective last-layer representation, which the authors believe may make model extraction easier than the original black box.
- Method: a frozen multi-layer public backbone provides features, a fixed Fastfood projection compresses them to D = 2,000 dimensions per layer, and a private HFG gate balances the layers before fusing them into a lightweight predictor; only the predictor is computed under CKKS FHE, and the output is mapped back to class probabilities via a centered-logit bijection. Two ideal criteria (prediction-artifact independence, information preservation) guide the split, and NPMI serves as an offline richness diagnostic.
- Efficiency: on CIFAR10, the ResNet50v2 configuration takes 0.99 s, 10.8 MB, 93.51% accuracy, versus the hybrid baseline Rhombus's 145 s, 1,152 MB, 93.62% (Table 3); across image, audio, and biomedical tasks, latency is 0.33–2.20 s.
- Security: on Caltech101 at 6400 queries, extraction accuracy against Gecko is 85.71%, lower than 93.11% against the transfer-learning baseline; reusing the public backbone or the full encoder shows no consistent advantage (free tuning 85.71% is the highest). At about 100k same dimensions, naive last-layer offloading is 19–27 percentage points easier to imitate than Gecko.
- Authors' conclusion: the authors state the results support public encoder offloading as a practical route that preserves model-side protection while reducing encrypted computation; currently CNN classification encoders are covered, and extending to transformers and generative models is future work.
Related papers
- Near-Duplicate Families Break Exact-Record Membership InferenceAnalysis / interpretabilityarXiv
- Label-Only Membership Inference AttacksAttacksarXiv
Show 3 more papers
- On the Privacy Risks of Model ExplanationsAttacksarXiv