Differentially Private Boxplots

Kelly Ramsay, Jairo Diaz-RodriguezICML 2025

Introduction

Exploratory Data Analysis (EDA) is the foundational step in almost any data science pipeline, and boxplots are its bread and butter. They provide a quick visual summary of a distribution's center, spread, skewness, and tails. However, in privacy-sensitive domains—such as medical records or financial data—simply plotting raw data or standard boxplots can leak individual information.

Differential Privacy (DP) offers a mathematical framework to share aggregate insights without compromising individual privacy. While DP histograms and scatterplots exist, DP boxplots have been surprisingly overlooked. A "naive" approach—simply applying a standard DP quantile algorithm to find the median and quartiles—often fails. These algorithms are typically optimized for the "middle" of the distribution and struggle to accurately place the whiskers or count outliers, leading to visualizations that are either misleading or inconsistent.

To bridge this gap, researchers have introduced DPBoxplot, the first specialized algorithm for creating differentially private boxplots. By intelligently combining different quantile estimation techniques for the "box" and the "whiskers," this visualization tool accurately reflects a dataset's location, scale, and outliers while maintaining rigorous privacy guarantees.

The DPBoxplot Methodology

The secret sauce of DPBoxplot lies in its hybrid algorithm, which uses different privacy mechanisms for different parts of the plot:

  1. The Box (Location & Scale): The algorithm uses the JointExp mechanism to estimate the median and quartiles ($Q_1, Q_3$). JointExp is mathematically proven to be optimal for these "inner" quantiles, ensuring the central box is placed accurately.
  2. The Whiskers (Skewness & Tails): Standard algorithms fail at the extremes. Instead, the authors use the unbounded algorithm to estimate the minimum and maximum. They prove that while JointExp is inconsistent for extreme values, unbounded remains reliable, allowing the whiskers to correctly represent the distribution's tails.
  3. The Outliers: Since plotting individual outlier points would violate privacy, DPBoxplot uses the Laplace mechanism to release a noisy count of how many points fall beyond the whiskers.
  4. The Buffer: A trust parameter ($\lambda_n$) acts as a buffer, preventing the more volatile extreme estimates from erroneously overriding the IQR-based whiskers in small samples.
The construction of a DPBoxplot (right) compared to a traditional boxplot (left).

Experimental Setup and Key Insights

The authors evaluated DPBoxplot using both synthetic distributions (Normal, Skew Normal, Uniform, and Beta) to test performance across various shapes, and a real-world dataset of 2019 New York City Airbnb listings (approx. 40,000 observations) to demonstrate practical utility.

No "One Size Fits All" for Quantiles

The most important theoretical takeaway is that a single DP algorithm cannot handle both the center and the tails of a distribution effectively. Algorithms that are sample-efficient for the median (like JointExp) are often mathematically inconsistent at the edges (the min/max). You need a hybrid approach to get a "best of both worlds" result.

Superior Accuracy and Convergence

Extensive simulations comparing DPBoxplot against naive DP implementations revealed that DPBoxplot consistently outperforms naive methods across all four key metrics: location, scale, skewness, and tails. As the sample size ($n$) increases, the error of the DP boxplot converges to zero, eventually performing almost identically to a non-private boxplot. Furthermore, the error attributed to the inherent randomness of sampling was often larger than the error added by the privatization process, suggesting that the privacy "tax" is quite low for large datasets.

Average error across different metrics and distributions. DPBoxplot consistently tracks closer to the non-private baseline than other methods.

Visualizing Simpson’s Paradox Privately

In the Airbnb case study, the DP boxplots successfully revealed a Simpson's Paradox—where prices seemed higher for "high minimum night" listings overall, but this trend vanished when broken down by room type. This proves that DP visualizations can support complex analytical reasoning just as effectively as their non-private counterparts.

Limitations and Future Work

While DPBoxplot is a significant step forward, it has a few limitations. At very small sample sizes, the unbounded algorithm can still underestimate the range of the data, leading to some inaccuracies in the skewness metric. Additionally, the paper uses a fixed heuristic for splitting the privacy budget ($\epsilon$) between the different components. Future work could explore how to optimally allocate this budget, especially in iterative workflows where an analyst might want to see multiple plots. Finally, extending these principles to high-dimensional, multivariate data remains an open challenge.

Summary updated

BibTeX
@inproceedings{ramsay2025differentially,
  author = {Kelly Ramsay and Jairo Diaz-Rodriguez},
  title = {{Differentially Private Boxplots}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=eRdXrPJFLM},
}
Figure