subset int64 0 99 | diff float64 -0 0 | score_sum float64 -0.06 0.05 |
|---|---|---|
0 | -0.001831 | -0.02919 |
1 | -0.001313 | -0.022047 |
2 | -0.000947 | -0.016431 |
3 | 0.00183 | 0.03327 |
4 | 0.00318 | 0.042704 |
5 | -0.001503 | -0.016427 |
6 | 0.000856 | 0.009624 |
7 | 0.00056 | 0.016618 |
8 | -0.000436 | -0.006987 |
9 | 0.001635 | 0.026742 |
10 | -0.000037 | -0.002755 |
11 | 0.002793 | 0.049985 |
12 | -0.000003 | 0.00326 |
13 | 0.000154 | 0.005294 |
14 | 0.001698 | 0.024854 |
15 | 0.001784 | 0.033461 |
16 | 0.001236 | 0.021332 |
17 | -0.002604 | -0.037632 |
18 | -0.001325 | -0.022946 |
19 | 0.003124 | 0.048978 |
20 | 0.001478 | 0.024875 |
21 | -0.001615 | -0.030085 |
22 | -0.002004 | -0.022883 |
23 | -0.000541 | -0.006326 |
24 | -0.002276 | -0.020154 |
25 | -0.000216 | -0.006861 |
26 | 0.000994 | 0.011762 |
27 | -0.002568 | -0.043309 |
28 | -0.001065 | -0.02017 |
29 | 0.000396 | 0.006441 |
30 | 0.00081 | 0.01868 |
31 | -0.002493 | -0.037736 |
32 | -0.000141 | -0.000974 |
33 | -0.002919 | -0.042925 |
34 | 0.000349 | 0.00518 |
35 | -0.00029 | 0.007907 |
36 | 0.001037 | 0.019828 |
37 | -0.002832 | -0.025017 |
38 | 0.000518 | 0.004872 |
39 | 0.002669 | 0.035356 |
40 | -0.000123 | -0.011233 |
41 | 0.000935 | 0.025381 |
42 | 0.002221 | 0.032907 |
43 | 0.001067 | 0.018197 |
44 | -0.000247 | 0.003451 |
45 | 0.002126 | 0.042106 |
46 | -0.002271 | -0.042877 |
47 | -0.001481 | -0.016458 |
48 | 0.001053 | 0.013141 |
49 | 0.001661 | 0.030897 |
50 | 0.001007 | 0.015841 |
51 | 0.00032 | 0.006935 |
52 | -0.000702 | -0.012217 |
53 | -0.000494 | -0.007515 |
54 | 0.000388 | 0.010313 |
55 | 0.001553 | 0.027597 |
56 | 0.000447 | 0.004184 |
57 | 0.002122 | 0.033044 |
58 | -0.000489 | 0.005981 |
59 | 0.001938 | 0.037387 |
60 | -0.001176 | -0.018758 |
61 | -0.000156 | 0.004055 |
62 | 0.001128 | 0.011502 |
63 | 0.001966 | 0.032094 |
64 | 0.000138 | 0.010196 |
65 | 0.001669 | 0.02927 |
66 | 0.000762 | 0.004966 |
67 | 0.001133 | 0.023898 |
68 | -0.00106 | -0.005665 |
69 | -0.002535 | -0.033193 |
70 | 0.001174 | 0.021431 |
71 | -0.000534 | -0.003247 |
72 | 0.000875 | 0.01503 |
73 | -0.001446 | -0.030635 |
74 | -0.000194 | -0.000978 |
75 | -0.001447 | -0.005219 |
76 | -0.002419 | -0.024683 |
77 | -0.000364 | -0.002362 |
78 | -0.003977 | -0.057307 |
79 | -0.001631 | -0.032493 |
80 | 0.000241 | 0.005458 |
81 | 0.001602 | 0.022662 |
82 | -0.000739 | -0.012122 |
83 | 0.002835 | 0.049486 |
84 | 0.000572 | -0.000967 |
85 | -0.002422 | -0.034761 |
86 | -0.00128 | -0.014441 |
87 | 0.000266 | 0.001113 |
88 | 0.000235 | 0.004116 |
89 | 0.002079 | 0.028064 |
90 | 0.001421 | 0.025427 |
91 | 0.00231 | 0.036505 |
92 | -0.00055 | -0.013259 |
93 | 0.000811 | 0.016342 |
94 | -0.000209 | -0.002288 |
95 | 0.002183 | 0.034248 |
96 | -0.000014 | 0.000564 |
97 | 0.001298 | 0.012789 |
98 | 0.001125 | 0.021215 |
99 | 0.000262 | 0.0053 |
bergson MAGIC scores — GPT-2 / wikitext-2 / random validation
Per-document MAGIC attribution scores for a GPT-2 model fine-tuned on
Salesforce/wikitext wikitext-2-raw-v1 train, attributing the
training-loss gradient with respect to the model's output on
test[3:4] (a single test example, taken as the query).
Scores were produced by the bergson
attribution toolkit's MAGIC subcommand, which back-propagates through
the entire training trajectory to compute, for each training doc d,
∂(L_query)/∂(w_d) — the first-order Taylor expansion of how much
removing doc d from training would change the query loss.
Files
| file | description |
|---|---|
scores.pt |
torch.float32 tensor, shape (36718,). Indexed by original wikitext-2 train row position (filtered <2-token rows have score 0). |
summary.csv |
Final Spearman/Pearson correlation between MAGIC scores and 100-subset leave-k-out training-loss diffs at validate time. |
validation.csv |
Per-subset (subset, diff, score_sum) records from the leave-k-out validation. |
Loading
import torch
scores = torch.load("scores.pt", map_location="cpu", weights_only=True)
# scores.shape == (36718,), one entry per original wikitext-2 train row.
Validation result
Random-strategy 100-subset leave-k-out validation, batch_size=256, num_epochs=2, polynomial LR schedule:
| metric | value | p |
|---|---|---|
| Spearman ρ | +0.9731 | 2.71e-64 |
| Pearson r | +0.9724 | 1.00e-63 |
| baseline_loss | 3.6840 |
(Sorted-strategy validation against the same scores reaches ρ = +0.9926 on the same 100 subsets.)
YAML used to generate these scores
run_path: runs/gpt2_wikitext
model: gpt2
overwrite: true
data:
dataset: Salesforce/wikitext
subset: wikitext-2-raw-v1
split: "train"
chunk_length: 512
query:
dataset: Salesforce/wikitext
subset: wikitext-2-raw-v1
split: "test[3:4]"
chunk_length: 0
distributed:
nproc_per_node: 4
nnode: 4
batch_size: 256
num_epochs: 2
lr_schedule:
lr_scheduler_type: polynomial
lr: 0.0008
lr_start: 1e-6
lr_end: 0.00008
warmup_steps: 0.25
subset_strategy: random
wandb_project: magic
Saved as examples/magic/gpt2_wikitext.yaml in the bergson repo.
Run with:
bergson magic examples/magic/gpt2_wikitext.yaml
- Downloads last month
- 73