Evaluating Knowledge Interventions › Generalization slices in detail

Michael BrenndoerferDecember 1, 20262 min read
Language AI HandbookAll chapters
Part 45 of 67Knowledge, Memory, Editing, and Unlearning
Chapter 351Evaluating Knowledge Interventions › Generalization slices in detail
Reading section 6 of 16 · Generalization slices in detail · 2 minSection 6 of 16 · 2 min

Section 6 of 16 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Different forms of transfer can fail independently. Design each probe around the behavior it is supposed to measure.

Multi-hop / compositional. The query about whether both books share an author depends on two author facts. The composition score includes only that query. A multiple-choice query asking who wrote the first book belongs in a separate reformulation slice.

Implication tables. When the chosen reference defines a reciprocal relation, add probes for the expected reverse direction. State the relationship assumptions in the ground truth.

Distractor and negation probes. Ask a question for which the edited name is a plausible distractor but still incorrect. These probes test whether the new answer appears outside its intended scope.

Select questions whose expected answers change between reference states. Include a matched unchanged set. Compare the measured outcomes across those slices before attributing a generalization failure to the edit.

The next check compares output strings for the same fact across direct and paraphrased prompts. Agreement and accuracy answer distinct questions. A model can consistently return the same wrong name.

PythonIn [20]
CollapseExpand
def consistency_report(results):
    """Calculate same-answer fractions among distinct probe pairs for a fact."""
    by_fact = defaultdict(list)
    for row in results:
        if row["slice"] != "compositional":
            key = row["subject"], row["relation"]
            by_fact[key].append(row["answer"])
    report = []
    for fact, answers in by_fact.items():
        n = len(answers)
        n_pairs = n * (n - 1) // 2
        if n_pairs:
            matching = sum(
                left == right
                for index, left in enumerate(answers)
                for right in answers[index + 1 :]
            )
            report.append(
                {"fact": fact, "n": n, "agreement": matching / n_pairs}
            )
    return report


consistency = consistency_report(all_results)

An agreement value below one means at least two outputs for a fact differed under this matching rule. A single-probe fact has no pair and is excluded. Check accuracy alongside agreement, and choose explicitly whether two abstentions count as a match.

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