Evaluating Knowledge Interventions › Leakage evaluation for suppression interventions
Language AI HandbookAll chapters As a teaching example, we build a direct output filter with a deliberately retained alternate lookup. There is no claim of model-level removal in this example.
Assessing whether a probe discloses the suppressed value under a defined protocol. Membership inference is a separate question about whether a supplied record appeared in training.
PythonIn [25]Expand
class SuppressionModel(ToyKnowledgeModel):
"""Disable one direct lookup while preserving a deliberate alternate route."""
def __init__(self, kb, templates, temperature=0.0, seed=0):
super().__init__(kb, templates, temperature, seed)
self.residual = {}
def suppress_direct_lookup(self, subject, relation):
"""Remove the fact from the direct surface but keep residual mass."""
key = (subject, relation)
d = self.dist.pop(key, None)
if d:
self.residual[key] = d
def probe_indirect(self, subject, relation):
"""Return the highest-scoring answer from the alternate route."""
key = (subject, relation)
if key in self.residual:
return max(self.residual[key], key=self.residual[key].get)
dist = self.answer_distribution(subject, relation)
return max(dist, key=dist.get) if dist else None
direct_model = SuppressionModel(KB, TEMPLATES, temperature=0.0, seed=0)
direct_model.suppress_direct_lookup("The Salt Map", "author")
# Direct query: does the model still answer the author of The Salt Map?
direct_dist = direct_model.answer_distribution("The Salt Map", "author")
direct_answer = max(direct_dist, key=direct_dist.get) if direct_dist else None
# Indirect reconstruction probe.
indirect_answer = direct_model.probe_indirect("The Salt Map", "author")ConsoleOut [26]Expand
Direct answer after filtering: None Indirect reconstruction probe: Iris Chen
The direct lookup abstains and the deliberately retained alternate route still gives "Iris Chen." This is a simulation of why a direct abstention does not establish removal. For an actual system, define and test the relevant alternative routes without assuming that a hidden copy exists.
The realistic protocol therefore includes:
- Direct probes: the same question the defender tested against.
- Paraphrase probes: "Name an author who wrote The Salt Map" (indirect).
- Completion probes: "The Salt Map was written by" (forces a completion).
- Multi-hop probes: "Did the author of The Salt Map also write The Night Orchard?" (reaches the fact via another route).
- Membership inference supplies a candidate record and asks whether it belonged to the training set. Evaluate the inference on known members and matched nonmembers. A loss or perplexity score can contribute to an inference, but does not itself identify membership or recover the contents of an unknown record.
PythonIn [27]Expand
def reconstruction_attack_suite(model, subject, relation, expected):
"""Compare direct and alternate routes against an independent target."""
direct_dist = model.answer_distribution(subject, relation)
direct = max(direct_dist, key=direct_dist.get, default=None)
indirect = model.probe_indirect(subject, relation)
observations = [("direct", direct), ("indirect_residual", indirect)]
return [
(probe, answer)
for probe, answer in observations
if match(answer, expected)
]
attacks = reconstruction_attack_suite(
direct_model, "The Salt Map", "author", "Iris Chen"
)ConsoleOut [28]Expand
Probes that disclosed the filtered value: indirect_residual -> Iris Chen
For content recovery, report how often probes return the predefined suppressed target and how often matched controls are falsely scored as recoveries. For membership, report detection and false-positive rates on known members and nonmembers at a stated threshold. A low loss for one record alone does not determine whether it was in training. For a claimed removal from a retrieval system, independently measure whether the index can still return the source using test authorizations. Report that access rate separately from the rate at which generated answers reveal the value.
Choose the threat model before running a suppression test. For example, a direct answer filter disables one response route. A forget-set study instead compares the unlearned model with an appropriate baseline, such as training on the retained data. TOFU defines its forget set as a subset of fictional author profiles. The two-route toy only illustrates the first type of test.
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!