Oblivious Sampling Algorithms for Private Data Analysis

Sajin Sasy, Olga Ohrimenko

Executive Summary

This paper introduces "oblivious" sampling algorithms that allow data scientists to perform private data analysis within Trusted Execution Environments (TEEs) without leaking sensitive information through memory access patterns. By ensuring that the indices of sampled data remain hidden from the hardware host, the authors enable "privacy amplification"—a mathematical property of Differential Privacy (DP) that significantly strengthens security guarantees for machine learning models, such as those trained on MNIST and CIFAR-10.

The Problem: Leaky Enclaves and Broken Amplification

When training machine learning models on sensitive data (like medical records), researchers often use two layers of protection:

  1. Trusted Execution Environments (TEEs), such as Intel SGX, which provide a secure "enclave" to process data away from the host operating system.
  2. Differential Privacy (DP), which adds statistical noise to the output to ensure individual records cannot be reverse-engineered or identified.

A core benefit of DP is privacy amplification by sampling. If an algorithm only looks at a random 1% of a dataset to answer a query, the privacy risk to any single individual is naturally reduced. However, for this amplification to hold mathematically, the identity of the sampled records must remain an absolute secret.

This presents a critical vulnerability: TEEs are "leaky." While the data inside the enclave is encrypted, an attacker (such as a compromised or malicious cloud provider) can still observe memory access patterns. If the TEE fetches record #42, record #105, and record #999, the attacker knows exactly who was included in the sample. This observation breaks the "hidden sample" assumption, effectively nullifying the privacy amplification and leaving the data far more vulnerable than the theoretical DP bounds suggest.

Methods: Data-Oblivious Algorithms

To address this vulnerability, the authors design novel data-oblivious sampling algorithms. These algorithms ensure that memory access patterns remain entirely independent of the specific indices being sampled.

  1. Oblivious Sampling Without Replacement (SWO): Instead of simply picking random indices, the algorithm uses a sequence of "oblivious shuffles" and linear scans. It creates a template of sample IDs and then obliviously maps the real data records to those IDs. To an outside observer, the TEE appears to be performing a uniform, predictable sequence of reads and writes, regardless of which specific records are chosen for a mini-batch.
  2. Oblivious Poisson Sampling: This approach is more complex because the number of items in a Poisson sample is itself a random variable. The authors hide the sample size and the boundaries between samples by padding the data with dummy elements and using oblivious sorting to group them securely.
  3. The Melbourne Shuffle: The algorithms leverage the Melbourne shuffle, an efficient technique for rearranging data obliviously. This method is particularly well-suited for the strict memory limits (often capped at 128MB) characteristic of hardware enclaves like Intel SGX.

Key Insights and Ideas

Sampling vs. Shuffling

In standard deep learning, it is common practice to shuffle the entire dataset and iterate through it in epochs. However, in the context of Differential Privacy, Poisson sampling or Sampling Without Replacement (SWO) provides much stronger mathematical privacy guarantees (lower $\epsilon$ values) than shuffling for the exact same level of model accuracy.

Theoretical privacy bounds for different sampling mechanisms.

The Hardware-Software Gap

This paper highlights that privacy is not solely a mathematical problem; it is fundamentally a systems problem. A system can have a flawless DP proof on paper, but if the underlying hardware reveals "random" choices through side-channels, the theoretical proof fails in practice.

Efficiency via Amortization

While oblivious algorithms are traditionally slow due to their computational overhead, the authors demonstrate that by producing an entire "epoch" of samples at once, they can amortize the cost of the oblivious shuffles. This batching approach makes the process practical for real-world ML training.

Empirical Results

The researchers evaluated their framework using standard image classification benchmarks (MNIST and CIFAR-10) to determine if their oblivious sampling methods affected model performance. They found that switching from standard shuffling to oblivious sampling maintained model accuracy while drastically improving privacy:

  • Massive Privacy Gains: For the DP-MNIST model, using standard shuffling resulted in a privacy loss ($\epsilon$) of 9.39. By implementing their oblivious Poisson sampling method, the privacy loss dropped to just 0.82—a nearly 11x improvement in the strength of the privacy guarantee.
  • Accuracy Stability: On CIFAR-10 (pre-trained on CIFAR-100), the DP-trained model achieved ~73% accuracy regardless of whether shuffling or sampling was used. This proves that practitioners do not have to sacrifice "utility" (accuracy) to achieve the "amplification" (better privacy) that true sampling provides.

Limitations and Future Work

  • Memory Constraints: Current TEEs have very limited secure memory (e.g., the Enclave Page Cache). While the authors' algorithms are designed to be memory-efficient, scaling to massive, terabyte-scale datasets would still pose significant performance challenges due to "paging" overhead.
  • Other Side-Channels: While this work successfully addresses memory access patterns, TEEs remain susceptible to other side-channels, such as cache timing attacks and branch prediction leaks. A truly "end-to-end" secure system would require mitigations for these vectors as well.
  • Poisson Padding Waste: The Poisson sampling method requires padding with dummy elements to obscure the true sample size. This introduces computational waste, and optimizing this "dummy" overhead remains a valuable area for future improvement.

Summary updated

BibTeX
@inproceedings{sasy2019oblivious,
  author = {Sajin Sasy and Olga Ohrimenko},
  title = {{Oblivious Sampling Algorithms for Private Data Analysis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=PacJEdFIGIV},
}
Figure