Abstract
In recent years, formal methods of privacy protection such as differential privacy (DP), capable of deployment to data-driven tasks such as machine learning (ML), have emerged. Reconciling large-scale ML with the closed-form reasoning required for the principled analysis of individual privacy loss requires the introduction of new tools for automatic sensitivity analysis and for tracking an individual's data and their features through the flow of computation. For this purpose, we introduce a novel hybrid automatic differentiation (AD) system which combines the efficiency of reverse-mode AD with an ability to obtain a closed-form expression for any given quantity in the computational graph. This enables modelling the sensitivity of arbitrary differentiable function compositions, such as the training of neural networks on private data. We demonstrate our approach by analysing the individual DP guarantees of statistical database queries. Moreover, we investigate the application of our technique to the training of DP neural networks. Our approach can enable the principled reasoning about privacy loss in the setting of data processing, and further the development of automatic sensitivity analysis and privacy budgeting systems.
Introduction
The integration of Differential Privacy (DP) into machine learning (ML) has become a cornerstone of responsible data science. However, the standard approach to ensuring privacy—Differentially Private Stochastic Gradient Descent (DP-SGD)—often relies on heuristic methods that can degrade model utility. Central to this challenge is the concept of sensitivity: the measure of how much a single individual's data can influence the output of a function.
In current deep learning frameworks, sensitivity is typically managed through gradient clipping, where gradients are forcibly scaled to a fixed threshold. While effective for privacy, clipping introduces geometric bias and often obscures the true relationship between data and model updates. This research introduces a novel hybrid automatic differentiation (AD) system designed to move beyond these "blunt instruments" by providing closed-form expressions for sensitivity.
The Limitations of Standard Automatic Differentiation
Modern ML relies on reverse-mode AD (backpropagation) to calculate numerical gradients efficiently. While powerful, these frameworks operate as "black boxes" regarding the underlying mathematical structure. They provide the value of a derivative at a specific point but cannot provide the formula for that derivative.
Without a closed-form expression, researchers cannot analytically determine the maximum possible change an individual's data might cause. Consequently, they resort to clipping, which treats all parameters and data points with the same rigid bound, regardless of the architecture's inherent sensitivity. This lack of introspection prevents the development of tighter, more principled privacy bounds.
A Hybrid Approach to Differentiation
To bridge the gap between numerical efficiency and analytical rigor, we propose a hybrid AD framework. This system combines the speed of reverse-mode AD with the introspective power of symbolic differentiation through a specialized compiler tool-chain.
1. Symbolic and Numerical Integration
Unlike standard symbolic systems that struggle with the complexity of large neural networks, our hybrid system utilizes a compiler to emit an intermediate representation (IR) of the mathematical operations. This IR is then compiled into high-performance low-level code, allowing for the generation of exact formulas for gradients without sacrificing the ability to execute on modern hardware.
2. Ahead-of-Time (AOT) Compilation
A key feature of the system is its ability to compile closed-form expressions for gradient norms before training begins. By treating data points as symbolic variables (e.g., $x_0$), researchers can reason about the privacy properties of an algorithm in the abstract. This enables a "privacy-by-design" workflow where the privacy budget can be analyzed and optimized prior to accessing sensitive datasets.
3. Handling Non-Smooth Functions
Neural networks frequently employ non-smooth activations like ReLU. Our compiler addresses this by tracking all possible execution paths and converting them into conditional mathematical statements, ensuring that discontinuities do not break the symbolic analysis.
Experimental Evaluation
We demonstrated the utility of the hybrid AD system through two primary use cases:
- Statistical Database Queries: We analyzed a non-linear query calculating an "age-adjusted body mass index." The system successfully derived the local Lipschitz constant (sensitivity), allowing for a precise Rényi Differential Privacy (RDP) guarantee that is far tighter than those provided by general-purpose bounds.
- Scalability Benchmarking: To test the limits of symbolic reasoning, we applied the framework to MobileNetV3, an architecture with approximately 2.5 million parameters. This experiment served as a benchmark for the computational costs associated with symbolic expression generation in a real-world ML context.
Results and the "Expression Swell" Challenge
The hybrid AD system successfully generated closed-form sensitivity expressions for complex architectures, proving that analytical privacy analysis is feasible for medium-scale models. However, the research also highlighted a significant bottleneck known as expression swell.
As the number of parameters increases, the mathematical expressions for gradients grow in complexity. For MobileNetV3, the static compilation process took approximately 60 hours on a single CPU core. The compilation time currently scales quadratically with the number of parameters, posing a challenge for applying this method to "foundation models" with billions of parameters in its current state.
Conclusion and Future Work
The introduction of hybrid AD represents a significant step toward principled privacy reasoning in machine learning. By replacing arbitrary gradient clipping with calculated sensitivity, we can potentially recover the utility lost in private training.
Future research will focus on optimizing the compiler tool-chain to mitigate expression swell. Techniques such as multi-threaded compilation and common subexpression elimination (CSE) are expected to reduce overhead. Furthermore, the ability to generate closed-form expressions opens the door to feature-level sensitivity analysis, allowing researchers to quantify the privacy impact of specific data attributes with unprecedented precision.
Summary updated