Machine Unlearning › Behavioral Forgetting versus Privacy and Attribution

Michael BrenndoerferDecember 1, 20265 min read
Language AI HandbookAll chapters
Part 45 of 67Knowledge, Memory, Editing, and Unlearning
Chapter 350Machine Unlearning › Behavioral Forgetting versus Privacy and Attribution
Reading section 7 of 13 · Behavioral Forgetting versus Privacy and Attribution · 5 minSection 7 of 13 · 5 min

Section 7 of 13 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Suppose the decision boundary matches the fresh retrain throughout the plotted grid. Even then the two models could use different hidden features or assign different probabilities. To examine this distinction we compare two scores on class-0 points the original model saw and on fresh class-0 points drawn from the same distribution.

The first score takes the largest softmax probability assigned to any class. It can be high when the classifier is confident in class 1 or 2. The second score takes the negative squared distance in the 16-dimensional hidden layer to a reference center. We form that center separately for each model using 300 independent reference points from the forget distribution. A larger score means closer to that center. No reference point is reused in either scoring cohort. The scoring cell reuses X_forget from the first draw of the main NumPy generator and X_forget_probe from the fourth draw. The new reference draw uses a separate generator seeded with 1. It does not advance the main generator. The hard case draws its nearby training and probe cohorts later from the main generator.

PythonIn [14]
CollapseExpand
reference_rng = np.random.default_rng(SEED + 1)
X_reference, _ = make_cluster(reference_rng, (-2.0, 0.0), 0.9, 300, 0)


def confidence_scores(model, features):
    with torch.no_grad():
        probabilities = torch.softmax(model(torch.from_numpy(features)), dim=1)
        return probabilities.max(dim=1).values.numpy()


def hidden_features(model, features):
    with torch.no_grad():
        return model.net[1](model.net[0](torch.from_numpy(features))).numpy()


def mean_gap(training_scores, fresh_scores):
    return float(training_scores.mean() - fresh_scores.mean())


score_gaps = {}
for name, model in models.items():
    center = hidden_features(model, X_reference).mean(axis=0)
    train_distance = ((hidden_features(model, X_forget) - center) ** 2).sum(
        axis=1
    )
    fresh_distance = (
        (hidden_features(model, X_forget_probe) - center) ** 2
    ).sum(axis=1)
    score_gaps[name] = (
        mean_gap(
            confidence_scores(model, X_forget),
            confidence_scores(model, X_forget_probe),
        ),
        mean_gap(-train_distance, -fresh_distance),
    )
ConsoleOut [15]
CollapseExpand
    Original | confidence gap -0.0011 | hidden-score gap +0.1483
     Retrain | confidence gap -0.0118 | hidden-score gap +0.0982
 Approximate | confidence gap +0.0000 | hidden-score gap +0.0824

Both gaps subtract the fresh cohort's mean from the training cohort's mean. A positive confidence gap means the model assigns higher confidence on average to the original training cohort; a negative hidden-score gap means those points are farther from the reference center on average. The fresh retrain has seen neither scoring cohort. Its gap can still be nonzero because the two cohorts are finite samples.

VisualizationOut [16]
CollapseExpand
Two signed bar charts compare original, retrained and approximate models on training-minus-fresh gaps. The left panel measures confidence and the right panel measures negative squared hidden distance.
Descriptive training-minus-fresh gaps for maximum probability and hidden-feature similarity. Each panel has its own scale. The fresh retrain also has finite-sample gaps.

The code reports differences in means. Evaluating a membership attack would require a rule for classifying individually scored records and a separate evaluation protocol, for example one that estimates the true-positive rate at a specified false-positive rate. A mean gap can miss differences elsewhere in the score distributions. A nonzero gap can occur with no membership effect at all. Those limits apply to the original, fresh retrain and approximate update alike.

Attribution asks a different question. Influence functions, for instance, estimate changes when a record's objective weight changes. The hidden score above never changes a record's weight. Data lineage matters for both tasks because it identifies model inputs that an audit may need to link to records or dataset snapshots. See Dataset Lineage and Provenance and Attribution and Training-Data Transparency.

The fresh retrain can provide a useful control for membership measurements. A score that varies similarly between the same two cohorts for the fresh retrain and for an edited model could reflect how those cohorts happened to sample the population. This is one reason to use matched data selection and to test on a new set of records. Reusing the records that helped choose a scoring rule for its final evaluation makes it hard to tell how much of the apparent separation would hold on fresh records.

A signed gap also hides the variability of individual scores. For a simple illustration, imagine two cohorts with scores [0,2][0,2] and [1,1][1,1]. Both have mean 1. A rule aimed at the extreme scores can still separate the cohorts in those four observations. In another example two cohorts can have different means yet have substantial overlap, so a rule based on one threshold produces both missed members and false positives. The toy chart reports two means subtracted, one pair for each model and score. It does not choose such a threshold.

Threat models specify what an evaluator sees. In one system the evaluator may only see sampled output text. In another they can see token probabilities. The hidden-feature score in this example needs access to activations and cannot be computed directly from just a class label returned by an endpoint. A score that works with activations in an experiment does not imply that a text-only interface reveals the same signal. Conversely, an unsuccessful attack with a narrow interface leaves open other access models.

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy