Machine Unlearning › Worked Comparison: When Approximate Unlearning Fails
Language AI HandbookAll chapters For a harder comparison, add two retained clusters near the forget cluster. These points use existing labels 1 and 2, so the architecture and output labels stay fixed. The original training set grows from 1,400 to 2,000 points while the forget cohort remains at 400. The retain set grows from 1,000 to 1,600 points, with the original distant clusters supplying 1,000 of those points. The comparison changes both the proximity of retained points to the forget cluster and the mixture within the retain loss. We train the original and retained-only models again with their respective datasets and use the same approximate update as before.
PythonIn [17]Expand
X_near_a, y_near_a = make_cluster(rng, (-1.0, 1.0), 0.7, 300, 1)
X_near_b, y_near_b = make_cluster(rng, (-1.0, -1.0), 0.7, 300, 2)
X_hard_ret = np.vstack([X_ret, X_near_a, X_near_b])
y_hard_ret = np.concatenate([y_ret, y_near_a, y_near_b])
X_hard_all = np.vstack([X_forget, X_hard_ret])
y_hard_all = np.concatenate([y_forget, y_hard_ret])
model_orig_hard = train_model(X_hard_all, y_hard_all)
model_retrain_hard = train_model(X_hard_ret, y_hard_ret)
model_unlearned_hard = approximate_unlearn(
model_orig_hard, X_forget, y_forget, X_hard_ret, y_hard_ret
)The original forget and distant-retain probes stay the same. For the new nearby cohorts, draw 300 fresh points per cluster. Their accuracy is a separate column so a large gain or loss near the forget cluster stays visible.
PythonIn [18]Expand
X_near_a_probe, y_near_a_probe = make_cluster(rng, (-1.0, 1.0), 0.7, 300, 1)
X_near_b_probe, y_near_b_probe = make_cluster(rng, (-1.0, -1.0), 0.7, 300, 2)
X_near_probe = np.vstack([X_near_a_probe, X_near_b_probe])
y_near_probe = np.concatenate([y_near_a_probe, y_near_b_probe])
hard_models = {
"Original": model_orig_hard,
"Retrain": model_retrain_hard,
"Approximate": model_unlearned_hard,
}
hard_metrics = {
name: (
*behavior_metrics(model, model_retrain_hard),
accuracy(model, X_near_probe, y_near_probe),
)
for name, model in hard_models.items()
}ConsoleOut [19]Expand
Original | forget 0.640 | distant retain 0.870 | nearby retain 0.803 | disagreement 0.640
Retrain | forget 0.000 | distant retain 0.873 | nearby retain 0.930 | disagreement 0.000
Approximate | forget 0.000 | distant retain 0.748 | nearby retain 0.502 | disagreement 0.490In this run the approximate model stops predicting class 0 on the forget probes, but its accuracy on the nearby retained clusters drops. Fresh retraining also stops predicting class 0 and classifies more of the nearby retained probes correctly. That is a failure of the particular update to match the comparator. The two outcomes show why low forget accuracy alone is an incomplete measure.
A language-model deletion request can similarly leave nearby text in the training set, such as documents on the same topic with different authors. Choose retain probes that reflect what those documents are supposed to preserve. The toy's clusters serve only to make it possible to vary related and less related evaluation cohorts separately.
The exact observed comparison is about 50.2% nearby-retain accuracy for the approximate update, 80.3% for the original and 93.0% for the fresh retrain. Nearby probes pool the two nearby retained cohorts. An approximate update can misclassify those points even when it succeeds at the chosen forget metric. In this run its accuracy on the distant cohorts also declines, but those two panels describe different mixtures of retained data.
Both updated models reach 0% forget accuracy on these probes and still disagree on 49.0% of them. Because both predict only classes 1 and 2 on those probes, every disagreement is a class-1 versus class-2 decision there. The hard case therefore isolates the distinction from the first case, where some disagreements can also come from the retrain still predicting class 0.
Accuracy in the nearby retained region is a property of predictions, so it is possible to improve it without restoring the original weights. The retained-only retrain here does that relative to the original, which had to also model the additional class. Whether performance uniformly improves on the retain data is a question for the held-out split. Looking at both nearby and distant cohorts documents where the change occurred.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!