Inferensys

Glossary

Composition Theorems

Composition theorems in differential privacy are mathematical rules that calculate the cumulative privacy loss (total epsilon and delta) when multiple private mechanisms are applied sequentially to the same dataset.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
DIFFERENTIAL PRIVACY

What are Composition Theorems?

Composition theorems are the mathematical rules governing cumulative privacy loss in differential privacy.

In differential privacy, a composition theorem is a formal rule that calculates the total privacy loss (the cumulative epsilon and delta) when multiple private mechanisms are applied to the same dataset, either sequentially (adaptive composition) or in parallel. These theorems are foundational for designing complex, multi-step private analyses, as they allow practitioners to track and bound the overall privacy expenditure against a predefined privacy budget. The most basic forms are sequential composition, which sums the epsilons, and advanced composition, which provides a tighter, more favorable bound for many queries.

The practical application of composition theorems is critical for privacy-preserving machine learning, where training involves thousands of gradient computations. Advanced composition and the moments accountant enable algorithms like DP-SGD to provide a tight, finite total privacy guarantee. Understanding these rules is essential for engineers building systems that must provably protect individual data across numerous operations while maintaining model utility, directly addressing the core privacy-utility trade-off.

DIFFERENTIAL PRIVACY

Key Composition Theorems

Composition theorems provide the mathematical rules for calculating cumulative privacy loss when multiple private mechanisms are applied to the same dataset, forming the backbone of privacy budgeting and complex private algorithm design.

01

Sequential Composition

The Sequential Composition Theorem states that the privacy parameters (epsilon and delta) add when multiple differentially private mechanisms are applied to the same dataset in sequence. If mechanism M1 is (ε₁, δ₁)-DP and mechanism M2 is (ε₂, δ₂)-DP, then their sequential composition satisfies (ε₁ + ε₂, δ₁ + δ₂)-DP. This is the fundamental rule for tracking a privacy budget.

  • Key Implication: It enables the design of complex, multi-step private algorithms by allowing engineers to allocate portions of a total privacy budget to each step.
  • Practical Use: Used in private machine learning where each training epoch or gradient update step consumes a portion of the overall budget.
02

Parallel Composition

The Parallel Composition Theorem provides a more favorable bound when mechanisms are applied to disjoint subsets of a dataset. If a dataset is partitioned into disjoint subsets, and a (ε, δ)-DP mechanism is applied to each partition, the overall process remains (ε, δ)-DP.

  • Key Implication: Privacy loss does not compound across independent data partitions. This allows for highly scalable private analyses on large, partitioned data.
  • Practical Use: Essential for privacy-preserving analytics in federated learning or distributed databases, where operations occur on separate user shards.
03

Advanced Composition

Advanced Composition Theorems provide tighter, more refined bounds for the composition of many mechanisms, improving over the simple linear addition of the basic sequential theorem. For k compositions of (ε, δ)-DP mechanisms, advanced composition can show the overall guarantee is approximately (ε√(2k log(1/δ')), kδ + δ')-DP for a chosen δ'.

  • Key Implication: The privacy parameter grows with O(√k) rather than O(k), allowing for a much larger number of queries or iterations within a fixed privacy budget.
  • Practical Use: Critical for enabling iterative algorithms like differentially private stochastic gradient descent (DP-SGD), which may require thousands of training steps.
04

Adaptive Composition

Adaptive Composition considers the realistic scenario where each subsequent mechanism can be chosen adaptively based on the outputs of previous mechanisms. All standard composition theorems (sequential, parallel, advanced) hold under adaptive composition, which is the model used for most real-world privacy accounting.

  • Key Implication: An adversary can adaptively choose queries based on past answers without weakening the proven composition bounds. This models realistic, interactive data analysis.
  • Practical Use: Underpins privacy accounting in interactive systems like differentially private SQL interfaces, where the analyst's next question depends on earlier results.
05

Privacy Filters and Odometers

Privacy Filters and Odometers are algorithmic constructs built upon composition theorems that allow for online or interactive privacy budgeting. A filter halts computation before a pre-specified privacy budget is exceeded, while an odometer tracks the spent budget in real-time.

  • Key Implication: They enable the safe deployment of private algorithms where the total number of computations or queries is not known in advance.
  • Practical Use: Used in systems that interactively answer an unknown number of user questions while guaranteeing the total privacy loss never surpasses a global limit (ε_total, δ_total).
06

Composition with Heterogeneous Mechanisms

Real-world private systems often compose mechanisms with different privacy guarantees (e.g., Laplace, Gaussian, Exponential mechanisms) and parameters. Composition theorems generalize to handle these heterogeneous compositions, with the overall (ε, δ) calculated by combining the respective parameters of each sub-mechanism.

  • Key Implication: System designers can mix and match optimal mechanisms for different data types (numeric, categorical) or operations (counting, averaging, selection) within a single private pipeline.
  • Practical Use: Designing a complex private data release that involves histogram queries (Laplace), means (Gaussian), and selecting a top-K result (Exponential mechanism) in a coordinated workflow.
PRIVACY-PRESERVING SYNTHESIS

How Composition Theorems Work

Composition theorems are the mathematical rules governing cumulative privacy loss in differential privacy, essential for designing complex, multi-step data analyses.

A composition theorem in differential privacy is a formal rule that calculates the total privacy loss (the combined epsilon and delta) when multiple differentially private mechanisms are applied sequentially to the same dataset. These theorems are foundational for privacy budgeting, allowing system designers to track and constrain cumulative disclosure risk across an entire workflow, such as training a machine learning model with multiple queries. The most basic form is sequential composition, where the epsilons of individual mechanisms simply add together for a pure (ε,0)-DP guarantee.

Advanced theorems provide tighter, more practical bounds. Advanced composition offers a quadratic relationship (ε_total ≈ ε√k) for k compositions under pure DP, often allowing for a much smaller total epsilon. For the more common (ε, δ)-differential privacy, composition bounds become more complex but are precisely defined, enabling the construction of sophisticated, privacy-preserving algorithms. Crucially, these theorems underpin the post-processing immunity of DP, ensuring that any further computation on already private outputs does not degrade the proven guarantee.

DIFFERENTIAL PRIVACY

Composition Theorem Comparison

This table compares the formal rules for calculating cumulative privacy loss (ε, δ) when multiple differentially private mechanisms are applied to the same dataset.

Composition TypePrivacy GuaranteeCumulative Epsilon (ε)Cumulative Delta (δ)Primary Use Case

Basic Sequential Composition

Pure (ε, 0)-DP

ε_total = Σ ε_i

δ_total = 0

Simple, deterministic chaining of mechanisms with known, fixed ε.

Advanced Composition

(ε, δ)-DP

ε_total = ε √(2k log(1/δ')) + kε(e^ε - 1)

δ_total = kδ + δ'

Tight bounds for many adaptive queries; requires a small δ' > 0.

Moments Accountant (RDP)

Rényi DP → (ε, δ)-DP

Converted from Rényi divergence. ε_total < Σ ε_i for high k.

δ_total = δ

State-of-the-art for deep learning with many training steps (e.g., DP-SGD).

Privacy Loss Distribution (PLD)

(ε, δ)-DP

Tight numerical bound via convolution of loss distributions.

δ_total = δ

Optimal, tight accounting for heterogeneous mechanisms; used in production libraries.

Parallel Composition

Pure (ε, 0)-DP

ε_total = max(ε_i) over disjoint data partitions

δ_total = 0

Applying mechanisms to disjoint subsets of the dataset.

Generic Chaining (Dwork et al.)

(ε, δ)-DP

ε_total = O(√(k log(1/δ)) ε) for k mechanisms of sensitivity 1.

δ_total = δ

Theoretical foundation demonstrating sub-linear growth in ε.

COMPOSITION THEOREMS

Practical Applications

Composition theorems are the mathematical engine that enables the practical deployment of differential privacy. They provide the rules for calculating cumulative privacy loss, allowing engineers to build complex, multi-step data analyses while maintaining a provable, quantifiable privacy guarantee.

01

Sequential Query Analysis

This is the most direct application. When a data analyst runs multiple statistical queries (e.g., counts, averages, histograms) on the same dataset, each using a differentially private mechanism like the Laplace or Gaussian mechanism, the composition theorems provide the formula to compute the total privacy budget (ε_total, δ_total) consumed. This allows for the design of workflows where the analyst can 'spend' a pre-defined privacy budget across many questions, ensuring the entire process remains within a safe privacy limit.

  • Example: A health researcher queries a private medical dataset 100 times, each with ε=0.01. Using basic sequential composition, the total privacy cost is a straightforward sum: ε_total = 1.0. Advanced composition allows for a tighter, more favorable bound.
02

Iterative Machine Learning

Training machine learning models—like gradient descent for logistic regression or neural networks—requires hundreds or thousands of iterations over the training data. Differentially Private Stochastic Gradient Descent (DP-SGD) adds noise to gradient computations in each training step. Composition theorems are essential for tracking the privacy loss across all iterations, providing the final (ε, δ) guarantee for the trained model. Without composition, it would be impossible to offer a rigorous privacy promise for any iteratively trained model.

  • Key Insight: The moment accountant and Rényi differential privacy are advanced composition techniques specifically developed to deliver much tighter privacy bounds for these iterative algorithms than naive sequential composition would allow.
03

Complex Data Pipeline Design

Modern data pipelines are not single queries but directed acyclic graphs (DAGs) of operations: data cleaning, feature engineering, model training, and evaluation. Composition theorems enable privacy by design for these entire pipelines. Engineers can assign privacy parameters to each component and use composition rules (sequential, parallel, adaptive) to compute the end-to-end privacy guarantee. This modular approach is foundational to systems like Google's Differential Privacy Library and Microsoft's SmartNoise.

  • Parallel Composition: A powerful rule stating that applying DP mechanisms to disjoint subsets of the data does not increase the overall ε for the worst-case individual, only the δ. This is crucial for partitioning data for scalable, private analysis.
04

Privacy Budget Management & Auditing

In enterprise settings, a privacy budget is allocated per dataset or per user. Composition theorems are the accounting ledger. Every query or model training job consumes a portion of this budget (ε, δ). A privacy budget manager tracks cumulative consumption using composition rules, enforcing hard stops when the budget is exhausted. This creates an auditable trail, proving to regulators (and individuals) that data usage complied with pre-defined, quantifiable privacy limits.

  • Compliance Use Case: Under frameworks like GDPR, demonstrating 'privacy by design' requires measurable controls. Composition theorems provide the necessary mathematics to generate an audit report showing total privacy loss never exceeded the policy-mandated threshold (e.g., ε=1.0, δ=1e-5).
05

Enabling Advanced Composition

Beyond simple summation, advanced composition theorems are a key application in themselves. They show that the privacy loss from k adaptive mechanisms grows much more slowly than k * ε—roughly on the order of √k. This quadratic improvement is what makes practical DP feasible. Libraries use these theorems to allow far more queries or training iterations for the same final privacy guarantee.

  • Technical Note: Advanced composition introduces a small, non-zero δ (failure probability). This trade-off—accepting a tiny, quantifiable risk of catastrophic privacy failure (δ) for a vastly improved ε bound—is a critical engineering decision enabled by the (ε, δ)-differential privacy framework and its composition rules.
06

Integration with Other Privacy Techniques

Composition theorems are not used in isolation. They are combined with other privacy-preserving techniques to build robust systems. For example:

  • With Federated Learning: Each round of model aggregation from devices can be made differentially private. Composition theorems track the privacy loss across all communication rounds.
  • With Secure Multi-Party Computation (MPC) or Homomorphic Encryption: DP noise can be added within a secure computation, and composition tracks the privacy loss of the overall secure protocol.
  • With Synthetic Data Generation: A generative model (like a GAN) trained with DP-SGD has a privacy guarantee derived via composition. The theorem certifies that the entire synthetic dataset, not just the model, carries the composed (ε, δ) guarantee.
COMPOSITION THEOREMS

Frequently Asked Questions

Composition theorems are the mathematical rules that govern cumulative privacy loss in differential privacy. This FAQ addresses common questions about how these theorems work, their practical implications, and their role in building complex, privacy-preserving data pipelines.

A composition theorem in differential privacy is a formal mathematical rule that calculates the total privacy loss (the combined epsilon and delta) when multiple differentially private mechanisms are applied to the same dataset, either sequentially (adaptive composition) or in parallel. It provides the foundational guarantee that privacy parameters add up in a predictable, bounded way, enabling the design of complex, multi-step analyses while maintaining a quantifiable overall privacy guarantee.

There are two primary types:

  • Basic Composition: The simpler, more conservative rule where the epsilons and deltas of individual mechanisms are summed directly. If you run k mechanisms, each satisfying (ε, δ)-DP, the overall composition satisfies (kε, kδ)-DP.
  • Advanced Composition: A tighter, more sophisticated analysis (often using the moments accountant or Rényi differential privacy) that yields a smaller total epsilon, especially for many compositions. For k mechanisms each satisfying (ε, δ)-DP, advanced composition can show the overall composition satisfies approximately (ε√(2k log(1/δ')), kδ + δ')-DP for a small δ'.

These theorems are critical for managing a privacy budget across an entire data analysis workflow.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.