Inferensys

Glossary

Sensitivity

The maximum amount by which a query's output can change when a single record is added to or removed from a dataset, determining the scale of noise required to achieve differential privacy.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
DIFFERENTIAL PRIVACY FUNDAMENTALS

What is Sensitivity?

Sensitivity quantifies the maximum possible change in a query's output when a single record is added to or removed from a dataset, serving as the critical calibration parameter for noise injection in differential privacy mechanisms.

In differential privacy, sensitivity is formally defined as the maximum L1 or L2 norm difference in a query function's output when applied to two neighboring datasets that differ by exactly one record. This metric captures the worst-case influence any single individual can have on the aggregate statistic, directly determining the scale of noise required to mask that individual's contribution and achieve a provable privacy guarantee.

The two primary variants are global sensitivity—the theoretical maximum change across all possible neighboring datasets—and local sensitivity, which is specific to a given dataset instance. Global sensitivity is preferred for rigorous privacy proofs because it is data-independent, while local sensitivity must be carefully smoothed to prevent leaking information about the dataset itself through the noise calibration process.

FOUNDATIONAL CONCEPTS

Types of Sensitivity

Sensitivity quantifies the maximum influence a single record can have on a query's output. The specific type of sensitivity used directly determines the scale and distribution of noise required to achieve a formal differential privacy guarantee.

01

Global Sensitivity

The absolute maximum difference in a query's output over all possible pairs of neighboring datasets. It is a worst-case, data-independent measure.

  • Definition: (GS_f = \max_{D \sim D'} ||f(D) - f(D')||)
  • Mechanism: Used to calibrate noise in the Laplace Mechanism.
  • Example: For a counting query, the global sensitivity is always 1.
  • Limitation: Can be very large for unbounded functions like sum, requiring excessive noise.
1
Sensitivity of a Counting Query
02

Local Sensitivity

The maximum change in a query's output for a specific, fixed dataset when one record is added or removed. It is a data-dependent measure.

  • Definition: (LS_f(D) = \max_{D'} ||f(D) - f(D')||) where (D') is a neighbor of (D).
  • Risk: Directly adding noise proportional to local sensitivity can leak information about the dataset.
  • Usage: Forms the basis for more advanced, smooth calibration techniques.
03

Smooth Sensitivity

An upper bound on local sensitivity that accounts for how much the local sensitivity itself can vary between neighboring datasets. It prevents the information leakage inherent in raw local sensitivity.

  • Framework: Defined as (S^*f(D) = \max{D'} (LS_f(D') \cdot e^{-\beta \cdot d(D, D')})).
  • Advantage: Allows adding significantly less noise than global sensitivity for queries where the worst-case is rare.
  • Example: Used for privately releasing the median of a dataset.
04

Sensitivity for the Exponential Mechanism

A specific sensitivity metric for scoring functions used in the Exponential Mechanism. It measures the maximum change in a utility score when a single record is modified.

  • Definition: (\Delta u = \max_{r \in R} \max_{D \sim D'} |u(D, r) - u(D', r)|).
  • Purpose: Calibrates the probability distribution over candidate outputs.
  • Key Insight: A candidate's selection probability is exponentially proportional to its utility score divided by this sensitivity.
05

Per-Example Sensitivity (DP-SGD)

The sensitivity of the gradient computed on a single training example in deep learning. It is the foundation of Differentially Private Stochastic Gradient Descent (DP-SGD).

  • Mechanism: Per-example gradients are computed, and their norms are clipped to a fixed threshold (C).
  • Result: The sensitivity of the averaged gradient query becomes bounded by (C).
  • Noise: Gaussian noise proportional to (C) is added to the aggregated gradient to achieve differential privacy.
06

Sensitivity in Local Differential Privacy

In the Local Differential Privacy (LDP) model, sensitivity defines the maximum influence a user's true value has on the output distribution of the perturbation mechanism they apply locally.

  • Contrast: Unlike the central model, sensitivity is applied to a single user's data transformation, not a database query.
  • Example: In Randomized Response, the sensitivity relates to the probability of flipping a binary answer.
  • Trade-off: LDP mechanisms often require much larger noise scales due to the lack of a trusted aggregator.
SENSITIVITY IN DIFFERENTIAL PRIVACY

Frequently Asked Questions

Explore the foundational concept of sensitivity, the mathematical measure that determines the scale of noise required to protect individual privacy in statistical queries.

Sensitivity is the maximum amount by which a query's output can change when a single record is added to or removed from a dataset. It quantifies the worst-case influence any individual can have on a statistical result. Formally, for a query function f mapping a dataset to a real-valued vector, the L1 sensitivity is defined as Δf = max ||f(D) - f(D')||₁ over all neighboring datasets D and D'. This metric directly calibrates the magnitude of noise required to mask an individual's contribution, ensuring that the presence or absence of a single record does not significantly alter the published output.

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.