TL;DR
DYNFRS is a high-performance framework that enables "exact" machine unlearning in Random Forests at speeds up to 1.5 million times faster than retraining from scratch. By combining a novel subsampling technique (OCC(q)) with a lazy update strategy (LZY), it allows models to "forget" specific data points—essential for GDPR compliance—without sacrificing predictive accuracy.
The Challenge of Unlearning in Random Forests
Machine unlearning is the process of removing the influence of specific training samples from a trained model, as if they had never existed in the dataset. This capability is increasingly driven by the "right to be forgotten" mandated by privacy regulations like GDPR and CCPA.
While unlearning is well-studied for neural networks (which can leverage gradient-based updates), it is notoriously difficult for Random Forests (RFs). Because RFs are non-parametric and rely on discrete tree structures, removing a single data point can change a decision split at the root, potentially requiring the reconstruction of an entire subtree. Existing methods, such as DaRE or HedgeCut, struggle with large-scale datasets, batch unlearning (removing many samples at once), or maintaining accuracy when a significant volume of samples is removed.
The DYNFRS Framework
To address these bottlenecks, the authors introduce the DYNFRS framework, which optimizes unlearning across three primary dimensions:
OCC(q)Subsampling (Across Trees): Instead of standard bootstrapping, this method ensures each training sample appears in exactly a proportion $q$ of the trees (e.g., if $q=0.1$, a sample is only in 10% of the trees). This limits the "blast radius" of a deletion request; if a sample isn't in a tree, that tree requires zero updates.LZYLazy Tag Strategy (Across Requests): DYNFRS doesn't immediately rebuild a tree when a sample is deleted. Instead, it places a "tag" on the affected node. The actual reconstruction is delayed until a query (inference request) actually hits that node. This avoids redundant work if multiple deletions affect the same subtree and amortizes the cost of updates over time.
- Extremely Randomized Trees (ERTs) as Base Learner: DYNFRS uses ERTs because they choose splits randomly rather than searching for the absolute best threshold. This makes the tree structure more "robust"—a single deleted sample is far less likely to change a random split than an optimized one, leading to fewer required reconstructions.
Datasets and Evaluation
The framework was rigorously evaluated on a diverse set of benchmarks:
- Binary Classification: 9 datasets including Purchase, Vaccine, Adult, Bank, Heart, Diabetes, NoShow, and large-scale sets like Synthetic (1M samples) and Higgs (11M samples).
- Multi-class Classification: Optical, Pen, and Letter.
- Regression: The Bike dataset.
Key Insights
- The Power of Laziness: The
LZYstrategy recognizes that in a massive tree, most nodes are never visited by a specific query. By only rebuilding the "path" needed for a current query, the system achieves near-instant response times even in high-churn data streams. - Predictable Speedups: The authors mathematically prove that
OCC(q)provides an expected $1/q^2$ unlearning speedup. For $q=0.1$, this translates to a theoretical 100x boost even before considering the other optimizations. - Randomness as a Shield: While intuition might suggest that "better" (more optimized) splits are always preferable, the paper shows that the inherent randomness of ERTs acts as a buffer. It makes the model structure more stable and easier to unlearn without losing significant accuracy.
Key Results
- Massive Speedups: DYNFRS achieved a 4,000x to 1,500,000x speedup relative to naive retraining. It outperformed state-of-the-art methods (like DaRE) by orders of magnitude, especially in sequential and batch unlearning scenarios.
- Accuracy Preservation: In many cases, the
OCC(q)subsampling actually improved accuracy compared to vanilla Random Forests by introducing beneficial diversity (randomness) into the ensemble. As shown below, predictive accuracy remains remarkably stable even when a large proportion of the dataset is unlearned.
- Real-time Performance: In a mixed data stream (adding, deleting, and querying simultaneously) on the 11-million-sample Higgs dataset, DYNFRS maintained an average latency of just 0.12 ms for modifications and 1.3 ms for queries.
Limitations and Future Work
- Hyperparameter Tuning: The performance is sensitive to the proportion factor $q$. If $q$ is too small (e.g., $< 0.1$), predictive accuracy can drop sharply.
- Memory Overhead: To enable fast updates, the framework stores split statistics (like counts of positive/negative samples per threshold) at each node. While DYNFRS is more memory-efficient than DaRE, it still requires more RAM than a standard "static" Random Forest.
- Future Directions: The authors suggest investigating even more aggressive tree-structure optimizations to further accelerate Random Forests in dynamic, real-world applications.
Summary updated