Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Gaussian Mechanism | Differential Privacy Mechanisms
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Data Privacy and Differential Privacy Fundamentals

bookGaussian Mechanism

The Gaussian mechanism is a core method for achieving (Ξ΅, Ξ΄)-Differential Privacy. Unlike the Laplace mechanism, which is used for pure Ξ΅-DP, the Gaussian mechanism is designed for situations where a small probability of failure (Ξ΄) is acceptable. This makes it particularly useful in real-world scenarios where perfect privacy cannot be guaranteed, but a strong probabilistic privacy guarantee is still required.

In the Gaussian mechanism, you add noise drawn from a Gaussian (normal) distribution to the output of a query. The amount of noise depends on the global sensitivity of the function (the maximum possible change in the output due to a single individual's data), the privacy parameters ΡΡ and δδ, and the standard deviation (σσ) of the noise. The standard deviation is typically chosen to be proportional to the global sensitivity and inversely proportional to ΡΡ, with an adjustment for δδ.

The Gaussian mechanism is especially suitable for (Ρ, δ)-DP because the tails of the normal distribution allow for a small probability of larger deviations, which aligns with the δδ parameter's interpretation as a "failure probability." This mechanism is widely used in practice, particularly in machine learning and large-scale data analysis, where strict ΡΡ-DP may be too restrictive or result in excessive noise.

12345678910111213141516171819202122232425
import numpy as np from scipy.stats import norm # Suppose you have a dataset of user counts data = np.array([10, 20, 15, 30, 25, 40, 35, 50]) # Define the sum query true_sum = np.sum(data) # Set privacy parameters epsilon = 1.0 delta = 1e-5 # Assume global sensitivity for sum query (e.g., max value a single user can contribute) global_sensitivity = 50 # Compute required standard deviation (Οƒ) for Gaussian noise sigma = (global_sensitivity * np.sqrt(2 * np.log(1.25 / delta))) / epsilon # Add Gaussian noise noisy_sum = true_sum + np.random.normal(0, sigma) print("True sum:", true_sum) print("Noisy sum (Gaussian mechanism):", noisy_sum) print("Standard deviation of noise (sigma):", sigma)
copy

1. Which of the following statements best describes the main difference between the Laplace and Gaussian mechanisms for differential privacy?

2. In which scenario would you prefer to use the Gaussian mechanism over the Laplace mechanism?

question mark

Which of the following statements best describes the main difference between the Laplace and Gaussian mechanisms for differential privacy?

Select the correct answer

question mark

In which scenario would you prefer to use the Gaussian mechanism over the Laplace mechanism?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

bookGaussian Mechanism

Swipe to show menu

The Gaussian mechanism is a core method for achieving (Ξ΅, Ξ΄)-Differential Privacy. Unlike the Laplace mechanism, which is used for pure Ξ΅-DP, the Gaussian mechanism is designed for situations where a small probability of failure (Ξ΄) is acceptable. This makes it particularly useful in real-world scenarios where perfect privacy cannot be guaranteed, but a strong probabilistic privacy guarantee is still required.

In the Gaussian mechanism, you add noise drawn from a Gaussian (normal) distribution to the output of a query. The amount of noise depends on the global sensitivity of the function (the maximum possible change in the output due to a single individual's data), the privacy parameters ΡΡ and δδ, and the standard deviation (σσ) of the noise. The standard deviation is typically chosen to be proportional to the global sensitivity and inversely proportional to ΡΡ, with an adjustment for δδ.

The Gaussian mechanism is especially suitable for (Ρ, δ)-DP because the tails of the normal distribution allow for a small probability of larger deviations, which aligns with the δδ parameter's interpretation as a "failure probability." This mechanism is widely used in practice, particularly in machine learning and large-scale data analysis, where strict ΡΡ-DP may be too restrictive or result in excessive noise.

12345678910111213141516171819202122232425
import numpy as np from scipy.stats import norm # Suppose you have a dataset of user counts data = np.array([10, 20, 15, 30, 25, 40, 35, 50]) # Define the sum query true_sum = np.sum(data) # Set privacy parameters epsilon = 1.0 delta = 1e-5 # Assume global sensitivity for sum query (e.g., max value a single user can contribute) global_sensitivity = 50 # Compute required standard deviation (Οƒ) for Gaussian noise sigma = (global_sensitivity * np.sqrt(2 * np.log(1.25 / delta))) / epsilon # Add Gaussian noise noisy_sum = true_sum + np.random.normal(0, sigma) print("True sum:", true_sum) print("Noisy sum (Gaussian mechanism):", noisy_sum) print("Standard deviation of noise (sigma):", sigma)
copy

1. Which of the following statements best describes the main difference between the Laplace and Gaussian mechanisms for differential privacy?

2. In which scenario would you prefer to use the Gaussian mechanism over the Laplace mechanism?

question mark

Which of the following statements best describes the main difference between the Laplace and Gaussian mechanisms for differential privacy?

Select the correct answer

question mark

In which scenario would you prefer to use the Gaussian mechanism over the Laplace mechanism?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 3
some-alt