Inferensys

Glossary

Sensitivity Analysis

The determination of the maximum change in a function's output caused by adding or removing a single record from the input dataset, a critical parameter for calibrating noise in differential privacy.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
PRIVACY PARAMETER CALIBRATION

What is Sensitivity Analysis?

Sensitivity analysis quantifies the maximum possible change in a function's output resulting from the addition or removal of a single record from the input dataset, serving as the foundational measurement for calibrating noise in differential privacy mechanisms.

Sensitivity analysis determines the global sensitivity of a query function, defined as the maximum L1 or L2 distance between the outputs of a function applied to any two datasets that differ by exactly one record. This worst-case metric is not empirical but a strict mathematical property of the function itself, dictating the scale of noise required to mask the influence of any single individual.

In the context of differential privacy, sensitivity directly parameterizes noise addition mechanisms like the Laplace and Gaussian mechanisms. A query with high sensitivity requires proportionally more noise to achieve a given privacy guarantee, establishing a critical trade-off between privacy budget expenditure and the utility of the released statistical result.

Privacy Calibration

Key Properties of Sensitivity Analysis

The foundational properties that define how sensitivity analysis quantifies the worst-case influence of a single record, enabling the precise calibration of differential privacy mechanisms.

01

Global L2 Sensitivity

The maximum Euclidean distance between the outputs of a function computed on any two adjacent datasets differing by one record. This metric directly calibrates the scale of Gaussian noise added in the Gaussian Mechanism. For a query function f, it is defined as the supremum of ||f(D) − f(D')||₂ over all adjacent D, D'. A smaller global sensitivity allows for less noise and higher utility.

Gaussian
Noise Calibration
02

Local Sensitivity

A data-dependent measure of the maximum change in a function's output when a specific record is added or removed from a fixed, concrete dataset. Unlike global sensitivity, it does not consider the worst-case over all possible datasets. While it is often much smaller, adding noise proportional to local sensitivity can leak information about the dataset itself, requiring smoothing techniques like the smooth sensitivity framework to provide rigorous privacy guarantees.

Data-Dependent
Measurement Type
03

Smooth Sensitivity

A framework that computes a smoothed upper bound on the local sensitivity of a function to avoid leaking information through the noise scale itself. It is defined by considering the maximum local sensitivity across datasets within a certain distance. This allows for adding significantly less noise than global sensitivity for functions with high variability, such as the median, while still satisfying pure differential privacy.

Median
Key Use Case
04

Per-Sample Gradient Norm Clipping

The core operation in DP-SGD that bounds the influence of any single training example on the model update. The gradient for each sample is computed, and its L2 norm is clipped to a maximum threshold C. This directly enforces a bounded sensitivity for the gradient computation step, transforming an unbounded influence into a controlled one before Gaussian noise is added. The clipping threshold is a critical hyperparameter balancing privacy and learning speed.

DP-SGD
Core Mechanism
05

Query Function Sensitivity

The general principle of measuring the maximum magnitude of change in a query's output caused by a unit change in the input. For a counting query, the sensitivity is 1. For a sum query, it is bounded by the data range. This concept is the bridge between a specific data analysis task and the amount of noise required by a privacy mechanism like the Laplace Mechanism, which calibrates to L1 sensitivity, or the Gaussian Mechanism, which calibrates to L2 sensitivity.

L1 & L2
Norm Types
06

Subsampling Amplification

A privacy amplification phenomenon where the act of randomly sampling a mini-batch from the dataset before computing a private update provides a stronger overall privacy guarantee. The sensitivity of the operation remains bounded by the clipping threshold, but the probability of a specific record being included is reduced. This allows the total privacy loss (epsilon) to compose more slowly, making deep learning with differential privacy practically feasible.

Poisson
Sampling Method
NOISE CALIBRATION FOUNDATIONS

L1 vs. L2 Sensitivity: A Comparison

A comparison of the two primary sensitivity measures used to calibrate noise in differential privacy mechanisms, determining how the maximum change in a function's output is quantified when a single record is added or removed.

FeatureL1 SensitivityL2 Sensitivity

Definition

Maximum absolute difference in output measured by the L1 norm (sum of absolute changes)

Maximum absolute difference in output measured by the L2 norm (Euclidean distance)

Mathematical Formula

Δf = max ||f(D) - f(D')||₁

Δf = max ||f(D) - f(D')||₂

Mechanism Pairing

Laplace Mechanism

Gaussian Mechanism

Noise Distribution

Laplace (double exponential)

Gaussian (normal)

Dimensionality Handling

Scales linearly with dimension

Scales with square root of dimension

Privacy Guarantee

Pure ε-Differential Privacy

Relaxed (ε, δ)-Differential Privacy

Typical Use Case

Counting queries, histograms, single-dimensional outputs

Gradient updates in DP-SGD, high-dimensional vectors

Noise Magnitude for High-Dim Data

Higher noise per coordinate

Lower noise per coordinate

SENSITIVITY ANALYSIS

Frequently Asked Questions

Explore the core concepts behind sensitivity analysis, the foundational mechanism for calibrating noise in differential privacy and defending against membership inference.

Sensitivity analysis is the determination of the maximum change in a function's output caused by adding or removing a single record from the input dataset. In differential privacy, this metric—known as global sensitivity—is the critical parameter used to calibrate the magnitude of statistical noise. If a query's sensitivity is high, a single individual's data can drastically alter the result, necessitating more noise to mask their presence. Conversely, a low sensitivity requires less noise, preserving higher data utility. This analysis bridges the gap between a raw statistical query and a provably private mechanism by quantifying the worst-case influence of one record.

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.