Private AI: Machine Learning on Encrypted Data

Kristin E. LauterIACR ePrint 2021

Introduction

The rapid advancement of artificial intelligence has created a significant privacy paradox. While cloud-based machine learning models offer transformative capabilities in fields like healthcare and finance, they typically require users to surrender sensitive raw data—such as medical records or financial history—to service providers. Traditional encryption methods protect data during storage and transmission but fail when the data must be processed, as decryption is usually required for computation. This "privacy bottleneck" exposes sensitive information to potential breaches and misuse.

This paper explores the paradigm of "Private AI," where machine learning models are trained and evaluated on data that remains encrypted throughout its entire lifecycle. By leveraging Homomorphic Encryption (HE), specifically lattice-based schemes, it is now possible to perform complex statistical analyses and neural network predictions in the cloud without the service provider ever accessing the underlying plaintext.

Methods: The Mechanics of Homomorphic Encryption

The cornerstone of Private AI is Homomorphic Encryption. Unlike standard encryption algorithms like AES, HE possesses a unique mathematical property: it allows operations performed on ciphertexts to be reflected in the underlying plaintexts upon decryption.

The Homomorphic Property

In its simplest form, the homomorphic property can be expressed as $E(a) * E(b) = E(a * b)$, where $E$ represents the encryption function and $*$ represents a mathematical operation (such as addition or multiplication). This allows a third party to compute functions on encrypted data without needing the decryption key.

The Homomorphic Property: Operations on ciphertexts correspond to operations on the underlying plaintexts.

Lattice-Based Cryptography and SEAL

Modern HE schemes, such as BFV and BGV, are built upon the Learning With Errors (LWE) problem in lattice-based cryptography. The security of these schemes relies on the computational hardness of finding the shortest vector in a high-dimensional lattice, a problem that is currently considered resistant even to quantum computing attacks.

To bridge the gap between theory and practice, the Simple Encrypted Arithmetic Library (SEAL) was developed. SEAL is an open-source C++ library that provides accessible primitives for non-experts to implement these complex cryptographic schemes. A critical aspect of using SEAL involves encoding real-world data (integers or floating-point numbers) into polynomial rings and managing "noise." Every homomorphic operation increases the noise within a ciphertext; if this noise exceeds a certain threshold, the data can no longer be decrypted correctly.

Key Insights: The "Homer-morphic" Analogy

To conceptualize how "computation in the dark" works, the author employs a clever analogy involving a jeweler (Homer Simpson) and a locked glove box.

The "Homer-morphic" analogy: A jeweler works on gold inside a locked glove box, manipulating the material without ever possessing it directly.

In this analogy, the gold represents the sensitive data, and the glove box represents the homomorphic encryption. The jeweler can reach into the box using the gloves to shape and process the gold (perform computations), but the gold itself remains locked inside. The jeweler never "sees" or "possesses" the raw gold outside the secure environment, just as a cloud provider processes encrypted data without ever seeing the plaintext.

Practical Applications and Benchmarks

Private AI has been validated across various sensitive datasets:

  • Healthcare: Using the Framingham Heart Study and pneumonia mortality records, researchers have built models to predict health risks using encrypted patient characteristics.
  • Genomics: In the iDASH competitions, HE has been used for secure DNA analysis, including chi-square tests and logistic regression.
  • Finance and Public Records: Large-scale processing of cancer statistics and financial risk assessments has demonstrated the scalability of these methods.

A significant technical hurdle in these applications is Polynomial Approximation. Because HE is optimized for additions and multiplications, non-linear functions common in AI (like ReLU or Sigmoid) must be approximated using low-degree polynomials to maintain efficiency.

Results and Scalability

Recent advancements have shown that Private AI is moving beyond theoretical research into practical implementation:

  • Large-Scale Inference: In collaboration with Merck, heart attack risks for 1 million patients were predicted in approximately 2 hours using encrypted data.
  • Real-Time Response: Pneumonia mortality risks for over 4,000 patients were calculated and returned by a cloud service in seconds.
  • Iterative Training: While encrypted inference is more mature, the author's team successfully demonstrated training a logistic regression model over 300 iterations on encrypted data, proving the feasibility of secure model training.

Limitations and Future Outlook

Despite its promise, Private AI faces several challenges:

  1. Computational Overhead: HE operations are significantly more resource-intensive than plaintext computations in terms of both memory and CPU cycles.
  2. Multiplicative Depth: The accumulation of noise limits the depth of neural networks that can be evaluated without "bootstrapping"—a process to refresh noise that is currently very slow.
  3. Operation Constraints: Logical comparisons (e.g., $x > y$) are difficult to perform in arithmetic-based HE, often requiring complex workarounds.

The future of the field likely lies in Hardware Acceleration. Specialized hardware like FPGAs or ASICs designed for lattice-based mathematics could provide the next order-of-magnitude leap in performance, making Private AI a standard for all cloud-based sensitive data processing.

Summary updated

BibTeX
@article{lauter2021private,
  author = {Kristin E. Lauter},
  title = {{Private AI: Machine Learning on Encrypted Data}},
  journal = {IACR Cryptol. ePrint Arch.},
  year = {2021},
}
Figure