leoncynn commited on
Commit
25567c0
·
verified ·
1 Parent(s): 5d9d52f

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Structural FFN Decomposition Guides Cross-Model Compression and Quantization
2
+
3
+ Artifacts for the paper by Yeonseong Cynn (River Lab, May 2026).
4
+
5
+ ## Summary
6
+
7
+ Decomposes transformer FFN layers into structural (format-preserving) and classification-relevant components across BERT and GPT-2.
8
+
9
+ Key findings:
10
+ - Early-layer FFN is 90-200x more structural than classification-relevant; late layers approach 1:1
11
+ - **Structural pruning**: head + FFN neuron removal with layer-wise retraining achieves 19.1% parameter reduction on BERT (SST-2) and 9.1% on GPT-2 with no accuracy loss
12
+ - **Neuron pruning**: removing 8% rarely-active FFN neurons *improves* BERT accuracy by 0.3%
13
+ - **Mixed-precision quantization**: INT4 on structurally-dominant layers (L1-L3) with STE retraining recovers to -2.1% loss
14
+
15
+ ## Files
16
+
17
+ ### Weights
18
+ - `bert_sst2_int4_ste.pt` — BERT SST-2 with L1-L3 INT4 quantization + STE retraining. Standard BERT state_dict, loadable directly. Accuracy: 90.1% (original FP32: 92.4%).
19
+
20
+ ### Results — BERT (`results/bert/`)
21
+ - `bert_structural_prune.json` — Per-layer structural pruning results (head/FFN reduction, accuracy)
22
+ - `bert_sst2_all_prune.json` — All-layer simultaneous FFN pruning results
23
+ - `bert_l8_prune_results.json` — L8 FFN correction + pruning (multi-seed)
24
+ - `bert_quantize_results.json` — INT4/INT8 post-training quantization results
25
+ - `bert_quantize_retrain.json` — INT4 STE retraining results
26
+
27
+ ### Results — GPT-2 (`results/gpt2/`)
28
+ - `gpt2_structural_prune.json` — Per-layer structural pruning (head + FFN)
29
+ - `gpt2_each_layer_prune.json` — Individual layer compression results
30
+ - `gpt2_prune_validate.json` — Pruning validation (PPL, accuracy)
31
+
32
+ ### Figures
33
+ - `figures/fig1_ratio.png` — FFN dual role ratio: BERT vs GPT-2 (log scale)
34
+ - `figures/fig2_compression.png` — Per-layer compression rates comparison
35
+ - `figures/fig3_pruning.png` — BERT SST-2 FFN neuron pruning curve
36
+ - `figures/fig4_quantization.png` — INT4 quantization results (PTQ vs STE)
37
+
38
+ ## Base Models
39
+
40
+ - BERT: [textattack/bert-base-uncased-SST-2](https://huggingface.co/textattack/bert-base-uncased-SST-2)
41
+ - GPT-2: [gpt2](https://huggingface.co/gpt2) (124M, pre-trained)
42
+
43
+ ## License
44
+
45
+ MIT
bert_sst2_int4_ste.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79966b6d38bca8420162c47e4b7417bc07b03bcc6770a4e743fd47f88cf246bd
3
+ size 438002578
figures/fig1_ratio.png ADDED
figures/fig2_compression.png ADDED
figures/fig3_pruning.png ADDED
figures/fig4_quantization.png ADDED
results/bert/bert_l8_prune_results.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "seed": 42,
4
+ "orig": 0.9243119266055045,
5
+ "fixed": 0.9185779816513762,
6
+ "pruned": 0.9139908256880734,
7
+ "keep": 706,
8
+ "total": 3072
9
+ },
10
+ {
11
+ "seed": 7,
12
+ "orig": 0.9243119266055045,
13
+ "fixed": 0.9231651376146789,
14
+ "pruned": 0.9139908256880734,
15
+ "keep": 707,
16
+ "total": 3072
17
+ },
18
+ {
19
+ "seed": 0,
20
+ "orig": 0.9243119266055045,
21
+ "fixed": 0.9197247706422018,
22
+ "pruned": 0.9208715596330275,
23
+ "keep": 713,
24
+ "total": 3072
25
+ },
26
+ {
27
+ "seed": 13,
28
+ "orig": 0.9243119266055045,
29
+ "fixed": 0.9174311926605505,
30
+ "pruned": 0.9162844036697247,
31
+ "keep": 712,
32
+ "total": 3072
33
+ },
34
+ {
35
+ "seed": 99,
36
+ "orig": 0.9243119266055045,
37
+ "fixed": 0.9208715596330275,
38
+ "pruned": 0.9151376146788991,
39
+ "keep": 703,
40
+ "total": 3072
41
+ }
42
+ ]
results/bert/bert_quantize_results.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "orig": 0.9243119266055045,
3
+ "results": {
4
+ "\uc804 \ub808\uc774\uc5b4 INT8": {
5
+ "accuracy": 0.9220183486238532,
6
+ "loss": 0.002293577981651307
7
+ },
8
+ "\uc804 \ub808\uc774\uc5b4 INT4": {
9
+ "accuracy": 0.5091743119266054,
10
+ "loss": 0.4151376146788991
11
+ },
12
+ "L1~L3 INT4 + \ub098\uba38\uc9c0 FP32": {
13
+ "accuracy": 0.8073394495412844,
14
+ "loss": 0.11697247706422009
15
+ },
16
+ "L1~L6 INT4 + \ub098\uba38\uc9c0 FP32": {
17
+ "accuracy": 0.5263761467889908,
18
+ "loss": 0.39793577981651373
19
+ },
20
+ "FFN\ub9cc \uc804\ubd80 INT4": {
21
+ "accuracy": 0.5091743119266054,
22
+ "loss": 0.4151376146788991
23
+ },
24
+ "L1~L6 FFN\ub9cc INT4": {
25
+ "accuracy": 0.5905963302752294,
26
+ "loss": 0.33371559633027514
27
+ },
28
+ "Mixed: L1~3 INT4, L4~8 INT8, L9~12 FP32": {
29
+ "accuracy": 0.8004587155963303,
30
+ "loss": 0.12385321100917424
31
+ },
32
+ "Mixed: L1~4 INT4, L5~10 INT8, L11~12 FP32": {
33
+ "accuracy": 0.7591743119266054,
34
+ "loss": 0.1651376146788991
35
+ }
36
+ }
37
+ }
results/bert/bert_quantize_retrain.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "orig": 0.9243119266055045,
3
+ "ptq": 0.8073394495412844,
4
+ "retrained": 0.875,
5
+ "ste": 0.9013761467889908,
6
+ "layers": [
7
+ 1,
8
+ 2,
9
+ 3
10
+ ],
11
+ "bits": 4
12
+ }
results/bert/bert_sst2_all_prune.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "orig_accuracy": 0.9243119266055045,
3
+ "results": {
4
+ "0.001": {
5
+ "accuracy": 0.9231651376146789,
6
+ "removed": 439,
7
+ "pct": 1.190863715277778,
8
+ "params_saved": 674304
9
+ },
10
+ "0.005": {
11
+ "accuracy": 0.926605504587156,
12
+ "removed": 3092,
13
+ "pct": 8.387586805555555,
14
+ "params_saved": 4749312
15
+ },
16
+ "0.01": {
17
+ "accuracy": 0.9162844036697247,
18
+ "removed": 7205,
19
+ "pct": 19.544813368055554,
20
+ "params_saved": 11066880
21
+ },
22
+ "0.02": {
23
+ "accuracy": 0.6330275229357798,
24
+ "removed": 13933,
25
+ "pct": 37.79568142361111,
26
+ "params_saved": 21401088
27
+ },
28
+ "0.03": {
29
+ "accuracy": 0.5389908256880734,
30
+ "removed": 18383,
31
+ "pct": 49.86707899305556,
32
+ "params_saved": 28236288
33
+ },
34
+ "0.05": {
35
+ "accuracy": 0.5321100917431193,
36
+ "removed": 23803,
37
+ "pct": 64.56976996527779,
38
+ "params_saved": 36561408
39
+ }
40
+ }
41
+ }
results/bert/bert_structural_prune.json ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L1": {
3
+ "keep_heads": [
4
+ 0,
5
+ 2,
6
+ 4,
7
+ 5,
8
+ 6,
9
+ 8,
10
+ 9,
11
+ 11
12
+ ],
13
+ "ffn_keep": 1319,
14
+ "ffn_dead": 1753,
15
+ "1_pruned_acc": 0.9208715596330275,
16
+ "2_retrained_acc": 0.9197247706422018,
17
+ "orig_params": 7087872,
18
+ "final_params": 3606311,
19
+ "reduction_pct": 49.119975642901,
20
+ "saved": 3481561
21
+ },
22
+ "L2": {
23
+ "keep_heads": [
24
+ 4,
25
+ 5,
26
+ 6,
27
+ 7,
28
+ 8,
29
+ 9,
30
+ 10,
31
+ 11
32
+ ],
33
+ "ffn_keep": 1533,
34
+ "ffn_dead": 1539,
35
+ "1_pruned_acc": 0.9220183486238532,
36
+ "2_retrained_acc": 0.9208715596330275,
37
+ "orig_params": 7087872,
38
+ "final_params": 3935229,
39
+ "reduction_pct": 44.479400869541664,
40
+ "saved": 3152643
41
+ },
42
+ "L3": {
43
+ "keep_heads": [
44
+ 0,
45
+ 1,
46
+ 3,
47
+ 4,
48
+ 5,
49
+ 7,
50
+ 8,
51
+ 11
52
+ ],
53
+ "ffn_keep": 1932,
54
+ "ffn_dead": 1140,
55
+ "1_pruned_acc": 0.9231651376146789,
56
+ "2_retrained_acc": 0.9243119266055045,
57
+ "orig_params": 7087872,
58
+ "final_params": 4548492,
59
+ "reduction_pct": 35.827114259399714,
60
+ "saved": 2539380
61
+ },
62
+ "L4": {
63
+ "keep_heads": [
64
+ 1,
65
+ 2,
66
+ 4,
67
+ 6,
68
+ 7,
69
+ 8,
70
+ 9,
71
+ 11
72
+ ],
73
+ "ffn_keep": 2301,
74
+ "ffn_dead": 771,
75
+ "1_pruned_acc": 0.9197247706422018,
76
+ "2_retrained_acc": 0.9231651376146789,
77
+ "orig_params": 7087872,
78
+ "final_params": 5115645,
79
+ "reduction_pct": 27.825375514681983,
80
+ "saved": 1972227
81
+ },
82
+ "L5": {
83
+ "keep_heads": [
84
+ 2,
85
+ 3,
86
+ 4,
87
+ 7,
88
+ 8,
89
+ 9,
90
+ 10,
91
+ 11
92
+ ],
93
+ "ffn_keep": 2255,
94
+ "ffn_dead": 817,
95
+ "1_pruned_acc": 0.9254587155963303,
96
+ "2_retrained_acc": 0.9208715596330275,
97
+ "orig_params": 7087872,
98
+ "final_params": 5044943,
99
+ "reduction_pct": 28.822882241665766,
100
+ "saved": 2042929
101
+ },
102
+ "L6": {
103
+ "keep_heads": [
104
+ 3,
105
+ 4,
106
+ 5,
107
+ 6,
108
+ 7,
109
+ 9,
110
+ 10,
111
+ 11
112
+ ],
113
+ "ffn_keep": 2380,
114
+ "ffn_dead": 692,
115
+ "1_pruned_acc": 0.9220183486238532,
116
+ "2_retrained_acc": 0.9220183486238532,
117
+ "orig_params": 7087872,
118
+ "final_params": 5237068,
119
+ "reduction_pct": 26.11226613573157,
120
+ "saved": 1850804
121
+ },
122
+ "L7": {
123
+ "keep_heads": [
124
+ 0,
125
+ 2,
126
+ 3,
127
+ 4,
128
+ 5,
129
+ 6,
130
+ 8,
131
+ 9
132
+ ],
133
+ "ffn_keep": 2478,
134
+ "ffn_dead": 594,
135
+ "1_pruned_acc": 0.9220183486238532,
136
+ "2_retrained_acc": 0.9231651376146789,
137
+ "orig_params": 7087872,
138
+ "final_params": 5387694,
139
+ "reduction_pct": 23.987143108679163,
140
+ "saved": 1700178
141
+ },
142
+ "L8": {
143
+ "keep_heads": [
144
+ 1,
145
+ 2,
146
+ 3,
147
+ 4,
148
+ 6,
149
+ 8,
150
+ 10,
151
+ 11
152
+ ],
153
+ "ffn_keep": 2715,
154
+ "ffn_dead": 357,
155
+ "1_pruned_acc": 0.9220183486238532,
156
+ "2_retrained_acc": 0.9208715596330275,
157
+ "orig_params": 7087872,
158
+ "final_params": 5751963,
159
+ "reduction_pct": 18.847814971827933,
160
+ "saved": 1335909
161
+ },
162
+ "L9": {
163
+ "keep_heads": [
164
+ 3,
165
+ 4,
166
+ 5,
167
+ 6,
168
+ 7,
169
+ 8,
170
+ 10,
171
+ 11
172
+ ],
173
+ "ffn_keep": 2647,
174
+ "ffn_dead": 425,
175
+ "1_pruned_acc": 0.9220183486238532,
176
+ "2_retrained_acc": 0.9220183486238532,
177
+ "orig_params": 7087872,
178
+ "final_params": 5647447,
179
+ "reduction_pct": 20.322390133456132,
180
+ "saved": 1440425
181
+ },
182
+ "L10": {
183
+ "keep_heads": [
184
+ 3,
185
+ 4,
186
+ 6,
187
+ 7,
188
+ 8,
189
+ 9,
190
+ 10,
191
+ 11
192
+ ],
193
+ "ffn_keep": 2627,
194
+ "ffn_dead": 445,
195
+ "1_pruned_acc": 0.9197247706422018,
196
+ "2_retrained_acc": 0.9277522935779816,
197
+ "orig_params": 7087872,
198
+ "final_params": 5616707,
199
+ "reduction_pct": 20.756088710405606,
200
+ "saved": 1471165
201
+ },
202
+ "L11": {
203
+ "keep_heads": [
204
+ 4,
205
+ 5,
206
+ 6,
207
+ 7,
208
+ 8,
209
+ 9,
210
+ 10,
211
+ 11
212
+ ],
213
+ "ffn_keep": 2594,
214
+ "ffn_dead": 478,
215
+ "1_pruned_acc": 0.9231651376146789,
216
+ "2_retrained_acc": 0.9243119266055045,
217
+ "orig_params": 7087872,
218
+ "final_params": 5565986,
219
+ "reduction_pct": 21.471691362372233,
220
+ "saved": 1521886
221
+ },
222
+ "L12": {
223
+ "keep_heads": [
224
+ 4,
225
+ 5,
226
+ 6,
227
+ 7,
228
+ 8,
229
+ 9,
230
+ 10,
231
+ 11
232
+ ],
233
+ "ffn_keep": 2818,
234
+ "ffn_dead": 254,
235
+ "1_pruned_acc": 0.9243119266055045,
236
+ "2_retrained_acc": 0.9231651376146789,
237
+ "orig_params": 7087872,
238
+ "final_params": 5910274,
239
+ "reduction_pct": 16.614267300538156,
240
+ "saved": 1177598
241
+ },
242
+ "summary": {
243
+ "orig_acc": 0.9243119266055045,
244
+ "total_saved": 23686705
245
+ }
246
+ }
results/gpt2/gpt2_each_layer_prune.json ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L1": {
3
+ "orig_ppl": 42.69972909357083,
4
+ "remove_heads": [
5
+ 11,
6
+ 6,
7
+ 4,
8
+ 3
9
+ ],
10
+ "keep_heads": [
11
+ 0,
12
+ 1,
13
+ 2,
14
+ 5,
15
+ 7,
16
+ 8,
17
+ 9,
18
+ 10
19
+ ],
20
+ "1_head_pruned_ppl": 51.474700614883176,
21
+ "2_retrained_ppl": 42.78067766084466,
22
+ "ffn_dead": 18,
23
+ "ffn_keep": 3054,
24
+ "3_ffn_pruned_ppl": 42.800225355233856,
25
+ "4_final_ppl": 42.80013634231672,
26
+ "orig_params": 7087872,
27
+ "final_params": 6273006,
28
+ "reduction_pct": 11.496624092534402,
29
+ "response": "floor, and the cat was still asleep.\n\n\"I'm sorry,"
30
+ },
31
+ "L2": {
32
+ "orig_ppl": 42.69972909357083,
33
+ "remove_heads": [
34
+ 9,
35
+ 8,
36
+ 7,
37
+ 0
38
+ ],
39
+ "keep_heads": [
40
+ 1,
41
+ 2,
42
+ 3,
43
+ 4,
44
+ 5,
45
+ 6,
46
+ 10,
47
+ 11
48
+ ],
49
+ "1_head_pruned_ppl": 43.49211919812955,
50
+ "2_retrained_ppl": 42.689468413731625,
51
+ "ffn_dead": 196,
52
+ "ffn_keep": 2876,
53
+ "3_ffn_pruned_ppl": 47.18787627109435,
54
+ "4_final_ppl": 42.73889757184751,
55
+ "orig_params": 7087872,
56
+ "final_params": 5999420,
57
+ "reduction_pct": 15.356541427384693,
58
+ "response": "floor, and the cat was still asleep.\n\n\"I'm sorry,"
59
+ },
60
+ "L3": {
61
+ "orig_ppl": 42.69972909357083,
62
+ "remove_heads": [
63
+ 1,
64
+ 4,
65
+ 2,
66
+ 7
67
+ ],
68
+ "keep_heads": [
69
+ 0,
70
+ 3,
71
+ 5,
72
+ 6,
73
+ 8,
74
+ 9,
75
+ 10,
76
+ 11
77
+ ],
78
+ "1_head_pruned_ppl": 44.33594594422876,
79
+ "2_retrained_ppl": 42.45262338662148,
80
+ "ffn_dead": 333,
81
+ "ffn_keep": 2739,
82
+ "3_ffn_pruned_ppl": 43.83093806103229,
83
+ "4_final_ppl": 42.74821930283572,
84
+ "orig_params": 7087872,
85
+ "final_params": 5788851,
86
+ "reduction_pct": 18.32737667948857,
87
+ "response": "floor, and the cat was still asleep.\n\n\"I was like"
88
+ },
89
+ "L4": {
90
+ "orig_ppl": 42.69972909357083,
91
+ "remove_heads": [
92
+ 3,
93
+ 1,
94
+ 2,
95
+ 7
96
+ ],
97
+ "keep_heads": [
98
+ 0,
99
+ 4,
100
+ 5,
101
+ 6,
102
+ 8,
103
+ 9,
104
+ 10,
105
+ 11
106
+ ],
107
+ "1_head_pruned_ppl": 43.35439449006305,
108
+ "2_retrained_ppl": 42.76731748730949,
109
+ "ffn_dead": 160,
110
+ "ffn_keep": 2912,
111
+ "3_ffn_pruned_ppl": 43.72942076446341,
112
+ "4_final_ppl": 42.85923799840107,
113
+ "orig_params": 7087872,
114
+ "final_params": 6054752,
115
+ "reduction_pct": 14.575883988875646,
116
+ "response": "floor, his head bowed, his eyes closed.\n\n\"I'm sor"
117
+ },
118
+ "L5": {
119
+ "orig_ppl": 42.69972909357083,
120
+ "remove_heads": [
121
+ 8,
122
+ 4,
123
+ 2,
124
+ 3
125
+ ],
126
+ "keep_heads": [
127
+ 0,
128
+ 1,
129
+ 5,
130
+ 6,
131
+ 7,
132
+ 9,
133
+ 10,
134
+ 11
135
+ ],
136
+ "1_head_pruned_ppl": 43.05504096539171,
137
+ "2_retrained_ppl": 42.83700060587286,
138
+ "ffn_dead": 93,
139
+ "ffn_keep": 2979,
140
+ "3_ffn_pruned_ppl": 43.25582619860287,
141
+ "4_final_ppl": 42.84181086031711,
142
+ "orig_params": 7087872,
143
+ "final_params": 6157731,
144
+ "reduction_pct": 13.12299375609492,
145
+ "response": "bed, her head resting on the pillow.\n\n\"I'm sorry,"
146
+ },
147
+ "L6": {
148
+ "orig_ppl": 42.69972909357083,
149
+ "remove_heads": [
150
+ 3,
151
+ 4,
152
+ 6,
153
+ 11
154
+ ],
155
+ "keep_heads": [
156
+ 0,
157
+ 1,
158
+ 2,
159
+ 5,
160
+ 7,
161
+ 8,
162
+ 9,
163
+ 10
164
+ ],
165
+ "1_head_pruned_ppl": 42.741236353443426,
166
+ "2_retrained_ppl": 42.86417964326868,
167
+ "ffn_dead": 89,
168
+ "ffn_keep": 2983,
169
+ "3_ffn_pruned_ppl": 43.53786287921236,
170
+ "4_final_ppl": 42.88954343116375,
171
+ "orig_params": 7087872,
172
+ "final_params": 6163879,
173
+ "reduction_pct": 13.036254040705025,
174
+ "response": "floor, and the cat was still asleep.\n\n\"I'm sorry,"
175
+ },
176
+ "L7": {
177
+ "orig_ppl": 42.69972909357083,
178
+ "remove_heads": [
179
+ 10,
180
+ 4,
181
+ 9,
182
+ 8
183
+ ],
184
+ "keep_heads": [
185
+ 0,
186
+ 1,
187
+ 2,
188
+ 3,
189
+ 5,
190
+ 6,
191
+ 7,
192
+ 11
193
+ ],
194
+ "1_head_pruned_ppl": 42.82263481027395,
195
+ "2_retrained_ppl": 42.73473983330326,
196
+ "ffn_dead": 77,
197
+ "ffn_keep": 2995,
198
+ "3_ffn_pruned_ppl": 43.36903752224206,
199
+ "4_final_ppl": 42.77897999011683,
200
+ "orig_params": 7087872,
201
+ "final_params": 6182323,
202
+ "reduction_pct": 12.776034894535341,
203
+ "response": "floor, and the cat was still asleep.\n\n\"I'm not su"
204
+ },
205
+ "L8": {
206
+ "orig_ppl": 42.69972909357083,
207
+ "remove_heads": [
208
+ 2,
209
+ 7,
210
+ 10,
211
+ 3
212
+ ],
213
+ "keep_heads": [
214
+ 0,
215
+ 1,
216
+ 4,
217
+ 5,
218
+ 6,
219
+ 8,
220
+ 9,
221
+ 11
222
+ ],
223
+ "1_head_pruned_ppl": 43.04766504591089,
224
+ "2_retrained_ppl": 42.95752446800668,
225
+ "ffn_dead": 61,
226
+ "ffn_keep": 3011,
227
+ "3_ffn_pruned_ppl": 43.518359113843076,
228
+ "4_final_ppl": 43.26192825871676,
229
+ "orig_params": 7087872,
230
+ "final_params": 6206915,
231
+ "reduction_pct": 12.429076032975765,
232
+ "response": "floor, and the cat was still asleep.\n\n\"I'm sorry,"
233
+ },
234
+ "L9": {
235
+ "orig_ppl": 42.69972909357083,
236
+ "remove_heads": [
237
+ 5,
238
+ 1,
239
+ 6,
240
+ 11
241
+ ],
242
+ "keep_heads": [
243
+ 0,
244
+ 2,
245
+ 3,
246
+ 4,
247
+ 7,
248
+ 8,
249
+ 9,
250
+ 10
251
+ ],
252
+ "1_head_pruned_ppl": 42.9115192613442,
253
+ "2_retrained_ppl": 43.1090656041147,
254
+ "ffn_dead": 48,
255
+ "ffn_keep": 3024,
256
+ "3_ffn_pruned_ppl": 43.25361420060106,
257
+ "4_final_ppl": 43.12893368107996,
258
+ "orig_params": 7087872,
259
+ "final_params": 6226896,
260
+ "reduction_pct": 12.147171957958609,
261
+ "response": "floor, and the cat was still asleep.\n\n\"I'm not su"
262
+ },
263
+ "L10": {
264
+ "orig_ppl": 42.69972909357083,
265
+ "remove_heads": [
266
+ 6,
267
+ 9,
268
+ 0,
269
+ 7
270
+ ],
271
+ "keep_heads": [
272
+ 1,
273
+ 2,
274
+ 3,
275
+ 4,
276
+ 5,
277
+ 8,
278
+ 10,
279
+ 11
280
+ ],
281
+ "1_head_pruned_ppl": 43.17806338090184,
282
+ "2_retrained_ppl": 42.96270073910099,
283
+ "ffn_dead": 40,
284
+ "ffn_keep": 3032,
285
+ "3_ffn_pruned_ppl": 43.25030736221565,
286
+ "4_final_ppl": 43.09593422928351,
287
+ "orig_params": 7087872,
288
+ "final_params": 6239192,
289
+ "reduction_pct": 11.97369252717882,
290
+ "response": "floor, his head bowed, his eyes closed.\n\n\"I'm sor"
291
+ },
292
+ "L11": {
293
+ "orig_ppl": 42.69972909357083,
294
+ "remove_heads": [
295
+ 3,
296
+ 4,
297
+ 11,
298
+ 6
299
+ ],
300
+ "keep_heads": [
301
+ 0,
302
+ 1,
303
+ 2,
304
+ 5,
305
+ 7,
306
+ 8,
307
+ 9,
308
+ 10
309
+ ],
310
+ "1_head_pruned_ppl": 43.03652662965237,
311
+ "2_retrained_ppl": 43.043991276127464,
312
+ "ffn_dead": 45,
313
+ "ffn_keep": 3027,
314
+ "3_ffn_pruned_ppl": 43.32754885474287,
315
+ "4_final_ppl": 43.07131553183212,
316
+ "orig_params": 7087872,
317
+ "final_params": 6231507,
318
+ "reduction_pct": 12.082117171416188,
319
+ "response": "floor, and the cat was still asleep.\n\n\"I'm sorry,"
320
+ },
321
+ "L12": {
322
+ "orig_ppl": 42.69972909357083,
323
+ "remove_heads": [
324
+ 11,
325
+ 7,
326
+ 10,
327
+ 5
328
+ ],
329
+ "keep_heads": [
330
+ 0,
331
+ 1,
332
+ 2,
333
+ 3,
334
+ 4,
335
+ 6,
336
+ 8,
337
+ 9
338
+ ],
339
+ "1_head_pruned_ppl": 42.88330372658153,
340
+ "2_retrained_ppl": 42.87923366407565,
341
+ "ffn_dead": 39,
342
+ "ffn_keep": 3033,
343
+ "3_ffn_pruned_ppl": 42.82775165013662,
344
+ "4_final_ppl": 43.02837596987722,
345
+ "orig_params": 7087872,
346
+ "final_params": 6240729,
347
+ "reduction_pct": 11.952007598331345,
348
+ "response": "floor, his head bowed, his eyes closed.\n\n\"I'm sor"
349
+ }
350
+ }
results/gpt2/gpt2_prune_validate.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "orig_ppls": {
3
+ "val1": 42.69972909357083,
4
+ "val2": 60.21109614480912,
5
+ "test": 59.59504167758228
6
+ }
7
+ }
results/gpt2/gpt2_structural_prune.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "0_orig": 42.69972909357083,
3
+ "1_head_pruned": 43.492672623598075,
4
+ "2_retrained": 42.68803812197702,
5
+ "3_ffn_pruned": 48.66275607347491,
6
+ "4_final": 42.789829607794296
7
+ }