Biostatistics · Advanced

The Laplace Mechanism

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

The Laplace mechanism ensures differential privacy by adding noise drawn from a Laplace distribution to a query's true output, with the noise scale calibrated to the function's sensitivity and the privacy parameter ϵ. It is defined by the equation F(x)=f(x)+Lap(s/ϵ) and satisfies pure ϵ-differential privacy without requiring an error parameter δ. This approach is particularly effective for counting queries, balancing the need for privacy against the utility of the statistical results.

Intuition

To understand the Laplace mechanism, imagine you are releasing a statistic, such as a count, but you must protect the privacy of individuals in the dataset. The mechanism achieves this by injecting random noise into the true value. The amount of noise is not arbitrary; it is precisely calibrated based on two factors: sensitivity and the privacy budget. Sensitivity measures how much the output can change if one person's data is added or removed from the dataset. The privacy parameter, epsilon, controls the strength of the privacy guarantee. By scaling the noise by the sensitivity and dividing by epsilon, the mechanism ensures that the probability of any output for adjacent datasets remains bounded, making it difficult to distinguish whether any specific individual's data was included. This creates a balance where enough noise is added to protect privacy, but not so much that the data becomes useless.

Key equations

F(x)=f(x)+Lap(sϵ)
(1)

The core definition of the Laplace mechanism, where the noisy output F(x) is the true function value f(x) plus noise sampled from a Laplace distribution with scale s/epsilon.

f(x)=12Sexp⁡(−|x|S)
(2)

The probability density function (PDF) of the Laplace distribution, characterized by a center of 0 and a scale parameter S.

Pr⁡[F(x)∈S]≤eϵPr⁡[F(x′)∈S]
(3)

The formal condition for differential privacy for continuous outputs, using set inclusion rather than equality because point probabilities are zero.

Derivation

  1. Define adjacency: Two datasets are adjacent if they differ by exactly one individual's data (add, remove, or replace).
  2. Calculate global sensitivity (s): Determine the maximum possible change in the function's output between any pair of adjacent datasets.
  3. Select the privacy parameter (epsilon): Choose epsilon to control the strength of the privacy guarantee.
  4. Determine the noise scale (S): Set the scale parameter of the Laplace distribution to S = s/epsilon.
  5. Generate the noisy output: Sample a value from the Laplace distribution with scale S and add it to the true function value f(x) to produce F(x).
  6. Verify privacy guarantee: Ensure that the probability ratios of outputs for adjacent datasets are bounded by e^epsilon.

Worked example

Problem

Calculate the noisy output for a counting query where 100 people are at least 40 years old. The global sensitivity s is 1, and the privacy parameter epsilon is 0.5. Assume a sample from the Laplace distribution with scale S is 2.0.

  1. Identify the true function value f(x) = 100.
  2. Identify the sensitivity s = 1.
  3. Identify the privacy parameter epsilon = 0.5.
  4. Calculate the scale parameter S = s/epsilon = 1/0.5 = 2.
  5. Sample a value from Lap(2). The problem states this sample is 2.0.
  6. Add the noise to the true value: F(x) = 100 + 2.0 = 102.

Answer The differentially private output is 102.

Common mistakes

  • Using equality (=) instead of set inclusion (in) when defining differential privacy for continuous distributions, as the probability of any single exact value is zero.
  • Confusing the Laplace mechanism with the Gaussian mechanism; the Laplace mechanism satisfies pure epsilon-differential privacy and does not require a delta parameter.
  • Miscalculating sensitivity by not considering the worst-case change over all possible pairs of adjacent datasets.
  • Assuming the Laplace mechanism is only suitable for low-privacy regimes; it is applicable in any privacy regime, though Gaussian is often preferred for high privacy (epsilon <= 1).

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

This is a text lesson: it has no animation code yet.

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.