NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Partially Encrypted Deep Learning using Functional Encryption

Théo Ryffel, David Pointcheval, Francis R. Bach, Edouard Dufour-Sans, Romain Gay

Machine learning on encrypted data is a rapidly growing field, allowing users to outsource computations to untrusted servers without exposing sensitive information. While Fully Homomorphic Encryption (FHE) and Secure Multi-Party Computation (SMPC) are the traditional heavy hitters in Privacy-Preserving Machine Learning (PPML), they come with significant drawbacks: FHE is notoriously slow, and SMPC requires the data owner to remain online to exchange messages with the server.

Functional Encryption (FE) offers a compelling "best of both worlds" alternative. Like FHE, it is non-interactive, but it operates much faster. However, practical FE schemes have historically faced two major hurdles:

  1. Functional Limits: Current practical FE schemes can only compute simple functions, such as inner products or quadratic forms, making deep, non-linear neural networks impossible to run entirely under encryption.
  2. Information Leakage: To bypass functional limits, developers often use a "semi-encrypted" setup where the server computes the first few layers via FE and decrypts the intermediate result to finish the task in plaintext. Unfortunately, these decrypted intermediate features can still leak sensitive metadata—a phenomenon known as collateral learning. For example, a model trained to recognize what you said might accidentally leak who you are.

This paper introduces a practical framework that tackles both of these challenges by combining a novel, high-performance FE scheme with adversarial training.

A Two-Pronged Approach: Quadratic FE and Adversarial Training

To make partially encrypted deep learning both fast and secure, the authors propose a hybrid architecture supported by two key innovations.

First, they developed a new Quadratic FE scheme specifically designed to compute quadratic polynomials ($x^T Q y$) more efficiently. It outperforms previous state-of-the-art methods by reducing computational complexity ($2n^2$ versus $3n^2$ operations) and producing smaller ciphertexts. Crucially, the decryption process in this new scheme is independent of the specific ciphertext, which allows for massive speedups via pre-computation.

Second, to combat "collateral learning" from the decrypted intermediate layers, they employ adversarial training. They treat the leakage of sensitive features as a minimax problem, training the network using a composite loss function:

$$\min_{\theta} [ \mathcal{L}_{main} - \alpha \mathcal{L}_{collateral} ]$$

This forces the network to learn features that are highly optimized for the main task but intentionally useless for a "collateral" task.

The hybrid architecture combining a Functional Encryption private network with an adversarial plaintext network to sanitize intermediate features.

In practice, this creates a hybrid architecture: the first layer of the network is a quadratic polynomial computed under FE. The output is then decrypted and passed through standard, plaintext layers (like a CNN) to reach the final classification, while an adversarial network simultaneously tries (and fails) to extract sensitive data from that same decrypted output.

Experimental Setup: The MNIST Font Challenge

To evaluate their approach, the authors used a customized version of the MNIST dataset consisting of 60,000 grayscale $28 \times 28$ images of digits.

To simulate collateral learning, each digit was written in one of two distinct fonts (e.g., Georgia vs. Cursive).

  • The Main Task: Identifying the digit (0-9).
  • The Collateral Task: Identifying the font, which represents the sensitive private information that must not be leaked.
Examples of MNIST digits modified with distinct fonts (Georgia and Cursive) to test collateral learning.

Key Findings and Performance

The proposed framework demonstrates that encryption and adversarial training can be successfully combined to protect data without destroying model utility.

  • High Accuracy: The system achieved 97.7% accuracy on the main MNIST digit classification task while running on encrypted inputs.
  • Privacy Protection: Without adversarial training, an attacker could identify the font with 93.5% accuracy simply by analyzing the decrypted intermediate features. With the authors' adversarial method, this accuracy dropped significantly, successfully "sanitizing" the latent space and making font prediction a hard task even for powerful adversarial models like CNNs and Random Forests.
  • Efficiency: Encrypted inference takes less than 3 seconds on a standard laptop. While the initial encryption of the input is the slowest part (~12 seconds), it only needs to be performed once per image, even if multiple different models are subsequently evaluated on it.

The authors also highlight an important accuracy-privacy trade-off: by reducing the number of neurons in the decrypted intermediate layer (creating an information bottleneck), developers can significantly cripple an adversary's ability to recover private info with only a marginal hit to the main task's accuracy.

Limitations and Future Directions

While promising, the framework has a few limitations. The FE scheme is currently restricted to degree-2 polynomials. Scaling this to complex datasets like ImageNet would likely require higher-degree FE or better polynomial approximations of deep networks. Additionally, the adversarial training requires the developer to know which sensitive features they want to protect in advance; it does not inherently protect against "unknown unknowns."

Finally, this scheme protects the user's data, but the model itself (the quadratic function) remains public. Future work could explore "function-hiding" FE to protect the intellectual property of the model weights alongside user privacy.

Summary updated

BibTeX
@inproceedings{ryffel2019partially,
  author = {Théo Ryffel and David Pointcheval and Francis R. Bach and Edouard Dufour-Sans and Romain Gay},
  title = {{Partially Encrypted Deep Learning using Functional Encryption}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=aXKeajPvk7},
}
Figure