Antik Khan commited on
Commit
3d3ae36
·
1 Parent(s): 7482ec9

Add annotations

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. annotations/case_101.json +157 -0
  2. annotations/case_102.json +157 -0
  3. annotations/case_103.json +200 -0
  4. annotations/case_104.json +157 -0
  5. annotations/case_105.json +157 -0
  6. annotations/case_106.json +157 -0
  7. annotations/case_11.json +172 -0
  8. annotations/case_110.json +172 -0
  9. annotations/case_111.json +214 -0
  10. annotations/case_113.json +291 -0
  11. annotations/case_114.json +157 -0
  12. annotations/case_121.json +157 -0
  13. annotations/case_122.json +157 -0
  14. annotations/case_123.json +157 -0
  15. annotations/case_124.json +216 -0
  16. annotations/case_129.json +200 -0
  17. annotations/case_13.json +171 -0
  18. annotations/case_130.json +187 -0
  19. annotations/case_14.json +171 -0
  20. annotations/case_15.json +135 -0
  21. annotations/case_18.json +203 -0
  22. annotations/case_19.json +221 -0
  23. annotations/case_2.json +215 -0
  24. annotations/case_20.json +158 -0
  25. annotations/case_21.json +214 -0
  26. annotations/case_24.json +157 -0
  27. annotations/case_25.json +203 -0
  28. annotations/case_26.json +157 -0
  29. annotations/case_29.json +157 -0
  30. annotations/case_3.json +122 -0
  31. annotations/case_30.json +157 -0
  32. annotations/case_31.json +157 -0
  33. annotations/case_33.json +157 -0
  34. annotations/case_34.json +157 -0
  35. annotations/case_35.json +157 -0
  36. annotations/case_36.json +157 -0
  37. annotations/case_37.json +157 -0
  38. annotations/case_39.json +671 -0
  39. annotations/case_4.json +188 -0
  40. annotations/case_40.json +171 -0
  41. annotations/case_41.json +157 -0
  42. annotations/case_43.json +157 -0
  43. annotations/case_44.json +172 -0
  44. annotations/case_45.json +200 -0
  45. annotations/case_46.json +157 -0
  46. annotations/case_49.json +157 -0
  47. annotations/case_50.json +157 -0
  48. annotations/case_51.json +157 -0
  49. annotations/case_52.json +157 -0
  50. annotations/case_53.json +171 -0
annotations/case_101.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_101",
4
+ "name": "check_square",
5
+ "summary": "Check if each element is a square of an integer.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 6,
11
+ 19,
12
+ 28,
13
+ 14,
14
+ 10,
15
+ 7,
16
+ 28,
17
+ 20,
18
+ 6
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 25,
37
+ 18,
38
+ 22,
39
+ 10,
40
+ 10,
41
+ 23,
42
+ 20,
43
+ 3,
44
+ 7
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 1,
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 24,
63
+ 16,
64
+ 26,
65
+ 26,
66
+ 9,
67
+ 27,
68
+ 27,
69
+ 15,
70
+ 14
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0,
75
+ 1,
76
+ 0,
77
+ 0,
78
+ 1,
79
+ 0,
80
+ 0,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 1,
89
+ 27,
90
+ 20,
91
+ 0,
92
+ 11,
93
+ 25,
94
+ 21,
95
+ 28,
96
+ 11
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 1,
101
+ 0,
102
+ 0,
103
+ 1,
104
+ 0,
105
+ 1,
106
+ 0,
107
+ 0,
108
+ 0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 23,
115
+ 2,
116
+ 21,
117
+ 20,
118
+ 1,
119
+ 23,
120
+ 11,
121
+ 29,
122
+ 5
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0,
127
+ 0,
128
+ 0,
129
+ 0,
130
+ 1,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "check_square = rasp.Map(lambda x: 1 if x ** 0.5 == int(x ** 0.5) else 0, rasp.tokens).named(\"check_square\")\nreturn check_square",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Evaluates each element independently and checks if it is a perfect square."
148
+ },
149
+ "rasp_vars": [
150
+ "check_square"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_102.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_102",
4
+ "name": "reflect_into_range",
5
+ "summary": "Reflects each element within a range (default is [2, 7]).",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ -3,
11
+ -17,
12
+ 4,
13
+ -7,
14
+ -12,
15
+ 5,
16
+ -19,
17
+ -1,
18
+ 7
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 7,
23
+ 3,
24
+ 4,
25
+ 3,
26
+ 6,
27
+ 5,
28
+ 3,
29
+ 5,
30
+ 7
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ -10,
37
+ 3,
38
+ 15,
39
+ 19,
40
+ 3,
41
+ -18,
42
+ 1,
43
+ -19,
44
+ 3
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 4,
49
+ 3,
50
+ 5,
51
+ 5,
52
+ 3,
53
+ 2,
54
+ 3,
55
+ 3,
56
+ 3
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 18,
63
+ 8,
64
+ -6,
65
+ -13,
66
+ 0,
67
+ 18,
68
+ -2,
69
+ 2,
70
+ -10
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 6,
75
+ 6,
76
+ 4,
77
+ 7,
78
+ 4,
79
+ 6,
80
+ 6,
81
+ 2,
82
+ 4
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 9,
89
+ 17,
90
+ -19,
91
+ 0,
92
+ 12,
93
+ -9,
94
+ 1,
95
+ 4,
96
+ 6
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 5,
101
+ 7,
102
+ 3,
103
+ 4,
104
+ 2,
105
+ 3,
106
+ 3,
107
+ 4,
108
+ 6
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 7,
115
+ -5,
116
+ -6,
117
+ -18,
118
+ 16,
119
+ -14,
120
+ 0,
121
+ -12,
122
+ 18
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 7,
127
+ 5,
128
+ 4,
129
+ 2,
130
+ 6,
131
+ 6,
132
+ 4,
133
+ 6,
134
+ 6
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(lambda x: reflect_into_range(max_val, min_val, x), rasp.tokens)",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies a per-element reflection rule to fold values back into the target range."
148
+ },
149
+ "rasp_vars": [
150
+ "reflected_sequence"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_103.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_103",
4
+ "name": "swap_consecutive",
5
+ "summary": "Swap consecutive numbers in a list.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 4.0,
23
+ 2.0,
24
+ 6.0,
25
+ 2.0,
26
+ 8.0,
27
+ 4.0,
28
+ 1.0,
29
+ 6.0,
30
+ 3.0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 1.0,
49
+ 4.0,
50
+ 5.0,
51
+ 7.0,
52
+ 4.0,
53
+ 1.0,
54
+ 9.0,
55
+ 0.0,
56
+ 5.0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 10.0,
75
+ 10.0,
76
+ 4.0,
77
+ 7.0,
78
+ 7.0,
79
+ 3.0,
80
+ 2.0,
81
+ 7.0,
82
+ 5.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0.0,
101
+ 8.0,
102
+ 10.0,
103
+ 10.0,
104
+ 2.0,
105
+ 9.0,
106
+ 3.0,
107
+ 6.0,
108
+ 8.0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 3.0,
127
+ 6.0,
128
+ 7.0,
129
+ 10.0,
130
+ 6.0,
131
+ 4.0,
132
+ 2.0,
133
+ 9.0,
134
+ 6.0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "len = rasp.SelectorWidth(rasp.Select(rasp.indices, rasp.indices, rasp.Comparison.TRUE)).named('len')\nswaper = rasp.SequenceMap(lambda idx, L: idx if (idx == L - 1 and idx % 2 == 0) else (idx + 1 if idx % 2 == 0 else idx - 1), rasp.indices, len).named('swaper')\nswap_selector = rasp.Select(rasp.indices, swaper, rasp.Comparison.EQ).named('swap_selector')\nswapped = rasp.Aggregate(swap_selector, rasp.tokens).named('swapped')\nreturn swapped",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Produces a shared sequence-level size signal used to handle the last element correctly during swapping."
148
+ },
149
+ "rasp_vars": [
150
+ "len"
151
+ ],
152
+ "labels": [
153
+ "selector_width_4_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Turns the length-related signal into a sequence-length feature."
162
+ },
163
+ "rasp_vars": [
164
+ "len"
165
+ ],
166
+ "labels": [
167
+ "selector_width_4_selector_width_attn_output",
168
+ "selector_width_4"
169
+ ]
170
+ },
171
+ {
172
+ "id": "L1_MLP",
173
+ "hook": "blocks.1.mlp.hook_post",
174
+ "role": {
175
+ "tag": "COMBINER",
176
+ "note": "For each position, computes the index of the element it should swap with (neighbor, with end-of-sequence handling)."
177
+ },
178
+ "rasp_vars": [
179
+ "swaper"
180
+ ],
181
+ "labels": [
182
+ "sequence_map_3"
183
+ ]
184
+ },
185
+ {
186
+ "id": "L2H0_ATTN",
187
+ "hook": "blocks.2.attn.hook_result[0]",
188
+ "role": {
189
+ "tag": "ROUTER",
190
+ "note": "Moves values so each position receives the value from its swap partner."
191
+ },
192
+ "rasp_vars": [
193
+ "swapped"
194
+ ],
195
+ "labels": [
196
+ "aggregate_1"
197
+ ]
198
+ }
199
+ ]
200
+ }
annotations/case_104.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_104",
4
+ "name": "exponential",
5
+ "summary": "Apply exponential function to all elements of the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 7.38905609893065,
23
+ 54.598150033144236,
24
+ 7.38905609893065,
25
+ 403.4287934927351,
26
+ 54.598150033144236,
27
+ 2980.9579870417283,
28
+ 403.4287934927351,
29
+ 2.718281828459045,
30
+ 20.085536923187668
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 54.598150033144236,
49
+ 2.718281828459045,
50
+ 1096.6331584284585,
51
+ 148.4131591025766,
52
+ 2.718281828459045,
53
+ 54.598150033144236,
54
+ 1.0,
55
+ 8103.083927575384,
56
+ 148.4131591025766
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 22026.465794806718,
75
+ 22026.465794806718,
76
+ 1096.6331584284585,
77
+ 54.598150033144236,
78
+ 20.085536923187668,
79
+ 1096.6331584284585,
80
+ 1096.6331584284585,
81
+ 7.38905609893065,
82
+ 148.4131591025766
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 2980.9579870417283,
101
+ 1.0,
102
+ 22026.465794806718,
103
+ 22026.465794806718,
104
+ 8103.083927575384,
105
+ 7.38905609893065,
106
+ 403.4287934927351,
107
+ 20.085536923187668,
108
+ 2980.9579870417283
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 403.4287934927351,
127
+ 20.085536923187668,
128
+ 22026.465794806718,
129
+ 1096.6331584284585,
130
+ 54.598150033144236,
131
+ 403.4287934927351,
132
+ 8103.083927575384,
133
+ 7.38905609893065,
134
+ 403.4287934927351
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "exp_approx = rasp.Map(lambda x: math.exp(x), rasp.tokens)\nreturn exp_approx",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies an element-wise exponential transformation to each input element."
148
+ },
149
+ "rasp_vars": [
150
+ "exp_approx"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_105.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_105",
4
+ "name": "next_prime",
5
+ "summary": "Replaces each number with the next prime after that number.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 6,
11
+ 19,
12
+ 28,
13
+ 14,
14
+ 10,
15
+ 7,
16
+ 28,
17
+ 20,
18
+ 6
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 7,
23
+ 19,
24
+ 29,
25
+ 17,
26
+ 11,
27
+ 7,
28
+ 29,
29
+ 23,
30
+ 7
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 25,
37
+ 18,
38
+ 22,
39
+ 10,
40
+ 10,
41
+ 23,
42
+ 20,
43
+ 3,
44
+ 7
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 29,
49
+ 19,
50
+ 23,
51
+ 11,
52
+ 11,
53
+ 23,
54
+ 23,
55
+ 3,
56
+ 7
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 24,
63
+ 16,
64
+ 26,
65
+ 26,
66
+ 9,
67
+ 27,
68
+ 27,
69
+ 15,
70
+ 14
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 29,
75
+ 17,
76
+ 29,
77
+ 29,
78
+ 11,
79
+ 29,
80
+ 29,
81
+ 17,
82
+ 17
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 1,
89
+ 27,
90
+ 20,
91
+ 0,
92
+ 11,
93
+ 25,
94
+ 21,
95
+ 28,
96
+ 11
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 2,
101
+ 29,
102
+ 23,
103
+ 2,
104
+ 11,
105
+ 29,
106
+ 23,
107
+ 29,
108
+ 11
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 23,
115
+ 2,
116
+ 21,
117
+ 20,
118
+ 1,
119
+ 23,
120
+ 11,
121
+ 29,
122
+ 5
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 23,
127
+ 2,
128
+ 23,
129
+ 23,
130
+ 2,
131
+ 23,
132
+ 11,
133
+ 29,
134
+ 5
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(next_prime, rasp.tokens).named(\"next_prime\")",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Maps each input number to the next prime number at or above it, producing a per-position replacement value."
148
+ },
149
+ "rasp_vars": [
150
+ "next_prime"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_106.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_106",
4
+ "name": "mask_sequence_index_1",
5
+ "summary": "Sets all elements to zero except for the element at index 1.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0,
23
+ 4,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0,
49
+ 1,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0,
75
+ 10,
76
+ 0,
77
+ 0,
78
+ 0,
79
+ 0,
80
+ 0,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0,
101
+ 0,
102
+ 0,
103
+ 0,
104
+ 0,
105
+ 0,
106
+ 0,
107
+ 0,
108
+ 0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0,
127
+ 3,
128
+ 0,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.SequenceMap(lambda x, y: x if y == index else 0, rasp.tokens, rasp.indices)",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "COMBINER",
147
+ "note": "Combines token content with position information to keep only one chosen position."
148
+ },
149
+ "rasp_vars": [
150
+ "mask_sequence"
151
+ ],
152
+ "labels": [
153
+ "sequence_map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_11.json ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_11",
4
+ "name": "word_count_by_length",
5
+ "summary": "Returns the length of each word in the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "oCLrZaW",
11
+ "V",
12
+ "b",
13
+ "oCLrZaW",
14
+ "TPSI",
15
+ "poiVg",
16
+ "b",
17
+ "b",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 7.0,
23
+ 1.0,
24
+ 1.0,
25
+ 7.0,
26
+ 4.0,
27
+ 5.0,
28
+ 1.0,
29
+ 1.0,
30
+ 7.0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "LB",
37
+ "TPSI",
38
+ "oCLrZaW",
39
+ "TPSI",
40
+ "TPSI",
41
+ "poiVg",
42
+ "b",
43
+ "V",
44
+ "poiVg"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 2.0,
49
+ 4.0,
50
+ 7.0,
51
+ 4.0,
52
+ 4.0,
53
+ 5.0,
54
+ 1.0,
55
+ 1.0,
56
+ 5.0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "poiVg",
63
+ "TPSI",
64
+ "no",
65
+ "b",
66
+ "LB",
67
+ "poiVg",
68
+ "V",
69
+ "no",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 5.0,
75
+ 4.0,
76
+ 2.0,
77
+ 1.0,
78
+ 2.0,
79
+ 5.0,
80
+ 1.0,
81
+ 2.0,
82
+ 2.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "J",
90
+ "J",
91
+ "TPSI",
92
+ "TPSI",
93
+ "oCLrZaW",
94
+ "LB",
95
+ "poiVg",
96
+ "V"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 1.0,
101
+ 1.0,
102
+ 1.0,
103
+ 4.0,
104
+ 4.0,
105
+ 7.0,
106
+ 2.0,
107
+ 5.0,
108
+ 1.0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "poiVg",
116
+ "V",
117
+ "b",
118
+ "J",
119
+ "V",
120
+ "LB",
121
+ "no",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 2.0,
127
+ 5.0,
128
+ 1.0,
129
+ 1.0,
130
+ 1.0,
131
+ 1.0,
132
+ 2.0,
133
+ 2.0,
134
+ 1.0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "word_length = rasp.Map(lambda x: len(x), sop)\nlength_selector = rasp.Select(word_length, word_length, rasp.Comparison.EQ)\nword_count = rasp.Aggregate(length_selector, word_length, default=None)\nreturn word_count",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Computes a per-token length feature that will be used to group tokens by equal length."
148
+ },
149
+ "rasp_vars": [
150
+ "word_length"
151
+ ],
152
+ "labels": [
153
+ "map_3"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L1H0_ATTN",
158
+ "hook": "blocks.1.attn.hook_result[0]",
159
+ "role": {
160
+ "tag": "AGGREGATOR",
161
+ "note": "Groups positions by matching word length and aggregates to produce the per-length count-style output."
162
+ },
163
+ "rasp_vars": [
164
+ "length_selector",
165
+ "word_count"
166
+ ],
167
+ "labels": [
168
+ "aggregate_1"
169
+ ]
170
+ }
171
+ ]
172
+ }
annotations/case_110.json ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_110",
4
+ "name": "insert_zeros",
5
+ "summary": "Inserts zeros between each element, removing the latter half of the list.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 2.0,
23
+ 0,
24
+ 4.0,
25
+ 0,
26
+ 2.0,
27
+ 0,
28
+ 6.0,
29
+ 0,
30
+ 4.0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 4.0,
49
+ 0,
50
+ 1.0,
51
+ 0,
52
+ 7.0,
53
+ 0,
54
+ 5.0,
55
+ 0,
56
+ 1.0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 10.0,
75
+ 0,
76
+ 10.0,
77
+ 0,
78
+ 7.0,
79
+ 0,
80
+ 4.0,
81
+ 0,
82
+ 3.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 8.0,
101
+ 0,
102
+ 0.0,
103
+ 0,
104
+ 10.0,
105
+ 0,
106
+ 10.0,
107
+ 0,
108
+ 9.0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 6.0,
127
+ 0,
128
+ 3.0,
129
+ 0,
130
+ 10.0,
131
+ 0,
132
+ 7.0,
133
+ 0,
134
+ 4.0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "shifter = rasp.Select(rasp.indices, rasp.indices, lambda x, y: x == int(y / 2))\nshifted = rasp.Aggregate(shifter, rasp.tokens)\nreturn rasp.SequenceMap(lambda x, y: x if y % 2 == 0 else 0, shifted, rasp.indices)",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "ROUTER",
147
+ "note": "Routes each output position to a source input position (floor(i/2)) so the first half gets expanded into even indices."
148
+ },
149
+ "rasp_vars": [
150
+ "shifter",
151
+ "shifted"
152
+ ],
153
+ "labels": [
154
+ "aggregate_2"
155
+ ]
156
+ },
157
+ {
158
+ "id": "L0_MLP",
159
+ "hook": "blocks.0.mlp.hook_post",
160
+ "role": {
161
+ "tag": "COMBINER",
162
+ "note": "Uses the routed value and the position index to emit the value on even positions and 0 on odd positions."
163
+ },
164
+ "rasp_vars": [
165
+ "sequence_map"
166
+ ],
167
+ "labels": [
168
+ "sequence_map_1"
169
+ ]
170
+ }
171
+ ]
172
+ }
annotations/case_111.json ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_111",
4
+ "name": "last_element_with_zero_padding",
5
+ "summary": "Returns the last element of the sequence and pads the rest with zeros.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 3.0,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 5.0,
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 5.0,
75
+ 0,
76
+ 0,
77
+ 0,
78
+ 0,
79
+ 0,
80
+ 0,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 8.0,
101
+ 0,
102
+ 0,
103
+ 0,
104
+ 0,
105
+ 0,
106
+ 0,
107
+ 0,
108
+ 0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 6.0,
127
+ 0,
128
+ 0,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "length = rasp.SelectorWidth(rasp.Select(rasp.tokens, rasp.tokens, rasp.Comparison.TRUE)).named(\"length\")\nlast_element_selector = rasp.Select(rasp.indices, rasp.Map(lambda x: x - 1, length), rasp.Comparison.EQ).named(\"last_element_selector\")\nlast_element_sequence = rasp.Aggregate(last_element_selector, rasp.tokens).named(\"last_element_sequence\")\nreturn rasp.SequenceMap(lambda x, y: x if y == 0 else 0, last_element_sequence, rasp.indices)",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Produces a shared sequence length signal used to identify the last position."
148
+ },
149
+ "rasp_vars": [
150
+ "length"
151
+ ],
152
+ "labels": [
153
+ "length_5_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Turns the length-related signal into a sequence-length feature."
162
+ },
163
+ "rasp_vars": [
164
+ "length"
165
+ ],
166
+ "labels": [
167
+ "length_5",
168
+ "length_5_selector_width_attn_output"
169
+ ]
170
+ },
171
+ {
172
+ "id": "L1_MLP",
173
+ "hook": "blocks.1.mlp.hook_post",
174
+ "role": {
175
+ "tag": "MAPPER",
176
+ "note": "Computes the last element's index by applying element-wise subtraction to the sequence-length feature."
177
+ },
178
+ "rasp_vars": [
179
+ "last_index"
180
+ ],
181
+ "labels": [
182
+ "map_4"
183
+ ]
184
+ },
185
+ {
186
+ "id": "L2H0_ATTN",
187
+ "hook": "blocks.2.attn.hook_result[0]",
188
+ "role": {
189
+ "tag": "ROUTER",
190
+ "note": "Retrieves the last token and makes it available for placement into the output sequence."
191
+ },
192
+ "rasp_vars": [
193
+ "last_element_sequence"
194
+ ],
195
+ "labels": [
196
+ "last_element_sequence_2"
197
+ ]
198
+ },
199
+ {
200
+ "id": "L2_MLP",
201
+ "hook": "blocks.2.mlp.hook_post",
202
+ "role": {
203
+ "tag": "COMBINER",
204
+ "note": "Outputs the last token in the first slot and writes zeros in every other slot."
205
+ },
206
+ "rasp_vars": [
207
+ "output_sequence"
208
+ ],
209
+ "labels": [
210
+ "sequence_map_1"
211
+ ]
212
+ }
213
+ ]
214
+ }
annotations/case_113.json ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_113",
4
+ "name": "invert_if_sorted",
5
+ "summary": "Inverts the sequence if it is sorted in ascending order, otherwise leaves it unchanged.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 6,
11
+ 19,
12
+ 28,
13
+ 14,
14
+ 10,
15
+ 7,
16
+ 28,
17
+ 20,
18
+ 6
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 6.0,
23
+ 19.0,
24
+ 28.0,
25
+ 14.0,
26
+ 10.0,
27
+ 7.0,
28
+ 28.0,
29
+ 20.0,
30
+ 6.0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 25,
37
+ 18,
38
+ 22,
39
+ 10,
40
+ 10,
41
+ 23,
42
+ 20,
43
+ 3,
44
+ 7
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 25.0,
49
+ 18.0,
50
+ 22.0,
51
+ 10.0,
52
+ 10.0,
53
+ 23.0,
54
+ 20.0,
55
+ 3.0,
56
+ 7.0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 24,
63
+ 16,
64
+ 26,
65
+ 26,
66
+ 9,
67
+ 27,
68
+ 27,
69
+ 15,
70
+ 14
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 24.0,
75
+ 16.0,
76
+ 26.0,
77
+ 26.0,
78
+ 9.0,
79
+ 27.0,
80
+ 27.0,
81
+ 15.0,
82
+ 14.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 1,
89
+ 27,
90
+ 20,
91
+ 0,
92
+ 11,
93
+ 25,
94
+ 21,
95
+ 28,
96
+ 11
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 1.0,
101
+ 27.0,
102
+ 20.0,
103
+ 0.0,
104
+ 11.0,
105
+ 25.0,
106
+ 21.0,
107
+ 28.0,
108
+ 11.0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 23,
115
+ 2,
116
+ 21,
117
+ 20,
118
+ 1,
119
+ 23,
120
+ 11,
121
+ 29,
122
+ 5
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 23.0,
127
+ 2.0,
128
+ 21.0,
129
+ 20.0,
130
+ 1.0,
131
+ 23.0,
132
+ 11.0,
133
+ 29.0,
134
+ 5.0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "shifter = rasp.Select(rasp.indices, rasp.indices, lambda x, y: x == y - 1 or (x == 0 and y == 0))\nshifted = rasp.Aggregate(shifter, rasp.tokens)\nchecks = rasp.SequenceMap(lambda x, y: 1 if x <= y else 0, shifted, rasp.tokens)\nzero_selector = rasp.Select(checks, rasp.Map(lambda x: 0, rasp.indices), rasp.Comparison.EQ)\ninvert_decider = rasp.Map(lambda x: 1 if x > 0 else -1, rasp.SelectorWidth(zero_selector))\navg_idx = rasp.Map(lambda x: x / 2 - 0.5, rasp.SelectorWidth(rasp.Select(rasp.indices, rasp.indices, rasp.Comparison.TRUE)))\ndiff_to_avg_idx = rasp.SequenceMap(lambda x, y: x - y, rasp.indices, avg_idx)\ninverter = rasp.SequenceMap(lambda x, y: x + y, avg_idx, rasp.SequenceMap(lambda x, y: x * y, invert_decider, diff_to_avg_idx))\ninvert_selector = rasp.Select(inverter, rasp.indices, rasp.Comparison.EQ)\nreturn rasp.Aggregate(invert_selector, rasp.tokens)",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Counts the number of non-increasing steps in the sequence by attending over positions where the sortedness check fails"
148
+ },
149
+ "rasp_vars": [
150
+ "shifter"
151
+ ],
152
+ "labels": [
153
+ "selector_width_6_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0H1_ATTN",
158
+ "hook": "blocks.0.attn.hook_result[1]",
159
+ "role": {
160
+ "tag": "ROUTER",
161
+ "note": "Produces the shifted token stream that aligns each token with its predecessor."
162
+ },
163
+ "rasp_vars": [
164
+ "shifted"
165
+ ],
166
+ "labels": [
167
+ "aggregate_14"
168
+ ]
169
+ },
170
+ {
171
+ "id": "L0_MLP",
172
+ "hook": "blocks.0.mlp.hook_post",
173
+ "role": {
174
+ "tag": "MAPPER",
175
+ "note": "Converts the attention-derived selector-width signal into sortedness evidence used by the global invert/keep decision."
176
+ },
177
+ "rasp_vars": [
178
+ "checks",
179
+ "zero_selector"
180
+ ],
181
+ "labels": [
182
+ "selector_width_6",
183
+ "selector_width_6_selector_width_attn_output",
184
+ "map_13"
185
+ ]
186
+ },
187
+ {
188
+ "id": "L1_MLP",
189
+ "hook": "blocks.1.mlp.hook_post",
190
+ "role": {
191
+ "tag": "COMBINER",
192
+ "note": "Converts the sortedness evidence into a single invert/keep control signal for the rest of the circuit."
193
+ },
194
+ "rasp_vars": [
195
+ "checks",
196
+ "invert_decider"
197
+ ],
198
+ "labels": [
199
+ "map_4",
200
+ "sequence_map_12"
201
+ ]
202
+ },
203
+ {
204
+ "id": "L2H0_ATTN",
205
+ "hook": "blocks.2.attn.hook_result[0]",
206
+ "role": {
207
+ "tag": "AGGREGATOR",
208
+ "note": "Provides the sequence-length-style signal that is later turned into a center index reference for inversion."
209
+ },
210
+ "rasp_vars": [
211
+ "length_helper"
212
+ ],
213
+ "labels": [
214
+ "selector_width_10_selector_width_attn_output"
215
+ ]
216
+ },
217
+ {
218
+ "id": "L2_MLP",
219
+ "hook": "blocks.2.mlp.hook_post",
220
+ "role": {
221
+ "tag": "COMBINER",
222
+ "note": "Turns the length/position information into a center reference and a per-position offset-from-center signal used for inversion arithmetic."
223
+ },
224
+ "rasp_vars": [
225
+ "avg_idx",
226
+ "diff_to_avg_idx"
227
+ ],
228
+ "labels": [
229
+ "selector_width_10",
230
+ "selector_width_10_selector_width_attn_output",
231
+ "sequence_map_8"
232
+ ]
233
+ },
234
+ {
235
+ "id": "L3_MLP",
236
+ "hook": "blocks.3.mlp.hook_post",
237
+ "role": {
238
+ "tag": "MAPPER",
239
+ "note": "Prepares an intermediate numeric signal for building the inverted index mapping."
240
+ },
241
+ "rasp_vars": [
242
+ "inversion_prep"
243
+ ],
244
+ "labels": [
245
+ "map_7"
246
+ ]
247
+ },
248
+ {
249
+ "id": "L4_MLP",
250
+ "hook": "blocks.4.mlp.hook_post",
251
+ "role": {
252
+ "tag": "COMBINER",
253
+ "note": "Combines the center reference, per-position offset, and the invert/keep control to produce the target source index for each position."
254
+ },
255
+ "rasp_vars": [
256
+ "inverter"
257
+ ],
258
+ "labels": [
259
+ "sequence_map_5"
260
+ ]
261
+ },
262
+ {
263
+ "id": "L5_MLP",
264
+ "hook": "blocks.5.mlp.hook_post",
265
+ "role": {
266
+ "tag": "COMBINER",
267
+ "note": "Finalizes the per-position index routing plan that will be used to either invert the sequence or leave it unchanged."
268
+ },
269
+ "rasp_vars": [
270
+ "invert_selector"
271
+ ],
272
+ "labels": [
273
+ "sequence_map_3"
274
+ ]
275
+ },
276
+ {
277
+ "id": "L6H0_ATTN",
278
+ "hook": "blocks.6.attn.hook_result[0]",
279
+ "role": {
280
+ "tag": "ROUTER",
281
+ "note": "Executes the final token movement: each position copies from its computed source index, yielding either the inverted or original sequence."
282
+ },
283
+ "rasp_vars": [
284
+ "output"
285
+ ],
286
+ "labels": [
287
+ "aggregate_1"
288
+ ]
289
+ }
290
+ ]
291
+ }
annotations/case_114.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_114",
4
+ "name": "logarithm_base10",
5
+ "summary": "Apply a logarithm base 10 to each element of the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 7,
11
+ 4,
12
+ 8,
13
+ 5,
14
+ 7,
15
+ 10,
16
+ 3,
17
+ 7,
18
+ 8
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0.8450980400142567,
23
+ 0.6020599913279623,
24
+ 0.9030899869919434,
25
+ 0.6989700043360187,
26
+ 0.8450980400142567,
27
+ 1.0,
28
+ 0.47712125471966244,
29
+ 0.8450980400142567,
30
+ 0.9030899869919434
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 3,
37
+ 7,
38
+ 4,
39
+ 9,
40
+ 3,
41
+ 5,
42
+ 3,
43
+ 7,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0.47712125471966244,
49
+ 0.8450980400142567,
50
+ 0.6020599913279623,
51
+ 0.9542425094393249,
52
+ 0.47712125471966244,
53
+ 0.6989700043360187,
54
+ 0.47712125471966244,
55
+ 0.8450980400142567,
56
+ 0.6989700043360187
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 6,
63
+ 2,
64
+ 5,
65
+ 1,
66
+ 10,
67
+ 6,
68
+ 9,
69
+ 1,
70
+ 10
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0.7781512503836435,
75
+ 0.30102999566398114,
76
+ 0.6989700043360187,
77
+ 0.0,
78
+ 1.0,
79
+ 0.7781512503836435,
80
+ 0.9542425094393249,
81
+ 0.0,
82
+ 1.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 5,
89
+ 4,
90
+ 8,
91
+ 8,
92
+ 3,
93
+ 6,
94
+ 5,
95
+ 2,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0.6989700043360187,
101
+ 0.6020599913279623,
102
+ 0.9030899869919434,
103
+ 0.9030899869919434,
104
+ 0.47712125471966244,
105
+ 0.7781512503836435,
106
+ 0.6989700043360187,
107
+ 0.30102999566398114,
108
+ 0.9030899869919434
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 9,
115
+ 7,
116
+ 2,
117
+ 4,
118
+ 9,
119
+ 2,
120
+ 10,
121
+ 9,
122
+ 10
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0.9542425094393249,
127
+ 0.8450980400142567,
128
+ 0.30102999566398114,
129
+ 0.6020599913279623,
130
+ 0.9542425094393249,
131
+ 0.30102999566398114,
132
+ 1.0,
133
+ 0.9542425094393249,
134
+ 1.0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "def apply_log(element):\n return math.log(element, 10)\n\nlogarithm = rasp.Map(apply_log, rasp.tokens).named(\"logarithm\")\nreturn logarithm",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies a base-10 logarithm to each element independently."
148
+ },
149
+ "rasp_vars": [
150
+ "logarithm"
151
+ ],
152
+ "labels": [
153
+ "logarithm_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_121.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_121",
4
+ "name": "arcsine",
5
+ "summary": "Applies the arcsine function to each element.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 0.7,
11
+ -0.19999999999999996,
12
+ -0.9,
13
+ 0.8999999999999999,
14
+ 0.3999999999999999,
15
+ -0.4,
16
+ 0.10000000000000009,
17
+ -0.30000000000000004,
18
+ 0.3999999999999999
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0.775397496610753,
23
+ -0.20135792079033074,
24
+ -1.1197695149986342,
25
+ 1.119769514998634,
26
+ 0.4115168460674879,
27
+ -0.41151684606748806,
28
+ 0.10016742116155988,
29
+ -0.3046926540153976,
30
+ 0.4115168460674879
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ -0.8,
37
+ -0.6,
38
+ 0.8,
39
+ -0.4,
40
+ -0.19999999999999996,
41
+ -0.4,
42
+ 0.7,
43
+ -0.7,
44
+ 0.30000000000000004
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ -0.9272952180016123,
49
+ -0.6435011087932844,
50
+ 0.9272952180016123,
51
+ -0.41151684606748806,
52
+ -0.20135792079033074,
53
+ -0.41151684606748806,
54
+ 0.775397496610753,
55
+ -0.775397496610753,
56
+ 0.3046926540153976
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ -0.4,
63
+ 0.8999999999999999,
64
+ 0.3999999999999999,
65
+ 0.0,
66
+ -0.30000000000000004,
67
+ -0.4,
68
+ 0.8,
69
+ 0.0,
70
+ 0.0
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ -0.41151684606748806,
75
+ 1.119769514998634,
76
+ 0.4115168460674879,
77
+ 0.0,
78
+ -0.3046926540153976,
79
+ -0.41151684606748806,
80
+ 0.9272952180016123,
81
+ 0.0,
82
+ 0.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ -0.7,
89
+ -0.30000000000000004,
90
+ -0.8,
91
+ -0.9,
92
+ 0.10000000000000009,
93
+ -0.5,
94
+ -0.9,
95
+ -1.0,
96
+ 0.10000000000000009
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ -0.775397496610753,
101
+ -0.3046926540153976,
102
+ -0.9272952180016123,
103
+ -1.1197695149986342,
104
+ 0.10016742116155988,
105
+ -0.5235987755982989,
106
+ -1.1197695149986342,
107
+ -1.5707963267948966,
108
+ 0.10016742116155988
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 0.10000000000000009,
115
+ 0.6000000000000001,
116
+ -0.09999999999999998,
117
+ 0.5,
118
+ 0.3999999999999999,
119
+ 0.3999999999999999,
120
+ 0.8,
121
+ 0.10000000000000009,
122
+ 0.8999999999999999
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0.10016742116155988,
127
+ 0.6435011087932845,
128
+ -0.10016742116155977,
129
+ 0.5235987755982989,
130
+ 0.4115168460674879,
131
+ 0.4115168460674879,
132
+ 0.9272952180016123,
133
+ 0.10016742116155988,
134
+ 1.119769514998634
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(lambda x: math.asin(x), rasp.tokens)",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies an arcsine nonlinear transformation to each input element independently."
148
+ },
149
+ "rasp_vars": [
150
+ "arcsine"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_122.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_122",
4
+ "name": "check_divisible_by_3",
5
+ "summary": "Check if each number is divisible by 3.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 6,
11
+ 19,
12
+ 28,
13
+ 14,
14
+ 10,
15
+ 7,
16
+ 28,
17
+ 20,
18
+ 6
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 0,
30
+ 1
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 25,
37
+ 18,
38
+ 22,
39
+ 10,
40
+ 10,
41
+ 23,
42
+ 20,
43
+ 3,
44
+ 7
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0,
49
+ 1,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 1,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 24,
63
+ 16,
64
+ 26,
65
+ 26,
66
+ 9,
67
+ 27,
68
+ 27,
69
+ 15,
70
+ 14
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 1,
75
+ 0,
76
+ 0,
77
+ 0,
78
+ 1,
79
+ 1,
80
+ 1,
81
+ 1,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 1,
89
+ 27,
90
+ 20,
91
+ 0,
92
+ 11,
93
+ 25,
94
+ 21,
95
+ 28,
96
+ 11
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0,
101
+ 1,
102
+ 0,
103
+ 1,
104
+ 0,
105
+ 0,
106
+ 1,
107
+ 0,
108
+ 0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 23,
115
+ 2,
116
+ 21,
117
+ 20,
118
+ 1,
119
+ 23,
120
+ 11,
121
+ 29,
122
+ 5
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0,
127
+ 0,
128
+ 1,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "check_divisible_by_3 = rasp.Map(lambda x: 1 if x % 3 == 0 else 0, rasp.tokens).named(\"check_divisible_by_3\")\nreturn check_divisible_by_3",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Outputs 1 when the input number is divisible by 3, otherwise outputs 0."
148
+ },
149
+ "rasp_vars": [
150
+ "check_divisible_by_3"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_123.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_123",
4
+ "name": "arccosine",
5
+ "summary": "Apply arccosine to each element of the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 0.7,
11
+ -0.19999999999999996,
12
+ -0.9,
13
+ 0.8999999999999999,
14
+ 0.3999999999999999,
15
+ -0.4,
16
+ 0.10000000000000009,
17
+ -0.30000000000000004,
18
+ 0.3999999999999999
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0.7953988301841436,
23
+ 1.7721542475852274,
24
+ 2.6905658417935308,
25
+ 0.45102681179626264,
26
+ 1.1592794807274087,
27
+ 1.9823131728623846,
28
+ 1.4706289056333368,
29
+ 1.8754889808102941,
30
+ 1.1592794807274087
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ -0.8,
37
+ -0.6,
38
+ 0.8,
39
+ -0.4,
40
+ -0.19999999999999996,
41
+ -0.4,
42
+ 0.7,
43
+ -0.7,
44
+ 0.30000000000000004
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 2.498091544796509,
49
+ 2.214297435588181,
50
+ 0.6435011087932843,
51
+ 1.9823131728623846,
52
+ 1.7721542475852274,
53
+ 1.9823131728623846,
54
+ 0.7953988301841436,
55
+ 2.3461938234056494,
56
+ 1.266103672779499
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ -0.4,
63
+ 0.8999999999999999,
64
+ 0.3999999999999999,
65
+ 0.0,
66
+ -0.30000000000000004,
67
+ -0.4,
68
+ 0.8,
69
+ 0.0,
70
+ 0.0
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 1.9823131728623846,
75
+ 0.45102681179626264,
76
+ 1.1592794807274087,
77
+ 1.5707963267948966,
78
+ 1.8754889808102941,
79
+ 1.9823131728623846,
80
+ 0.6435011087932843,
81
+ 1.5707963267948966,
82
+ 1.5707963267948966
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ -0.7,
89
+ -0.30000000000000004,
90
+ -0.8,
91
+ -0.9,
92
+ 0.10000000000000009,
93
+ -0.5,
94
+ -0.9,
95
+ -1.0,
96
+ 0.10000000000000009
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 2.3461938234056494,
101
+ 1.8754889808102941,
102
+ 2.498091544796509,
103
+ 2.6905658417935308,
104
+ 1.4706289056333368,
105
+ 2.0943951023931957,
106
+ 2.6905658417935308,
107
+ 3.141592653589793,
108
+ 1.4706289056333368
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 0.10000000000000009,
115
+ 0.6000000000000001,
116
+ -0.09999999999999998,
117
+ 0.5,
118
+ 0.3999999999999999,
119
+ 0.3999999999999999,
120
+ 0.8,
121
+ 0.10000000000000009,
122
+ 0.8999999999999999
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 1.4706289056333368,
127
+ 0.9272952180016121,
128
+ 1.6709637479564563,
129
+ 1.0471975511965979,
130
+ 1.1592794807274087,
131
+ 1.1592794807274087,
132
+ 0.6435011087932843,
133
+ 1.4706289056333368,
134
+ 0.45102681179626264
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(lambda x: math.acos(x), rasp.tokens)",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies an arccosine nonlinear transformation to each input element independently."
148
+ },
149
+ "rasp_vars": [
150
+ "arccosine"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_124.json ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_124",
4
+ "name": "check_all_equal",
5
+ "summary": "Check if all elements in a list are equal.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 3,
11
+ 3,
12
+ 3,
13
+ 3,
14
+ 3,
15
+ 3,
16
+ 3,
17
+ 3,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1,
23
+ 1,
24
+ 1,
25
+ 1,
26
+ 1,
27
+ 1,
28
+ 1,
29
+ 1,
30
+ 1
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 9,
37
+ 4,
38
+ 0,
39
+ 2,
40
+ 5,
41
+ 3,
42
+ 7,
43
+ 10,
44
+ 8
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0,
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 2,
63
+ 1,
64
+ 8,
65
+ 9,
66
+ 4,
67
+ 3,
68
+ 0,
69
+ 6,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0,
75
+ 0,
76
+ 0,
77
+ 0,
78
+ 0,
79
+ 0,
80
+ 0,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 0,
89
+ 0,
90
+ 0,
91
+ 0,
92
+ 0,
93
+ 0,
94
+ 0,
95
+ 0,
96
+ 0
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 1,
101
+ 1,
102
+ 1,
103
+ 1,
104
+ 1,
105
+ 1,
106
+ 1,
107
+ 1,
108
+ 1
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 3,
115
+ 8,
116
+ 0,
117
+ 10,
118
+ 5,
119
+ 6,
120
+ 4,
121
+ 7,
122
+ 9
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0,
127
+ 0,
128
+ 0,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "unequal_selector = rasp.Select(rasp.tokens, rasp.tokens, lambda x, y: x != y)\nchecks = rasp.SelectorWidth(unequal_selector)\nzero_selector = rasp.Select(checks, rasp.Map(lambda x: 0, rasp.indices), rasp.Comparison.EQ)\nreturn rasp.Map(lambda x: 1 if x > 0 else 0, rasp.SelectorWidth(zero_selector))",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Aggregates positions holding tokens unequal to the current token into a per-position mismatch count."
148
+ },
149
+ "rasp_vars": [
150
+ "unequal_selector"
151
+ ],
152
+ "labels": [
153
+ "selector_width_4_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Turns the mismatch signal into a per-position mismatch count and prepares it for the global decision."
162
+ },
163
+ "rasp_vars": [
164
+ "checks"
165
+ ],
166
+ "labels": [
167
+ "selector_width_4",
168
+ "map_5",
169
+ "selector_width_4_selector_width_attn_output"
170
+ ]
171
+ },
172
+ {
173
+ "id": "L1H0_ATTN",
174
+ "hook": "blocks.1.attn.hook_result[0]",
175
+ "role": {
176
+ "tag": "AGGREGATOR",
177
+ "note": "Aggregates positions where the mismatch count is zero, producing a per-position count of zero-mismatch occurrences."
178
+ },
179
+ "rasp_vars": [
180
+ "zero_selector"
181
+ ],
182
+ "labels": [
183
+ "selector_width_2_selector_width_attn_output"
184
+ ]
185
+ },
186
+ {
187
+ "id": "L1_MLP",
188
+ "hook": "blocks.1.mlp.hook_post",
189
+ "role": {
190
+ "tag": "MAPPER",
191
+ "note": "Converts the zero-mismatch mask into a scalar-like summary signal that can be read out."
192
+ },
193
+ "rasp_vars": [
194
+ "all_equal_signal"
195
+ ],
196
+ "labels": [
197
+ "selector_width_2",
198
+ "selector_width_2_selector_width_attn_output"
199
+ ]
200
+ },
201
+ {
202
+ "id": "L2_MLP",
203
+ "hook": "blocks.2.mlp.hook_post",
204
+ "role": {
205
+ "tag": "INDICATOR",
206
+ "note": "Outputs the final binary decision: 1 if all elements are equal, otherwise 0."
207
+ },
208
+ "rasp_vars": [
209
+ "all_equal"
210
+ ],
211
+ "labels": [
212
+ "map_1"
213
+ ]
214
+ }
215
+ ]
216
+ }
annotations/case_129.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_129",
4
+ "name": "check_multiple_of_n",
5
+ "summary": "Checks if all elements are a multiple of n (default n=2).",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 0,
11
+ 28,
12
+ 2,
13
+ 6,
14
+ 22,
15
+ 16,
16
+ 26,
17
+ 20,
18
+ 10
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1,
23
+ 1,
24
+ 1,
25
+ 1,
26
+ 1,
27
+ 1,
28
+ 1,
29
+ 1,
30
+ 1
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 0,
37
+ 8,
38
+ 2,
39
+ 26,
40
+ 9,
41
+ 6,
42
+ 20,
43
+ 24,
44
+ 12
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0,
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 4,
63
+ 10,
64
+ 14,
65
+ 0,
66
+ 6,
67
+ 9,
68
+ 12,
69
+ 8,
70
+ 18
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0,
75
+ 0,
76
+ 0,
77
+ 0,
78
+ 0,
79
+ 0,
80
+ 0,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 0,
89
+ 22,
90
+ 8,
91
+ 6,
92
+ 26,
93
+ 4,
94
+ 2,
95
+ 16,
96
+ 24
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 1,
101
+ 1,
102
+ 1,
103
+ 1,
104
+ 1,
105
+ 1,
106
+ 1,
107
+ 1,
108
+ 1
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 2,
115
+ 26,
116
+ 8,
117
+ 14,
118
+ 29,
119
+ 18,
120
+ 0,
121
+ 10,
122
+ 16
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0,
127
+ 0,
128
+ 0,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "checks = rasp.Map(lambda x: 1 if x % n == 0 else 0, rasp.tokens).named(f\"check_multiple_of_{n}\")\nzero_selector = rasp.Select(checks, rasp.Map(lambda x: 0, rasp.indices), rasp.Comparison.EQ)\nreturn rasp.Map(lambda x: 0 if x > 0 else 1, rasp.SelectorWidth(zero_selector))",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Computes a per-element pass/fail flag indicating whether each value is divisible by n."
148
+ },
149
+ "rasp_vars": [
150
+ "checks"
151
+ ],
152
+ "labels": [
153
+ "check_multiple_of_2_4",
154
+ "map_5"
155
+ ]
156
+ },
157
+ {
158
+ "id": "L1H0_ATTN",
159
+ "hook": "blocks.1.attn.hook_result[0]",
160
+ "role": {
161
+ "tag": "AGGREGATOR",
162
+ "note": "Aggregates positions where the divisibility flag is zero, producing a per-position count of non-multiple occurrences."
163
+ },
164
+ "rasp_vars": [
165
+ "zero_selector"
166
+ ],
167
+ "labels": [
168
+ "selector_width_2_selector_width_attn_output"
169
+ ]
170
+ },
171
+ {
172
+ "id": "L1_MLP",
173
+ "hook": "blocks.1.mlp.hook_post",
174
+ "role": {
175
+ "tag": "MAPPER",
176
+ "note": "Summarizes the mismatch count signal into a single global indicator shared across positions."
177
+ },
178
+ "rasp_vars": [
179
+ "mismatch_count"
180
+ ],
181
+ "labels": [
182
+ "selector_width_2"
183
+ ]
184
+ },
185
+ {
186
+ "id": "L2_MLP",
187
+ "hook": "blocks.2.mlp.hook_post",
188
+ "role": {
189
+ "tag": "INDICATOR",
190
+ "note": "Converts the global mismatch indicator into the final decision: all-multiples vs not-all-multiples."
191
+ },
192
+ "rasp_vars": [
193
+ "all_multiples"
194
+ ],
195
+ "labels": [
196
+ "map_1"
197
+ ]
198
+ }
199
+ ]
200
+ }
annotations/case_13.json ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_13",
4
+ "name": "token_trend_analysis",
5
+ "summary": "Analyzes the trend [increasing, decreasing, constant] of numeric tokens.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 1,
11
+ 1,
12
+ 0,
13
+ 0,
14
+ 1,
15
+ 1,
16
+ 0,
17
+ 0,
18
+ 0
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "constant",
23
+ "decreasing",
24
+ "constant",
25
+ "increasing",
26
+ "constant",
27
+ "decreasing",
28
+ "constant",
29
+ "constant",
30
+ null
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 2,
37
+ 2,
38
+ 0,
39
+ 2,
40
+ 0,
41
+ 2,
42
+ 2,
43
+ 0,
44
+ 0
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "constant",
49
+ "decreasing",
50
+ "increasing",
51
+ "decreasing",
52
+ "increasing",
53
+ "constant",
54
+ "decreasing",
55
+ "constant",
56
+ null
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 2,
63
+ 0,
64
+ 2,
65
+ 2,
66
+ 0,
67
+ 0,
68
+ 2,
69
+ 1,
70
+ 2
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "decreasing",
75
+ "increasing",
76
+ "constant",
77
+ "decreasing",
78
+ "constant",
79
+ "increasing",
80
+ "decreasing",
81
+ "increasing",
82
+ null
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 2,
89
+ 2,
90
+ 2,
91
+ 1,
92
+ 2,
93
+ 1,
94
+ 1,
95
+ 2,
96
+ 1
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "constant",
101
+ "constant",
102
+ "decreasing",
103
+ "increasing",
104
+ "decreasing",
105
+ "constant",
106
+ "increasing",
107
+ "decreasing",
108
+ null
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 2,
115
+ 2,
116
+ 2,
117
+ 0,
118
+ 2,
119
+ 1,
120
+ 0,
121
+ 1,
122
+ 1
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "constant",
127
+ "constant",
128
+ "decreasing",
129
+ "increasing",
130
+ "decreasing",
131
+ "decreasing",
132
+ "increasing",
133
+ "constant",
134
+ null
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "select_off_by_offset = rasp.Select[rasp.indices, rasp.indices, lambda k,q: q == k + offset]\nnext_token = rasp.Aggregate[select_off_by_offset, sop, default=None].named[\"shift_by(-1)\"]\ntrend_analysis = rasp.SequenceMap[second_part_fn, sop, next_token]\nreturn trend_analysis",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "ROUTER",
147
+ "note": "Shifts the sequence to provide each position with the next token (and pads the end)."
148
+ },
149
+ "rasp_vars": [
150
+ "next_token"
151
+ ],
152
+ "labels": [
153
+ "shift_by(-1)_2"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "COMBINER",
161
+ "note": "Compares the current token with the next token and outputs the trend class."
162
+ },
163
+ "rasp_vars": [
164
+ "trend_analysis"
165
+ ],
166
+ "labels": [
167
+ "sequence_map_1"
168
+ ]
169
+ }
170
+ ]
171
+ }
annotations/case_130.json ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_130",
4
+ "name": "clip",
5
+ "summary": "Clips each element to be within a range (make the default range [2, 7]).",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ -9,
11
+ 4,
12
+ 13,
13
+ -1,
14
+ -5,
15
+ -8,
16
+ 13,
17
+ 5,
18
+ -9
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 2,
23
+ 4,
24
+ 7,
25
+ 2,
26
+ 2,
27
+ 2,
28
+ 7,
29
+ 5,
30
+ 2
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 10,
37
+ 3,
38
+ 7,
39
+ -5,
40
+ -5,
41
+ 8,
42
+ 5,
43
+ -12,
44
+ -8
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 7,
49
+ 3,
50
+ 7,
51
+ 2,
52
+ 2,
53
+ 7,
54
+ 5,
55
+ 2,
56
+ 2
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 9,
63
+ 1,
64
+ 11,
65
+ 11,
66
+ -6,
67
+ 12,
68
+ 12,
69
+ 0,
70
+ -1
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 7,
75
+ 2,
76
+ 7,
77
+ 7,
78
+ 2,
79
+ 7,
80
+ 7,
81
+ 2,
82
+ 2
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ -14,
89
+ 12,
90
+ 5,
91
+ -15,
92
+ -4,
93
+ 10,
94
+ 6,
95
+ 13,
96
+ -4
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 2,
101
+ 7,
102
+ 5,
103
+ 2,
104
+ 2,
105
+ 7,
106
+ 6,
107
+ 7,
108
+ 2
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 8,
115
+ -13,
116
+ 6,
117
+ 5,
118
+ -14,
119
+ 8,
120
+ -4,
121
+ 14,
122
+ -10
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 7,
127
+ 2,
128
+ 6,
129
+ 5,
130
+ 2,
131
+ 7,
132
+ 2,
133
+ 7,
134
+ 2
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "all_min_val = rasp.Map(lambda x: 2, rasp.tokens)\nall_max_val = rasp.Map(lambda x: 7, rasp.tokens)\nless_than_min = rasp.Map(lambda x: x < 2, rasp.tokens)\ngreater_than_max = rasp.Map(lambda x: x > 7, rasp.tokens)\nclip_min = rasp.SequenceMap(lambda orig, clip: clip if orig < 2 else orig, rasp.tokens, all_min_val)\nclip_max = rasp.SequenceMap(lambda clipped_min, clip: clip if clipped_min > 7 else clipped_min, clip_min, all_max_val)\nreturn clip_max",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Creates constant per-position helper values used as the lower and upper clipping bounds."
148
+ },
149
+ "rasp_vars": [
150
+ "all_min_val",
151
+ "all_max_val"
152
+ ],
153
+ "labels": [
154
+ "map_3",
155
+ "map_4"
156
+ ]
157
+ },
158
+ {
159
+ "id": "L1_MLP",
160
+ "hook": "blocks.1.mlp.hook_post",
161
+ "role": {
162
+ "tag": "COMBINER",
163
+ "note": "Applies the lower-bound clipping step, replacing values below the minimum with the minimum."
164
+ },
165
+ "rasp_vars": [
166
+ "clip_min"
167
+ ],
168
+ "labels": [
169
+ "sequence_map_2"
170
+ ]
171
+ },
172
+ {
173
+ "id": "L2_MLP",
174
+ "hook": "blocks.2.mlp.hook_post",
175
+ "role": {
176
+ "tag": "COMBINER",
177
+ "note": "Applies the upper-bound clipping step, replacing values above the maximum with the maximum."
178
+ },
179
+ "rasp_vars": [
180
+ "clip_max"
181
+ ],
182
+ "labels": [
183
+ "sequence_map_1"
184
+ ]
185
+ }
186
+ ]
187
+ }
annotations/case_14.json ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_14",
4
+ "name": "count_a",
5
+ "summary": "Returns the count of 'a' in the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "b",
11
+ "b",
12
+ "a",
13
+ "a",
14
+ "b",
15
+ "b",
16
+ "a",
17
+ "a",
18
+ "a"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 5,
23
+ 5,
24
+ 5,
25
+ 5,
26
+ 5,
27
+ 5,
28
+ 5,
29
+ 5,
30
+ 5
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "c",
37
+ "c",
38
+ "a",
39
+ "c",
40
+ "a",
41
+ "c",
42
+ "c",
43
+ "a",
44
+ "a"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 4,
49
+ 4,
50
+ 4,
51
+ 4,
52
+ 4,
53
+ 4,
54
+ 4,
55
+ 4,
56
+ 4
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "c",
63
+ "a",
64
+ "c",
65
+ "c",
66
+ "a",
67
+ "a",
68
+ "c",
69
+ "b",
70
+ "c"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 3,
75
+ 3,
76
+ 3,
77
+ 3,
78
+ 3,
79
+ 3,
80
+ 3,
81
+ 3,
82
+ 3
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "c",
89
+ "c",
90
+ "c",
91
+ "b",
92
+ "c",
93
+ "b",
94
+ "b",
95
+ "c",
96
+ "b"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0,
101
+ 0,
102
+ 0,
103
+ 0,
104
+ 0,
105
+ 0,
106
+ 0,
107
+ 0,
108
+ 0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "c",
115
+ "c",
116
+ "c",
117
+ "a",
118
+ "c",
119
+ "b",
120
+ "a",
121
+ "b",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 2,
127
+ 2,
128
+ 2,
129
+ 2,
130
+ 2,
131
+ 2,
132
+ 2,
133
+ 2,
134
+ 2
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "count_a_selector = rasp.Select(sop, sop, lambda k, q: k == token).named(\"count_a_selector\")\ncount_a = rasp.SelectorWidth(count_a_selector).named(\"count_a\")\nreturn count_a",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Aggregates positions containing the target token 'a' into a per-position match count."
148
+ },
149
+ "rasp_vars": [
150
+ "count_a_selector"
151
+ ],
152
+ "labels": [
153
+ "count_a_1_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Turns the match pattern into a per-position total count of 'a' in the sequence."
162
+ },
163
+ "rasp_vars": [
164
+ "count_a"
165
+ ],
166
+ "labels": [
167
+ "count_a_1"
168
+ ]
169
+ }
170
+ ]
171
+ }
annotations/case_15.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_15",
4
+ "name": "double_minus_index",
5
+ "summary": "Returns each token multiplied by two and subtracted by its index.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 3,
13
+ 2
14
+ ],
15
+ "output": [
16
+ "BOS",
17
+ 4,
18
+ 7,
19
+ 4,
20
+ 1
21
+ ]
22
+ },
23
+ {
24
+ "input": [
25
+ "BOS",
26
+ 4,
27
+ 1,
28
+ 3,
29
+ 1
30
+ ],
31
+ "output": [
32
+ "BOS",
33
+ 8,
34
+ 1,
35
+ 4,
36
+ -1
37
+ ]
38
+ },
39
+ {
40
+ "input": [
41
+ "BOS",
42
+ 3,
43
+ 4,
44
+ 2,
45
+ 4
46
+ ],
47
+ "output": [
48
+ "BOS",
49
+ 6,
50
+ 7,
51
+ 2,
52
+ 5
53
+ ]
54
+ },
55
+ {
56
+ "input": [
57
+ "BOS",
58
+ 3,
59
+ 4,
60
+ 0,
61
+ 3
62
+ ],
63
+ "output": [
64
+ "BOS",
65
+ 6,
66
+ 7,
67
+ -2,
68
+ 3
69
+ ]
70
+ },
71
+ {
72
+ "input": [
73
+ "BOS",
74
+ 4,
75
+ 1,
76
+ 2,
77
+ 2
78
+ ],
79
+ "output": [
80
+ "BOS",
81
+ 8,
82
+ 1,
83
+ 2,
84
+ 1
85
+ ]
86
+ }
87
+ ],
88
+ "is_categorical": true
89
+ },
90
+ "program": "values, *sops = sops; for sop in sops: values = rasp.SequenceMap(lambda x, y: (*x, y) if isinstance(x, tuple) else (x, y), values, sop); return rasp.Map(lambda args: f(*args), values)",
91
+ "components": [
92
+ {
93
+ "id": "L0_MLP",
94
+ "hook": "blocks.0.mlp.hook_post",
95
+ "role": {
96
+ "tag": "COMBINER",
97
+ "note": "Builds an intermediate representation that packages multiple per-position inputs together so they can be processed as a single combined object downstream."
98
+ },
99
+ "rasp_vars": [
100
+ "values_tuple_stage_1"
101
+ ],
102
+ "labels": [
103
+ "sequence_map_3"
104
+ ]
105
+ },
106
+ {
107
+ "id": "L1_MLP",
108
+ "hook": "blocks.1.mlp.hook_post",
109
+ "role": {
110
+ "tag": "COMBINER",
111
+ "note": "Extends the combined per-position representation by incorporating the position index, forming the final set of arguments needed for the arithmetic step."
112
+ },
113
+ "rasp_vars": [
114
+ "values_tuple_stage_2"
115
+ ],
116
+ "labels": [
117
+ "sequence_map_2"
118
+ ]
119
+ },
120
+ {
121
+ "id": "L2_MLP",
122
+ "hook": "blocks.2.mlp.hook_post",
123
+ "role": {
124
+ "tag": "MAPPER",
125
+ "note": "Computes the final per-position arithmetic from the bundled arguments (equivalent to doubling the token value and subtracting the index)."
126
+ },
127
+ "rasp_vars": [
128
+ "output"
129
+ ],
130
+ "labels": [
131
+ "map_1"
132
+ ]
133
+ }
134
+ ]
135
+ }
annotations/case_18.json ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_18",
4
+ "name": "token_frequency_classifier",
5
+ "summary": "Classify each token based on its frequency as 'rare', 'common', or 'frequent'.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "a",
11
+ "d",
12
+ "b",
13
+ "e",
14
+ "d",
15
+ "a",
16
+ "a",
17
+ "c",
18
+ "c"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "common",
23
+ "rare",
24
+ "rare",
25
+ "rare",
26
+ "rare",
27
+ "common",
28
+ "common",
29
+ "rare",
30
+ "rare"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "b",
37
+ "d",
38
+ "d",
39
+ "c",
40
+ "d",
41
+ "d",
42
+ "a",
43
+ "c",
44
+ "e"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "rare",
49
+ "common",
50
+ "common",
51
+ "rare",
52
+ "common",
53
+ "common",
54
+ "rare",
55
+ "rare",
56
+ "rare"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "c",
63
+ "e",
64
+ "a",
65
+ "b",
66
+ "d",
67
+ "a",
68
+ "d",
69
+ "b",
70
+ "b"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "rare",
75
+ "rare",
76
+ "rare",
77
+ "common",
78
+ "rare",
79
+ "rare",
80
+ "rare",
81
+ "common",
82
+ "common"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "e",
89
+ "d",
90
+ "c",
91
+ "e",
92
+ "b",
93
+ "d",
94
+ "b",
95
+ "d",
96
+ "e"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "common",
101
+ "common",
102
+ "rare",
103
+ "common",
104
+ "rare",
105
+ "common",
106
+ "rare",
107
+ "common",
108
+ "common"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "d",
115
+ "e",
116
+ "c",
117
+ "e",
118
+ "e",
119
+ "b",
120
+ "c",
121
+ "c",
122
+ "c"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "rare",
127
+ "common",
128
+ "common",
129
+ "common",
130
+ "common",
131
+ "rare",
132
+ "common",
133
+ "common",
134
+ "common"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "frequency = make_hist()\ntotal_tokens = make_length()\nfrequency_classification = rasp.SequenceMap(\n lambda freq, total: \"frequent\" if freq > total/2 else (\"common\" if freq > total/4 else \"rare\"),\n frequency, total_tokens)\nreturn frequency_classification",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Builds the token-equality matching structure used to count how often each token appears."
148
+ },
149
+ "rasp_vars": [
150
+ "same_tok"
151
+ ],
152
+ "labels": [
153
+ "hist_2_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0H1_ATTN",
158
+ "hook": "blocks.0.attn.hook_result[1]",
159
+ "role": {
160
+ "tag": "AGGREGATOR",
161
+ "note": "Builds the all-positions selector used as the basis for computing sequence length."
162
+ },
163
+ "rasp_vars": [
164
+ "all_true_selector"
165
+ ],
166
+ "labels": [
167
+ "length_3_selector_width_attn_output"
168
+ ]
169
+ },
170
+ {
171
+ "id": "L0_MLP",
172
+ "hook": "blocks.0.mlp.hook_post",
173
+ "role": {
174
+ "tag": "MAPPER",
175
+ "note": "Turns the selector-width signals into usable numeric features for per-token frequency and total length."
176
+ },
177
+ "rasp_vars": [
178
+ "frequency",
179
+ "total_tokens"
180
+ ],
181
+ "labels": [
182
+ "hist_2",
183
+ "length_3",
184
+ "hist_2_selector_width_attn_output",
185
+ "length_3_selector_width_attn_output"
186
+ ]
187
+ },
188
+ {
189
+ "id": "L1_MLP",
190
+ "hook": "blocks.1.mlp.hook_post",
191
+ "role": {
192
+ "tag": "COMBINER",
193
+ "note": "Combines per-token frequency with total length to assign the label rare/common/frequent."
194
+ },
195
+ "rasp_vars": [
196
+ "frequency_classification"
197
+ ],
198
+ "labels": [
199
+ "sequence_map_1"
200
+ ]
201
+ }
202
+ ]
203
+ }
annotations/case_19.json ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_19",
4
+ "name": "sequential_duplicate_removal",
5
+ "summary": "Removes consecutive duplicate tokens from a sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "c",
11
+ "a",
12
+ "c",
13
+ "c",
14
+ "a",
15
+ "a",
16
+ "c",
17
+ "b",
18
+ "c",
19
+ "c",
20
+ "c",
21
+ "c",
22
+ "a",
23
+ "c"
24
+ ],
25
+ "output": [
26
+ "BOS",
27
+ null,
28
+ "a",
29
+ "c",
30
+ null,
31
+ "a",
32
+ null,
33
+ "c",
34
+ "b",
35
+ "c",
36
+ null,
37
+ null,
38
+ null,
39
+ "a",
40
+ "c"
41
+ ]
42
+ },
43
+ {
44
+ "input": [
45
+ "BOS",
46
+ "c",
47
+ "c",
48
+ "b",
49
+ "c",
50
+ "b",
51
+ "b",
52
+ "c",
53
+ "b",
54
+ "c",
55
+ "c",
56
+ "a",
57
+ "c",
58
+ "a",
59
+ "c"
60
+ ],
61
+ "output": [
62
+ "BOS",
63
+ null,
64
+ null,
65
+ "b",
66
+ "c",
67
+ "b",
68
+ null,
69
+ "c",
70
+ "b",
71
+ "c",
72
+ null,
73
+ "a",
74
+ "c",
75
+ "a",
76
+ "c"
77
+ ]
78
+ },
79
+ {
80
+ "input": [
81
+ "BOS",
82
+ "c",
83
+ "a",
84
+ "a",
85
+ "c",
86
+ "b",
87
+ "a",
88
+ "b",
89
+ "b",
90
+ "b",
91
+ "a",
92
+ "b",
93
+ "a",
94
+ "b",
95
+ "c"
96
+ ],
97
+ "output": [
98
+ "BOS",
99
+ null,
100
+ "a",
101
+ null,
102
+ "c",
103
+ "b",
104
+ "a",
105
+ "b",
106
+ null,
107
+ null,
108
+ "a",
109
+ "b",
110
+ "a",
111
+ "b",
112
+ "c"
113
+ ]
114
+ },
115
+ {
116
+ "input": [
117
+ "BOS",
118
+ "c",
119
+ "a",
120
+ "c",
121
+ "c",
122
+ "b",
123
+ "a",
124
+ "b",
125
+ "b",
126
+ "b",
127
+ "b",
128
+ "b",
129
+ "b",
130
+ "b",
131
+ "a"
132
+ ],
133
+ "output": [
134
+ "BOS",
135
+ null,
136
+ "a",
137
+ "c",
138
+ null,
139
+ "b",
140
+ "a",
141
+ "b",
142
+ null,
143
+ null,
144
+ null,
145
+ null,
146
+ null,
147
+ null,
148
+ "a"
149
+ ]
150
+ },
151
+ {
152
+ "input": [
153
+ "BOS",
154
+ "b",
155
+ "a",
156
+ "b",
157
+ "b",
158
+ "b",
159
+ "b",
160
+ "a",
161
+ "a",
162
+ "b",
163
+ "b",
164
+ "a",
165
+ "a",
166
+ "a",
167
+ "c"
168
+ ],
169
+ "output": [
170
+ "BOS",
171
+ null,
172
+ "a",
173
+ "b",
174
+ null,
175
+ null,
176
+ null,
177
+ "a",
178
+ null,
179
+ "b",
180
+ null,
181
+ "a",
182
+ null,
183
+ null,
184
+ "c"
185
+ ]
186
+ }
187
+ ],
188
+ "is_categorical": true
189
+ },
190
+ "program": "shifted_sop = shift_by(1, sop)\nduplicate_removal_sop = rasp.SequenceMap(lambda x, y: x if x != y else None, sop, shifted_sop).named(\"sequential_duplicate_removal\")\nreturn duplicate_removal_sop",
191
+ "components": [
192
+ {
193
+ "id": "L0H0_ATTN",
194
+ "hook": "blocks.0.attn.hook_result[0]",
195
+ "role": {
196
+ "tag": "ROUTER",
197
+ "note": "Shifts the sequence by one position to expose the previous token at each index for comparison."
198
+ },
199
+ "rasp_vars": [
200
+ "shifted_sop"
201
+ ],
202
+ "labels": [
203
+ "shift_by(1)_2"
204
+ ]
205
+ },
206
+ {
207
+ "id": "L0_MLP",
208
+ "hook": "blocks.0.mlp.hook_post",
209
+ "role": {
210
+ "tag": "COMBINER",
211
+ "note": "Compares each token to the previous token and outputs the token only when it differs; otherwise outputs None to remove consecutive duplicates."
212
+ },
213
+ "rasp_vars": [
214
+ "sequential_duplicate_removal"
215
+ ],
216
+ "labels": [
217
+ "sequential_duplicate_removal_1"
218
+ ]
219
+ }
220
+ ]
221
+ }
annotations/case_2.json ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_2",
4
+ "name": "reverse_sequence",
5
+ "summary": "Reverse the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "l",
11
+ "z",
12
+ "v",
13
+ "l",
14
+ "y",
15
+ "q",
16
+ "j",
17
+ "p",
18
+ "o"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "o",
23
+ "p",
24
+ "j",
25
+ "q",
26
+ "y",
27
+ "l",
28
+ "v",
29
+ "z",
30
+ "l"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "w",
37
+ "k",
38
+ "k",
39
+ "x",
40
+ "u",
41
+ "d",
42
+ "h",
43
+ "x",
44
+ "c"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "c",
49
+ "x",
50
+ "h",
51
+ "d",
52
+ "u",
53
+ "x",
54
+ "k",
55
+ "k",
56
+ "w"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "v",
63
+ "u",
64
+ "b",
65
+ "x",
66
+ "l",
67
+ "f",
68
+ "b",
69
+ "u",
70
+ "a"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "a",
75
+ "u",
76
+ "b",
77
+ "f",
78
+ "l",
79
+ "x",
80
+ "b",
81
+ "u",
82
+ "v"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "g",
89
+ "t",
90
+ "o",
91
+ "k",
92
+ "h",
93
+ "u",
94
+ "g",
95
+ "z",
96
+ "s"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "s",
101
+ "z",
102
+ "g",
103
+ "u",
104
+ "h",
105
+ "k",
106
+ "o",
107
+ "t",
108
+ "g"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "o",
115
+ "s",
116
+ "l",
117
+ "w",
118
+ "t",
119
+ "y",
120
+ "c",
121
+ "e",
122
+ "s"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "s",
127
+ "e",
128
+ "c",
129
+ "y",
130
+ "t",
131
+ "w",
132
+ "l",
133
+ "s",
134
+ "o"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "length = make_length(); opp_idx = length - indices; opp_idx_minus_1 = opp_idx - 1; reverse_selector = Select(indices, opp_idx_minus_1, EQ); reverse = Aggregate(reverse_selector, tokens)",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Produces a sequence-length signal by counting tokens via the attention output width."
148
+ },
149
+ "rasp_vars": [
150
+ "length"
151
+ ],
152
+ "labels": [
153
+ "length_5_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Computes sequence length feature from the length-related signal produced by the attention head."
162
+ },
163
+ "rasp_vars": [
164
+ "length"
165
+ ],
166
+ "labels": [
167
+ "length_5",
168
+ "length_5_selector_width_attn_output"
169
+ ]
170
+ },
171
+ {
172
+ "id": "L1_MLP",
173
+ "hook": "blocks.1.mlp.hook_post",
174
+ "role": {
175
+ "tag": "COMBINER",
176
+ "note": "For each position, computes which position it should pull from to create the reversed order."
177
+ },
178
+ "rasp_vars": [
179
+ "opp_idx"
180
+ ],
181
+ "labels": [
182
+ "opp_idx_4"
183
+ ]
184
+ },
185
+ {
186
+ "id": "L2_MLP",
187
+ "hook": "blocks.2.mlp.hook_post",
188
+ "role": {
189
+ "tag": "MAPPER",
190
+ "note": "Adjusts the computed source position so it lines up with the correct reverse indexing."
191
+ },
192
+ "rasp_vars": [
193
+ "opp_idx_minus_1"
194
+ ],
195
+ "labels": [
196
+ "opp_idx-1_3"
197
+ ]
198
+ },
199
+ {
200
+ "id": "L3H0_ATTN",
201
+ "hook": "blocks.3.attn.hook_result[0]",
202
+ "role": {
203
+ "tag": "ROUTER",
204
+ "note": "Moves tokens so every output position receives the token from its mirrored position, producing the reversed sequence."
205
+ },
206
+ "rasp_vars": [
207
+ "reverse_selector",
208
+ "reverse"
209
+ ],
210
+ "labels": [
211
+ "reverse_1"
212
+ ]
213
+ }
214
+ ]
215
+ }
annotations/case_20.json ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_20",
4
+ "name": "spam_message_detector",
5
+ "summary": "Detect spam messages based on appearance of spam keywords.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "poiVg",
11
+ "poiVg",
12
+ "now",
13
+ "b",
14
+ "V",
15
+ "now",
16
+ "now",
17
+ "TPSI",
18
+ "click"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "not spam",
23
+ "not spam",
24
+ "spam",
25
+ "not spam",
26
+ "not spam",
27
+ "spam",
28
+ "spam",
29
+ "not spam",
30
+ "spam"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "spam",
37
+ "offer",
38
+ "click",
39
+ "spam",
40
+ "oCLrZaW",
41
+ "J",
42
+ "poiVg",
43
+ "poiVg",
44
+ "offer"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "not spam",
49
+ "spam",
50
+ "spam",
51
+ "not spam",
52
+ "not spam",
53
+ "not spam",
54
+ "not spam",
55
+ "not spam",
56
+ "spam"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "no",
63
+ "V",
64
+ "poiVg",
65
+ "now",
66
+ "b",
67
+ "no",
68
+ "offer",
69
+ "TPSI",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "not spam",
75
+ "not spam",
76
+ "not spam",
77
+ "spam",
78
+ "not spam",
79
+ "not spam",
80
+ "spam",
81
+ "not spam",
82
+ "not spam"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "spam",
89
+ "spam",
90
+ "TPSI",
91
+ "spam",
92
+ "no",
93
+ "V",
94
+ "oCLrZaW",
95
+ "TPSI",
96
+ "b"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "not spam",
101
+ "not spam",
102
+ "not spam",
103
+ "not spam",
104
+ "not spam",
105
+ "not spam",
106
+ "not spam",
107
+ "not spam",
108
+ "not spam"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "b",
115
+ "LB",
116
+ "now",
117
+ "spam",
118
+ "click",
119
+ "LB",
120
+ "spam",
121
+ "b",
122
+ "J"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "not spam",
127
+ "not spam",
128
+ "spam",
129
+ "not spam",
130
+ "spam",
131
+ "not spam",
132
+ "not spam",
133
+ "not spam",
134
+ "not spam"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "spam_keywords = {\"free\", \"offer\", \"click\", \"now\"}\nkeyword_count = rasp.Map(lambda x: sum(x == keyword for keyword in spam_keywords), sop)\nis_spam = rasp.Map(lambda x: \"spam\" if x > 0 else \"not spam\", keyword_count)\nreturn is_spam",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Checks each token for membership in a spam-keyword set and emits a spam/not-spam label for that position."
148
+ },
149
+ "rasp_vars": [
150
+ "keyword_count",
151
+ "is_spam"
152
+ ],
153
+ "labels": [
154
+ "map_1"
155
+ ]
156
+ }
157
+ ]
158
+ }
annotations/case_21.json ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_21",
4
+ "name": "unique_token_extractor",
5
+ "summary": "Extract unique tokens from a string",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "b",
11
+ "b",
12
+ "a",
13
+ "a",
14
+ "b",
15
+ "b",
16
+ "a",
17
+ "a",
18
+ "a"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "b",
23
+ null,
24
+ "a",
25
+ null,
26
+ null,
27
+ null,
28
+ null,
29
+ null,
30
+ null
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "c",
37
+ "c",
38
+ "a",
39
+ "c",
40
+ "a",
41
+ "c",
42
+ "c",
43
+ "a",
44
+ "a"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "c",
49
+ null,
50
+ "a",
51
+ null,
52
+ null,
53
+ null,
54
+ null,
55
+ null,
56
+ null
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "c",
63
+ "a",
64
+ "c",
65
+ "c",
66
+ "a",
67
+ "a",
68
+ "c",
69
+ "b",
70
+ "c"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "c",
75
+ "a",
76
+ null,
77
+ null,
78
+ null,
79
+ null,
80
+ null,
81
+ "b",
82
+ null
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "c",
89
+ "c",
90
+ "c",
91
+ "b",
92
+ "c",
93
+ "b",
94
+ "b",
95
+ "c",
96
+ "b"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "c",
101
+ null,
102
+ null,
103
+ "b",
104
+ null,
105
+ null,
106
+ null,
107
+ null,
108
+ null
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "c",
115
+ "c",
116
+ "c",
117
+ "a",
118
+ "c",
119
+ "b",
120
+ "a",
121
+ "b",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "c",
127
+ null,
128
+ null,
129
+ "a",
130
+ null,
131
+ "b",
132
+ null,
133
+ null,
134
+ null
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "tokens_with_indices = rasp.SequenceMap(lambda x, i: (x, i), sop, rasp.indices)\noccurrences_selector = rasp.Select(tokens_with_indices, tokens_with_indices, lambda k, q: k[0] == q[0] and k[1] <= q[1])\noccurrences_per_row = rasp.SelectorWidth(occurrences_selector)\nfirst_occurrences_indices = rasp.SequenceMap(lambda count, i: i if count == 1 else -1, occurrences_per_row, rasp.indices)\ntokens_selector = rasp.Select(first_occurrences_indices, rasp.indices, rasp.Comparison.EQ).named(\"unique_tokens_selector\")\nreturn rasp.Aggregate(tokens_selector, sop, default=None).named(\"unique_tokens\")",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "COMBINER",
147
+ "note": "Creates a combined 'token + position' representation so later steps can tell which token occurred where."
148
+ },
149
+ "rasp_vars": [
150
+ "tokens_with_indices"
151
+ ],
152
+ "labels": [
153
+ "sequence_map_6"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L1H0_ATTN",
158
+ "hook": "blocks.1.attn.hook_result[0]",
159
+ "role": {
160
+ "tag": "AGGREGATOR",
161
+ "note": "Aggregates matching positions (same token, earlier-or-equal index) into a per-position count of how many times each token has appeared up to and including the current position."
162
+ },
163
+ "rasp_vars": [
164
+ "occurrences_selector"
165
+ ],
166
+ "labels": [
167
+ "selector_width_4_selector_width_attn_output"
168
+ ]
169
+ },
170
+ {
171
+ "id": "L1_MLP",
172
+ "hook": "blocks.1.mlp.hook_post",
173
+ "role": {
174
+ "tag": "MAPPER",
175
+ "note": "Converts the per-position summary into the explicit running count of that token's occurrences so far. (how many times this token has appeared up to here)."
176
+ },
177
+ "rasp_vars": [
178
+ "occurrences_per_row"
179
+ ],
180
+ "labels": [
181
+ "selector_width_4",
182
+ "selector_width_4_selector_width_attn_output"
183
+ ]
184
+ },
185
+ {
186
+ "id": "L2_MLP",
187
+ "hook": "blocks.2.mlp.hook_post",
188
+ "role": {
189
+ "tag": "COMBINER",
190
+ "note": "Computes a per-position routing key that marks the first occurrence positions and marks all others as an invalid index."
191
+ },
192
+ "rasp_vars": [
193
+ "first_occurrences_indices"
194
+ ],
195
+ "labels": [
196
+ "sequence_map_3"
197
+ ]
198
+ },
199
+ {
200
+ "id": "L3H0_ATTN",
201
+ "hook": "blocks.3.attn.hook_result[0]",
202
+ "role": {
203
+ "tag": "AGGREGATOR",
204
+ "note": "Attends to the position (if any) whose 'first occurrences indices' equals the current index, and aggregates the token value from there, or None if no such position exists."
205
+ },
206
+ "rasp_vars": [
207
+ "unique_tokens"
208
+ ],
209
+ "labels": [
210
+ "unique_tokens_1"
211
+ ]
212
+ }
213
+ ]
214
+ }
annotations/case_24.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_24",
4
+ "name": "first_occurrence",
5
+ "summary": "Copies each token in the sequence to the output unchanged.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "b",
11
+ "b",
12
+ "a",
13
+ "a",
14
+ "b",
15
+ "b",
16
+ "a",
17
+ "a",
18
+ "a"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "b",
23
+ "b",
24
+ "a",
25
+ "a",
26
+ "b",
27
+ "b",
28
+ "a",
29
+ "a",
30
+ "a"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "c",
37
+ "c",
38
+ "a",
39
+ "c",
40
+ "a",
41
+ "c",
42
+ "c",
43
+ "a",
44
+ "a"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "c",
49
+ "c",
50
+ "a",
51
+ "c",
52
+ "a",
53
+ "c",
54
+ "c",
55
+ "a",
56
+ "a"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "c",
63
+ "a",
64
+ "c",
65
+ "c",
66
+ "a",
67
+ "a",
68
+ "c",
69
+ "b",
70
+ "c"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "c",
75
+ "a",
76
+ "c",
77
+ "c",
78
+ "a",
79
+ "a",
80
+ "c",
81
+ "b",
82
+ "c"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "c",
89
+ "c",
90
+ "c",
91
+ "b",
92
+ "c",
93
+ "b",
94
+ "b",
95
+ "c",
96
+ "b"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "c",
101
+ "c",
102
+ "c",
103
+ "b",
104
+ "c",
105
+ "b",
106
+ "b",
107
+ "c",
108
+ "b"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "c",
115
+ "c",
116
+ "c",
117
+ "a",
118
+ "c",
119
+ "b",
120
+ "a",
121
+ "b",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "c",
127
+ "c",
128
+ "c",
129
+ "a",
130
+ "c",
131
+ "b",
132
+ "a",
133
+ "b",
134
+ "b"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "first_occurrence = rasp.Aggregate(rasp.Select(rasp.indices, rasp.indices, rasp.Comparison.EQ), sop, default=None).named(\"first_occurrence\"); return first_occurrence",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "ROUTER",
147
+ "note": "Routes each position's token value to itself via an identity attention pattern. Each query position attends exclusively to its own key position, acting as a pass-through."
148
+ },
149
+ "rasp_vars": [
150
+ "first_occurrence"
151
+ ],
152
+ "labels": [
153
+ "first_occurrence_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_25.json ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_25",
4
+ "name": "token_frequency_normalization",
5
+ "summary": "Normalizes token frequencies in a sequence to a range between 0 and 1.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "b",
11
+ "b",
12
+ "a",
13
+ "a",
14
+ "b",
15
+ "b",
16
+ "a",
17
+ "a",
18
+ "a"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0.4444444444444444,
23
+ 0.4444444444444444,
24
+ 0.5555555555555556,
25
+ 0.5555555555555556,
26
+ 0.4444444444444444,
27
+ 0.4444444444444444,
28
+ 0.5555555555555556,
29
+ 0.5555555555555556,
30
+ 0.5555555555555556
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "c",
37
+ "c",
38
+ "a",
39
+ "c",
40
+ "a",
41
+ "c",
42
+ "c",
43
+ "a",
44
+ "a"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0.5555555555555556,
49
+ 0.5555555555555556,
50
+ 0.4444444444444444,
51
+ 0.5555555555555556,
52
+ 0.4444444444444444,
53
+ 0.5555555555555556,
54
+ 0.5555555555555556,
55
+ 0.4444444444444444,
56
+ 0.4444444444444444
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "c",
63
+ "a",
64
+ "c",
65
+ "c",
66
+ "a",
67
+ "a",
68
+ "c",
69
+ "b",
70
+ "c"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0.5555555555555556,
75
+ 0.3333333333333333,
76
+ 0.5555555555555556,
77
+ 0.5555555555555556,
78
+ 0.3333333333333333,
79
+ 0.3333333333333333,
80
+ 0.5555555555555556,
81
+ 0.1111111111111111,
82
+ 0.5555555555555556
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "c",
89
+ "c",
90
+ "c",
91
+ "b",
92
+ "c",
93
+ "b",
94
+ "b",
95
+ "c",
96
+ "b"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0.5555555555555556,
101
+ 0.5555555555555556,
102
+ 0.5555555555555556,
103
+ 0.4444444444444444,
104
+ 0.5555555555555556,
105
+ 0.4444444444444444,
106
+ 0.4444444444444444,
107
+ 0.5555555555555556,
108
+ 0.4444444444444444
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "c",
115
+ "c",
116
+ "c",
117
+ "a",
118
+ "c",
119
+ "b",
120
+ "a",
121
+ "b",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0.4444444444444444,
127
+ 0.4444444444444444,
128
+ 0.4444444444444444,
129
+ 0.2222222222222222,
130
+ 0.4444444444444444,
131
+ 0.3333333333333333,
132
+ 0.2222222222222222,
133
+ 0.3333333333333333,
134
+ 0.3333333333333333
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "normalized_freq = rasp.SequenceMap(lambda x, y: (x / y) if y > 0 else None, make_hist(), make_length())\nreturn normalized_freq",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Builds the token-matching pattern used to count how often each token appears."
148
+ },
149
+ "rasp_vars": [
150
+ "same_tok"
151
+ ],
152
+ "labels": [
153
+ "hist_2_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0H1_ATTN",
158
+ "hook": "blocks.0.attn.hook_result[1]",
159
+ "role": {
160
+ "tag": "AGGREGATOR",
161
+ "note": "Builds the all-positions pattern used to compute the sequence length."
162
+ },
163
+ "rasp_vars": [
164
+ "all_true_selector"
165
+ ],
166
+ "labels": [
167
+ "length_3_selector_width_attn_output"
168
+ ]
169
+ },
170
+ {
171
+ "id": "L0_MLP",
172
+ "hook": "blocks.0.mlp.hook_post",
173
+ "role": {
174
+ "tag": "MAPPER",
175
+ "note": "Post-processes the two attention outputs into usable per-position features of token frequency count and sequence length."
176
+ },
177
+ "rasp_vars": [
178
+ "hist",
179
+ "length"
180
+ ],
181
+ "labels": [
182
+ "hist_2",
183
+ "length_3",
184
+ "hist_2_selector_width_attn_output",
185
+ "length_3_selector_width_attn_output"
186
+ ]
187
+ },
188
+ {
189
+ "id": "L1_MLP",
190
+ "hook": "blocks.1.mlp.hook_post",
191
+ "role": {
192
+ "tag": "COMBINER",
193
+ "note": "Combines the per-token frequency with the sequence length to output normalized frequencies in the 0-1 range."
194
+ },
195
+ "rasp_vars": [
196
+ "normalized_freq"
197
+ ],
198
+ "labels": [
199
+ "sequence_map_1"
200
+ ]
201
+ }
202
+ ]
203
+ }
annotations/case_26.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_26",
4
+ "name": "token_cascade",
5
+ "summary": "Creates a cascading effect by repeating each token in sequence incrementally.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "b",
11
+ "b",
12
+ "a",
13
+ "a",
14
+ "b",
15
+ "b",
16
+ "a",
17
+ "a",
18
+ "a"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "b",
23
+ "bb",
24
+ "aaa",
25
+ "aaaa",
26
+ "bbbbb",
27
+ "bbbbbb",
28
+ "aaaaaaa",
29
+ "aaaaaaaa",
30
+ "aaaaaaaaa"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "c",
37
+ "c",
38
+ "a",
39
+ "c",
40
+ "a",
41
+ "c",
42
+ "c",
43
+ "a",
44
+ "a"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "c",
49
+ "cc",
50
+ "aaa",
51
+ "cccc",
52
+ "aaaaa",
53
+ "cccccc",
54
+ "ccccccc",
55
+ "aaaaaaaa",
56
+ "aaaaaaaaa"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "c",
63
+ "a",
64
+ "c",
65
+ "c",
66
+ "a",
67
+ "a",
68
+ "c",
69
+ "b",
70
+ "c"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "c",
75
+ "aa",
76
+ "ccc",
77
+ "cccc",
78
+ "aaaaa",
79
+ "aaaaaa",
80
+ "ccccccc",
81
+ "bbbbbbbb",
82
+ "ccccccccc"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "c",
89
+ "c",
90
+ "c",
91
+ "b",
92
+ "c",
93
+ "b",
94
+ "b",
95
+ "c",
96
+ "b"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "c",
101
+ "cc",
102
+ "ccc",
103
+ "bbbb",
104
+ "ccccc",
105
+ "bbbbbb",
106
+ "bbbbbbb",
107
+ "cccccccc",
108
+ "bbbbbbbbb"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "c",
115
+ "c",
116
+ "c",
117
+ "a",
118
+ "c",
119
+ "b",
120
+ "a",
121
+ "b",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "c",
127
+ "cc",
128
+ "ccc",
129
+ "aaaa",
130
+ "ccccc",
131
+ "bbbbbb",
132
+ "aaaaaaa",
133
+ "bbbbbbbb",
134
+ "bbbbbbbbb"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "cascade_sop = rasp.SequenceMap(lambda x, i: x * (i + 1), sop, rasp.indices)\nreturn cascade_sop",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "COMBINER",
147
+ "note": "Combines each token with its position index to repeat the token an increasing number of times across the sequence."
148
+ },
149
+ "rasp_vars": [
150
+ "cascade_sop"
151
+ ],
152
+ "labels": [
153
+ "sequence_map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_29.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_29",
4
+ "name": "token_abbreviation",
5
+ "summary": "Creates abbreviations for each token in the sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "oCLrZaW",
11
+ "V",
12
+ "b",
13
+ "oCLrZaW",
14
+ "TPSI",
15
+ "poiVg",
16
+ "b",
17
+ "b",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "oCL",
23
+ "V",
24
+ "b",
25
+ "oCL",
26
+ "TPS",
27
+ "poi",
28
+ "b",
29
+ "b",
30
+ "oCL"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "LB",
37
+ "TPSI",
38
+ "oCLrZaW",
39
+ "TPSI",
40
+ "TPSI",
41
+ "poiVg",
42
+ "b",
43
+ "V",
44
+ "poiVg"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "LB",
49
+ "TPS",
50
+ "oCL",
51
+ "TPS",
52
+ "TPS",
53
+ "poi",
54
+ "b",
55
+ "V",
56
+ "poi"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "poiVg",
63
+ "TPSI",
64
+ "no",
65
+ "b",
66
+ "LB",
67
+ "poiVg",
68
+ "V",
69
+ "no",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "poi",
75
+ "TPS",
76
+ "no",
77
+ "b",
78
+ "LB",
79
+ "poi",
80
+ "V",
81
+ "no",
82
+ "no"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "J",
90
+ "J",
91
+ "TPSI",
92
+ "TPSI",
93
+ "oCLrZaW",
94
+ "LB",
95
+ "poiVg",
96
+ "V"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "V",
101
+ "J",
102
+ "J",
103
+ "TPS",
104
+ "TPS",
105
+ "oCL",
106
+ "LB",
107
+ "poi",
108
+ "V"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "poiVg",
116
+ "V",
117
+ "b",
118
+ "J",
119
+ "V",
120
+ "LB",
121
+ "no",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "LB",
127
+ "poi",
128
+ "V",
129
+ "b",
130
+ "J",
131
+ "V",
132
+ "LB",
133
+ "no",
134
+ "b"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "abbreviation = rasp.Map(lambda x: x[:3] if len(x) > 3 else x, sop); return abbreviation",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies elementwise abbreviation rule, truncates to first 3 chars if len>3, else keeps token."
148
+ },
149
+ "rasp_vars": [
150
+ "abbreviation"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_3.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_3",
4
+ "name": "frac_prevs",
5
+ "summary": "Returns the fraction of 'x' in the input up to the i-th position for all i.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "c",
11
+ "x",
12
+ "a",
13
+ "c"
14
+ ],
15
+ "output": [
16
+ "BOS",
17
+ 0.0,
18
+ 0.5,
19
+ 0.3333333333333333,
20
+ 0.25
21
+ ]
22
+ },
23
+ {
24
+ "input": [
25
+ "BOS",
26
+ "c",
27
+ "b",
28
+ "c",
29
+ "c"
30
+ ],
31
+ "output": [
32
+ "BOS",
33
+ 0.0,
34
+ 0.0,
35
+ 0.0,
36
+ 0.0
37
+ ]
38
+ },
39
+ {
40
+ "input": [
41
+ "BOS",
42
+ "c",
43
+ "c",
44
+ "x",
45
+ "a"
46
+ ],
47
+ "output": [
48
+ "BOS",
49
+ 0.0,
50
+ 0.0,
51
+ 0.3333333333333333,
52
+ 0.25
53
+ ]
54
+ },
55
+ {
56
+ "input": [
57
+ "BOS",
58
+ "c",
59
+ "x",
60
+ "a",
61
+ "a"
62
+ ],
63
+ "output": [
64
+ "BOS",
65
+ 0.0,
66
+ 0.5,
67
+ 0.3333333333333333,
68
+ 0.25
69
+ ]
70
+ },
71
+ {
72
+ "input": [
73
+ "BOS",
74
+ "x",
75
+ "x",
76
+ "x",
77
+ "c"
78
+ ],
79
+ "output": [
80
+ "BOS",
81
+ 1.0,
82
+ 1.0,
83
+ 1.0,
84
+ 0.75
85
+ ]
86
+ }
87
+ ],
88
+ "is_categorical": false
89
+ },
90
+ "program": "is_x = (rasp.tokens == \"x\").named(\"is_x\"); bools = rasp.numerical(is_x); prevs = rasp.Select(rasp.indices, rasp.indices, rasp.Comparison.LEQ); return rasp.numerical(rasp.Aggregate(prevs, bools, default=0)).named(\"frac_prevs\")",
91
+ "components": [
92
+ {
93
+ "id": "L0_MLP",
94
+ "hook": "blocks.0.mlp.hook_post",
95
+ "role": {
96
+ "tag": "INDICATOR",
97
+ "note": "Computes per-position feature indicating whether the token at that position is 'x' or not."
98
+ },
99
+ "rasp_vars": [
100
+ "is_x"
101
+ ],
102
+ "labels": [
103
+ "is_x_3"
104
+ ]
105
+ },
106
+ {
107
+ "id": "L1H2_ATTN",
108
+ "hook": "blocks.1.attn.hook_result[2]",
109
+ "role": {
110
+ "tag": "AGGREGATOR",
111
+ "note": "Aggregates prefix fraction by attending over previous positions."
112
+ },
113
+ "rasp_vars": [
114
+ "prevs",
115
+ "frac_prevs"
116
+ ],
117
+ "labels": [
118
+ "frac_prevs_1"
119
+ ]
120
+ }
121
+ ]
122
+ }
annotations/case_30.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_30",
4
+ "name": "numeric_range_tagging",
5
+ "summary": "Tags numeric tokens in a sequence based on whether they fall within a given range.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "14",
11
+ "26",
12
+ "8",
13
+ "21",
14
+ "18",
15
+ "15",
16
+ "8",
17
+ "27",
18
+ "14"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ true,
23
+ false,
24
+ false,
25
+ false,
26
+ true,
27
+ true,
28
+ false,
29
+ false,
30
+ true
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "5",
37
+ "25",
38
+ "29",
39
+ "18",
40
+ "18",
41
+ "3",
42
+ "27",
43
+ "11",
44
+ "15"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ false,
49
+ false,
50
+ false,
51
+ true,
52
+ true,
53
+ false,
54
+ false,
55
+ true,
56
+ true
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "4",
63
+ "23",
64
+ "6",
65
+ "6",
66
+ "17",
67
+ "7",
68
+ "7",
69
+ "22",
70
+ "21"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ false,
75
+ false,
76
+ false,
77
+ false,
78
+ true,
79
+ false,
80
+ false,
81
+ false,
82
+ false
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "1",
89
+ "7",
90
+ "27",
91
+ "0",
92
+ "19",
93
+ "5",
94
+ "28",
95
+ "8",
96
+ "19"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ false,
101
+ false,
102
+ false,
103
+ false,
104
+ true,
105
+ false,
106
+ false,
107
+ false,
108
+ true
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "3",
115
+ "10",
116
+ "28",
117
+ "27",
118
+ "1",
119
+ "3",
120
+ "19",
121
+ "9",
122
+ "13"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ false,
127
+ true,
128
+ false,
129
+ false,
130
+ false,
131
+ false,
132
+ true,
133
+ false,
134
+ true
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "range_tagging = rasp.Map(lambda x: lower_bound <= int(x) <= upper_bound if x.isdigit() else False, sop)\nreturn range_tagging",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Applies a per-token range test and outputs a boolean tag for each position."
148
+ },
149
+ "rasp_vars": [
150
+ "range_tagging"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_31.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_31",
4
+ "name": "token_anagram_identifier",
5
+ "summary": "Identify if tokens in the sequence are anagrams of the word 'listen'.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "V",
11
+ "poiVg",
12
+ "LB",
13
+ "poiVg",
14
+ "b",
15
+ "LB",
16
+ "V",
17
+ "no",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ false,
23
+ false,
24
+ false,
25
+ false,
26
+ false,
27
+ false,
28
+ false,
29
+ false,
30
+ false
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "poiVg",
37
+ "TPSI",
38
+ "b",
39
+ "TPSI",
40
+ "no",
41
+ "b",
42
+ "poiVg",
43
+ "no",
44
+ "LB"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ false,
49
+ false,
50
+ false,
51
+ false,
52
+ false,
53
+ false,
54
+ false,
55
+ false,
56
+ false
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "no",
63
+ "V",
64
+ "oCLrZaW",
65
+ "b",
66
+ "no",
67
+ "TPSI",
68
+ "no",
69
+ "oCLrZaW",
70
+ "b"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ false,
75
+ false,
76
+ false,
77
+ false,
78
+ false,
79
+ false,
80
+ false,
81
+ false,
82
+ false
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "oCLrZaW",
90
+ "oCLrZaW",
91
+ "TPSI",
92
+ "listen",
93
+ "b",
94
+ "LB",
95
+ "oCLrZaW",
96
+ "listen"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ false,
101
+ false,
102
+ false,
103
+ false,
104
+ true,
105
+ false,
106
+ false,
107
+ false,
108
+ true
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "b",
116
+ "J",
117
+ "listen",
118
+ "poiVg",
119
+ "J",
120
+ "TPSI",
121
+ "no",
122
+ "V"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ false,
127
+ false,
128
+ false,
129
+ true,
130
+ false,
131
+ false,
132
+ false,
133
+ false,
134
+ false
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "sorted_target = sorted(target)\nanagram_identifier = rasp.Map(lambda x: sorted(x) == sorted_target, sop)\nreturn anagram_identifier",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Checks each token against the target anagram condition and outputs a boolean."
148
+ },
149
+ "rasp_vars": [
150
+ "anagram_identifier"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_33.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_33",
4
+ "name": "token_length_parity",
5
+ "summary": "Checks if each token's length is odd or even.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "oCLrZaW",
11
+ "V",
12
+ "b",
13
+ "oCLrZaW",
14
+ "TPSI",
15
+ "poiVg",
16
+ "b",
17
+ "b",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ false,
23
+ false,
24
+ false,
25
+ false,
26
+ true,
27
+ false,
28
+ false,
29
+ false,
30
+ false
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "LB",
37
+ "TPSI",
38
+ "oCLrZaW",
39
+ "TPSI",
40
+ "TPSI",
41
+ "poiVg",
42
+ "b",
43
+ "V",
44
+ "poiVg"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ true,
49
+ true,
50
+ false,
51
+ true,
52
+ true,
53
+ false,
54
+ false,
55
+ false,
56
+ false
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "poiVg",
63
+ "TPSI",
64
+ "no",
65
+ "b",
66
+ "LB",
67
+ "poiVg",
68
+ "V",
69
+ "no",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ false,
75
+ true,
76
+ true,
77
+ false,
78
+ true,
79
+ false,
80
+ false,
81
+ true,
82
+ true
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "J",
90
+ "J",
91
+ "TPSI",
92
+ "TPSI",
93
+ "oCLrZaW",
94
+ "LB",
95
+ "poiVg",
96
+ "V"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ false,
101
+ false,
102
+ false,
103
+ true,
104
+ true,
105
+ false,
106
+ true,
107
+ false,
108
+ false
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "poiVg",
116
+ "V",
117
+ "b",
118
+ "J",
119
+ "V",
120
+ "LB",
121
+ "no",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ true,
127
+ false,
128
+ false,
129
+ false,
130
+ false,
131
+ false,
132
+ true,
133
+ true,
134
+ false
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "length_parity_checker = rasp.Map(lambda x: len(x) % 2 == 0, sop)\nreturn length_parity_checker",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Computes a boolean per token indicating whether its length is even."
148
+ },
149
+ "rasp_vars": [
150
+ "length_parity_checker"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_34.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_34",
4
+ "name": "vowel_consonant_ratio",
5
+ "summary": "Calculate the ratio of vowels to consonants in each word.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "oCLrZaW",
11
+ "V",
12
+ "b",
13
+ "oCLrZaW",
14
+ "TPSI",
15
+ "poiVg",
16
+ "b",
17
+ "b",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0.4,
23
+ 0.0,
24
+ 0.0,
25
+ 0.4,
26
+ 0.3333333333333333,
27
+ 0.6666666666666666,
28
+ 0.0,
29
+ 0.0,
30
+ 0.4
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "LB",
37
+ "TPSI",
38
+ "oCLrZaW",
39
+ "TPSI",
40
+ "TPSI",
41
+ "poiVg",
42
+ "b",
43
+ "V",
44
+ "poiVg"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0.0,
49
+ 0.3333333333333333,
50
+ 0.4,
51
+ 0.3333333333333333,
52
+ 0.3333333333333333,
53
+ 0.6666666666666666,
54
+ 0.0,
55
+ 0.0,
56
+ 0.6666666666666666
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "poiVg",
63
+ "TPSI",
64
+ "no",
65
+ "b",
66
+ "LB",
67
+ "poiVg",
68
+ "V",
69
+ "no",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0.6666666666666666,
75
+ 0.3333333333333333,
76
+ 1.0,
77
+ 0.0,
78
+ 0.0,
79
+ 0.6666666666666666,
80
+ 0.0,
81
+ 1.0,
82
+ 1.0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "J",
90
+ "J",
91
+ "TPSI",
92
+ "TPSI",
93
+ "oCLrZaW",
94
+ "LB",
95
+ "poiVg",
96
+ "V"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0.0,
101
+ 0.0,
102
+ 0.0,
103
+ 0.3333333333333333,
104
+ 0.3333333333333333,
105
+ 0.4,
106
+ 0.0,
107
+ 0.6666666666666666,
108
+ 0.0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "poiVg",
116
+ "V",
117
+ "b",
118
+ "J",
119
+ "V",
120
+ "LB",
121
+ "no",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0.0,
127
+ 0.6666666666666666,
128
+ 0.0,
129
+ 0.0,
130
+ 0.0,
131
+ 0.0,
132
+ 0.0,
133
+ 1.0,
134
+ 0.0
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "ratio_calculator = rasp.Map(calc_ratio, sop)\nreturn ratio_calculator",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Computes, for each token, the vowel-to-consonant ratio (with an infinity output when there are no consonants)."
148
+ },
149
+ "rasp_vars": [
150
+ "ratio_calculator"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_35.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_35",
4
+ "name": "token_capitalization_alternator",
5
+ "summary": "Alternates capitalization of each character in words.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "oCLrZaW",
11
+ "V",
12
+ "b",
13
+ "oCLrZaW",
14
+ "TPSI",
15
+ "poiVg",
16
+ "b",
17
+ "b",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "OcLrZaW",
23
+ "V",
24
+ "B",
25
+ "OcLrZaW",
26
+ "TpSi",
27
+ "PoIvG",
28
+ "B",
29
+ "B",
30
+ "OcLrZaW"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "LB",
37
+ "TPSI",
38
+ "oCLrZaW",
39
+ "TPSI",
40
+ "TPSI",
41
+ "poiVg",
42
+ "b",
43
+ "V",
44
+ "poiVg"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "Lb",
49
+ "TpSi",
50
+ "OcLrZaW",
51
+ "TpSi",
52
+ "TpSi",
53
+ "PoIvG",
54
+ "B",
55
+ "V",
56
+ "PoIvG"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "poiVg",
63
+ "TPSI",
64
+ "no",
65
+ "b",
66
+ "LB",
67
+ "poiVg",
68
+ "V",
69
+ "no",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "PoIvG",
75
+ "TpSi",
76
+ "No",
77
+ "B",
78
+ "Lb",
79
+ "PoIvG",
80
+ "V",
81
+ "No",
82
+ "No"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "J",
90
+ "J",
91
+ "TPSI",
92
+ "TPSI",
93
+ "oCLrZaW",
94
+ "LB",
95
+ "poiVg",
96
+ "V"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "V",
101
+ "J",
102
+ "J",
103
+ "TpSi",
104
+ "TpSi",
105
+ "OcLrZaW",
106
+ "Lb",
107
+ "PoIvG",
108
+ "V"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "poiVg",
116
+ "V",
117
+ "b",
118
+ "J",
119
+ "V",
120
+ "LB",
121
+ "no",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "Lb",
127
+ "PoIvG",
128
+ "V",
129
+ "B",
130
+ "J",
131
+ "V",
132
+ "Lb",
133
+ "No",
134
+ "B"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "def alternate_capitalization(word):\n return ''.join(c.upper() if i % 2 == 0 else c.lower() for i, c in enumerate(word))\n\nalternator = rasp.Map(alternate_capitalization, sop)\nreturn alternator",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Transforms each token independently by applying a consistent per-character formatting rule."
148
+ },
149
+ "rasp_vars": [
150
+ "alternator"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_36.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_36",
4
+ "name": "emoji_sentiment_classifier",
5
+ "summary": "Classifies each token as 'positive', 'negative', or 'neutral' based on emojis.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "😊",
11
+ "😊",
12
+ "📘",
13
+ "📘",
14
+ "😊",
15
+ "😊",
16
+ "📘",
17
+ "📘",
18
+ "📘"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "positive",
23
+ "positive",
24
+ "neutral",
25
+ "neutral",
26
+ "positive",
27
+ "positive",
28
+ "neutral",
29
+ "neutral",
30
+ "neutral"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "😢",
37
+ "😢",
38
+ "📘",
39
+ "😢",
40
+ "📘",
41
+ "😢",
42
+ "😢",
43
+ "📘",
44
+ "📘"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "negative",
49
+ "negative",
50
+ "neutral",
51
+ "negative",
52
+ "neutral",
53
+ "negative",
54
+ "negative",
55
+ "neutral",
56
+ "neutral"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "😢",
63
+ "📘",
64
+ "😢",
65
+ "😢",
66
+ "📘",
67
+ "📘",
68
+ "😢",
69
+ "😊",
70
+ "😢"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "negative",
75
+ "neutral",
76
+ "negative",
77
+ "negative",
78
+ "neutral",
79
+ "neutral",
80
+ "negative",
81
+ "positive",
82
+ "negative"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "😢",
89
+ "😢",
90
+ "😢",
91
+ "😊",
92
+ "😢",
93
+ "😊",
94
+ "😊",
95
+ "😢",
96
+ "😊"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "negative",
101
+ "negative",
102
+ "negative",
103
+ "positive",
104
+ "negative",
105
+ "positive",
106
+ "positive",
107
+ "negative",
108
+ "positive"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "😢",
115
+ "😢",
116
+ "😢",
117
+ "📘",
118
+ "😢",
119
+ "😊",
120
+ "📘",
121
+ "😊",
122
+ "😊"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "negative",
127
+ "negative",
128
+ "negative",
129
+ "neutral",
130
+ "negative",
131
+ "positive",
132
+ "neutral",
133
+ "positive",
134
+ "positive"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "emoji_sentiments = {\"😊\": \"positive\", \"😢\": \"negative\", \"📘\": \"neutral\"}\nclassify_sentiment = rasp.Map(lambda x: emoji_sentiments.get(x, \"neutral\"), sop)\nreturn classify_sentiment",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Assigns a category to each token using a fixed lookup rule."
148
+ },
149
+ "rasp_vars": [
150
+ "classify_sentiment"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_37.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_37",
4
+ "name": "token_reversal_with_exclusion",
5
+ "summary": "Reverses each word in the sequence except for specified exclusions.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "oCLrZaW",
11
+ "V",
12
+ "b",
13
+ "oCLrZaW",
14
+ "TPSI",
15
+ "poiVg",
16
+ "b",
17
+ "b",
18
+ "oCLrZaW"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ "WaZrLCo",
23
+ "V",
24
+ "b",
25
+ "WaZrLCo",
26
+ "ISPT",
27
+ "gViop",
28
+ "b",
29
+ "b",
30
+ "WaZrLCo"
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ "LB",
37
+ "TPSI",
38
+ "oCLrZaW",
39
+ "TPSI",
40
+ "TPSI",
41
+ "poiVg",
42
+ "b",
43
+ "V",
44
+ "poiVg"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ "BL",
49
+ "ISPT",
50
+ "WaZrLCo",
51
+ "ISPT",
52
+ "ISPT",
53
+ "gViop",
54
+ "b",
55
+ "V",
56
+ "gViop"
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "poiVg",
63
+ "TPSI",
64
+ "no",
65
+ "b",
66
+ "LB",
67
+ "poiVg",
68
+ "V",
69
+ "no",
70
+ "no"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ "gViop",
75
+ "ISPT",
76
+ "on",
77
+ "b",
78
+ "BL",
79
+ "gViop",
80
+ "V",
81
+ "on",
82
+ "on"
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "V",
89
+ "J",
90
+ "J",
91
+ "TPSI",
92
+ "TPSI",
93
+ "oCLrZaW",
94
+ "LB",
95
+ "poiVg",
96
+ "V"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ "V",
101
+ "J",
102
+ "J",
103
+ "ISPT",
104
+ "ISPT",
105
+ "WaZrLCo",
106
+ "BL",
107
+ "gViop",
108
+ "V"
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "LB",
115
+ "poiVg",
116
+ "V",
117
+ "b",
118
+ "J",
119
+ "V",
120
+ "LB",
121
+ "no",
122
+ "b"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ "BL",
127
+ "gViop",
128
+ "V",
129
+ "b",
130
+ "J",
131
+ "V",
132
+ "BL",
133
+ "on",
134
+ "b"
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "reversal = rasp.Map(lambda x: x[::-1] if x != exclude else x, sop)\nreturn reversal",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Reverses each token unless it matches the excluded token, in which case it is passed through unchanged."
148
+ },
149
+ "rasp_vars": [
150
+ "reversal"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_39.json ADDED
@@ -0,0 +1,671 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_39",
4
+ "name": "frac_prevs_long",
5
+ "summary": "Returns the fraction of 'x' in the input up to the i-th position for all i (longer sequence length).",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "t",
11
+ "o",
12
+ "g",
13
+ "l",
14
+ "h",
15
+ "o",
16
+ "c",
17
+ "n",
18
+ "q",
19
+ "d",
20
+ "r",
21
+ "h",
22
+ "d",
23
+ "b",
24
+ "f",
25
+ "v",
26
+ "j",
27
+ "d",
28
+ "v",
29
+ "r",
30
+ "z",
31
+ "l",
32
+ "b",
33
+ "j",
34
+ "d",
35
+ "n",
36
+ "p",
37
+ "o",
38
+ "h",
39
+ "n",
40
+ "w",
41
+ "y",
42
+ "h",
43
+ "u",
44
+ "p",
45
+ "m",
46
+ "r",
47
+ "o",
48
+ "u",
49
+ "x",
50
+ "z",
51
+ "y",
52
+ "m",
53
+ "i",
54
+ "o",
55
+ "m",
56
+ "a",
57
+ "y",
58
+ "g",
59
+ "i",
60
+ "x",
61
+ "a",
62
+ "l",
63
+ "h",
64
+ "x",
65
+ "k",
66
+ "s",
67
+ "q",
68
+ "h"
69
+ ],
70
+ "output": [
71
+ "BOS",
72
+ 0.0,
73
+ 0.0,
74
+ 0.0,
75
+ 0.0,
76
+ 0.0,
77
+ 0.0,
78
+ 0.0,
79
+ 0.0,
80
+ 0.0,
81
+ 0.0,
82
+ 0.0,
83
+ 0.0,
84
+ 0.0,
85
+ 0.0,
86
+ 0.0,
87
+ 0.0,
88
+ 0.0,
89
+ 0.0,
90
+ 0.0,
91
+ 0.0,
92
+ 0.0,
93
+ 0.0,
94
+ 0.0,
95
+ 0.0,
96
+ 0.0,
97
+ 0.0,
98
+ 0.0,
99
+ 0.0,
100
+ 0.0,
101
+ 0.0,
102
+ 0.0,
103
+ 0.0,
104
+ 0.0,
105
+ 0.0,
106
+ 0.0,
107
+ 0.0,
108
+ 0.0,
109
+ 0.0,
110
+ 0.0,
111
+ 0.025,
112
+ 0.024390243902439025,
113
+ 0.023809523809523808,
114
+ 0.023255813953488372,
115
+ 0.022727272727272728,
116
+ 0.022222222222222223,
117
+ 0.021739130434782608,
118
+ 0.02127659574468085,
119
+ 0.020833333333333332,
120
+ 0.02040816326530612,
121
+ 0.02,
122
+ 0.0392156862745098,
123
+ 0.038461538461538464,
124
+ 0.03773584905660377,
125
+ 0.037037037037037035,
126
+ 0.05454545454545454,
127
+ 0.05357142857142857,
128
+ 0.05263157894736842,
129
+ 0.05172413793103448,
130
+ 0.05084745762711865
131
+ ]
132
+ },
133
+ {
134
+ "input": [
135
+ "BOS",
136
+ "j",
137
+ "m",
138
+ "y",
139
+ "u",
140
+ "f",
141
+ "l",
142
+ "l",
143
+ "t",
144
+ "k",
145
+ "z",
146
+ "w",
147
+ "y",
148
+ "g",
149
+ "a",
150
+ "a",
151
+ "y",
152
+ "y",
153
+ "t",
154
+ "m",
155
+ "i",
156
+ "c",
157
+ "g",
158
+ "f",
159
+ "h",
160
+ "i",
161
+ "e",
162
+ "a",
163
+ "s",
164
+ "j",
165
+ "l",
166
+ "x",
167
+ "o",
168
+ "v",
169
+ "x",
170
+ "i",
171
+ "t",
172
+ "q",
173
+ "q",
174
+ "z",
175
+ "t",
176
+ "l",
177
+ "g",
178
+ "b",
179
+ "c",
180
+ "q",
181
+ "e",
182
+ "q",
183
+ "x",
184
+ "q",
185
+ "q",
186
+ "b",
187
+ "b",
188
+ "v",
189
+ "w",
190
+ "e",
191
+ "a",
192
+ "a",
193
+ "s",
194
+ "b"
195
+ ],
196
+ "output": [
197
+ "BOS",
198
+ 0.0,
199
+ 0.0,
200
+ 0.0,
201
+ 0.0,
202
+ 0.0,
203
+ 0.0,
204
+ 0.0,
205
+ 0.0,
206
+ 0.0,
207
+ 0.0,
208
+ 0.0,
209
+ 0.0,
210
+ 0.0,
211
+ 0.0,
212
+ 0.0,
213
+ 0.0,
214
+ 0.0,
215
+ 0.0,
216
+ 0.0,
217
+ 0.0,
218
+ 0.0,
219
+ 0.0,
220
+ 0.0,
221
+ 0.0,
222
+ 0.0,
223
+ 0.0,
224
+ 0.0,
225
+ 0.0,
226
+ 0.0,
227
+ 0.0,
228
+ 0.03225806451612903,
229
+ 0.03125,
230
+ 0.030303030303030304,
231
+ 0.058823529411764705,
232
+ 0.05714285714285714,
233
+ 0.05555555555555555,
234
+ 0.05405405405405406,
235
+ 0.05263157894736842,
236
+ 0.05128205128205128,
237
+ 0.05,
238
+ 0.04878048780487805,
239
+ 0.047619047619047616,
240
+ 0.046511627906976744,
241
+ 0.045454545454545456,
242
+ 0.044444444444444446,
243
+ 0.043478260869565216,
244
+ 0.0425531914893617,
245
+ 0.0625,
246
+ 0.061224489795918366,
247
+ 0.06,
248
+ 0.058823529411764705,
249
+ 0.057692307692307696,
250
+ 0.05660377358490566,
251
+ 0.05555555555555555,
252
+ 0.05454545454545454,
253
+ 0.05357142857142857,
254
+ 0.05263157894736842,
255
+ 0.05172413793103448,
256
+ 0.05084745762711865
257
+ ]
258
+ },
259
+ {
260
+ "input": [
261
+ "BOS",
262
+ "c",
263
+ "c",
264
+ "a",
265
+ "e",
266
+ "j",
267
+ "g",
268
+ "z",
269
+ "i",
270
+ "g",
271
+ "i",
272
+ "h",
273
+ "l",
274
+ "b",
275
+ "a",
276
+ "p",
277
+ "w",
278
+ "w",
279
+ "x",
280
+ "e",
281
+ "c",
282
+ "l",
283
+ "h",
284
+ "v",
285
+ "c",
286
+ "a",
287
+ "c",
288
+ "e",
289
+ "o",
290
+ "n",
291
+ "c",
292
+ "a",
293
+ "e",
294
+ "z",
295
+ "w",
296
+ "n",
297
+ "g",
298
+ "i",
299
+ "o",
300
+ "o",
301
+ "z",
302
+ "j",
303
+ "m",
304
+ "s",
305
+ "g",
306
+ "q",
307
+ "t",
308
+ "d",
309
+ "e",
310
+ "w",
311
+ "g",
312
+ "m",
313
+ "o",
314
+ "k",
315
+ "d",
316
+ "m",
317
+ "g",
318
+ "s",
319
+ "v",
320
+ "b"
321
+ ],
322
+ "output": [
323
+ "BOS",
324
+ 0.0,
325
+ 0.0,
326
+ 0.0,
327
+ 0.0,
328
+ 0.0,
329
+ 0.0,
330
+ 0.0,
331
+ 0.0,
332
+ 0.0,
333
+ 0.0,
334
+ 0.0,
335
+ 0.0,
336
+ 0.0,
337
+ 0.0,
338
+ 0.0,
339
+ 0.0,
340
+ 0.0,
341
+ 0.05555555555555555,
342
+ 0.05263157894736842,
343
+ 0.05,
344
+ 0.047619047619047616,
345
+ 0.045454545454545456,
346
+ 0.043478260869565216,
347
+ 0.041666666666666664,
348
+ 0.04,
349
+ 0.038461538461538464,
350
+ 0.037037037037037035,
351
+ 0.03571428571428571,
352
+ 0.034482758620689655,
353
+ 0.03333333333333333,
354
+ 0.03225806451612903,
355
+ 0.03125,
356
+ 0.030303030303030304,
357
+ 0.029411764705882353,
358
+ 0.02857142857142857,
359
+ 0.027777777777777776,
360
+ 0.02702702702702703,
361
+ 0.02631578947368421,
362
+ 0.02564102564102564,
363
+ 0.025,
364
+ 0.024390243902439025,
365
+ 0.023809523809523808,
366
+ 0.023255813953488372,
367
+ 0.022727272727272728,
368
+ 0.022222222222222223,
369
+ 0.021739130434782608,
370
+ 0.02127659574468085,
371
+ 0.020833333333333332,
372
+ 0.02040816326530612,
373
+ 0.02,
374
+ 0.0196078431372549,
375
+ 0.019230769230769232,
376
+ 0.018867924528301886,
377
+ 0.018518518518518517,
378
+ 0.01818181818181818,
379
+ 0.017857142857142856,
380
+ 0.017543859649122806,
381
+ 0.017241379310344827,
382
+ 0.01694915254237288
383
+ ]
384
+ },
385
+ {
386
+ "input": [
387
+ "BOS",
388
+ "g",
389
+ "t",
390
+ "o",
391
+ "k",
392
+ "h",
393
+ "u",
394
+ "g",
395
+ "z",
396
+ "s",
397
+ "w",
398
+ "k",
399
+ "k",
400
+ "x",
401
+ "u",
402
+ "d",
403
+ "h",
404
+ "x",
405
+ "c",
406
+ "v",
407
+ "u",
408
+ "b",
409
+ "x",
410
+ "l",
411
+ "f",
412
+ "b",
413
+ "u",
414
+ "a",
415
+ "l",
416
+ "z",
417
+ "v",
418
+ "l",
419
+ "y",
420
+ "q",
421
+ "j",
422
+ "p",
423
+ "o",
424
+ "o",
425
+ "s",
426
+ "l",
427
+ "w",
428
+ "t",
429
+ "y",
430
+ "c",
431
+ "e",
432
+ "s",
433
+ "g",
434
+ "u",
435
+ "i",
436
+ "g",
437
+ "r",
438
+ "d",
439
+ "y",
440
+ "n",
441
+ "r",
442
+ "z",
443
+ "i",
444
+ "z",
445
+ "u",
446
+ "b"
447
+ ],
448
+ "output": [
449
+ "BOS",
450
+ 0.0,
451
+ 0.0,
452
+ 0.0,
453
+ 0.0,
454
+ 0.0,
455
+ 0.0,
456
+ 0.0,
457
+ 0.0,
458
+ 0.0,
459
+ 0.0,
460
+ 0.0,
461
+ 0.0,
462
+ 0.07692307692307693,
463
+ 0.07142857142857142,
464
+ 0.06666666666666667,
465
+ 0.0625,
466
+ 0.11764705882352941,
467
+ 0.1111111111111111,
468
+ 0.10526315789473684,
469
+ 0.1,
470
+ 0.09523809523809523,
471
+ 0.13636363636363635,
472
+ 0.13043478260869565,
473
+ 0.125,
474
+ 0.12,
475
+ 0.11538461538461539,
476
+ 0.1111111111111111,
477
+ 0.10714285714285714,
478
+ 0.10344827586206896,
479
+ 0.1,
480
+ 0.0967741935483871,
481
+ 0.09375,
482
+ 0.09090909090909091,
483
+ 0.08823529411764706,
484
+ 0.08571428571428572,
485
+ 0.08333333333333333,
486
+ 0.08108108108108109,
487
+ 0.07894736842105263,
488
+ 0.07692307692307693,
489
+ 0.075,
490
+ 0.07317073170731707,
491
+ 0.07142857142857142,
492
+ 0.06976744186046512,
493
+ 0.06818181818181818,
494
+ 0.06666666666666667,
495
+ 0.06521739130434782,
496
+ 0.06382978723404255,
497
+ 0.0625,
498
+ 0.061224489795918366,
499
+ 0.06,
500
+ 0.058823529411764705,
501
+ 0.057692307692307696,
502
+ 0.05660377358490566,
503
+ 0.05555555555555555,
504
+ 0.05454545454545454,
505
+ 0.05357142857142857,
506
+ 0.05263157894736842,
507
+ 0.05172413793103448,
508
+ 0.05084745762711865
509
+ ]
510
+ },
511
+ {
512
+ "input": [
513
+ "BOS",
514
+ "u",
515
+ "l",
516
+ "z",
517
+ "f",
518
+ "w",
519
+ "d",
520
+ "w",
521
+ "k",
522
+ "x",
523
+ "q",
524
+ "f",
525
+ "x",
526
+ "e",
527
+ "t",
528
+ "b",
529
+ "f",
530
+ "v",
531
+ "k",
532
+ "p",
533
+ "p",
534
+ "a",
535
+ "i",
536
+ "f",
537
+ "p",
538
+ "c",
539
+ "t",
540
+ "d",
541
+ "s",
542
+ "z",
543
+ "c",
544
+ "s",
545
+ "t",
546
+ "g",
547
+ "t",
548
+ "i",
549
+ "a",
550
+ "h",
551
+ "g",
552
+ "r",
553
+ "h",
554
+ "a",
555
+ "k",
556
+ "y",
557
+ "y",
558
+ "r",
559
+ "w",
560
+ "j",
561
+ "c",
562
+ "g",
563
+ "p",
564
+ "z",
565
+ "p",
566
+ "y",
567
+ "t",
568
+ "q",
569
+ "b",
570
+ "a",
571
+ "p",
572
+ "l"
573
+ ],
574
+ "output": [
575
+ "BOS",
576
+ 0.0,
577
+ 0.0,
578
+ 0.0,
579
+ 0.0,
580
+ 0.0,
581
+ 0.0,
582
+ 0.0,
583
+ 0.0,
584
+ 0.1111111111111111,
585
+ 0.1,
586
+ 0.09090909090909091,
587
+ 0.16666666666666666,
588
+ 0.15384615384615385,
589
+ 0.14285714285714285,
590
+ 0.13333333333333333,
591
+ 0.125,
592
+ 0.11764705882352941,
593
+ 0.1111111111111111,
594
+ 0.10526315789473684,
595
+ 0.1,
596
+ 0.09523809523809523,
597
+ 0.09090909090909091,
598
+ 0.08695652173913043,
599
+ 0.08333333333333333,
600
+ 0.08,
601
+ 0.07692307692307693,
602
+ 0.07407407407407407,
603
+ 0.07142857142857142,
604
+ 0.06896551724137931,
605
+ 0.06666666666666667,
606
+ 0.06451612903225806,
607
+ 0.0625,
608
+ 0.06060606060606061,
609
+ 0.058823529411764705,
610
+ 0.05714285714285714,
611
+ 0.05555555555555555,
612
+ 0.05405405405405406,
613
+ 0.05263157894736842,
614
+ 0.05128205128205128,
615
+ 0.05,
616
+ 0.04878048780487805,
617
+ 0.047619047619047616,
618
+ 0.046511627906976744,
619
+ 0.045454545454545456,
620
+ 0.044444444444444446,
621
+ 0.043478260869565216,
622
+ 0.0425531914893617,
623
+ 0.041666666666666664,
624
+ 0.04081632653061224,
625
+ 0.04,
626
+ 0.0392156862745098,
627
+ 0.038461538461538464,
628
+ 0.03773584905660377,
629
+ 0.037037037037037035,
630
+ 0.03636363636363636,
631
+ 0.03571428571428571,
632
+ 0.03508771929824561,
633
+ 0.034482758620689655,
634
+ 0.03389830508474576
635
+ ]
636
+ }
637
+ ],
638
+ "is_categorical": false
639
+ },
640
+ "program": "is_x = (rasp.tokens == \"x\").named(\"is_x\")\nbools = rasp.numerical(is_x); prevs = rasp.Select(rasp.indices, rasp.indices, rasp.Comparison.LEQ); return rasp.numerical(rasp.Aggregate(prevs, bools, default=0)).named(\"frac_prevs\")",
641
+ "components": [
642
+ {
643
+ "id": "L0_MLP",
644
+ "hook": "blocks.0.mlp.hook_post",
645
+ "role": {
646
+ "tag": "INDICATOR",
647
+ "note": "Computes a per-position boolean feature indicating whether the current token is 'x'."
648
+ },
649
+ "rasp_vars": [
650
+ "is_x"
651
+ ],
652
+ "labels": [
653
+ "is_x_3"
654
+ ]
655
+ },
656
+ {
657
+ "id": "L1H0_ATTN",
658
+ "hook": "blocks.1.attn.hook_result[0]",
659
+ "role": {
660
+ "tag": "AGGREGATOR",
661
+ "note": "Aggregates the prefix of the sequence to produce the running fraction of 'x' up to each position."
662
+ },
663
+ "rasp_vars": [
664
+ "frac_prevs"
665
+ ],
666
+ "labels": [
667
+ "frac_prevs_1"
668
+ ]
669
+ }
670
+ ]
671
+ }
annotations/case_4.json ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_4",
4
+ "name": "pair_balance",
5
+ "summary": "Return fraction of previous open tokens minus the fraction of close tokens.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ "(",
11
+ "b",
12
+ ")",
13
+ "c",
14
+ "b",
15
+ "(",
16
+ "(",
17
+ "a",
18
+ "a"
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1.0,
23
+ 0.5,
24
+ 0.0,
25
+ 0.0,
26
+ 0.0,
27
+ 0.16666666666666666,
28
+ 0.2857142857142857,
29
+ 0.25,
30
+ 0.2222222222222222
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ ")",
37
+ "b",
38
+ "b",
39
+ "a",
40
+ "b",
41
+ "b",
42
+ "(",
43
+ "a",
44
+ "c"
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ -1.0,
49
+ -0.5,
50
+ -0.3333333333333333,
51
+ -0.25,
52
+ -0.2,
53
+ -0.16666666666666666,
54
+ 0.0,
55
+ 0.0,
56
+ 0.0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ "a",
63
+ "c",
64
+ "(",
65
+ ")",
66
+ "b",
67
+ "(",
68
+ "b",
69
+ ")",
70
+ ")"
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0.0,
75
+ 0.0,
76
+ 0.3333333333333333,
77
+ 0.0,
78
+ 0.0,
79
+ 0.16666666666666666,
80
+ 0.14285714285714285,
81
+ 0.0,
82
+ -0.1111111111111111
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ "c",
89
+ "b",
90
+ "a",
91
+ "c",
92
+ ")",
93
+ "b",
94
+ ")",
95
+ "b",
96
+ "c"
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0.0,
101
+ 0.0,
102
+ 0.0,
103
+ 0.0,
104
+ -0.2,
105
+ -0.16666666666666666,
106
+ -0.2857142857142857,
107
+ -0.25,
108
+ -0.2222222222222222
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ "b",
115
+ "c",
116
+ "a",
117
+ "c",
118
+ "c",
119
+ ")",
120
+ "a",
121
+ "a",
122
+ "a"
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0.0,
127
+ 0.0,
128
+ 0.0,
129
+ 0.0,
130
+ 0.0,
131
+ -0.16666666666666666,
132
+ -0.14285714285714285,
133
+ -0.125,
134
+ -0.1111111111111111
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": false
139
+ },
140
+ "program": "bools_open = rasp.numerical(sop == open_token).named(\"bools_open\"); opens = rasp.numerical(make_frac_prevs(bools_open)).named(\"opens\"); bools_close = rasp.numerical(sop == close_token).named(\"bools_close\"); closes = rasp.numerical(make_frac_prevs(bools_close)).named(\"closes\"); pair_balance = rasp.numerical(rasp.LinearSequenceMap(opens, closes, 1, -1)); return pair_balance.named(\"pair_balance\")",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Computes per-token indicator features for open and close tokens."
148
+ },
149
+ "rasp_vars": [
150
+ "bools_open",
151
+ "bools_close"
152
+ ]
153
+ },
154
+ {
155
+ "id": "L1H0_ATTN",
156
+ "hook": "blocks.1.attn.hook_result[0]",
157
+ "role": {
158
+ "tag": "AGGREGATOR",
159
+ "note": "Computes prefix aggregate for opens (fraction/count up to i) by attending over previous positions and reading the open-indicator via values."
160
+ },
161
+ "rasp_vars": [
162
+ "opens"
163
+ ]
164
+ },
165
+ {
166
+ "id": "L1H1_ATTN",
167
+ "hook": "blocks.1.attn.hook_result[1]",
168
+ "role": {
169
+ "tag": "AGGREGATOR",
170
+ "note": "Computes prefix aggregate for closes (fraction/count up to i) by attending over previous positions and reading the close-indicator via values."
171
+ },
172
+ "rasp_vars": [
173
+ "closes"
174
+ ]
175
+ },
176
+ {
177
+ "id": "L1_MLP",
178
+ "hook": "blocks.1.mlp.hook_post",
179
+ "role": {
180
+ "tag": "COMBINER",
181
+ "note": "Combines the open and close aggregates to compute the final balanced pair output."
182
+ },
183
+ "rasp_vars": [
184
+ "pair_balance"
185
+ ]
186
+ }
187
+ ]
188
+ }
annotations/case_40.json ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_40",
4
+ "name": "sum_last_two_digits",
5
+ "summary": "Sum the last and previous to last digits of a number",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 6,
11
+ 19,
12
+ 28,
13
+ 14,
14
+ 10,
15
+ 7,
16
+ 28,
17
+ 20,
18
+ 6
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 6,
23
+ 10,
24
+ 10,
25
+ 5,
26
+ 1,
27
+ 7,
28
+ 10,
29
+ 2,
30
+ 6
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 25,
37
+ 18,
38
+ 22,
39
+ 10,
40
+ 10,
41
+ 23,
42
+ 20,
43
+ 3,
44
+ 7
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 7,
49
+ 9,
50
+ 4,
51
+ 1,
52
+ 1,
53
+ 5,
54
+ 2,
55
+ 3,
56
+ 7
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 16,
63
+ 26,
64
+ 26,
65
+ 9,
66
+ 27,
67
+ 27,
68
+ 15,
69
+ 14,
70
+ 14
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 7,
75
+ 8,
76
+ 8,
77
+ 9,
78
+ 9,
79
+ 9,
80
+ 6,
81
+ 5,
82
+ 5
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 27,
89
+ 20,
90
+ 0,
91
+ 11,
92
+ 25,
93
+ 21,
94
+ 28,
95
+ 11,
96
+ 24
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 9,
101
+ 2,
102
+ 0,
103
+ 2,
104
+ 7,
105
+ 3,
106
+ 10,
107
+ 2,
108
+ 6
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 23,
115
+ 2,
116
+ 21,
117
+ 20,
118
+ 1,
119
+ 23,
120
+ 11,
121
+ 5,
122
+ 1
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 5,
127
+ 2,
128
+ 3,
129
+ 2,
130
+ 1,
131
+ 5,
132
+ 2,
133
+ 5,
134
+ 1
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "tens_place = rasp.Map(lambda x: x // 10, rasp.tokens).named(\"tens_place\")\nones_place = rasp.Map(lambda x: x % 10, rasp.tokens).named(\"ones_place\")\nsum_digits = rasp.SequenceMap(lambda x, y: x + y, tens_place, ones_place).named(\"sum_digits\")\nreturn sum_digits",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Derives the tens-place digit and also the ones-place digit from each input number."
148
+ },
149
+ "rasp_vars": [
150
+ "tens_place, ones_place"
151
+ ],
152
+ "labels": [
153
+ "tens_place_2, ones_place_3"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L1_MLP",
158
+ "hook": "blocks.1.mlp.hook_post",
159
+ "role": {
160
+ "tag": "COMBINER",
161
+ "note": "Adds the tens-place and ones-place digits to produce the final per-token output."
162
+ },
163
+ "rasp_vars": [
164
+ "sum_digits"
165
+ ],
166
+ "labels": [
167
+ "sum_digits_1"
168
+ ]
169
+ }
170
+ ]
171
+ }
annotations/case_41.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_41",
4
+ "name": "make_absolute",
5
+ "summary": "Make each element of the input sequence absolute.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 7,
11
+ -2,
12
+ -9,
13
+ 9,
14
+ 4,
15
+ -4,
16
+ 1,
17
+ -3,
18
+ 4
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 7,
23
+ 2,
24
+ 9,
25
+ 9,
26
+ 4,
27
+ 4,
28
+ 1,
29
+ 3,
30
+ 4
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ -8,
37
+ -6,
38
+ 8,
39
+ -4,
40
+ -2,
41
+ -4,
42
+ 7,
43
+ -7,
44
+ 3
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 8,
49
+ 6,
50
+ 8,
51
+ 4,
52
+ 2,
53
+ 4,
54
+ 7,
55
+ 7,
56
+ 3
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ -4,
63
+ 9,
64
+ 4,
65
+ 0,
66
+ -3,
67
+ -4,
68
+ 8,
69
+ 0,
70
+ 0
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 4,
75
+ 9,
76
+ 4,
77
+ 0,
78
+ 3,
79
+ 4,
80
+ 8,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ -7,
89
+ -3,
90
+ -8,
91
+ -9,
92
+ 1,
93
+ -5,
94
+ -9,
95
+ -10,
96
+ 1
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 7,
101
+ 3,
102
+ 8,
103
+ 9,
104
+ 1,
105
+ 5,
106
+ 9,
107
+ 10,
108
+ 1
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 1,
115
+ 6,
116
+ -1,
117
+ 5,
118
+ 4,
119
+ 4,
120
+ 8,
121
+ 1,
122
+ 9
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 1,
127
+ 6,
128
+ 1,
129
+ 5,
130
+ 4,
131
+ 4,
132
+ 8,
133
+ 1,
134
+ 9
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(lambda x: x if x >= 0 else -x, rasp.tokens).named(\"make_absolute\")",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies an element-wise absolute-value transform to each input number."
148
+ },
149
+ "rasp_vars": [
150
+ "make_absolute"
151
+ ],
152
+ "labels": [
153
+ "make_absolute_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_43.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_43",
4
+ "name": "nth_fibonacci",
5
+ "summary": "Returns the corresponding Fibonacci number for each element in the input sequence.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 17,
11
+ 8,
12
+ 1,
13
+ 19,
14
+ 14,
15
+ 6,
16
+ 11,
17
+ 7,
18
+ 14
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1597,
23
+ 21,
24
+ 1,
25
+ 4181,
26
+ 377,
27
+ 8,
28
+ 89,
29
+ 13,
30
+ 377
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 2,
37
+ 4,
38
+ 18,
39
+ 6,
40
+ 8,
41
+ 6,
42
+ 17,
43
+ 3,
44
+ 13
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 1,
49
+ 3,
50
+ 2584,
51
+ 8,
52
+ 21,
53
+ 8,
54
+ 1597,
55
+ 2,
56
+ 233
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 6,
63
+ 19,
64
+ 14,
65
+ 10,
66
+ 7,
67
+ 6,
68
+ 18,
69
+ 10,
70
+ 10
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 8,
75
+ 4181,
76
+ 377,
77
+ 55,
78
+ 13,
79
+ 8,
80
+ 2584,
81
+ 55,
82
+ 55
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 3,
89
+ 7,
90
+ 2,
91
+ 1,
92
+ 11,
93
+ 5,
94
+ 1,
95
+ 0,
96
+ 11
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 2,
101
+ 13,
102
+ 1,
103
+ 1,
104
+ 89,
105
+ 5,
106
+ 1,
107
+ 0,
108
+ 89
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 11,
115
+ 16,
116
+ 9,
117
+ 15,
118
+ 14,
119
+ 14,
120
+ 18,
121
+ 11,
122
+ 19
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 89,
127
+ 987,
128
+ 34,
129
+ 610,
130
+ 377,
131
+ 377,
132
+ 2584,
133
+ 89,
134
+ 4181
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "fib_sequence = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765]\nnth_fib = rasp.Map(lambda x: fib_sequence[x] if x < len(fib_sequence) else 0, rasp.tokens).named(\"nth_fib\")\nreturn nth_fib",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Maps each input index to its corresponding Fibonacci value using a fixed lookup table."
148
+ },
149
+ "rasp_vars": [
150
+ "nth_fib"
151
+ ],
152
+ "labels": [
153
+ "nth_fib_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_44.json ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_44",
4
+ "name": "count_greater_than",
5
+ "summary": "Replaces each element with the number of elements greater than it in the sequence",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 6,
23
+ 3,
24
+ 6,
25
+ 1,
26
+ 3,
27
+ 0,
28
+ 1,
29
+ 8,
30
+ 5
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 4,
49
+ 6,
50
+ 1,
51
+ 2,
52
+ 6,
53
+ 4,
54
+ 8,
55
+ 0,
56
+ 2
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 0,
75
+ 0,
76
+ 2,
77
+ 6,
78
+ 7,
79
+ 2,
80
+ 2,
81
+ 8,
82
+ 5
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 3,
101
+ 8,
102
+ 0,
103
+ 0,
104
+ 2,
105
+ 7,
106
+ 5,
107
+ 6,
108
+ 3
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 3,
127
+ 7,
128
+ 0,
129
+ 2,
130
+ 6,
131
+ 3,
132
+ 1,
133
+ 8,
134
+ 3
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "greater_than_selector = rasp.Select(rasp.tokens, rasp.tokens, rasp.Comparison.GT).named(\"greater_than_selector\")\ncount_greater_than = rasp.SelectorWidth(greater_than_selector).named(\"count_greater_than\")\nreturn count_greater_than",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Attends to all positions whose token value is greater than the current position's token and produces a count of those matches"
148
+ },
149
+ "rasp_vars": [
150
+ "greater_than_selector"
151
+ ],
152
+ "labels": [
153
+ "count_greater_than_1_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Converts the aggregated attention signal into per-position counts of how many elements are greater."
162
+ },
163
+ "rasp_vars": [
164
+ "count_greater_than"
165
+ ],
166
+ "labels": [
167
+ "count_greater_than_1",
168
+ "count_greater_than_1_selector_width_attn_output"
169
+ ]
170
+ }
171
+ ]
172
+ }
annotations/case_45.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_45",
4
+ "name": "double_first_half",
5
+ "summary": "Doubles the first half of the sequence",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 4,
23
+ 8,
24
+ 4,
25
+ 12,
26
+ 8,
27
+ 8,
28
+ 6,
29
+ 1,
30
+ 3
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 8,
49
+ 2,
50
+ 14,
51
+ 10,
52
+ 2,
53
+ 4,
54
+ 0,
55
+ 9,
56
+ 5
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 20,
75
+ 20,
76
+ 14,
77
+ 8,
78
+ 6,
79
+ 7,
80
+ 7,
81
+ 2,
82
+ 5
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 16,
101
+ 0,
102
+ 20,
103
+ 20,
104
+ 18,
105
+ 2,
106
+ 6,
107
+ 3,
108
+ 8
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 12,
127
+ 6,
128
+ 20,
129
+ 14,
130
+ 8,
131
+ 6,
132
+ 9,
133
+ 2,
134
+ 6
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "length = rasp.SelectorWidth(rasp.Select(rasp.tokens, rasp.tokens, rasp.Comparison.TRUE)).named(\"length\")\nfirst_half_selector = rasp.SequenceMap(lambda idx, length: 1 if idx < length / 2 else 0, rasp.indices, length).named(\"first_half_selector\")\ndouble_first_half = rasp.SequenceMap(lambda x, sel: x * (1 + sel), rasp.tokens, first_half_selector).named(\"double_first_half\")\nreturn double_first_half",
141
+ "components": [
142
+ {
143
+ "id": "L0H0_ATTN",
144
+ "hook": "blocks.0.attn.hook_result[0]",
145
+ "role": {
146
+ "tag": "AGGREGATOR",
147
+ "note": "Produces a sequence-length signal by counting tokens via the attention output width."
148
+ },
149
+ "rasp_vars": [
150
+ "length_helper"
151
+ ],
152
+ "labels": [
153
+ "length_3_selector_width_attn_output"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L0_MLP",
158
+ "hook": "blocks.0.mlp.hook_post",
159
+ "role": {
160
+ "tag": "MAPPER",
161
+ "note": "Computes the sequence length feature used to split the sequence into halves."
162
+ },
163
+ "rasp_vars": [
164
+ "length"
165
+ ],
166
+ "labels": [
167
+ "length_3",
168
+ "length_3_selector_width_attn_output"
169
+ ]
170
+ },
171
+ {
172
+ "id": "L1_MLP",
173
+ "hook": "blocks.1.mlp.hook_post",
174
+ "role": {
175
+ "tag": "COMBINER",
176
+ "note": "Builds a per-position mask indicating whether the position is in the first half."
177
+ },
178
+ "rasp_vars": [
179
+ "first_half_selector"
180
+ ],
181
+ "labels": [
182
+ "first_half_selector_2"
183
+ ]
184
+ },
185
+ {
186
+ "id": "L2_MLP",
187
+ "hook": "blocks.2.mlp.hook_post",
188
+ "role": {
189
+ "tag": "COMBINER",
190
+ "note": "Conditionally doubles elements in the first half using the first-half mask."
191
+ },
192
+ "rasp_vars": [
193
+ "double_first_half"
194
+ ],
195
+ "labels": [
196
+ "double_first_half_1"
197
+ ]
198
+ }
199
+ ]
200
+ }
annotations/case_46.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_46",
4
+ "name": "decrement_by_1",
5
+ "summary": "Decrements each element in the sequence by 1.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1,
23
+ 3,
24
+ 1,
25
+ 5,
26
+ 3,
27
+ 7,
28
+ 5,
29
+ 0,
30
+ 2
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 3,
49
+ 0,
50
+ 6,
51
+ 4,
52
+ 0,
53
+ 3,
54
+ -1,
55
+ 8,
56
+ 4
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 9,
75
+ 9,
76
+ 6,
77
+ 3,
78
+ 2,
79
+ 6,
80
+ 6,
81
+ 1,
82
+ 4
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 7,
101
+ -1,
102
+ 9,
103
+ 9,
104
+ 8,
105
+ 1,
106
+ 5,
107
+ 2,
108
+ 7
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 5,
127
+ 2,
128
+ 9,
129
+ 6,
130
+ 3,
131
+ 5,
132
+ 8,
133
+ 1,
134
+ 5
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(lambda x: x - 1, rasp.tokens).named('decrement')",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Adjusts each value by a fixed amount (subtracting 1) across the entire sequence."
148
+ },
149
+ "rasp_vars": [
150
+ "decrement"
151
+ ],
152
+ "labels": [
153
+ "decrement_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_49.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_49",
4
+ "name": "decrement_to_multiple_of_three",
5
+ "summary": "Decrements each element in the sequence until it becomes a multiple of 3.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0,
23
+ 3,
24
+ 0,
25
+ 6,
26
+ 3,
27
+ 6,
28
+ 6,
29
+ 0,
30
+ 3
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 3,
49
+ 0,
50
+ 6,
51
+ 3,
52
+ 0,
53
+ 3,
54
+ 0,
55
+ 9,
56
+ 3
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 9,
75
+ 9,
76
+ 6,
77
+ 3,
78
+ 3,
79
+ 6,
80
+ 6,
81
+ 0,
82
+ 3
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 6,
101
+ 0,
102
+ 9,
103
+ 9,
104
+ 9,
105
+ 0,
106
+ 6,
107
+ 3,
108
+ 6
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 6,
127
+ 3,
128
+ 9,
129
+ 6,
130
+ 3,
131
+ 6,
132
+ 9,
133
+ 0,
134
+ 6
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "decrement_to_multiple_of_three = rasp.Map(lambda x: x - (x % 3), rasp.tokens).named('decrement_to_multiple_of_three')\nreturn decrement_to_multiple_of_three",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Reduces each value to the nearest value that is a multiple of three."
148
+ },
149
+ "rasp_vars": [
150
+ "decrement_to_multiple_of_three"
151
+ ],
152
+ "labels": [
153
+ "decrement_to_multiple_of_three_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_50.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_50",
4
+ "name": "hyperbolic_cosine",
5
+ "summary": "Applies the hyperbolic cosine to each element.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 3.7621956910836314,
23
+ 27.308232836016487,
24
+ 3.7621956910836314,
25
+ 201.7156361224559,
26
+ 27.308232836016487,
27
+ 1490.479161252178,
28
+ 201.7156361224559,
29
+ 1.5430806348152437,
30
+ 10.067661995777765
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 27.308232836016487,
49
+ 1.5430806348152437,
50
+ 548.317035155212,
51
+ 74.20994852478785,
52
+ 1.5430806348152437,
53
+ 27.308232836016487,
54
+ 1.0,
55
+ 4051.5420254925943,
56
+ 74.20994852478785
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 11013.232920103324,
75
+ 11013.232920103324,
76
+ 548.317035155212,
77
+ 27.308232836016487,
78
+ 10.067661995777765,
79
+ 548.317035155212,
80
+ 548.317035155212,
81
+ 3.7621956910836314,
82
+ 74.20994852478785
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 1490.479161252178,
101
+ 1.0,
102
+ 11013.232920103324,
103
+ 11013.232920103324,
104
+ 4051.5420254925943,
105
+ 3.7621956910836314,
106
+ 201.7156361224559,
107
+ 10.067661995777765,
108
+ 1490.479161252178
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 201.7156361224559,
127
+ 10.067661995777765,
128
+ 11013.232920103324,
129
+ 548.317035155212,
130
+ 27.308232836016487,
131
+ 201.7156361224559,
132
+ 4051.5420254925943,
133
+ 3.7621956910836314,
134
+ 201.7156361224559
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(math.cosh, rasp.tokens)",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies an elementwise hyperbolic cosine transformation to each input value."
148
+ },
149
+ "rasp_vars": [
150
+ "hyperbolic_cosine"
151
+ ],
152
+ "labels": [
153
+ "map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_51.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_51",
4
+ "name": "check_fibonacci",
5
+ "summary": "Checks if each element is a Fibonacci number",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 74,
11
+ 87,
12
+ 99,
13
+ 23,
14
+ 2,
15
+ 21,
16
+ 52,
17
+ 1,
18
+ 87
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 0,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 1,
27
+ 1,
28
+ 0,
29
+ 1,
30
+ 0
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 51,
37
+ 92,
38
+ 14,
39
+ 71,
40
+ 60,
41
+ 20,
42
+ 82,
43
+ 86,
44
+ 74
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 0,
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0,
54
+ 0,
55
+ 0,
56
+ 0
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 21,
63
+ 88,
64
+ 48,
65
+ 90,
66
+ 58,
67
+ 41,
68
+ 91,
69
+ 59,
70
+ 79
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 1,
75
+ 0,
76
+ 0,
77
+ 0,
78
+ 0,
79
+ 0,
80
+ 0,
81
+ 0,
82
+ 0
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 29,
89
+ 37,
90
+ 1,
91
+ 63,
92
+ 59,
93
+ 20,
94
+ 32,
95
+ 75,
96
+ 57
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 0,
101
+ 0,
102
+ 1,
103
+ 0,
104
+ 0,
105
+ 0,
106
+ 0,
107
+ 0,
108
+ 0
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 14,
115
+ 61,
116
+ 61,
117
+ 46,
118
+ 61,
119
+ 50,
120
+ 54,
121
+ 63,
122
+ 2
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 0,
127
+ 0,
128
+ 0,
129
+ 0,
130
+ 0,
131
+ 0,
132
+ 0,
133
+ 0,
134
+ 1
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "fib_sequence = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\ncheck_fibonacci_map = rasp.Map(lambda x: 1 if x in fib_sequence else 0, rasp.tokens).named(\"check_fibonacci_map\")\nreturn check_fibonacci_map",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "INDICATOR",
147
+ "note": "Marks each input element as Fibonacci or not using a fixed lookup set."
148
+ },
149
+ "rasp_vars": [
150
+ "check_fibonacci_map"
151
+ ],
152
+ "labels": [
153
+ "check_fibonacci_map_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_52.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_52",
4
+ "name": "square_root",
5
+ "summary": "Apply square root to each token/value independently.",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 1.4142135623730951,
23
+ 2.0,
24
+ 1.4142135623730951,
25
+ 2.449489742783178,
26
+ 2.0,
27
+ 2.8284271247461903,
28
+ 2.449489742783178,
29
+ 1.0,
30
+ 1.7320508075688772
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 2.0,
49
+ 1.0,
50
+ 2.6457513110645907,
51
+ 2.23606797749979,
52
+ 1.0,
53
+ 2.0,
54
+ 0.0,
55
+ 3.0,
56
+ 2.23606797749979
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 3.1622776601683795,
75
+ 3.1622776601683795,
76
+ 2.6457513110645907,
77
+ 2.0,
78
+ 1.7320508075688772,
79
+ 2.6457513110645907,
80
+ 2.6457513110645907,
81
+ 1.4142135623730951,
82
+ 2.23606797749979
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 2.8284271247461903,
101
+ 0.0,
102
+ 3.1622776601683795,
103
+ 3.1622776601683795,
104
+ 3.0,
105
+ 1.4142135623730951,
106
+ 2.449489742783178,
107
+ 1.7320508075688772,
108
+ 2.8284271247461903
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 2.449489742783178,
127
+ 1.7320508075688772,
128
+ 3.1622776601683795,
129
+ 2.6457513110645907,
130
+ 2.0,
131
+ 2.449489742783178,
132
+ 3.0,
133
+ 1.4142135623730951,
134
+ 2.449489742783178
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "return rasp.Map(lambda x: x ** 0.5, rasp.tokens).named(\"square_root\")",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Applies a per-position numeric map by computing the square root for each element."
148
+ },
149
+ "rasp_vars": [
150
+ "square_root"
151
+ ],
152
+ "labels": [
153
+ "square_root_1"
154
+ ]
155
+ }
156
+ ]
157
+ }
annotations/case_53.json ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "task": {
3
+ "id": "case_53",
4
+ "name": "increment_odd_indices",
5
+ "summary": "Increment elements at odd indices by 1",
6
+ "examples": [
7
+ {
8
+ "input": [
9
+ "BOS",
10
+ 2,
11
+ 4,
12
+ 2,
13
+ 6,
14
+ 4,
15
+ 8,
16
+ 6,
17
+ 1,
18
+ 3
19
+ ],
20
+ "output": [
21
+ "BOS",
22
+ 2,
23
+ 5,
24
+ 2,
25
+ 7,
26
+ 4,
27
+ 9,
28
+ 6,
29
+ 2,
30
+ 3
31
+ ]
32
+ },
33
+ {
34
+ "input": [
35
+ "BOS",
36
+ 4,
37
+ 1,
38
+ 7,
39
+ 5,
40
+ 1,
41
+ 4,
42
+ 0,
43
+ 9,
44
+ 5
45
+ ],
46
+ "output": [
47
+ "BOS",
48
+ 4,
49
+ 2,
50
+ 7,
51
+ 6,
52
+ 1,
53
+ 5,
54
+ 0,
55
+ 10,
56
+ 5
57
+ ]
58
+ },
59
+ {
60
+ "input": [
61
+ "BOS",
62
+ 10,
63
+ 10,
64
+ 7,
65
+ 4,
66
+ 3,
67
+ 7,
68
+ 7,
69
+ 2,
70
+ 5
71
+ ],
72
+ "output": [
73
+ "BOS",
74
+ 10,
75
+ 11,
76
+ 7,
77
+ 5,
78
+ 3,
79
+ 8,
80
+ 7,
81
+ 3,
82
+ 5
83
+ ]
84
+ },
85
+ {
86
+ "input": [
87
+ "BOS",
88
+ 8,
89
+ 0,
90
+ 10,
91
+ 10,
92
+ 9,
93
+ 2,
94
+ 6,
95
+ 3,
96
+ 8
97
+ ],
98
+ "output": [
99
+ "BOS",
100
+ 8,
101
+ 1,
102
+ 10,
103
+ 11,
104
+ 9,
105
+ 3,
106
+ 6,
107
+ 4,
108
+ 8
109
+ ]
110
+ },
111
+ {
112
+ "input": [
113
+ "BOS",
114
+ 6,
115
+ 3,
116
+ 10,
117
+ 7,
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 2,
122
+ 6
123
+ ],
124
+ "output": [
125
+ "BOS",
126
+ 6,
127
+ 4,
128
+ 10,
129
+ 8,
130
+ 4,
131
+ 7,
132
+ 9,
133
+ 3,
134
+ 6
135
+ ]
136
+ }
137
+ ],
138
+ "is_categorical": true
139
+ },
140
+ "program": "odd_index_marker = rasp.Map(lambda x: x % 2, rasp.indices).named(\"odd_index_marker\")\nincremented_elements = rasp.SequenceMap(lambda elem, mark: elem + mark, rasp.tokens, odd_index_marker).named(\"incremented_elements\")\nreturn incremented_elements",
141
+ "components": [
142
+ {
143
+ "id": "L0_MLP",
144
+ "hook": "blocks.0.mlp.hook_post",
145
+ "role": {
146
+ "tag": "MAPPER",
147
+ "note": "Computes the parity of each position's index (index mod 2) to produce a per-position binary value used as an increment signal."
148
+ },
149
+ "rasp_vars": [
150
+ "odd_index_marker"
151
+ ],
152
+ "labels": [
153
+ "odd_index_marker_2"
154
+ ]
155
+ },
156
+ {
157
+ "id": "L1_MLP",
158
+ "hook": "blocks.1.mlp.hook_post",
159
+ "role": {
160
+ "tag": "COMBINER",
161
+ "note": "Adds the odd-index marker to each element so only odd positions are incremented."
162
+ },
163
+ "rasp_vars": [
164
+ "incremented_elements"
165
+ ],
166
+ "labels": [
167
+ "incremented_elements_1"
168
+ ]
169
+ }
170
+ ]
171
+ }