eval bundle v1244-ckpt120-vs-086-subset200-20260615T203643Z
Browse files- runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/artifacts/v1244_cot_safe/subset200_solution.csv +1576 -0
- runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/run_v1244-ckpt120-vs-086-subset200-20260615T203643Z_remote.sh +78 -0
- runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/scripts/evaluate_lora_adapter.py +670 -0
- runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/scripts/evaluate_lora_adapters_batch.py +456 -0
- runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/scripts/kg1_score_live.py +511 -0
- runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/src/competition_utils.py +470 -0
runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/artifacts/v1244_cot_safe/subset200_solution.csv
ADDED
|
@@ -0,0 +1,1576 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
id,prompt,answer,family
|
| 2 |
+
00208201,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 3 |
+
10.08 m becomes 6.69
|
| 4 |
+
17.83 m becomes 11.83
|
| 5 |
+
35.85 m becomes 23.79
|
| 6 |
+
17.06 m becomes 11.32
|
| 7 |
+
31.54 m becomes 20.93
|
| 8 |
+
Now, convert the following measurement: 25.09 m",16.65,unit_conversion
|
| 9 |
+
00457d26,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 10 |
+
`!*[{ = '""[`
|
| 11 |
+
\'*'> = ![@
|
| 12 |
+
\'-!` = \\
|
| 13 |
+
`!*\& = '@'{
|
| 14 |
+
Now, determine the result for: [[-!'",@&,equation_transform
|
| 15 |
+
0047365c,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 16 |
+
32.58 m becomes 26.62
|
| 17 |
+
10.9 m becomes 8.90
|
| 18 |
+
17.86 m becomes 14.59
|
| 19 |
+
Now, convert the following measurement: 13.0 m",10.62,unit_conversion
|
| 20 |
+
005ad22a,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 21 |
+
hmxad apdhvdq vid ohexahm apwqvhm -> alice creates the magical crystal
|
| 22 |
+
zxuhpl zhvaidq xyqxld txmmhed -> wizard watches inside village
|
| 23 |
+
nfddy xohexydq xy ehpldy -> queen imagines in garden
|
| 24 |
+
osfqd qddq lssp -> mouse sees door
|
| 25 |
+
vid amdtdp zxuhpl dgjmspdq -> the clever wizard explores
|
| 26 |
+
Now, decrypt the following text: bxye aihqdq ahqvmd",king chases castle,text_encryption
|
| 27 |
+
00d9f682,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 28 |
+
4 -> IV
|
| 29 |
+
42 -> XLII
|
| 30 |
+
59 -> LIX
|
| 31 |
+
77 -> LXXVII
|
| 32 |
+
55 -> LV
|
| 33 |
+
Now, write the number 100 in the Wonderland numeral system.",C,numeral_system
|
| 34 |
+
00ed1836,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 35 |
+
For t = 3.28s, distance = 53.97 m
|
| 36 |
+
For t = 4.11s, distance = 84.74 m
|
| 37 |
+
For t = 3.11s, distance = 48.52 m
|
| 38 |
+
For t = 2.12s, distance = 22.55 m
|
| 39 |
+
For t = 4.66s, distance = 108.94 m
|
| 40 |
+
Now, determine the falling distance for t = 2.2s given d = 0.5*g*t^2.",24.28,gravity_constant
|
| 41 |
+
00efa37c,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 42 |
+
vmelt lyvutu wyt lfmfcaom keccfc -> alice chases the colorful mirror
|
| 43 |
+
lvw afobd wyt xfmdtb dffc -> cat found the golden door
|
| 44 |
+
wyt uemitc wtvlytc tnjmfctu -> the silver teacher explores
|
| 45 |
+
jcebltuu lctvwtu wyt locefou sffp -> princess creates the curious book
|
| 46 |
+
pbexyw hvwlytu wyt xfmdtb joggmt -> knight watches the golden puzzle
|
| 47 |
+
Now, decrypt the following text: wocwmt hvwlytu wyt kzuwtcefou xvcdtb",turtle watches the mysterious garden,text_encryption
|
| 48 |
+
00fdc0be,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 49 |
+
|
| 50 |
+
Here are some examples of input -> output:
|
| 51 |
+
01101111 -> 10111111
|
| 52 |
+
01001110 -> 00111111
|
| 53 |
+
01111101 -> 11111110
|
| 54 |
+
10111111 -> 11111111
|
| 55 |
+
01101011 -> 10111101
|
| 56 |
+
00010101 -> 11011110
|
| 57 |
+
11011111 -> 11111111
|
| 58 |
+
|
| 59 |
+
Now, determine the output for: 10101111",11111111,bit_manipulation
|
| 60 |
+
01248b76,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 61 |
+
|
| 62 |
+
Here are some examples of input -> output:
|
| 63 |
+
01101100 -> 00011000
|
| 64 |
+
01010011 -> 10010110
|
| 65 |
+
00000000 -> 00000000
|
| 66 |
+
11011010 -> 00010101
|
| 67 |
+
00011010 -> 10010100
|
| 68 |
+
00000001 -> 00010010
|
| 69 |
+
11110110 -> 10001101
|
| 70 |
+
01100110 -> 10101100
|
| 71 |
+
|
| 72 |
+
Now, determine the output for: 11110010",11000101,bit_manipulation
|
| 73 |
+
016482c8,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 74 |
+
48.1 m becomes 62.12
|
| 75 |
+
25.84 m becomes 33.37
|
| 76 |
+
24.4 m becomes 31.51
|
| 77 |
+
9.65 m becomes 12.46
|
| 78 |
+
Now, convert the following measurement: 48.26 m",62.33,unit_conversion
|
| 79 |
+
01714be2,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 80 |
+
For t = 1.32s, distance = 9.87 m
|
| 81 |
+
For t = 1.07s, distance = 6.48 m
|
| 82 |
+
For t = 1.48s, distance = 12.4 m
|
| 83 |
+
Now, determine the falling distance for t = 4.98s given d = 0.5*g*t^2.",140.44,gravity_constant
|
| 84 |
+
017a161b,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 85 |
+
tfsu lsjimjx xjlsjm -> bird creates secret
|
| 86 |
+
sittfm pnvvngx mqj ihlfjhm unns -> rabbit follows the ancient door
|
| 87 |
+
zndxj jabvnsjx wisujh -> mouse explores garden
|
| 88 |
+
Now, decrypt the following text: sittfm lsjimjx fh nljih",rabbit creates in ocean,text_encryption
|
| 89 |
+
01a065bb,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 90 |
+
For t = 2.28s, distance = 21.1 m
|
| 91 |
+
For t = 1.22s, distance = 6.04 m
|
| 92 |
+
For t = 1.52s, distance = 9.38 m
|
| 93 |
+
For t = 4.51s, distance = 82.54 m
|
| 94 |
+
Now, determine the falling distance for t = 3.33s given d = 0.5*g*t^2.",45.0,gravity_constant
|
| 95 |
+
02356cb8,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 96 |
+
14.95 m becomes 17.94
|
| 97 |
+
15.99 m becomes 19.19
|
| 98 |
+
24.97 m becomes 29.97
|
| 99 |
+
15.3 m becomes 18.36
|
| 100 |
+
Now, convert the following measurement: 23.52 m",28.23,unit_conversion
|
| 101 |
+
023739fe,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 102 |
+
31.12 m becomes 46.71
|
| 103 |
+
37.24 m becomes 55.89
|
| 104 |
+
27.81 m becomes 41.74
|
| 105 |
+
34.79 m becomes 52.21
|
| 106 |
+
Now, convert the following measurement: 14.05 m",21.09,unit_conversion
|
| 107 |
+
02902eb3,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 108 |
+
!&*%% = }%>%
|
| 109 |
+
%&-/> = $)
|
| 110 |
+
$]*&& = }&&}
|
| 111 |
+
Now, determine the result for: !!+$>",>/,equation_transform
|
| 112 |
+
0290f51a,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 113 |
+
|
| 114 |
+
Here are some examples of input -> output:
|
| 115 |
+
01011010 -> 00101011
|
| 116 |
+
10100100 -> 01010111
|
| 117 |
+
10110001 -> 10110111
|
| 118 |
+
00011001 -> 10011001
|
| 119 |
+
11101011 -> 01100111
|
| 120 |
+
11100001 -> 10100111
|
| 121 |
+
10000001 -> 10111111
|
| 122 |
+
01001101 -> 00001110
|
| 123 |
+
11101111 -> 11100111
|
| 124 |
+
|
| 125 |
+
Now, determine the output for: 11010001",10101111,bit_manipulation
|
| 126 |
+
03a3437f,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 127 |
+
/>-|/ = ':
|
| 128 |
+
'>+/! = '>/!
|
| 129 |
+
}!-'` = >'
|
| 130 |
+
Now, determine the result for: '}-/>",-!,equation_transform
|
| 131 |
+
03e3c7b6,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 132 |
+
37.35 m becomes 55.43
|
| 133 |
+
9.11 m becomes 13.52
|
| 134 |
+
8.17 m becomes 12.12
|
| 135 |
+
Now, convert the following measurement: 27.17 m",40.32,unit_conversion
|
| 136 |
+
03ed28b0,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 137 |
+
2 -> II
|
| 138 |
+
97 -> XCVII
|
| 139 |
+
77 -> LXXVII
|
| 140 |
+
92 -> XCII
|
| 141 |
+
Now, write the number 94 in the Wonderland numeral system.",XCIV,numeral_system
|
| 142 |
+
0429104b,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 143 |
+
27.87 m becomes 35.12
|
| 144 |
+
29.32 m becomes 36.95
|
| 145 |
+
38.37 m becomes 48.35
|
| 146 |
+
12.75 m becomes 16.07
|
| 147 |
+
46.62 m becomes 58.75
|
| 148 |
+
Now, convert the following measurement: 23.5 m",29.61,unit_conversion
|
| 149 |
+
0440e6ab,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 150 |
+
|
| 151 |
+
Here are some examples of input -> output:
|
| 152 |
+
00101101 -> 10100000
|
| 153 |
+
00001011 -> 01100000
|
| 154 |
+
11011000 -> 00000001
|
| 155 |
+
00111000 -> 00000000
|
| 156 |
+
11110100 -> 10000001
|
| 157 |
+
10001110 -> 11000001
|
| 158 |
+
01001000 -> 00000000
|
| 159 |
+
00101111 -> 11100000
|
| 160 |
+
|
| 161 |
+
Now, determine the output for: 01110011",01100000,bit_manipulation
|
| 162 |
+
04732729,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 163 |
+
37.63 m becomes 39.64
|
| 164 |
+
13.77 m becomes 14.51
|
| 165 |
+
6.1 m becomes 6.43
|
| 166 |
+
27.56 m becomes 29.03
|
| 167 |
+
Now, convert the following measurement: 21.31 m",22.45,unit_conversion
|
| 168 |
+
048cc279,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 169 |
+
|
| 170 |
+
Here are some examples of input -> output:
|
| 171 |
+
10000110 -> 00100001
|
| 172 |
+
11111111 -> 11111111
|
| 173 |
+
01011100 -> 10110000
|
| 174 |
+
11011010 -> 10110100
|
| 175 |
+
11110101 -> 10101001
|
| 176 |
+
00011001 -> 00000010
|
| 177 |
+
11110010 -> 10110100
|
| 178 |
+
01011101 -> 10111010
|
| 179 |
+
|
| 180 |
+
Now, determine the output for: 11101010",01010000,bit_manipulation
|
| 181 |
+
04b818d2,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 182 |
+
6.15 m becomes 7.01
|
| 183 |
+
14.5 m becomes 16.52
|
| 184 |
+
45.41 m becomes 51.75
|
| 185 |
+
Now, convert the following measurement: 36.59 m",41.70,unit_conversion
|
| 186 |
+
04f03c7e,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 187 |
+
54 -> LIV
|
| 188 |
+
85 -> LXXXV
|
| 189 |
+
96 -> XCVI
|
| 190 |
+
68 -> LXVIII
|
| 191 |
+
50 -> L
|
| 192 |
+
Now, write the number 82 in the Wonderland numeral system.",LXXXII,numeral_system
|
| 193 |
+
04f569be,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 194 |
+
69 -> LXIX
|
| 195 |
+
30 -> XXX
|
| 196 |
+
82 -> LXXXII
|
| 197 |
+
25 -> XXV
|
| 198 |
+
8 -> VIII
|
| 199 |
+
Now, write the number 87 in the Wonderland numeral system.",LXXXVII,numeral_system
|
| 200 |
+
050492a9,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 201 |
+
8.79 m becomes 16.10
|
| 202 |
+
29.18 m becomes 53.44
|
| 203 |
+
22.55 m becomes 41.30
|
| 204 |
+
37.35 m becomes 68.41
|
| 205 |
+
Now, convert the following measurement: 39.89 m",73.06,unit_conversion
|
| 206 |
+
05195c8e,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 207 |
+
15 -> XV
|
| 208 |
+
45 -> XLV
|
| 209 |
+
39 -> XXXIX
|
| 210 |
+
99 -> XCIX
|
| 211 |
+
87 -> LXXXVII
|
| 212 |
+
Now, write the number 94 in the Wonderland numeral system.",XCIV,numeral_system
|
| 213 |
+
059bced5,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 214 |
+
62 -> LXII
|
| 215 |
+
12 -> XII
|
| 216 |
+
94 -> XCIV
|
| 217 |
+
Now, write the number 63 in the Wonderland numeral system.",LXIII,numeral_system
|
| 218 |
+
05ca617c,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 219 |
+
|
| 220 |
+
Here are some examples of input -> output:
|
| 221 |
+
01111111 -> 10111111
|
| 222 |
+
01011101 -> 11101111
|
| 223 |
+
01001111 -> 11100111
|
| 224 |
+
01100001 -> 10111101
|
| 225 |
+
10001011 -> 01101101
|
| 226 |
+
01111100 -> 00111111
|
| 227 |
+
10111001 -> 01011100
|
| 228 |
+
01010000 -> 01111111
|
| 229 |
+
|
| 230 |
+
Now, determine the output for: 10010010",11011011,bit_manipulation
|
| 231 |
+
06120e47,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 232 |
+
|
| 233 |
+
Here are some examples of input -> output:
|
| 234 |
+
01010100 -> 11101111
|
| 235 |
+
10000011 -> 11111101
|
| 236 |
+
11110110 -> 11100101
|
| 237 |
+
10010111 -> 11111001
|
| 238 |
+
10101101 -> 11011111
|
| 239 |
+
00111010 -> 11110111
|
| 240 |
+
11101111 -> 11000111
|
| 241 |
+
00100110 -> 11110111
|
| 242 |
+
01001000 -> 11111110
|
| 243 |
+
|
| 244 |
+
Now, determine the output for: 01110011",11110010,bit_manipulation
|
| 245 |
+
07735828,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 246 |
+
6.24 m becomes 3.77
|
| 247 |
+
18.52 m becomes 11.19
|
| 248 |
+
26.37 m becomes 15.93
|
| 249 |
+
10.4 m becomes 6.28
|
| 250 |
+
Now, convert the following measurement: 7.7 m",4.65,unit_conversion
|
| 251 |
+
07c96a99,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 252 |
+
For t = 3.91s, distance = 47.61 m
|
| 253 |
+
For t = 3.71s, distance = 42.87 m
|
| 254 |
+
For t = 1.83s, distance = 10.43 m
|
| 255 |
+
For t = 1.05s, distance = 3.43 m
|
| 256 |
+
Now, determine the falling distance for t = 3.56s given d = 0.5*g*t^2.",39.47,gravity_constant
|
| 257 |
+
07ceed47,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 258 |
+
|
| 259 |
+
Here are some examples of input -> output:
|
| 260 |
+
10001010 -> 00010001
|
| 261 |
+
00100111 -> 10000100
|
| 262 |
+
00011011 -> 10000011
|
| 263 |
+
00101011 -> 10000101
|
| 264 |
+
00101101 -> 10000101
|
| 265 |
+
01000010 -> 00001000
|
| 266 |
+
00010111 -> 10000010
|
| 267 |
+
|
| 268 |
+
Now, determine the output for: 00101001",10000101,bit_manipulation
|
| 269 |
+
084757f1,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 270 |
+
6 -> VI
|
| 271 |
+
39 -> XXXIX
|
| 272 |
+
3 -> III
|
| 273 |
+
2 -> II
|
| 274 |
+
61 -> LXI
|
| 275 |
+
Now, write the number 86 in the Wonderland numeral system.",LXXXVI,numeral_system
|
| 276 |
+
0848cbc0,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 277 |
+
For t = 2.59s, distance = 44.43 m
|
| 278 |
+
For t = 3.19s, distance = 67.4 m
|
| 279 |
+
For t = 1.28s, distance = 10.85 m
|
| 280 |
+
For t = 1.03s, distance = 7.03 m
|
| 281 |
+
Now, determine the falling distance for t = 4.38s given d = 0.5*g*t^2.",127.07,gravity_constant
|
| 282 |
+
0866671e,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 283 |
+
yzlwcb ibmslai bca nlia yao -> knight studies the wise key
|
| 284 |
+
xmaaz kvqqvni yao -> queen follows key
|
| 285 |
+
hvmia apjqveai bca htwlutq beatimea -> mouse explores the magical treasure
|
| 286 |
+
Now, decrypt the following text: bca ibetzwa tqlua kvqqvni",the strange alice follows,text_encryption
|
| 287 |
+
08d8d7e1,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 288 |
+
41+98 = 301
|
| 289 |
+
94+07 = 911
|
| 290 |
+
06*49 = 4906
|
| 291 |
+
95*27 = 2795
|
| 292 |
+
Now, determine the result for: 65+23",88,equation_transform
|
| 293 |
+
08df5363,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 294 |
+
|
| 295 |
+
Here are some examples of input -> output:
|
| 296 |
+
01001101 -> 00101001
|
| 297 |
+
01010111 -> 01101010
|
| 298 |
+
00101001 -> 00100101
|
| 299 |
+
10100011 -> 01110100
|
| 300 |
+
11110001 -> 00111110
|
| 301 |
+
00010000 -> 00000010
|
| 302 |
+
00000110 -> 11000000
|
| 303 |
+
00000001 -> 00100000
|
| 304 |
+
00101100 -> 10000101
|
| 305 |
+
|
| 306 |
+
Now, determine the output for: 11100010",01011100,bit_manipulation
|
| 307 |
+
094b8eea,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 308 |
+
22 -> XXII
|
| 309 |
+
7 -> VII
|
| 310 |
+
51 -> LI
|
| 311 |
+
81 -> LXXXI
|
| 312 |
+
40 -> XL
|
| 313 |
+
Now, write the number 86 in the Wonderland numeral system.",LXXXVI,numeral_system
|
| 314 |
+
095b3eab,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 315 |
+
imwwlx hxlmfg fsxxax -> hatter dreams mirror
|
| 316 |
+
mrsvl xlmhg scgshl rszxmxe -> alice reads inside library
|
| 317 |
+
mrsvl xlmhg clmx umrrle -> alice reads near valley
|
| 318 |
+
fangl panch wil gwxmckl zaab -> mouse found the strange book
|
| 319 |
+
gwnhlcw hxlmfg dawsac -> student dreams potion
|
| 320 |
+
Now, decrypt the following text: bcskiw hxmjg wil vnxsang dawsac",knight draws the curious potion,text_encryption
|
| 321 |
+
0978d9f3,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 322 |
+
For t = 2.3s, distance = 48.1 m
|
| 323 |
+
For t = 1.89s, distance = 32.48 m
|
| 324 |
+
For t = 3.37s, distance = 103.27 m
|
| 325 |
+
For t = 3.21s, distance = 93.7 m
|
| 326 |
+
Now, determine the falling distance for t = 2.4s given d = 0.5*g*t^2.",52.38,gravity_constant
|
| 327 |
+
09d5ee68,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 328 |
+
<:+|& = <:|&
|
| 329 |
+
'&+>? = '&>?
|
| 330 |
+
$!*!| = !!:&
|
| 331 |
+
|:-?' = -&$
|
| 332 |
+
Now, determine the result for: |:*>>",!?'!,equation_transform
|
| 333 |
+
09eb1f7e,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 334 |
+
31.36 m becomes 33.72
|
| 335 |
+
25.52 m becomes 27.44
|
| 336 |
+
25.64 m becomes 27.57
|
| 337 |
+
38.45 m becomes 41.35
|
| 338 |
+
27.52 m becomes 29.59
|
| 339 |
+
Now, convert the following measurement: 28.49 m",30.64,unit_conversion
|
| 340 |
+
0a3c8962,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 341 |
+
For t = 2.48s, distance = 37.4 m
|
| 342 |
+
For t = 2.32s, distance = 32.73 m
|
| 343 |
+
For t = 1.33s, distance = 10.76 m
|
| 344 |
+
For t = 4.16s, distance = 105.23 m
|
| 345 |
+
For t = 3.84s, distance = 89.66 m
|
| 346 |
+
Now, determine the falling distance for t = 2.99s given d = 0.5*g*t^2.",54.36,gravity_constant
|
| 347 |
+
0aaf8d39,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 348 |
+
51 -> LI
|
| 349 |
+
84 -> LXXXIV
|
| 350 |
+
20 -> XX
|
| 351 |
+
Now, write the number 61 in the Wonderland numeral system.",LXI,numeral_system
|
| 352 |
+
0af037a5,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 353 |
+
htnjmz bineve fiv iahhvz hmmt -> dragon chases the hidden door
|
| 354 |
+
fiv hnts wmdev awnjazve -> the dark mouse imagines
|
| 355 |
+
htnjmz bineve fitmdji kmzhvtpnzh -> dragon chases through wonderland
|
| 356 |
+
gtazbvee efdhave ntmdzh aepnzh -> princess studies around island
|
| 357 |
+
kaxnth cmppmke fiv bpvuvt gdxxpv -> wizard follows the clever puzzle
|
| 358 |
+
Now, decrypt the following text: efdhvzf efdhave zvnt unppvy",student studies near valley,text_encryption
|
| 359 |
+
0b1e1afc,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 360 |
+
For t = 2.13s, distance = 16.24 m
|
| 361 |
+
For t = 1.56s, distance = 8.71 m
|
| 362 |
+
For t = 1.12s, distance = 4.49 m
|
| 363 |
+
For t = 1.88s, distance = 12.65 m
|
| 364 |
+
For t = 1.26s, distance = 5.68 m
|
| 365 |
+
Now, determine the falling distance for t = 4.67s given d = 0.5*g*t^2.",78.08,gravity_constant
|
| 366 |
+
0b2877ce,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 367 |
+
58 -> LVIII
|
| 368 |
+
32 -> XXXII
|
| 369 |
+
20 -> XX
|
| 370 |
+
Now, write the number 40 in the Wonderland numeral system.",XL,numeral_system
|
| 371 |
+
0bb591e6,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 372 |
+
)(-)( = ""
|
| 373 |
+
&(-(( = <
|
| 374 |
+
$(-(% = )<
|
| 375 |
+
<%-%$ = ??
|
| 376 |
+
Now, determine the result for: ""$+%%",%?<,equation_transform
|
| 377 |
+
0bc7de44,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 378 |
+
31.68 m becomes 57.04
|
| 379 |
+
30.67 m becomes 55.22
|
| 380 |
+
20.22 m becomes 36.40
|
| 381 |
+
44.9 m becomes 80.84
|
| 382 |
+
Now, convert the following measurement: 17.35 m",31.24,unit_conversion
|
| 383 |
+
0bd41b01,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 384 |
+
43 -> XLIII
|
| 385 |
+
79 -> LXXIX
|
| 386 |
+
37 -> XXXVII
|
| 387 |
+
Now, write the number 85 in the Wonderland numeral system.",LXXXV,numeral_system
|
| 388 |
+
0c2243ff,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 389 |
+
qhfeldgg dpqijhdg fe qoiold -> princess explores in palace
|
| 390 |
+
kcd yzgkdhfjrg yjrgd vhdoyg -> the mysterious mouse dreams
|
| 391 |
+
afuohv vhoag ohjrev kjadh -> wizard draws around tower
|
| 392 |
+
kcd gkhoewd mfew gkrvfdg -> the strange king studies
|
| 393 |
+
Now, decrypt the following text: tfhv ahfkdg fegfvd wohvde",bird writes inside garden,text_encryption
|
| 394 |
+
0c2407ef,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 395 |
+
|
| 396 |
+
Here are some examples of input -> output:
|
| 397 |
+
11001100 -> 00010001
|
| 398 |
+
01101001 -> 01001000
|
| 399 |
+
11101000 -> 00011000
|
| 400 |
+
11111001 -> 01011110
|
| 401 |
+
01101111 -> 11001001
|
| 402 |
+
00110110 -> 10000100
|
| 403 |
+
01011001 -> 01000010
|
| 404 |
+
10110111 -> 11000100
|
| 405 |
+
01010000 -> 00000000
|
| 406 |
+
|
| 407 |
+
Now, determine the output for: 10011111",11000011,bit_manipulation
|
| 408 |
+
0c4e7430,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 409 |
+
85 -> LXXXV
|
| 410 |
+
18 -> XVIII
|
| 411 |
+
4 -> IV
|
| 412 |
+
Now, write the number 46 in the Wonderland numeral system.",XLVI,numeral_system
|
| 413 |
+
0d10d1ae,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 414 |
+
18.59 m becomes 31.08
|
| 415 |
+
28.32 m becomes 47.35
|
| 416 |
+
43.69 m becomes 73.05
|
| 417 |
+
26.48 m becomes 44.27
|
| 418 |
+
Now, convert the following measurement: 43.74 m",73.13,unit_conversion
|
| 419 |
+
0d3974ba,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 420 |
+
47.83 m becomes 41.24
|
| 421 |
+
11.33 m becomes 9.77
|
| 422 |
+
19.38 m becomes 16.71
|
| 423 |
+
18.45 m becomes 15.91
|
| 424 |
+
Now, convert the following measurement: 46.52 m",40.11,unit_conversion
|
| 425 |
+
0d90736f,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 426 |
+
[|*|` = \$()
|
| 427 |
+
!|-$) = )/
|
| 428 |
+
/$+|/ = :\
|
| 429 |
+
\/+): = [`
|
| 430 |
+
`$*|! = `[|`
|
| 431 |
+
Now, determine the result for: ::-)[",:,equation_transform
|
| 432 |
+
0da5e774,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 433 |
+
79 -> LXXIX
|
| 434 |
+
15 -> XV
|
| 435 |
+
1 -> I
|
| 436 |
+
99 -> XCIX
|
| 437 |
+
Now, write the number 89 in the Wonderland numeral system.",LXXXIX,numeral_system
|
| 438 |
+
0dfd7674,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 439 |
+
|
| 440 |
+
Here are some examples of input -> output:
|
| 441 |
+
00110100 -> 01100101
|
| 442 |
+
00010001 -> 01100110
|
| 443 |
+
10011000 -> 00010110
|
| 444 |
+
00101111 -> 10010101
|
| 445 |
+
00001010 -> 10010110
|
| 446 |
+
01111111 -> 00100001
|
| 447 |
+
11001110 -> 00101111
|
| 448 |
+
11111001 -> 10001100
|
| 449 |
+
11010110 -> 00011001
|
| 450 |
+
00110011 -> 10101010
|
| 451 |
+
|
| 452 |
+
Now, determine the output for: 01101010",01001110,bit_manipulation
|
| 453 |
+
0e009c6d,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 454 |
+
>@'>> = )?>
|
| 455 |
+
\%*\` = #!
|
| 456 |
+
\>'@\ = \!?>
|
| 457 |
+
`\*)> = @/
|
| 458 |
+
Now, determine the result for: @?'`?",`?\!,equation_transform
|
| 459 |
+
0e19e1bb,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 460 |
+
44.64 m becomes 67.20
|
| 461 |
+
8.84 m becomes 13.31
|
| 462 |
+
7.77 m becomes 11.70
|
| 463 |
+
Now, convert the following measurement: 32.5 m",48.92,unit_conversion
|
| 464 |
+
0e3962f6,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 465 |
+
|
| 466 |
+
Here are some examples of input -> output:
|
| 467 |
+
00101110 -> 01110001
|
| 468 |
+
00100110 -> 00110001
|
| 469 |
+
01101001 -> 01001011
|
| 470 |
+
01110111 -> 10111011
|
| 471 |
+
01001011 -> 01011010
|
| 472 |
+
11000010 -> 00010110
|
| 473 |
+
10000100 -> 00100100
|
| 474 |
+
01010111 -> 10111010
|
| 475 |
+
11001010 -> 01010110
|
| 476 |
+
|
| 477 |
+
Now, determine the output for: 11011111",11111110,bit_manipulation
|
| 478 |
+
0e3d5b3d,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 479 |
+
92 -> XCII
|
| 480 |
+
23 -> XXIII
|
| 481 |
+
84 -> LXXXIV
|
| 482 |
+
Now, write the number 47 in the Wonderland numeral system.",XLVII,numeral_system
|
| 483 |
+
0e467c7b,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 484 |
+
22.05 m becomes 28.58
|
| 485 |
+
14.69 m becomes 19.04
|
| 486 |
+
25.24 m becomes 32.72
|
| 487 |
+
17.22 m becomes 22.32
|
| 488 |
+
36.08 m becomes 46.77
|
| 489 |
+
Now, convert the following measurement: 41.11 m",53.29,unit_conversion
|
| 490 |
+
0e653f2b,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 491 |
+
42.89 m becomes 43.45
|
| 492 |
+
49.11 m becomes 49.75
|
| 493 |
+
37.76 m becomes 38.26
|
| 494 |
+
20.86 m becomes 21.13
|
| 495 |
+
48.22 m becomes 48.85
|
| 496 |
+
Now, convert the following measurement: 24.95 m",25.28,unit_conversion
|
| 497 |
+
0e70c867,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 498 |
+
|
| 499 |
+
Here are some examples of input -> output:
|
| 500 |
+
01010011 -> 00000000
|
| 501 |
+
00111100 -> 11000000
|
| 502 |
+
00001100 -> 00000000
|
| 503 |
+
10110101 -> 01010100
|
| 504 |
+
00111101 -> 11010000
|
| 505 |
+
00111110 -> 11100000
|
| 506 |
+
11101001 -> 10000111
|
| 507 |
+
|
| 508 |
+
Now, determine the output for: 10010110",01000000,bit_manipulation
|
| 509 |
+
0e897e03,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 510 |
+
For t = 2.74s, distance = 36.92 m
|
| 511 |
+
For t = 2.63s, distance = 34.02 m
|
| 512 |
+
For t = 1.54s, distance = 11.66 m
|
| 513 |
+
For t = 4.63s, distance = 105.43 m
|
| 514 |
+
For t = 3.65s, distance = 65.52 m
|
| 515 |
+
Now, determine the falling distance for t = 2.5s given d = 0.5*g*t^2.",30.74,gravity_constant
|
| 516 |
+
0f26a837,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 517 |
+
12.33 m becomes 11.88
|
| 518 |
+
46.39 m becomes 44.69
|
| 519 |
+
40.1 m becomes 38.63
|
| 520 |
+
29.51 m becomes 28.43
|
| 521 |
+
20.99 m becomes 20.22
|
| 522 |
+
Now, convert the following measurement: 5.64 m",5.43,unit_conversion
|
| 523 |
+
0f2dec86,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 524 |
+
|
| 525 |
+
Here are some examples of input -> output:
|
| 526 |
+
00011011 -> 01100001
|
| 527 |
+
11110001 -> 10111100
|
| 528 |
+
11101011 -> 11011001
|
| 529 |
+
11010111 -> 00110111
|
| 530 |
+
10111000 -> 10111100
|
| 531 |
+
00011101 -> 01111010
|
| 532 |
+
11100111 -> 11101111
|
| 533 |
+
|
| 534 |
+
Now, determine the output for: 11110000",10111000,bit_manipulation
|
| 535 |
+
0f7ddd75,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 536 |
+
|
| 537 |
+
Here are some examples of input -> output:
|
| 538 |
+
01110101 -> 11111111
|
| 539 |
+
10111001 -> 11110110
|
| 540 |
+
10110110 -> 11111110
|
| 541 |
+
01100100 -> 11011001
|
| 542 |
+
00100111 -> 11011110
|
| 543 |
+
00001100 -> 00111000
|
| 544 |
+
11011111 -> 11111111
|
| 545 |
+
01001100 -> 10111001
|
| 546 |
+
00101011 -> 11111110
|
| 547 |
+
01010010 -> 11101101
|
| 548 |
+
|
| 549 |
+
Now, determine the output for: 00111001",11110110,bit_manipulation
|
| 550 |
+
0fe06e8c,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 551 |
+
|
| 552 |
+
Here are some examples of input -> output:
|
| 553 |
+
11001000 -> 10000011
|
| 554 |
+
11101101 -> 11010011
|
| 555 |
+
01001101 -> 11010001
|
| 556 |
+
11010110 -> 01100011
|
| 557 |
+
11010101 -> 01010011
|
| 558 |
+
01011000 -> 10000001
|
| 559 |
+
01001010 -> 10100001
|
| 560 |
+
00001111 -> 11110000
|
| 561 |
+
11010000 -> 00000011
|
| 562 |
+
00000111 -> 01110000
|
| 563 |
+
|
| 564 |
+
Now, determine the output for: 10111001",10010010,bit_manipulation
|
| 565 |
+
0fe53bac,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 566 |
+
(@+!| = @""
|
| 567 |
+
}(-^} = }}
|
| 568 |
+
?""+): = ()@
|
| 569 |
+
@@-""@ = -)
|
| 570 |
+
Now, determine the result for: ^?+(|","(""",equation_transform
|
| 571 |
+
1029ef5a,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 572 |
+
For t = 2.31s, distance = 47.1 m
|
| 573 |
+
For t = 2.86s, distance = 72.2 m
|
| 574 |
+
For t = 3.61s, distance = 115.04 m
|
| 575 |
+
For t = 2.73s, distance = 65.79 m
|
| 576 |
+
For t = 2.02s, distance = 36.02 m
|
| 577 |
+
Now, determine the falling distance for t = 1.94s given d = 0.5*g*t^2.",33.22,gravity_constant
|
| 578 |
+
105255db,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 579 |
+
3 -> III
|
| 580 |
+
98 -> XCVIII
|
| 581 |
+
56 -> LVI
|
| 582 |
+
Now, write the number 49 in the Wonderland numeral system.",XLIX,numeral_system
|
| 583 |
+
10f1809a,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 584 |
+
ras brwegys nissg qerhasb -> the strange queen watches
|
| 585 |
+
cwdghsbb pvmmvqb cvrdvg -> princess follows potion
|
| 586 |
+
zgdyar pvigf kec -> knight found map
|
| 587 |
+
jdwf fweqb ras bshwsr ksbbeys -> bird draws the secret message
|
| 588 |
+
wejjdr fdbhvxswb rwsebiws -> rabbit discovers treasure
|
| 589 |
+
Now, decrypt the following text: her fweqb zst",cat draws key,text_encryption
|
| 590 |
+
114a7439,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 591 |
+
|
| 592 |
+
Here are some examples of input -> output:
|
| 593 |
+
10101100 -> 01100101
|
| 594 |
+
00100011 -> 00011001
|
| 595 |
+
10111001 -> 10001101
|
| 596 |
+
01110100 -> 10100011
|
| 597 |
+
11000000 -> 00000110
|
| 598 |
+
00001110 -> 01110000
|
| 599 |
+
10011001 -> 10001100
|
| 600 |
+
|
| 601 |
+
Now, determine the output for: 00111110",01110001,bit_manipulation
|
| 602 |
+
119fa9e1,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 603 |
+
16 -> XVI
|
| 604 |
+
32 -> XXXII
|
| 605 |
+
53 -> LIII
|
| 606 |
+
77 -> LXXVII
|
| 607 |
+
49 -> XLIX
|
| 608 |
+
Now, write the number 93 in the Wonderland numeral system.",XCIII,numeral_system
|
| 609 |
+
11a3d729,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 610 |
+
23 -> XXIII
|
| 611 |
+
86 -> LXXXVI
|
| 612 |
+
84 -> LXXXIV
|
| 613 |
+
12 -> XII
|
| 614 |
+
Now, write the number 32 in the Wonderland numeral system.",XXXII,numeral_system
|
| 615 |
+
127b232a,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 616 |
+
For t = 3.46s, distance = 75.68 m
|
| 617 |
+
For t = 1.49s, distance = 14.03 m
|
| 618 |
+
For t = 1.16s, distance = 8.51 m
|
| 619 |
+
For t = 4.04s, distance = 103.18 m
|
| 620 |
+
For t = 1.56s, distance = 15.38 m
|
| 621 |
+
Now, determine the falling distance for t = 2.61s given d = 0.5*g*t^2.",43.06,gravity_constant
|
| 622 |
+
1282c5c5,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 623 |
+
|
| 624 |
+
Here are some examples of input -> output:
|
| 625 |
+
11110000 -> 10001111
|
| 626 |
+
11000111 -> 11111100
|
| 627 |
+
00101000 -> 11101011
|
| 628 |
+
10100010 -> 11101110
|
| 629 |
+
11000100 -> 00011101
|
| 630 |
+
01001010 -> 10011110
|
| 631 |
+
10001110 -> 01111000
|
| 632 |
+
00010011 -> 00010111
|
| 633 |
+
|
| 634 |
+
Now, determine the output for: 01101110",00001110,bit_manipulation
|
| 635 |
+
12e0ac8c,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 636 |
+
|
| 637 |
+
Here are some examples of input -> output:
|
| 638 |
+
11111101 -> 01110101
|
| 639 |
+
01010000 -> 10101011
|
| 640 |
+
11011001 -> 11101101
|
| 641 |
+
10001010 -> 01110101
|
| 642 |
+
01111110 -> 10011000
|
| 643 |
+
10110001 -> 01010111
|
| 644 |
+
10100100 -> 01000111
|
| 645 |
+
10100110 -> 11001111
|
| 646 |
+
01010111 -> 01110110
|
| 647 |
+
01011100 -> 10011000
|
| 648 |
+
|
| 649 |
+
Now, determine the output for: 10011100",10101001,bit_manipulation
|
| 650 |
+
12e6f711,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 651 |
+
For t = 4.5s, distance = 187.95 m
|
| 652 |
+
For t = 1.17s, distance = 12.71 m
|
| 653 |
+
For t = 2.18s, distance = 44.11 m
|
| 654 |
+
Now, determine the falling distance for t = 3.33s given d = 0.5*g*t^2.",102.92,gravity_constant
|
| 655 |
+
12e947ca,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 656 |
+
|
| 657 |
+
Here are some examples of input -> output:
|
| 658 |
+
10010001 -> 00001000
|
| 659 |
+
00011101 -> 01001110
|
| 660 |
+
10010101 -> 00001010
|
| 661 |
+
11110001 -> 00111000
|
| 662 |
+
01001000 -> 00100100
|
| 663 |
+
01010100 -> 00101010
|
| 664 |
+
00010010 -> 10001001
|
| 665 |
+
11100101 -> 00110010
|
| 666 |
+
11101100 -> 01110110
|
| 667 |
+
10110001 -> 00011000
|
| 668 |
+
|
| 669 |
+
Now, determine the output for: 11111101",00111110,bit_manipulation
|
| 670 |
+
12fe3d99,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 671 |
+
For t = 1.32s, distance = 14.16 m
|
| 672 |
+
For t = 2.33s, distance = 44.13 m
|
| 673 |
+
For t = 4.52s, distance = 166.06 m
|
| 674 |
+
For t = 3.25s, distance = 85.85 m
|
| 675 |
+
Now, determine the falling distance for t = 1.48s given d = 0.5*g*t^2.",17.8,gravity_constant
|
| 676 |
+
13912aeb,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 677 |
+
aofvwsll rjxvy tus bfls pca -> princess found the wise map
|
| 678 |
+
mxssv wosctsl cgjzs rjoslt -> queen creates above forest
|
| 679 |
+
gfoy rjkkjbl tus hjkysv hcoysv -> bird follows the golden garden
|
| 680 |
+
tus bfls mxssv snakjosl -> the wise queen explores
|
| 681 |
+
gfoy rjxvy tus cvwfsvt psllchs -> bird found the ancient message
|
| 682 |
+
Now, decrypt the following text: tus ycoi ckfws yflwjzsol",the dark alice discovers,text_encryption
|
| 683 |
+
13c36657,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 684 |
+
For t = 2.19s, distance = 44.59 m
|
| 685 |
+
For t = 2.08s, distance = 40.22 m
|
| 686 |
+
For t = 4.8s, distance = 214.19 m
|
| 687 |
+
For t = 3.67s, distance = 125.21 m
|
| 688 |
+
Now, determine the falling distance for t = 1.03s given d = 0.5*g*t^2.",9.86,gravity_constant
|
| 689 |
+
14570aeb,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 690 |
+
43.76 m becomes 74.13
|
| 691 |
+
19.64 m becomes 33.27
|
| 692 |
+
20.65 m becomes 34.98
|
| 693 |
+
Now, convert the following measurement: 31.32 m",53.05,unit_conversion
|
| 694 |
+
14cca3a2,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 695 |
+
34.37 m becomes 57.86
|
| 696 |
+
38.56 m becomes 64.91
|
| 697 |
+
36.84 m becomes 62.01
|
| 698 |
+
44.32 m becomes 74.61
|
| 699 |
+
19.46 m becomes 32.76
|
| 700 |
+
Now, convert the following measurement: 46.68 m",78.58,unit_conversion
|
| 701 |
+
1564de32,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 702 |
+
65 -> LXV
|
| 703 |
+
38 -> XXXVIII
|
| 704 |
+
17 -> XVII
|
| 705 |
+
Now, write the number 8 in the Wonderland numeral system.",VIII,numeral_system
|
| 706 |
+
157f8266,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 707 |
+
yzh otaghl ulbndq txbntqho -> the silver dragon imagines
|
| 708 |
+
zbyyhl hfpadlho qhbl rdquhlabqu -> hatter explores near wonderland
|
| 709 |
+
oysuhqy oysutho wdlhoy -> student studies forest
|
| 710 |
+
mshhq lhbuo yzh ublk xbp -> queen reads the dark map
|
| 711 |
+
Now, decrypt the following text: vtlu rbyezho tqotuh toabqu",bird watches inside island,text_encryption
|
| 712 |
+
15b1b62e,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 713 |
+
24.14 m becomes 21.08
|
| 714 |
+
16.39 m becomes 14.31
|
| 715 |
+
40.18 m becomes 35.08
|
| 716 |
+
47.18 m becomes 41.20
|
| 717 |
+
11.91 m becomes 10.40
|
| 718 |
+
Now, convert the following measurement: 10.54 m",9.20,unit_conversion
|
| 719 |
+
15e79ae0,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 720 |
+
For t = 1.01s, distance = 9.96 m
|
| 721 |
+
For t = 2.33s, distance = 53.0 m
|
| 722 |
+
For t = 4.19s, distance = 171.4 m
|
| 723 |
+
Now, determine the falling distance for t = 1.27s given d = 0.5*g*t^2.",15.75,gravity_constant
|
| 724 |
+
16d0c65e,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 725 |
+
For t = 3.94s, distance = 61.22 m
|
| 726 |
+
For t = 4.45s, distance = 78.1 m
|
| 727 |
+
For t = 2.04s, distance = 16.41 m
|
| 728 |
+
For t = 2.64s, distance = 27.49 m
|
| 729 |
+
Now, determine the falling distance for t = 4.32s given d = 0.5*g*t^2.",73.6,gravity_constant
|
| 730 |
+
16e73f0e,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 731 |
+
|
| 732 |
+
Here are some examples of input -> output:
|
| 733 |
+
00001010 -> 00000000
|
| 734 |
+
00001000 -> 00000000
|
| 735 |
+
11000011 -> 00000000
|
| 736 |
+
00001011 -> 00000000
|
| 737 |
+
11110011 -> 00001100
|
| 738 |
+
01011100 -> 00000101
|
| 739 |
+
01000111 -> 00000000
|
| 740 |
+
10001011 -> 00000000
|
| 741 |
+
00010000 -> 00000000
|
| 742 |
+
10100011 -> 00001000
|
| 743 |
+
|
| 744 |
+
Now, determine the output for: 10011100",00000001,bit_manipulation
|
| 745 |
+
17a00c5a,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 746 |
+
32 -> XXXII
|
| 747 |
+
80 -> LXXX
|
| 748 |
+
14 -> XIV
|
| 749 |
+
Now, write the number 61 in the Wonderland numeral system.",LXI,numeral_system
|
| 750 |
+
17d4aac4,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 751 |
+
43.12 m becomes 49.25
|
| 752 |
+
15.18 m becomes 17.34
|
| 753 |
+
8.98 m becomes 10.26
|
| 754 |
+
13.31 m becomes 15.20
|
| 755 |
+
14.86 m becomes 16.97
|
| 756 |
+
Now, convert the following measurement: 25.25 m",28.84,unit_conversion
|
| 757 |
+
186cccdf,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 758 |
+
For t = 3.84s, distance = 107.09 m
|
| 759 |
+
For t = 1.36s, distance = 13.43 m
|
| 760 |
+
For t = 1.14s, distance = 9.44 m
|
| 761 |
+
Now, determine the falling distance for t = 4.39s given d = 0.5*g*t^2.",139.97,gravity_constant
|
| 762 |
+
188111de,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 763 |
+
qfeoadf qfeowaq zykqfhg -> student studies crystal
|
| 764 |
+
twlhyo qfeowaq qfbyk -> wizard studies story
|
| 765 |
+
vywdzaqq oyhtq wd ihggak -> princess draws in valley
|
| 766 |
+
vywdzaqq qaaq wdqwoa qzpbbg -> princess sees inside school
|
| 767 |
+
Now, decrypt the following text: vywdzaqq thfzpaq fpybeup uhyoad",princess watches through garden,text_encryption
|
| 768 |
+
18ad64a2,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 769 |
+
25.94 m becomes 25.37
|
| 770 |
+
40.79 m becomes 39.89
|
| 771 |
+
45.44 m becomes 44.44
|
| 772 |
+
Now, convert the following measurement: 37.26 m",36.44,unit_conversion
|
| 773 |
+
190b9dad,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 774 |
+
zuv mjyavjz ojaluz dmzyuvn -> the ancient knight watches
|
| 775 |
+
gkvvj aemlajvn yhxnzmq -> queen imagines crystal
|
| 776 |
+
dasmhf dhazvn aj lmhfvj -> wizard writes in garden
|
| 777 |
+
Now, decrypt the following text: hmbbaz nzkfavn zuv ycqchtkq yhxnzmq",rabbit studies the colorful crystal,text_encryption
|
| 778 |
+
19291958,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 779 |
+
62 -> LXII
|
| 780 |
+
25 -> XXV
|
| 781 |
+
29 -> XXIX
|
| 782 |
+
1 -> I
|
| 783 |
+
92 -> XCII
|
| 784 |
+
Now, write the number 87 in the Wonderland numeral system.",LXXXVII,numeral_system
|
| 785 |
+
194695e8,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 786 |
+
{|*<\ = {%!|
|
| 787 |
+
]|*!] = {<|%
|
| 788 |
+
]$-<% = |!
|
| 789 |
+
Now, determine the result for: !\-{<",%,equation_transform
|
| 790 |
+
1950808e,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 791 |
+
axvfrb axvnh ibatx krxthm -> dragon draws under forest
|
| 792 |
+
met qvfdpvc mtvpetx xtvah -> the magical teacher reads
|
| 793 |
+
sdbf nvmpeth otzrba qribmvdb -> king watches beyond mountain
|
| 794 |
+
sdbf kriba dbhdat jdccvft -> king found inside village
|
| 795 |
+
Now, decrypt the following text: mixmct hmiadth btvx dhcvba",turtle studies near island,text_encryption
|
| 796 |
+
1a2ac571,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 797 |
+
For t = 4.04s, distance = 155.41 m
|
| 798 |
+
For t = 1.0s, distance = 9.52 m
|
| 799 |
+
For t = 4.28s, distance = 174.43 m
|
| 800 |
+
For t = 2.93s, distance = 81.74 m
|
| 801 |
+
Now, determine the falling distance for t = 1.21s given d = 0.5*g*t^2.",13.94,gravity_constant
|
| 802 |
+
1a6c0053,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 803 |
+
For t = 2.16s, distance = 14.66 m
|
| 804 |
+
For t = 1.41s, distance = 6.25 m
|
| 805 |
+
For t = 1.93s, distance = 11.71 m
|
| 806 |
+
Now, determine the falling distance for t = 1.06s given d = 0.5*g*t^2.",3.53,gravity_constant
|
| 807 |
+
1a7c8520,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 808 |
+
|
| 809 |
+
Here are some examples of input -> output:
|
| 810 |
+
01101101 -> 10010011
|
| 811 |
+
10001000 -> 00000000
|
| 812 |
+
00001011 -> 00000100
|
| 813 |
+
00000111 -> 00001100
|
| 814 |
+
01011101 -> 00110010
|
| 815 |
+
11011101 -> 00110110
|
| 816 |
+
00100101 -> 00000000
|
| 817 |
+
|
| 818 |
+
Now, determine the output for: 10111000",01100000,bit_manipulation
|
| 819 |
+
1abaffca,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 820 |
+
|
| 821 |
+
Here are some examples of input -> output:
|
| 822 |
+
10010110 -> 00110101
|
| 823 |
+
00010010 -> 00100100
|
| 824 |
+
10001111 -> 00010011
|
| 825 |
+
01000110 -> 10001100
|
| 826 |
+
00111001 -> 00010110
|
| 827 |
+
10111100 -> 00011001
|
| 828 |
+
11111010 -> 00011101
|
| 829 |
+
|
| 830 |
+
Now, determine the output for: 00100000",01000000,bit_manipulation
|
| 831 |
+
1af4f53a,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 832 |
+
14 -> XIV
|
| 833 |
+
61 -> LXI
|
| 834 |
+
4 -> IV
|
| 835 |
+
Now, write the number 32 in the Wonderland numeral system.",XXXII,numeral_system
|
| 836 |
+
1b3891f3,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 837 |
+
cpr tyxig rmz cxqbyxd vzk -> cat found the curious key
|
| 838 |
+
jbqg tyxig rmz picbzir cpdrlz -> bird found the ancient castle
|
| 839 |
+
cpr qzpgd rmz cylyqtxl jyyv -> cat reads the colorful book
|
| 840 |
+
uqbiczdd qzpgd bi ryezq -> princess reads in tower
|
| 841 |
+
ebnpqg gqzpad gyyq -> wizard dreams door
|
| 842 |
+
Now, decrypt the following text: rmz clzhzq mprrzq bapobizd",the clever hatter imagines,text_encryption
|
| 843 |
+
1bf3f0f1,"In Alice's Wonderland, a secret unit conversion is applied to measurements. For example:
|
| 844 |
+
17.01 m becomes 19.11
|
| 845 |
+
6.37 m becomes 7.16
|
| 846 |
+
10.74 m becomes 12.07
|
| 847 |
+
Now, convert the following measurement: 6.2 m",6.97,unit_conversion
|
| 848 |
+
1c566511,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 849 |
+
|
| 850 |
+
Here are some examples of input -> output:
|
| 851 |
+
10100001 -> 10010000
|
| 852 |
+
11111011 -> 00111101
|
| 853 |
+
01000111 -> 01100011
|
| 854 |
+
01110000 -> 00111000
|
| 855 |
+
11011100 -> 01101110
|
| 856 |
+
10010110 -> 11001011
|
| 857 |
+
00000001 -> 11000000
|
| 858 |
+
01100101 -> 11110010
|
| 859 |
+
00001100 -> 00000110
|
| 860 |
+
11000100 -> 01100010
|
| 861 |
+
|
| 862 |
+
Now, determine the output for: 10100100",01010010,bit_manipulation
|
| 863 |
+
1c671acc,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 864 |
+
|
| 865 |
+
Here are some examples of input -> output:
|
| 866 |
+
10110010 -> 11011101
|
| 867 |
+
10010011 -> 11011100
|
| 868 |
+
00100000 -> 10000001
|
| 869 |
+
01101100 -> 11110011
|
| 870 |
+
11110000 -> 11000111
|
| 871 |
+
00000111 -> 00111100
|
| 872 |
+
00011011 -> 11111100
|
| 873 |
+
11011101 -> 11111110
|
| 874 |
+
11111000 -> 11100111
|
| 875 |
+
|
| 876 |
+
Now, determine the output for: 00101011",11111101,bit_manipulation
|
| 877 |
+
1cf8fadd,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 878 |
+
90 -> XC
|
| 879 |
+
70 -> LXX
|
| 880 |
+
96 -> XCVI
|
| 881 |
+
57 -> LVII
|
| 882 |
+
Now, write the number 51 in the Wonderland numeral system.",LI,numeral_system
|
| 883 |
+
1d08947a,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 884 |
+
|
| 885 |
+
Here are some examples of input -> output:
|
| 886 |
+
00111110 -> 11111000
|
| 887 |
+
11110110 -> 11011000
|
| 888 |
+
11100110 -> 10011000
|
| 889 |
+
10101100 -> 10110000
|
| 890 |
+
11111010 -> 11101000
|
| 891 |
+
10001111 -> 00111100
|
| 892 |
+
00010011 -> 01001100
|
| 893 |
+
|
| 894 |
+
Now, determine the output for: 01100101",10010100,bit_manipulation
|
| 895 |
+
1d32836c,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 896 |
+
For t = 2.75s, distance = 57.45 m
|
| 897 |
+
For t = 3.87s, distance = 113.78 m
|
| 898 |
+
For t = 2.03s, distance = 31.31 m
|
| 899 |
+
For t = 4.96s, distance = 186.9 m
|
| 900 |
+
For t = 4.6s, distance = 160.75 m
|
| 901 |
+
Now, determine the falling distance for t = 1.92s given d = 0.5*g*t^2.",28.01,gravity_constant
|
| 902 |
+
1d79fe85,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 903 |
+
xgbbdc hznuljdcn bxd qvnbdczlfn qdnngod -> hatter discovers the mysterious message
|
| 904 |
+
bxd ulylcefy izko elfkh -> the colorful king found
|
| 905 |
+
bxd xzhhdk xgbbdc hcdgqn -> the hidden hatter dreams
|
| 906 |
+
xgbbdc hcdgqn tlli -> hatter dreams book
|
| 907 |
+
Now, decrypt the following text: cgttzb uxgndn zk ogchdk",rabbit chases in garden,text_encryption
|
| 908 |
+
1dd697e1,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 909 |
+
rib txyxskey tzr lsprbn -> the colorful cat writes
|
| 910 |
+
rib tybvbs zyptb tsbzrbn -> the clever alice creates
|
| 911 |
+
msphtbnn kxyyxln rib tespxen mxrpxh -> princess follows the curious potion
|
| 912 |
+
dhpgir oszln rib wzgptzy qxxd -> knight draws the magical book
|
| 913 |
+
Now, decrypt the following text: rib tespxen qpso tsbzrbn",the curious bird creates,text_encryption
|
| 914 |
+
1df786ed,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 915 |
+
wlmg telpzc ymhze aboozj -> king writes under valley
|
| 916 |
+
ibppze czzc rleene -> hatter sees mirror
|
| 917 |
+
cpyhzmp zxsonezc piz czfezp czfezp -> student explores the secret secret
|
| 918 |
+
qyzzm fibczc lm fbaz -> queen chases in cave
|
| 919 |
+
Now, decrypt the following text: piz rbglfbo cpyhzmp hebtc",the magical student draws,text_encryption
|
| 920 |
+
1ef440dc,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 921 |
+
For t = 3.36s, distance = 57.55 m
|
| 922 |
+
For t = 3.67s, distance = 68.65 m
|
| 923 |
+
For t = 4.98s, distance = 126.41 m
|
| 924 |
+
For t = 4.73s, distance = 114.04 m
|
| 925 |
+
Now, determine the falling distance for t = 1.78s given d = 0.5*g*t^2.",16.15,gravity_constant
|
| 926 |
+
1f7407ed,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 927 |
+
|
| 928 |
+
Here are some examples of input -> output:
|
| 929 |
+
11010110 -> 10001011
|
| 930 |
+
10101000 -> 10111010
|
| 931 |
+
01010011 -> 00000101
|
| 932 |
+
00110101 -> 11110110
|
| 933 |
+
11101000 -> 10111011
|
| 934 |
+
00010101 -> 11110111
|
| 935 |
+
11111101 -> 10110011
|
| 936 |
+
01110000 -> 01111101
|
| 937 |
+
00000001 -> 11010111
|
| 938 |
+
|
| 939 |
+
Now, determine the output for: 01110010",00101101,bit_manipulation
|
| 940 |
+
20052c2f,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 941 |
+
|
| 942 |
+
Here are some examples of input -> output:
|
| 943 |
+
10010110 -> 11010011
|
| 944 |
+
01110011 -> 01101110
|
| 945 |
+
11110011 -> 01111111
|
| 946 |
+
10010011 -> 01110011
|
| 947 |
+
11010001 -> 00111011
|
| 948 |
+
11001000 -> 00011001
|
| 949 |
+
11101100 -> 10011101
|
| 950 |
+
11011000 -> 00011011
|
| 951 |
+
01111010 -> 01001111
|
| 952 |
+
|
| 953 |
+
Now, determine the output for: 00110011",01100110,bit_manipulation
|
| 954 |
+
201255d5,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 955 |
+
btnfz mtnoi pswfdja -> mouse found crystal
|
| 956 |
+
qeog iszjbf drz pazyzs mtszfd -> king dreams the clever forest
|
| 957 |
+
dnsdaz fzzf bjh -> turtle sees map
|
| 958 |
+
Now, decrypt the following text: drz feayzs sjuued iefptyzsf",the silver rabbit discovers,text_encryption
|
| 959 |
+
202af98d,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 960 |
+
|
| 961 |
+
Here are some examples of input -> output:
|
| 962 |
+
01000101 -> 01111111
|
| 963 |
+
00000110 -> 11000011
|
| 964 |
+
01000100 -> 01110111
|
| 965 |
+
10011001 -> 01001101
|
| 966 |
+
10101111 -> 11011111
|
| 967 |
+
10101011 -> 11110101
|
| 968 |
+
10001000 -> 11101111
|
| 969 |
+
10111001 -> 01011100
|
| 970 |
+
01001001 -> 00100111
|
| 971 |
+
|
| 972 |
+
Now, determine the output for: 11110010",11111101,bit_manipulation
|
| 973 |
+
2087df86,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 974 |
+
14 -> XIV
|
| 975 |
+
95 -> XCV
|
| 976 |
+
15 -> XV
|
| 977 |
+
96 -> XCVI
|
| 978 |
+
Now, write the number 36 in the Wonderland numeral system.",XXXVI,numeral_system
|
| 979 |
+
208d7838,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 980 |
+
#}+{% = }$$
|
| 981 |
+
%#*%[ = &:[[
|
| 982 |
+
}%-&[ = [$
|
| 983 |
+
<&+:$ = :#
|
| 984 |
+
}%*&# = }[$%
|
| 985 |
+
Now, determine the result for: [&-<>",[:,equation_transform
|
| 986 |
+
209c43f0,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 987 |
+
10^12 = 21
|
| 988 |
+
92!90 = 8280
|
| 989 |
+
98^33 = 130
|
| 990 |
+
48:26 = 22
|
| 991 |
+
Now, determine the result for: 18^84",101,equation_transform
|
| 992 |
+
20cdbdb1,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 993 |
+
|
| 994 |
+
Here are some examples of input -> output:
|
| 995 |
+
01100110 -> 01100000
|
| 996 |
+
11001101 -> 11010001
|
| 997 |
+
10101000 -> 10000001
|
| 998 |
+
00100001 -> 00010000
|
| 999 |
+
10100010 -> 00100001
|
| 1000 |
+
10101111 -> 11110001
|
| 1001 |
+
11111000 -> 10000001
|
| 1002 |
+
01101100 -> 11000000
|
| 1003 |
+
11110011 -> 00110001
|
| 1004 |
+
00111010 -> 10100000
|
| 1005 |
+
|
| 1006 |
+
Now, determine the output for: 10001110",11100001,bit_manipulation
|
| 1007 |
+
20f0fac9,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1008 |
+
78]18 = 6
|
| 1009 |
+
95]24 = 23
|
| 1010 |
+
52*94 = 145
|
| 1011 |
+
21]91 = 7
|
| 1012 |
+
Now, determine the result for: 31%96",2976,equation_transform
|
| 1013 |
+
21245d76,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1014 |
+
|
| 1015 |
+
Here are some examples of input -> output:
|
| 1016 |
+
00101100 -> 01011011
|
| 1017 |
+
11110101 -> 11011111
|
| 1018 |
+
01111101 -> 10110111
|
| 1019 |
+
11000010 -> 10011110
|
| 1020 |
+
00000110 -> 11100100
|
| 1021 |
+
11101110 -> 00111110
|
| 1022 |
+
10011100 -> 11001001
|
| 1023 |
+
11111000 -> 01101111
|
| 1024 |
+
|
| 1025 |
+
Now, determine the output for: 11011011",01111111,bit_manipulation
|
| 1026 |
+
21261dc6,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1027 |
+
05-25 = -2
|
| 1028 |
+
74*67 = 2753
|
| 1029 |
+
89-85 = -04
|
| 1030 |
+
Now, determine the result for: 02-27",-25,equation_transform
|
| 1031 |
+
215050ec,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 1032 |
+
43 -> XLIII
|
| 1033 |
+
28 -> XXVIII
|
| 1034 |
+
84 -> LXXXIV
|
| 1035 |
+
44 -> XLIV
|
| 1036 |
+
30 -> XXX
|
| 1037 |
+
Now, write the number 54 in the Wonderland numeral system.",LIV,numeral_system
|
| 1038 |
+
21519be7,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1039 |
+
58@52 = 011
|
| 1040 |
+
31>55 = 24
|
| 1041 |
+
85>27 = 41
|
| 1042 |
+
Now, determine the result for: 82@52",35,equation_transform
|
| 1043 |
+
215fda9c,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 1044 |
+
For t = 4.79s, distance = 159.9 m
|
| 1045 |
+
For t = 3.37s, distance = 79.15 m
|
| 1046 |
+
For t = 3.83s, distance = 102.23 m
|
| 1047 |
+
For t = 1.92s, distance = 25.69 m
|
| 1048 |
+
Now, determine the falling distance for t = 1.62s given d = 0.5*g*t^2.",18.29,gravity_constant
|
| 1049 |
+
21bd1251,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1050 |
+
amxbg idxpgq pcg ixqg wsdgqp -> alice writes the wise forest
|
| 1051 |
+
ysjqg iapbcgq ygqqafg -> mouse watches message
|
| 1052 |
+
pgabcgd gtemsdgq adsjlz eamabg -> teacher explores around palace
|
| 1053 |
+
pgabcgd dgazq adsjlz baqpmg -> teacher reads around castle
|
| 1054 |
+
ixkadz bcaqgq hgnslz xqmalz -> wizard chases beyond island
|
| 1055 |
+
Now, decrypt the following text: pjdpmg zxqbsrgdq ejkkmg",turtle discovers puzzle,text_encryption
|
| 1056 |
+
21e2511d,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 1057 |
+
For t = 2.59s, distance = 16.8 m
|
| 1058 |
+
For t = 2.64s, distance = 17.46 m
|
| 1059 |
+
For t = 2.98s, distance = 22.25 m
|
| 1060 |
+
Now, determine the falling distance for t = 4.45s given d = 0.5*g*t^2.",49.61,gravity_constant
|
| 1061 |
+
22045c05,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1062 |
+
utlfmo ztklqkw wqmtx -> dragon creates story
|
| 1063 |
+
anof wqiunkw ummt -> king studies door
|
| 1064 |
+
qdk etnfdq qklzdkt kycsmtkw -> the bright teacher explores
|
| 1065 |
+
Now, decrypt the following text: pikko vmiou akx",queen found key,text_encryption
|
| 1066 |
+
22844f06,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1067 |
+
nofnij xfjgnjd mbfjdn -> turtle creates forest
|
| 1068 |
+
nofnij mbose ntj qwdj vwffbf -> turtle found the wise mirror
|
| 1069 |
+
lwsp wvgpwsjd ntj vgpwxgi vwffbf -> king imagines the magical mirror
|
| 1070 |
+
Now, decrypt the following text: qwugfe mbose vwffbf",wizard found mirror,text_encryption
|
| 1071 |
+
2306289a,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 1072 |
+
For t = 2.47s, distance = 22.06 m
|
| 1073 |
+
For t = 3.9s, distance = 54.99 m
|
| 1074 |
+
For t = 3.11s, distance = 34.97 m
|
| 1075 |
+
Now, determine the falling distance for t = 4.03s given d = 0.5*g*t^2.",58.72,gravity_constant
|
| 1076 |
+
254f9885,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1077 |
+
fummbk xknmbt mfb huenzuo yavvob -> hatter writes the magical puzzle
|
| 1078 |
+
yknqzbtt blyockbt qbuk ntouqj -> princess explores near island
|
| 1079 |
+
yknqzbtt tbbt mfb zakncat yavvob -> princess sees the curious puzzle
|
| 1080 |
+
gnkj dcaqj mkbutakb -> bird found treasure
|
| 1081 |
+
makmob kbujt ugcrb ruoobw -> turtle reads above valley
|
| 1082 |
+
Now, decrypt the following text: mfb tbzkbm mbuzfbk tbbt",the secret teacher sees,text_encryption
|
| 1083 |
+
25bdf5be,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1084 |
+
squcxojj qovaj xvjtio -> princess reads castle
|
| 1085 |
+
tovxzoq xzvjoj tzqlewz xvbo -> teacher chases through cave
|
| 1086 |
+
viuxo aqovgj wvqaoc -> alice dreams garden
|
| 1087 |
+
rcuwzt ugvwucoj vqleca mlcaoqivca -> knight imagines around wonderland
|
| 1088 |
+
tovxzoq qovaj tzo avqr sltulc -> teacher reads the dark potion
|
| 1089 |
+
Now, decrypt the following text: qvnnut pliilmj tzo avqr wvqaoc",rabbit follows the dark garden,text_encryption
|
| 1090 |
+
26e2d26a,"In Alice's Wonderland, the gravitational constant has been secretly changed. Here are some example observations:
|
| 1091 |
+
For t = 2.78s, distance = 46.94 m
|
| 1092 |
+
For t = 2.02s, distance = 24.78 m
|
| 1093 |
+
For t = 2.99s, distance = 54.3 m
|
| 1094 |
+
For t = 4.64s, distance = 130.76 m
|
| 1095 |
+
For t = 3.37s, distance = 68.98 m
|
| 1096 |
+
Now, determine the falling distance for t = 3.94s given d = 0.5*g*t^2.",94.29,gravity_constant
|
| 1097 |
+
26e48e98,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1098 |
+
%]`]< = ]""<%
|
| 1099 |
+
""#/|< = {""%
|
| 1100 |
+
]@)@| = @
|
| 1101 |
+
#|`({ = {<@#
|
| 1102 |
+
#|){( = )#]
|
| 1103 |
+
Now, determine the result for: ""])%{",){|,equation_transform
|
| 1104 |
+
26fe52a0,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1105 |
+
ofrrmn bague rxqaue zmrofoq -> rabbit found beyond library
|
| 1106 |
+
dfn bazzajw rxqaue baoxwn -> cat follows beyond forest
|
| 1107 |
+
fzmdx doxfnxw nkx tfcmdfz txwwfcx -> alice creates the magical message
|
| 1108 |
+
nkx romckn wngexun xvlzaoxw -> the bright student explores
|
| 1109 |
+
nkx tqwnxomagw ygxxu bazzajw -> the mysterious queen follows
|
| 1110 |
+
Now, decrypt the following text: fzmdx dkfwxw nkx dgomagw dfwnzx",alice chases the curious castle,text_encryption
|
| 1111 |
+
270c6986,"In Alice's Wonderland, numbers are secretly converted into a different numeral system. Some examples are given below:
|
| 1112 |
+
3 -> III
|
| 1113 |
+
40 -> XL
|
| 1114 |
+
22 -> XXII
|
| 1115 |
+
45 -> XLV
|
| 1116 |
+
Now, write the number 29 in the Wonderland numeral system.",XXIX,numeral_system
|
| 1117 |
+
274def88,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1118 |
+
33*74 = 2551
|
| 1119 |
+
29-79 = -5
|
| 1120 |
+
17+69 = 861
|
| 1121 |
+
01-72 = -71
|
| 1122 |
+
42*38 = 3991
|
| 1123 |
+
Now, determine the result for: 85-92",92,equation_transform
|
| 1124 |
+
2764222d,"In Alice's Wonderland, secret encryption rules are used on text. Here are some examples:
|
| 1125 |
+
awxxo jfiqzuxti sdr -> queen discovers map
|
| 1126 |
+
khx iktdovx qdk ikwjfxi -> the strange cat studies
|
| 1127 |
+
lfov ndkqhxi khtzwvh nzojxtmdoj -> king watches through wonderland
|
| 1128 |
+
kwtkmx ixxi rzkfzo -> turtle sees potion
|
| 1129 |
+
Now, decrypt the following text: eftj jtdni khx nfix ikztc",bird draws the wise story,text_encryption
|
| 1130 |
+
27cec7a9,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1131 |
+
62!34 = 95
|
| 1132 |
+
17%40 = %23
|
| 1133 |
+
52:35 = 5235
|
| 1134 |
+
52%99 = %47
|
| 1135 |
+
90:55 = 9055
|
| 1136 |
+
Now, determine the result for: 33:41",3341,equation_transform
|
| 1137 |
+
28b0ff48,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1138 |
+
/'+|# = ""/
|
| 1139 |
+
(?-(' = '
|
| 1140 |
+
^""*'# = /]|(
|
| 1141 |
+
Now, determine the result for: |^-^^",'],equation_transform
|
| 1142 |
+
294453b5,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1143 |
+
@!->: = `
|
| 1144 |
+
&@*:` = &`&(
|
| 1145 |
+
@!-)! = !`
|
| 1146 |
+
Now, determine the result for: ##-!)",&(,equation_transform
|
| 1147 |
+
29e458d6,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1148 |
+
|
| 1149 |
+
Here are some examples of input -> output:
|
| 1150 |
+
10110101 -> 10010000
|
| 1151 |
+
01110101 -> 00010000
|
| 1152 |
+
10001100 -> 01000110
|
| 1153 |
+
11000010 -> 01100001
|
| 1154 |
+
01001011 -> 00100001
|
| 1155 |
+
10100111 -> 10010001
|
| 1156 |
+
00011010 -> 00001001
|
| 1157 |
+
10010101 -> 11000000
|
| 1158 |
+
00111001 -> 10001100
|
| 1159 |
+
|
| 1160 |
+
Now, determine the output for: 00100100",00010010,bit_manipulation
|
| 1161 |
+
2a5d4790,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1162 |
+
|
| 1163 |
+
Here are some examples of input -> output:
|
| 1164 |
+
00000111 -> 01110011
|
| 1165 |
+
11011110 -> 11101111
|
| 1166 |
+
01000000 -> 00100100
|
| 1167 |
+
01111100 -> 11111111
|
| 1168 |
+
11100110 -> 01111111
|
| 1169 |
+
10111100 -> 11011111
|
| 1170 |
+
00000011 -> 00110001
|
| 1171 |
+
00101100 -> 11010110
|
| 1172 |
+
|
| 1173 |
+
Now, determine the output for: 01111111",11111111,bit_manipulation
|
| 1174 |
+
2af7134e,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1175 |
+
13+14 = 1
|
| 1176 |
+
92+33 = 59
|
| 1177 |
+
95}54 = 9554
|
| 1178 |
+
56+21 = 35
|
| 1179 |
+
Now, determine the result for: 61+41",20,equation_transform
|
| 1180 |
+
2d3547af,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1181 |
+
#}`)$ = }\
|
| 1182 |
+
$<(>/ = (^/
|
| 1183 |
+
!}&#< = $)^}
|
| 1184 |
+
>\`## = )$<
|
| 1185 |
+
Now, determine the result for: \$&\\",))^),equation_transform
|
| 1186 |
+
2e2d60b2,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1187 |
+
24*52 = 1501
|
| 1188 |
+
31*51 = 691
|
| 1189 |
+
05+52 = 67
|
| 1190 |
+
41+52 = 04
|
| 1191 |
+
Now, determine the result for: 85+11",07,equation_transform
|
| 1192 |
+
2ead53dc,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1193 |
+
|
| 1194 |
+
Here are some examples of input -> output:
|
| 1195 |
+
10001010 -> 00001000
|
| 1196 |
+
10011111 -> 00001001
|
| 1197 |
+
01101000 -> 00000110
|
| 1198 |
+
11110001 -> 00001111
|
| 1199 |
+
10011100 -> 00001001
|
| 1200 |
+
11111011 -> 00001111
|
| 1201 |
+
10101100 -> 00001010
|
| 1202 |
+
00101101 -> 00000010
|
| 1203 |
+
11000111 -> 00001100
|
| 1204 |
+
|
| 1205 |
+
Now, determine the output for: 01011010",00000101,bit_manipulation
|
| 1206 |
+
2facfaa4,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1207 |
+
|
| 1208 |
+
Here are some examples of input -> output:
|
| 1209 |
+
01111110 -> 11111101
|
| 1210 |
+
00111110 -> 01111100
|
| 1211 |
+
00110001 -> 01100010
|
| 1212 |
+
10011100 -> 00111010
|
| 1213 |
+
10110000 -> 01100010
|
| 1214 |
+
10110111 -> 01101100
|
| 1215 |
+
10001010 -> 00010110
|
| 1216 |
+
|
| 1217 |
+
Now, determine the output for: 10011110",00111110,bit_manipulation
|
| 1218 |
+
30ac5c8e,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1219 |
+
&}-@) = -\@
|
| 1220 |
+
:/*/} = #/&?
|
| 1221 |
+
}&*#"" = #&\}
|
| 1222 |
+
\}*)@ = &&#?
|
| 1223 |
+
""\+#\ = ::?
|
| 1224 |
+
Now, determine the result for: @\+}?",)#?,equation_transform
|
| 1225 |
+
30ba0cf4,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1226 |
+
|
| 1227 |
+
Here are some examples of input -> output:
|
| 1228 |
+
10110110 -> 10101101
|
| 1229 |
+
10101011 -> 11101011
|
| 1230 |
+
00111011 -> 11001110
|
| 1231 |
+
01001010 -> 10010010
|
| 1232 |
+
11001001 -> 01110011
|
| 1233 |
+
01100110 -> 10011001
|
| 1234 |
+
11100010 -> 10111001
|
| 1235 |
+
11011000 -> 00110111
|
| 1236 |
+
|
| 1237 |
+
Now, determine the output for: 10110101",01101101,bit_manipulation
|
| 1238 |
+
333d93ec,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1239 |
+
85+27 = 131
|
| 1240 |
+
16+97 = 141
|
| 1241 |
+
16+76 = 921
|
| 1242 |
+
86-28 = 41
|
| 1243 |
+
63-52 = 11
|
| 1244 |
+
Now, determine the result for: 44-73",7,equation_transform
|
| 1245 |
+
3383d4ec,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1246 |
+
88-12 = 76
|
| 1247 |
+
32+44 = 4432
|
| 1248 |
+
32+72 = 7232
|
| 1249 |
+
Now, determine the result for: 39-72",66,equation_transform
|
| 1250 |
+
339149c9,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1251 |
+
34-93 = 4
|
| 1252 |
+
53+23 = 2353
|
| 1253 |
+
81*69 = 8271
|
| 1254 |
+
99-34 = 31
|
| 1255 |
+
34-63 = 7
|
| 1256 |
+
Now, determine the result for: 32-62",3,equation_transform
|
| 1257 |
+
343095d3,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1258 |
+
|
| 1259 |
+
Here are some examples of input -> output:
|
| 1260 |
+
01100111 -> 10001110
|
| 1261 |
+
11011100 -> 00111001
|
| 1262 |
+
01101111 -> 00001110
|
| 1263 |
+
10010010 -> 00000101
|
| 1264 |
+
00101101 -> 00001010
|
| 1265 |
+
01001001 -> 00000010
|
| 1266 |
+
01000110 -> 10001100
|
| 1267 |
+
00000001 -> 00000010
|
| 1268 |
+
10101100 -> 00011001
|
| 1269 |
+
01100011 -> 11000110
|
| 1270 |
+
|
| 1271 |
+
Now, determine the output for: 01111010",01010100,bit_manipulation
|
| 1272 |
+
34c563c5,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1273 |
+
28`44 = 83`
|
| 1274 |
+
77\54 = 221
|
| 1275 |
+
84\34 = 19
|
| 1276 |
+
Now, determine the result for: 45`41",04`,equation_transform
|
| 1277 |
+
3595c82c,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1278 |
+
|
| 1279 |
+
Here are some examples of input -> output:
|
| 1280 |
+
11110110 -> 01111101
|
| 1281 |
+
10100001 -> 10100111
|
| 1282 |
+
11100011 -> 00000111
|
| 1283 |
+
01011110 -> 10100110
|
| 1284 |
+
10010100 -> 10011111
|
| 1285 |
+
10011100 -> 00001111
|
| 1286 |
+
00011111 -> 00110000
|
| 1287 |
+
|
| 1288 |
+
Now, determine the output for: 10000110",10011011,bit_manipulation
|
| 1289 |
+
368f20dd,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1290 |
+
|
| 1291 |
+
Here are some examples of input -> output:
|
| 1292 |
+
00000100 -> 00100000
|
| 1293 |
+
11100110 -> 00111110
|
| 1294 |
+
11000101 -> 00100100
|
| 1295 |
+
00111101 -> 11101011
|
| 1296 |
+
00101110 -> 01110010
|
| 1297 |
+
10110111 -> 10110011
|
| 1298 |
+
11101111 -> 01110110
|
| 1299 |
+
00110111 -> 10111011
|
| 1300 |
+
11111010 -> 11011111
|
| 1301 |
+
|
| 1302 |
+
Now, determine the output for: 01010000",10000101,bit_manipulation
|
| 1303 |
+
386b6d03,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1304 |
+
47[35 = 2293
|
| 1305 |
+
82-68 = -85
|
| 1306 |
+
09[97 = 0117
|
| 1307 |
+
Now, determine the result for: 79'97",671,equation_transform
|
| 1308 |
+
39c237c7,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1309 |
+
)\*// = ])`\
|
| 1310 |
+
/{+'{ = /{'{
|
| 1311 |
+
]&+/` = ]&/`
|
| 1312 |
+
Now, determine the result for: {]+``",{]``,equation_transform
|
| 1313 |
+
3a148f6a,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1314 |
+
|
| 1315 |
+
Here are some examples of input -> output:
|
| 1316 |
+
00100011 -> 00101000
|
| 1317 |
+
10100000 -> 11101111
|
| 1318 |
+
10011000 -> 10000011
|
| 1319 |
+
11001010 -> 00001111
|
| 1320 |
+
00111000 -> 10010011
|
| 1321 |
+
01001011 -> 11001100
|
| 1322 |
+
10000111 -> 00110011
|
| 1323 |
+
00110001 -> 00000101
|
| 1324 |
+
00000100 -> 11110101
|
| 1325 |
+
01111101 -> 10111011
|
| 1326 |
+
|
| 1327 |
+
Now, determine the output for: 10001111",00100111,bit_manipulation
|
| 1328 |
+
3a67aa26,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1329 |
+
|
| 1330 |
+
Here are some examples of input -> output:
|
| 1331 |
+
01101110 -> 01011011
|
| 1332 |
+
11011110 -> 00110111
|
| 1333 |
+
11001000 -> 10111011
|
| 1334 |
+
10011001 -> 01110111
|
| 1335 |
+
10100000 -> 10101111
|
| 1336 |
+
01111011 -> 10011110
|
| 1337 |
+
01001110 -> 01011011
|
| 1338 |
+
00001111 -> 10111011
|
| 1339 |
+
11101011 -> 11111010
|
| 1340 |
+
11110010 -> 00111110
|
| 1341 |
+
|
| 1342 |
+
Now, determine the output for: 10111010",00101110,bit_manipulation
|
| 1343 |
+
3a7dd604,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1344 |
+
|
| 1345 |
+
Here are some examples of input -> output:
|
| 1346 |
+
00001011 -> 10111010
|
| 1347 |
+
01110001 -> 00000111
|
| 1348 |
+
00110011 -> 10100110
|
| 1349 |
+
10111111 -> 11100001
|
| 1350 |
+
11110011 -> 11000111
|
| 1351 |
+
00101100 -> 11101001
|
| 1352 |
+
00000011 -> 10111110
|
| 1353 |
+
|
| 1354 |
+
Now, determine the output for: 01101010",01001010,bit_manipulation
|
| 1355 |
+
3a90fdf6,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1356 |
+
|
| 1357 |
+
Here are some examples of input -> output:
|
| 1358 |
+
00100011 -> 00000000
|
| 1359 |
+
11111000 -> 00000000
|
| 1360 |
+
01100010 -> 00000000
|
| 1361 |
+
11011010 -> 01000000
|
| 1362 |
+
00101000 -> 00000000
|
| 1363 |
+
00001100 -> 00000000
|
| 1364 |
+
01000111 -> 00000000
|
| 1365 |
+
01001001 -> 00100000
|
| 1366 |
+
11101001 -> 00100000
|
| 1367 |
+
|
| 1368 |
+
Now, determine the output for: 11111101",10100000,bit_manipulation
|
| 1369 |
+
3ace787f,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1370 |
+
|
| 1371 |
+
Here are some examples of input -> output:
|
| 1372 |
+
11101100 -> 10100111
|
| 1373 |
+
11011000 -> 00001111
|
| 1374 |
+
11010101 -> 00100110
|
| 1375 |
+
00101111 -> 01001101
|
| 1376 |
+
01011001 -> 01100011
|
| 1377 |
+
11110101 -> 00101111
|
| 1378 |
+
11100101 -> 10101111
|
| 1379 |
+
01100101 -> 10001111
|
| 1380 |
+
|
| 1381 |
+
Now, determine the output for: 01111011",11111011,bit_manipulation
|
| 1382 |
+
3c12aeb9,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1383 |
+
68|06 = 62
|
| 1384 |
+
12$29 = 311
|
| 1385 |
+
29$51 = 701
|
| 1386 |
+
98|25 = 73
|
| 1387 |
+
27$85 = 031
|
| 1388 |
+
Now, determine the result for: 27$15",321,equation_transform
|
| 1389 |
+
3c424916,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1390 |
+
26*84 = 5792
|
| 1391 |
+
22+78 = 901
|
| 1392 |
+
49*64 = 3234
|
| 1393 |
+
Now, determine the result for: 82*55",9351,equation_transform
|
| 1394 |
+
3cb3fd89,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1395 |
+
@)-@\ = -)
|
| 1396 |
+
[$*$$ = [|{\
|
| 1397 |
+
$]+!\ = |$|
|
| 1398 |
+
$[*$& = &@![
|
| 1399 |
+
Now, determine the result for: ]$*$)",[[&],equation_transform
|
| 1400 |
+
3cd80c64,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1401 |
+
|
| 1402 |
+
Here are some examples of input -> output:
|
| 1403 |
+
00011101 -> 00001110
|
| 1404 |
+
00100101 -> 00010010
|
| 1405 |
+
11111111 -> 01111111
|
| 1406 |
+
00100000 -> 00010000
|
| 1407 |
+
00001011 -> 00000101
|
| 1408 |
+
00000100 -> 00000010
|
| 1409 |
+
10110101 -> 01011010
|
| 1410 |
+
|
| 1411 |
+
Now, determine the output for: 11001000",01100100,bit_manipulation
|
| 1412 |
+
3cfc5f9c,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1413 |
+
|
| 1414 |
+
Here are some examples of input -> output:
|
| 1415 |
+
00100010 -> 11001111
|
| 1416 |
+
00001000 -> 00111111
|
| 1417 |
+
10001010 -> 00001111
|
| 1418 |
+
11110101 -> 00000111
|
| 1419 |
+
01001001 -> 00100111
|
| 1420 |
+
01110100 -> 00011111
|
| 1421 |
+
11101011 -> 00010111
|
| 1422 |
+
|
| 1423 |
+
Now, determine the output for: 11101111",01110111,bit_manipulation
|
| 1424 |
+
3d24aef4,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1425 |
+
|
| 1426 |
+
Here are some examples of input -> output:
|
| 1427 |
+
00111001 -> 11001001
|
| 1428 |
+
00101000 -> 01000001
|
| 1429 |
+
01111001 -> 11001011
|
| 1430 |
+
10000011 -> 00011101
|
| 1431 |
+
11011111 -> 11111111
|
| 1432 |
+
11110000 -> 10000110
|
| 1433 |
+
01110011 -> 10011011
|
| 1434 |
+
00001000 -> 01000000
|
| 1435 |
+
01101100 -> 01100011
|
| 1436 |
+
|
| 1437 |
+
Now, determine the output for: 10010100",10100101,bit_manipulation
|
| 1438 |
+
3ee36e0a,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1439 |
+
15-69 = -54
|
| 1440 |
+
74)02 = 149
|
| 1441 |
+
24>42 = 66
|
| 1442 |
+
Now, determine the result for: 48-99",-51,equation_transform
|
| 1443 |
+
3fa49035,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1444 |
+
73/78 = 150
|
| 1445 |
+
96#58 = 38
|
| 1446 |
+
88>60 = 5280
|
| 1447 |
+
23/75 = 97
|
| 1448 |
+
Now, determine the result for: 24>29",696,equation_transform
|
| 1449 |
+
3feeabea,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1450 |
+
|
| 1451 |
+
Here are some examples of input -> output:
|
| 1452 |
+
10000001 -> 00010010
|
| 1453 |
+
11010000 -> 00000011
|
| 1454 |
+
10110011 -> 00110010
|
| 1455 |
+
11111011 -> 10110011
|
| 1456 |
+
01001111 -> 11110001
|
| 1457 |
+
00100101 -> 01010000
|
| 1458 |
+
01001000 -> 10000001
|
| 1459 |
+
10010000 -> 00000010
|
| 1460 |
+
01010010 -> 00100001
|
| 1461 |
+
|
| 1462 |
+
Now, determine the output for: 10101001",10010010,bit_manipulation
|
| 1463 |
+
4166067c,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1464 |
+
|
| 1465 |
+
Here are some examples of input -> output:
|
| 1466 |
+
01100101 -> 01011001
|
| 1467 |
+
11110111 -> 01111101
|
| 1468 |
+
01100110 -> 10011001
|
| 1469 |
+
01110110 -> 10011101
|
| 1470 |
+
11101101 -> 01111011
|
| 1471 |
+
11000001 -> 01110000
|
| 1472 |
+
00110101 -> 01001101
|
| 1473 |
+
|
| 1474 |
+
Now, determine the output for: 11011011",01110110,bit_manipulation
|
| 1475 |
+
41e6cbfc,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1476 |
+
05+12 = 1205
|
| 1477 |
+
02*63 = 6302
|
| 1478 |
+
69+97 = 9769
|
| 1479 |
+
61+47 = 4761
|
| 1480 |
+
Now, determine the result for: 18+93",9318,equation_transform
|
| 1481 |
+
42cb233d,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1482 |
+
81*84 = 368
|
| 1483 |
+
17+26 = 431
|
| 1484 |
+
41-94 = -53
|
| 1485 |
+
Now, determine the result for: 59+29",881,equation_transform
|
| 1486 |
+
432b1110,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1487 |
+
]{+/] = ]{/]
|
| 1488 |
+
/[+%\ = /[%\
|
| 1489 |
+
@[+{@ = @[{@
|
| 1490 |
+
%/+]% = %/]%
|
| 1491 |
+
Now, determine the result for: \{*<?",%[:?,equation_transform
|
| 1492 |
+
4353cd0b,"In Alice's Wonderland, a secret bit manipulation rule transforms 8-bit binary numbers. The transformation involves operations like bit shifts, rotations, XOR, AND, OR, NOT, and possibly majority or choice functions.
|
| 1493 |
+
|
| 1494 |
+
Here are some examples of input -> output:
|
| 1495 |
+
01110010 -> 11000110
|
| 1496 |
+
10001011 -> 00111101
|
| 1497 |
+
11101110 -> 10100101
|
| 1498 |
+
00101111 -> 10111001
|
| 1499 |
+
11001100 -> 00101001
|
| 1500 |
+
01011000 -> 01101011
|
| 1501 |
+
00110011 -> 11001010
|
| 1502 |
+
|
| 1503 |
+
Now, determine the output for: 01001010",00100001,bit_manipulation
|
| 1504 |
+
44398869,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1505 |
+
09^83 = 0243
|
| 1506 |
+
97^26 = 8984
|
| 1507 |
+
37^04 = 0292
|
| 1508 |
+
77^69 = 2937
|
| 1509 |
+
67+97 = 551
|
| 1510 |
+
Now, determine the result for: 54^17",5913,equation_transform
|
| 1511 |
+
47c1d8f5,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1512 |
+
{/*@] = {(
|
| 1513 |
+
@%#]] = ]^
|
| 1514 |
+
]^#]` = {@]
|
| 1515 |
+
>(*^} = *}]
|
| 1516 |
+
Now, determine the result for: /`#%`",]%],equation_transform
|
| 1517 |
+
48c25e0e,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1518 |
+
82-18 = 1476
|
| 1519 |
+
93^50 = ^43
|
| 1520 |
+
26-61 = 1586
|
| 1521 |
+
Now, determine the result for: 43&11",53,equation_transform
|
| 1522 |
+
491b8ea5,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1523 |
+
!^+){ = |}
|
| 1524 |
+
]/*|| = ]/||
|
| 1525 |
+
]@-|] = !)
|
| 1526 |
+
Now, determine the result for: @|-]!",)!,equation_transform
|
| 1527 |
+
4aeed935,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1528 |
+
24*74 = 7424
|
| 1529 |
+
75+78 = 7875
|
| 1530 |
+
31+96 = 9631
|
| 1531 |
+
07-19 = -12
|
| 1532 |
+
Now, determine the result for: 55*14",1455,equation_transform
|
| 1533 |
+
4bb8c6cd,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1534 |
+
`!-|: = -]!
|
| 1535 |
+
]/-]: = `
|
| 1536 |
+
'`-\' = -`/
|
| 1537 |
+
]`+\| = ]`\|
|
| 1538 |
+
]^-|/ = -`|
|
| 1539 |
+
Now, determine the result for: ]}*\!",]}\!,equation_transform
|
| 1540 |
+
4bfd095a,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1541 |
+
{%*)) = )){
|
| 1542 |
+
)/*/"" = [^^{
|
| 1543 |
+
)""-\[ = -\\
|
| 1544 |
+
{)*[{ = \\@
|
| 1545 |
+
Now, determine the result for: @/*[@",{<<<,equation_transform
|
| 1546 |
+
4dbec546,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1547 |
+
61-22 = -6
|
| 1548 |
+
51+72 = 24
|
| 1549 |
+
63*47 = 4763
|
| 1550 |
+
18*63 = 6318
|
| 1551 |
+
08*67 = 6708
|
| 1552 |
+
Now, determine the result for: 06+65",611,equation_transform
|
| 1553 |
+
4ed6b56f,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1554 |
+
`'+:' = (`]
|
| 1555 |
+
]:*}> = !""(/
|
| 1556 |
+
:}*:' = :/(/
|
| 1557 |
+
>]-(( = '!
|
| 1558 |
+
Now, determine the result for: !:*`(","(""/""",equation_transform
|
| 1559 |
+
518deb39,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1560 |
+
<'+<"" = (>
|
| 1561 |
+
""'-$< = '<
|
| 1562 |
+
(""*(< = <<!!
|
| 1563 |
+
!$*<> = !^\
|
| 1564 |
+
Now, determine the result for: $$-<>",$,equation_transform
|
| 1565 |
+
528b694b,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1566 |
+
@>+^\ = @@^>
|
| 1567 |
+
]@<@\ = <')
|
| 1568 |
+
'>+^$ = @]{)
|
| 1569 |
+
@'<)> = "")
|
| 1570 |
+
Now, determine the result for: >]<])","""'",equation_transform
|
| 1571 |
+
528ec0d8,"In Alice's Wonderland, a secret set of transformation rules is applied to equations. Below are a few examples:
|
| 1572 |
+
38(96 = 3648
|
| 1573 |
+
13(43 = 559
|
| 1574 |
+
42#38 = 81
|
| 1575 |
+
41(94 = 3854
|
| 1576 |
+
Now, determine the result for: 11-50",-39,equation_transform
|
runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/run_v1244-ckpt120-vs-086-subset200-20260615T203643Z_remote.sh
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
exec 2>&1
|
| 2 |
+
export DEBIAN_FRONTEND=noninteractive PYTHONDONTWRITEBYTECODE=1 PYTHONIOENCODING=utf-8 PYTHONUTF8=1
|
| 3 |
+
export LC_ALL=C.UTF-8 LANG=C.UTF-8 TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1
|
| 4 |
+
export HF_HOME=/tmp/kg1_hf_home HF_HUB_ENABLE_HF_TRANSFER=1
|
| 5 |
+
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
| 6 |
+
echo "=== KG1 V1244 EVAL ckpt120 vs 086 subset200 START (image=nvcr.io/nvidia/vllm:26.02-py3 flavor=a100-large) ==="
|
| 7 |
+
echo "[0] locate python"
|
| 8 |
+
PYBIN=$(command -v python3 || command -v python || true)
|
| 9 |
+
echo "[0] PYBIN=$PYBIN"; $PYBIN --version || echo "[0] NO PYTHON rc=$?"
|
| 10 |
+
echo "[0b] workspace listing:"; ls -la "/tmp/ws/runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/" || echo "[0b] WS LS FAILED rc=$?"
|
| 11 |
+
rm -rf /tmp/kg1_hf_home /tmp/kg1/repo /tmp/kg1/out /tmp/kg1/adapter_086 /tmp/kg1/adapter_120
|
| 12 |
+
mkdir -p /tmp/kg1_hf_home /tmp/kg1/repo /tmp/kg1/out /tmp/kg1/adapter_086 /tmp/kg1/adapter_120
|
| 13 |
+
echo "[1] GPU check"
|
| 14 |
+
$PYBIN -c "import torch; ok=torch.cuda.is_available(); print('[1] cuda',ok, torch.cuda.get_device_name(0) if ok else 'NONE', round(torch.cuda.get_device_properties(0).total_memory/1024**3,1) if ok else 0)" || echo "[1] GPU CHECK FAILED rc=$?"
|
| 15 |
+
echo "[2] pip extras"
|
| 16 |
+
$PYBIN -m pip install -q --no-cache-dir pandas hf_transfer huggingface_hub && echo "[2] pip ok" || echo "[2] pip FAILED rc=$?"
|
| 17 |
+
echo "[3] copy workspace -> /tmp/kg1/repo"
|
| 18 |
+
cp -R "/tmp/ws/runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/." /tmp/kg1/repo/ && echo "[3] cp ok" || echo "[3] cp FAILED rc=$?"
|
| 19 |
+
cd /tmp/kg1/repo && echo "[3b] cwd=$(pwd)"; ls scripts src || echo "[3b] ls FAILED"
|
| 20 |
+
echo "[4] py_compile"
|
| 21 |
+
$PYBIN -m py_compile scripts/evaluate_lora_adapters_batch.py scripts/evaluate_lora_adapter.py scripts/kg1_score_live.py src/competition_utils.py && echo "[4] compile ok" || echo "[4] compile FAILED rc=$?"
|
| 22 |
+
echo "[5] subset sha"
|
| 23 |
+
$PYBIN -c "import hashlib;d=hashlib.sha256(open('artifacts/v1244_cot_safe/subset200_solution.csv','rb').read()).hexdigest();print('[5] subset_sha',d);assert d=='dcd5cafe2b9b3ff4f0da1ebc4fa30b6e588112f1d3025a636bd16dea443f7c6d','SHA MISMATCH'" && echo "[5] sha ok" || echo "[5] sha FAILED rc=$?"
|
| 24 |
+
echo "[6] snapshot adapters"
|
| 25 |
+
$PYBIN - <<'PY'
|
| 26 |
+
import json, os
|
| 27 |
+
from pathlib import Path
|
| 28 |
+
from huggingface_hub import snapshot_download
|
| 29 |
+
tok = os.environ.get("HF_TOKEN") or None
|
| 30 |
+
def grab(repo, rev, sub, dest):
|
| 31 |
+
sub = (sub or "").strip("/")
|
| 32 |
+
pats = [sub + "/*"] if sub else ["*"]
|
| 33 |
+
root = Path(snapshot_download(repo_id=repo, revision=rev, local_dir=dest, allow_patterns=pats, token=tok, force_download=True))
|
| 34 |
+
d = root / sub if sub else root
|
| 35 |
+
assert (d/"adapter_config.json").exists() and (d/"adapter_model.safetensors").exists(), f"incomplete adapter {repo}:{sub}"
|
| 36 |
+
cfg = json.loads((d/"adapter_config.json").read_text())
|
| 37 |
+
print(f"[6] adapter {repo} sub={sub!r} r={cfg.get('r')} alpha={cfg.get('lora_alpha')} dir={d}", flush=True)
|
| 38 |
+
return str(d)
|
| 39 |
+
a086 = grab("felipesp1983/kg1-recovered-v291-v290-checkpoint6-submit086", "f4134a6d223249d27be2f1c5d94ed59d118d1ce5", "", "/tmp/kg1/adapter_086")
|
| 40 |
+
a120 = grab("felipesp1983/kg1-v1244-cot-candidate", "main", "runs/v1244_train_20260615_144332/checkpoint-120", "/tmp/kg1/adapter_120")
|
| 41 |
+
cands = [
|
| 42 |
+
{"name": "086_baseline", "adapter": a086, "source_kind": "hf_model_repo"},
|
| 43 |
+
{"name": "v1244_ckpt120", "adapter": a120, "source_kind": "hf_model_repo_subfolder"},
|
| 44 |
+
]
|
| 45 |
+
Path("/tmp/kg1/candidates.json").write_text(json.dumps(cands, indent=2))
|
| 46 |
+
print("[6] candidates.json="+json.dumps(cands), flush=True)
|
| 47 |
+
PY
|
| 48 |
+
echo "[6] snapshot rc=$?"
|
| 49 |
+
echo "=== [7] BATCH EVAL START ==="
|
| 50 |
+
timeout --foreground 6900 $PYBIN scripts/evaluate_lora_adapters_batch.py --solution-csv "artifacts/v1244_cot_safe/subset200_solution.csv" --questions-csv "artifacts/v1244_cot_safe/subset200_solution.csv" --candidates-json /tmp/kg1/candidates.json --base-model-path "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16" --label-prefix v1244_subset200 --seed 42 --limit 0 --output-dir /tmp/kg1/out/eval --max-tokens 7680 --max-model-len 8192 --max-num-seqs 64 --gpu-memory-utilization 0.85 --warmup-rows 4 --continue-on-error
|
| 51 |
+
rc=$?
|
| 52 |
+
echo "[7] batch_eval_rc=$rc"
|
| 53 |
+
echo "[8] summary + upload"
|
| 54 |
+
$PYBIN - <<'PY'
|
| 55 |
+
import json, os
|
| 56 |
+
from pathlib import Path
|
| 57 |
+
p = Path("/tmp/kg1/out/eval/batch_candidate_summary.json")
|
| 58 |
+
if p.exists():
|
| 59 |
+
s = json.loads(p.read_text())
|
| 60 |
+
print("[8] BATCH_SUMMARY="+json.dumps(s)[:4000], flush=True)
|
| 61 |
+
for row in (s.get("rows") or []):
|
| 62 |
+
print("[8] CAND %s correct=%s/%s bit=%s eq=%s trunc=%s status=%s" % (
|
| 63 |
+
row.get("name"), row.get("strict_boxed_correct", row.get("correct")), row.get("rows"),
|
| 64 |
+
row.get("bit_manipulation_correct"), row.get("equation_transform_correct"),
|
| 65 |
+
row.get("truncated"), row.get("status")), flush=True)
|
| 66 |
+
else:
|
| 67 |
+
print("[8] BATCH_SUMMARY_MISSING", flush=True)
|
| 68 |
+
try:
|
| 69 |
+
from huggingface_hub import HfApi
|
| 70 |
+
HfApi(token=os.environ.get("HF_TOKEN") or None).upload_folder(
|
| 71 |
+
repo_id="felipesp1983/kg1-v1244-cot-candidate", repo_type="model", folder_path="/tmp/kg1/out/eval",
|
| 72 |
+
path_in_repo="evals/v1244-ckpt120-vs-086-subset200-20260615T203643Z", commit_message="V1244 ckpt120 vs 086 subset200 eval")
|
| 73 |
+
print("[8] UPLOAD_OK felipesp1983/kg1-v1244-cot-candidate/evals/v1244-ckpt120-vs-086-subset200-20260615T203643Z", flush=True)
|
| 74 |
+
except Exception as e:
|
| 75 |
+
print("[8] UPLOAD_FAILED", str(e)[:200], flush=True)
|
| 76 |
+
PY
|
| 77 |
+
echo "=== KG1 V1244 EVAL END (rc=$rc) ==="
|
| 78 |
+
exit 0
|
runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/scripts/evaluate_lora_adapter.py
ADDED
|
@@ -0,0 +1,670 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Official-like vLLM evaluator for Nemotron LoRA adapters.
|
| 3 |
+
|
| 4 |
+
This script is intentionally evaluation-only. It does not train, package, or
|
| 5 |
+
submit. By default it generates answers with the scoring-facing settings
|
| 6 |
+
visible in the downloaded public Kaggle metric notebook: LoRA enabled, max
|
| 7 |
+
rank 32, 8192 context, 7680 output tokens, temperature 0.0/top_p 1.0,
|
| 8 |
+
official final-answer extraction, and per-family ACC.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import argparse
|
| 14 |
+
import json
|
| 15 |
+
import os
|
| 16 |
+
import sys
|
| 17 |
+
import time
|
| 18 |
+
from collections import defaultdict
|
| 19 |
+
from datetime import datetime, timezone
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
from typing import Any
|
| 22 |
+
|
| 23 |
+
import pandas as pd
|
| 24 |
+
|
| 25 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 26 |
+
if str(ROOT) not in sys.path:
|
| 27 |
+
sys.path.insert(0, str(ROOT))
|
| 28 |
+
|
| 29 |
+
from src.competition_utils import ( # noqa: E402
|
| 30 |
+
MODEL_NAME,
|
| 31 |
+
OFFICIAL_INFERENCE_CONFIG,
|
| 32 |
+
PROMPT_SUFFIX,
|
| 33 |
+
canonical_answer,
|
| 34 |
+
classify_puzzle,
|
| 35 |
+
ensure_prompt_suffix,
|
| 36 |
+
extract_boxed_answers,
|
| 37 |
+
extract_final_answer,
|
| 38 |
+
extract_final_boxed_answer,
|
| 39 |
+
has_closed_boxed_answer,
|
| 40 |
+
verify_answer,
|
| 41 |
+
verify_strict_boxed_answer,
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def utc_now() -> str:
|
| 46 |
+
return datetime.now(timezone.utc).isoformat()
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def parse_seeds(raw: str | int | None) -> list[int]:
|
| 50 |
+
if raw is None or raw == "":
|
| 51 |
+
return [42]
|
| 52 |
+
if isinstance(raw, int):
|
| 53 |
+
return [raw]
|
| 54 |
+
seeds: list[int] = []
|
| 55 |
+
for chunk in str(raw).replace(";", ",").split(","):
|
| 56 |
+
chunk = chunk.strip()
|
| 57 |
+
if chunk:
|
| 58 |
+
seeds.append(int(chunk))
|
| 59 |
+
return seeds or [42]
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def resolve_base_model_path(base_model_path: str = "") -> str:
|
| 63 |
+
"""Resolve the base model path for Colab, Kaggle, or local H100 runs."""
|
| 64 |
+
|
| 65 |
+
if base_model_path:
|
| 66 |
+
return base_model_path
|
| 67 |
+
env_path = os.environ.get("KG1_BASE_MODEL_PATH") or os.environ.get("BASE_MODEL_PATH")
|
| 68 |
+
if env_path:
|
| 69 |
+
return env_path
|
| 70 |
+
|
| 71 |
+
kaggle_candidates = [
|
| 72 |
+
"/kaggle/input/models/metric/nemotron-3-nano-30b-a3b-bf16/transformers/default/1",
|
| 73 |
+
"/kaggle/input/models/metric/nemotron-3-nano-30b-a3b-bf16/transformers/default",
|
| 74 |
+
"/kaggle/input/nemotron-3-nano-30b-a3b-bf16/transformers/default/1",
|
| 75 |
+
]
|
| 76 |
+
for candidate in kaggle_candidates:
|
| 77 |
+
if Path(candidate).exists():
|
| 78 |
+
return candidate
|
| 79 |
+
return MODEL_NAME
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
def resolve_model_revision(base_model_path: str, config: dict[str, Any]) -> str | None:
|
| 83 |
+
"""Use the pinned HF revision for repo IDs, but not for local model paths."""
|
| 84 |
+
|
| 85 |
+
revision = str(config.get("model_revision") or "").strip()
|
| 86 |
+
if not revision:
|
| 87 |
+
return None
|
| 88 |
+
model_text = str(base_model_path)
|
| 89 |
+
if Path(model_text).exists() or os.path.isabs(model_text):
|
| 90 |
+
return None
|
| 91 |
+
return revision
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def row_id_column(frame: pd.DataFrame) -> str:
|
| 95 |
+
for candidate in ("id", "row_id"):
|
| 96 |
+
if candidate in frame.columns:
|
| 97 |
+
return candidate
|
| 98 |
+
raise ValueError("CSV must contain an id or row_id column")
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
def read_csv_str(path: str | Path) -> pd.DataFrame:
|
| 102 |
+
"""Read challenge CSVs without numeric coercion or NA rewriting."""
|
| 103 |
+
|
| 104 |
+
frame = pd.read_csv(path, dtype=str, keep_default_na=False)
|
| 105 |
+
empty_columns = [column for column in frame.columns if not str(column).strip()]
|
| 106 |
+
if empty_columns:
|
| 107 |
+
raise ValueError(f"{path} contains empty CSV column names")
|
| 108 |
+
return frame
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def exact_answer_match(expected: object, observed: object) -> bool:
|
| 112 |
+
expected_text = canonical_answer(expected).lower()
|
| 113 |
+
observed_text = canonical_answer(observed).lower()
|
| 114 |
+
return bool(expected_text and observed_text and observed_text != "not_found" and expected_text == observed_text)
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def normalize_questions(solution: pd.DataFrame, questions: pd.DataFrame, limit: int = 0) -> pd.DataFrame:
|
| 118 |
+
solution = solution.copy()
|
| 119 |
+
questions = questions.copy()
|
| 120 |
+
sol_id = row_id_column(solution)
|
| 121 |
+
q_id = row_id_column(questions)
|
| 122 |
+
if sol_id != "id":
|
| 123 |
+
solution = solution.rename(columns={sol_id: "id"})
|
| 124 |
+
if q_id != "id":
|
| 125 |
+
questions = questions.rename(columns={q_id: "id"})
|
| 126 |
+
solution["id"] = solution["id"].astype(str)
|
| 127 |
+
questions["id"] = questions["id"].astype(str)
|
| 128 |
+
if "prompt" not in questions.columns:
|
| 129 |
+
if "prompt" not in solution.columns:
|
| 130 |
+
raise ValueError("questions or solution must contain a prompt column")
|
| 131 |
+
questions = solution[["id", "prompt"]].copy()
|
| 132 |
+
ordered = solution[["id"]].merge(questions, on="id", how="left", validate="one_to_one")
|
| 133 |
+
missing_prompt = ordered["prompt"].isna().sum()
|
| 134 |
+
if missing_prompt:
|
| 135 |
+
raise ValueError(f"questions missing prompts for {missing_prompt} solution rows")
|
| 136 |
+
if limit > 0:
|
| 137 |
+
ordered = ordered.head(limit).copy()
|
| 138 |
+
return ordered
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def validate_adapter_dir(adapter_dir: str | Path) -> Path:
|
| 142 |
+
path = Path(adapter_dir)
|
| 143 |
+
if not path.exists():
|
| 144 |
+
raise FileNotFoundError(f"adapter path does not exist: {path}")
|
| 145 |
+
if path.is_file() and path.suffix == ".zip":
|
| 146 |
+
raise ValueError("adapter zip must be extracted before vLLM evaluation")
|
| 147 |
+
config = path / "adapter_config.json"
|
| 148 |
+
if not config.exists():
|
| 149 |
+
raise FileNotFoundError(f"missing adapter_config.json: {config}")
|
| 150 |
+
model_files = list(path.glob("adapter_model.safetensors")) + list(path.glob("adapter_model.bin"))
|
| 151 |
+
if not model_files:
|
| 152 |
+
raise FileNotFoundError(f"missing adapter_model.safetensors or adapter_model.bin in {path}")
|
| 153 |
+
return path
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
def render_prompts(tokenizer: Any, questions: pd.DataFrame, config: dict[str, Any]) -> list[str]:
|
| 157 |
+
prompts: list[str] = []
|
| 158 |
+
prompt_suffix = str(config.get("prompt_suffix", PROMPT_SUFFIX))
|
| 159 |
+
enable_thinking = bool(config.get("enable_thinking", True))
|
| 160 |
+
for row in questions.itertuples(index=False):
|
| 161 |
+
user_content = ensure_prompt_suffix(getattr(row, "prompt"), prompt_suffix)
|
| 162 |
+
try:
|
| 163 |
+
prompt = tokenizer.apply_chat_template(
|
| 164 |
+
[{"role": "user", "content": user_content}],
|
| 165 |
+
tokenize=False,
|
| 166 |
+
add_generation_prompt=True,
|
| 167 |
+
enable_thinking=enable_thinking,
|
| 168 |
+
)
|
| 169 |
+
except Exception:
|
| 170 |
+
prompt = user_content
|
| 171 |
+
prompts.append(prompt)
|
| 172 |
+
return prompts
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
def _sampling_params(config: dict[str, Any], seed: int):
|
| 176 |
+
from vllm import SamplingParams
|
| 177 |
+
|
| 178 |
+
kwargs = {
|
| 179 |
+
"temperature": float(config.get("temperature", 0.0)),
|
| 180 |
+
"top_p": float(config.get("top_p", 1.0)),
|
| 181 |
+
"max_tokens": int(config.get("max_tokens", 7680)),
|
| 182 |
+
}
|
| 183 |
+
try:
|
| 184 |
+
return SamplingParams(**kwargs, seed=int(seed))
|
| 185 |
+
except TypeError:
|
| 186 |
+
return SamplingParams(**kwargs)
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
TRUNCATED_FINISH_REASONS = {
|
| 190 |
+
"length",
|
| 191 |
+
"max_tokens",
|
| 192 |
+
"max_output_tokens",
|
| 193 |
+
"token_limit",
|
| 194 |
+
"truncated",
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
def is_truncated_completion(
|
| 199 |
+
finish_reason: object,
|
| 200 |
+
completion_tokens: object,
|
| 201 |
+
max_tokens: int,
|
| 202 |
+
) -> bool:
|
| 203 |
+
"""Detect generation truncation across vLLM/HF reason variants."""
|
| 204 |
+
|
| 205 |
+
normalized = str(finish_reason or "").strip().lower()
|
| 206 |
+
if normalized in TRUNCATED_FINISH_REASONS:
|
| 207 |
+
return True
|
| 208 |
+
try:
|
| 209 |
+
token_count = int(float(str(completion_tokens).strip()))
|
| 210 |
+
except (TypeError, ValueError):
|
| 211 |
+
return False
|
| 212 |
+
return token_count >= int(max_tokens)
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
def apply_vllm_runtime_safety_settings() -> dict[str, str]:
|
| 216 |
+
"""Apply Colab-safe vLLM settings before importing/initializing vLLM.
|
| 217 |
+
|
| 218 |
+
Colab H100 runtimes may install vLLM builds where DeepGEMM is enabled by
|
| 219 |
+
default, but the `deep_gemm` backend package is absent or too old. In that
|
| 220 |
+
state vLLM can fail during engine warmup before any generation starts. The
|
| 221 |
+
challenge evaluation does not require DeepGEMM specifically, so disable it
|
| 222 |
+
unless the caller explicitly opts back in.
|
| 223 |
+
"""
|
| 224 |
+
|
| 225 |
+
allow_deep_gemm = os.environ.get("KG1_ALLOW_VLLM_DEEP_GEMM", "0").strip().lower() in {
|
| 226 |
+
"1",
|
| 227 |
+
"true",
|
| 228 |
+
"yes",
|
| 229 |
+
"on",
|
| 230 |
+
}
|
| 231 |
+
if not allow_deep_gemm:
|
| 232 |
+
os.environ["VLLM_USE_DEEP_GEMM"] = "0"
|
| 233 |
+
os.environ["VLLM_MOE_USE_DEEP_GEMM"] = "0"
|
| 234 |
+
os.environ["VLLM_USE_DEEP_GEMM_E8M0"] = "0"
|
| 235 |
+
os.environ["VLLM_USE_DEEP_GEMM_TMA_ALIGNED_SCALES"] = "0"
|
| 236 |
+
os.environ["VLLM_DEEP_GEMM_WARMUP"] = "skip"
|
| 237 |
+
os.environ.setdefault("VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS", "0")
|
| 238 |
+
keys = [
|
| 239 |
+
"KG1_ALLOW_VLLM_DEEP_GEMM",
|
| 240 |
+
"VLLM_USE_DEEP_GEMM",
|
| 241 |
+
"VLLM_MOE_USE_DEEP_GEMM",
|
| 242 |
+
"VLLM_USE_DEEP_GEMM_E8M0",
|
| 243 |
+
"VLLM_USE_DEEP_GEMM_TMA_ALIGNED_SCALES",
|
| 244 |
+
"VLLM_DEEP_GEMM_WARMUP",
|
| 245 |
+
"VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS",
|
| 246 |
+
]
|
| 247 |
+
return {key: os.environ.get(key, "") for key in keys}
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
def first_existing_column(frame: pd.DataFrame, candidates: list[str]) -> str | None:
|
| 251 |
+
for candidate in candidates:
|
| 252 |
+
if candidate in frame.columns:
|
| 253 |
+
return candidate
|
| 254 |
+
return None
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
def prepare_merged_predictions(solution: pd.DataFrame, pred: pd.DataFrame) -> pd.DataFrame:
|
| 258 |
+
"""Merge generated rows with labels without relying on pandas suffix names."""
|
| 259 |
+
|
| 260 |
+
pred_for_merge = pred.rename(columns={"prompt": "generated_prompt", "type": "pred_type"}).copy()
|
| 261 |
+
merged = solution.merge(pred_for_merge, on="id", how="left", validate="one_to_one")
|
| 262 |
+
|
| 263 |
+
prompt_col = first_existing_column(merged, ["prompt", "generated_prompt", "prompt_x", "prompt_y"])
|
| 264 |
+
if prompt_col is None:
|
| 265 |
+
merged["prompt"] = ""
|
| 266 |
+
elif prompt_col != "prompt":
|
| 267 |
+
merged["prompt"] = merged[prompt_col].fillna("").astype(str)
|
| 268 |
+
|
| 269 |
+
if "prediction" not in merged.columns:
|
| 270 |
+
merged["prediction"] = ""
|
| 271 |
+
if "finish_reason" not in merged.columns:
|
| 272 |
+
merged["finish_reason"] = ""
|
| 273 |
+
if "completion_tokens" not in merged.columns:
|
| 274 |
+
merged["completion_tokens"] = 0
|
| 275 |
+
|
| 276 |
+
type_col = first_existing_column(merged, ["type", "task_type", "family", "type_x", "pred_type", "type_y"])
|
| 277 |
+
if type_col is None:
|
| 278 |
+
merged["type"] = merged["prompt"].map(classify_puzzle)
|
| 279 |
+
elif type_col != "type":
|
| 280 |
+
merged["type"] = merged[type_col].fillna("").astype(str)
|
| 281 |
+
missing_type = merged["type"].fillna("").astype(str).eq("")
|
| 282 |
+
if missing_type.any():
|
| 283 |
+
merged.loc[missing_type, "type"] = merged.loc[missing_type, "prompt"].map(classify_puzzle)
|
| 284 |
+
|
| 285 |
+
return merged
|
| 286 |
+
|
| 287 |
+
|
| 288 |
+
def evaluate_adapter(
|
| 289 |
+
solution: pd.DataFrame,
|
| 290 |
+
questions: pd.DataFrame,
|
| 291 |
+
*,
|
| 292 |
+
lora_path: str,
|
| 293 |
+
base_model_path: str,
|
| 294 |
+
config: dict[str, Any] | None = None,
|
| 295 |
+
seed: int = 42,
|
| 296 |
+
raw_predictions_path: str | Path | None = None,
|
| 297 |
+
) -> tuple[dict[str, Any], pd.DataFrame]:
|
| 298 |
+
"""Run vLLM adapter inference and return a summary plus row predictions."""
|
| 299 |
+
|
| 300 |
+
config = {**OFFICIAL_INFERENCE_CONFIG, **(config or {})}
|
| 301 |
+
adapter_dir = validate_adapter_dir(lora_path)
|
| 302 |
+
questions = normalize_questions(solution, questions, limit=0)
|
| 303 |
+
solution = solution.copy()
|
| 304 |
+
id_col = row_id_column(solution)
|
| 305 |
+
if id_col != "id":
|
| 306 |
+
solution = solution.rename(columns={id_col: "id"})
|
| 307 |
+
solution["id"] = solution["id"].astype(str)
|
| 308 |
+
if "answer" not in solution.columns:
|
| 309 |
+
raise RuntimeError(
|
| 310 |
+
"solution CSV is missing the answer column; refusing to emit an all-false accuracy report."
|
| 311 |
+
)
|
| 312 |
+
|
| 313 |
+
print("========================================================================")
|
| 314 |
+
print("KG1 official-like adapter evaluation")
|
| 315 |
+
print("========================================================================")
|
| 316 |
+
print("generated_at_utc =", utc_now())
|
| 317 |
+
print("base_model_path =", base_model_path)
|
| 318 |
+
print("adapter_dir =", adapter_dir)
|
| 319 |
+
print("rows =", len(questions))
|
| 320 |
+
print("seed =", seed)
|
| 321 |
+
print("config =", json.dumps(config, indent=2, sort_keys=True))
|
| 322 |
+
print(
|
| 323 |
+
"vllm_runtime_safety_settings =",
|
| 324 |
+
json.dumps(apply_vllm_runtime_safety_settings(), indent=2, sort_keys=True),
|
| 325 |
+
)
|
| 326 |
+
|
| 327 |
+
from vllm import LLM
|
| 328 |
+
from vllm.lora.request import LoRARequest
|
| 329 |
+
|
| 330 |
+
llm_kwargs = {
|
| 331 |
+
"model": str(base_model_path),
|
| 332 |
+
"tensor_parallel_size": int(config.get("tensor_parallel_size", 1)),
|
| 333 |
+
"max_num_seqs": int(config.get("max_num_seqs", 64)),
|
| 334 |
+
"gpu_memory_utilization": float(config.get("gpu_memory_utilization", 0.85)),
|
| 335 |
+
"dtype": config.get("dtype", "auto"),
|
| 336 |
+
"max_model_len": int(config.get("max_model_len", 8192)),
|
| 337 |
+
"trust_remote_code": bool(config.get("trust_remote_code", True)),
|
| 338 |
+
"enable_lora": True,
|
| 339 |
+
"max_lora_rank": int(config.get("max_lora_rank", 32)),
|
| 340 |
+
"enable_prefix_caching": bool(config.get("enable_prefix_caching", True)),
|
| 341 |
+
"enable_chunked_prefill": bool(config.get("enable_chunked_prefill", True)),
|
| 342 |
+
}
|
| 343 |
+
model_revision = resolve_model_revision(str(base_model_path), config)
|
| 344 |
+
if model_revision:
|
| 345 |
+
llm_kwargs["revision"] = model_revision
|
| 346 |
+
llm_kwargs["tokenizer_revision"] = model_revision
|
| 347 |
+
print("llm_revision =", llm_kwargs.get("revision", "local_path_or_default"))
|
| 348 |
+
if config.get("enforce_eager") is not None:
|
| 349 |
+
llm_kwargs["enforce_eager"] = bool(config["enforce_eager"])
|
| 350 |
+
|
| 351 |
+
start = time.time()
|
| 352 |
+
llm = LLM(**llm_kwargs)
|
| 353 |
+
tokenizer = llm.get_tokenizer()
|
| 354 |
+
print(f"vLLM loaded in {time.time() - start:.1f}s")
|
| 355 |
+
|
| 356 |
+
rendered = render_prompts(tokenizer, questions, config)
|
| 357 |
+
sampling_params = _sampling_params(config, seed)
|
| 358 |
+
lora_request = LoRARequest("adapter", 1, str(adapter_dir))
|
| 359 |
+
|
| 360 |
+
warmup_rows = int(config.get("warmup_rows", 4))
|
| 361 |
+
if rendered and warmup_rows > 0:
|
| 362 |
+
warmup_n = min(warmup_rows, len(rendered))
|
| 363 |
+
print(f"warmup_rows = {warmup_n}")
|
| 364 |
+
warmup_start = time.time()
|
| 365 |
+
_ = llm.generate(rendered[:warmup_n], sampling_params=sampling_params, lora_request=lora_request)
|
| 366 |
+
print(f"warmup_elapsed_s = {time.time() - warmup_start:.1f}")
|
| 367 |
+
else:
|
| 368 |
+
print("warmup_rows = 0")
|
| 369 |
+
|
| 370 |
+
gen_start = time.time()
|
| 371 |
+
outputs = llm.generate(rendered, sampling_params=sampling_params, lora_request=lora_request)
|
| 372 |
+
gen_elapsed = time.time() - gen_start
|
| 373 |
+
print(f"generation_elapsed_s = {gen_elapsed:.1f}")
|
| 374 |
+
|
| 375 |
+
rows: list[dict[str, Any]] = []
|
| 376 |
+
for row, output in zip(questions.itertuples(index=False), outputs):
|
| 377 |
+
completion = output.outputs[0]
|
| 378 |
+
raw_output = completion.text
|
| 379 |
+
prediction = extract_final_answer(raw_output)
|
| 380 |
+
boxed_answers = [item.strip() for item in extract_boxed_answers(raw_output)]
|
| 381 |
+
strict_boxed_prediction = extract_final_boxed_answer(raw_output)
|
| 382 |
+
well_formed_boxed = has_closed_boxed_answer(raw_output)
|
| 383 |
+
row_id = str(getattr(row, "id"))
|
| 384 |
+
prompt = str(getattr(row, "prompt"))
|
| 385 |
+
expected = getattr(row, "answer", None)
|
| 386 |
+
rows.append(
|
| 387 |
+
{
|
| 388 |
+
"id": row_id,
|
| 389 |
+
"prompt": prompt,
|
| 390 |
+
"raw_output": raw_output,
|
| 391 |
+
"prediction": prediction,
|
| 392 |
+
"strict_boxed_prediction": strict_boxed_prediction,
|
| 393 |
+
"strict_boxed_correct": (
|
| 394 |
+
verify_strict_boxed_answer(expected, raw_output)
|
| 395 |
+
if expected is not None
|
| 396 |
+
else False
|
| 397 |
+
),
|
| 398 |
+
"exact_prediction_correct": (
|
| 399 |
+
exact_answer_match(expected, prediction)
|
| 400 |
+
if expected is not None
|
| 401 |
+
else False
|
| 402 |
+
),
|
| 403 |
+
"boxed_count": len(boxed_answers),
|
| 404 |
+
"first_boxed_prediction": boxed_answers[0] if boxed_answers else "",
|
| 405 |
+
"well_formed_boxed": well_formed_boxed,
|
| 406 |
+
"malformed_boxed": len(boxed_answers) > 0 and not well_formed_boxed,
|
| 407 |
+
"no_box_fallback_used": len(boxed_answers) == 0,
|
| 408 |
+
"prompt_tokens": len(getattr(output, "prompt_token_ids", []) or []),
|
| 409 |
+
"completion_tokens": len(getattr(completion, "token_ids", []) or []),
|
| 410 |
+
"finish_reason": completion.finish_reason or "",
|
| 411 |
+
"type": classify_puzzle(prompt),
|
| 412 |
+
}
|
| 413 |
+
)
|
| 414 |
+
|
| 415 |
+
pred = pd.DataFrame(rows)
|
| 416 |
+
if raw_predictions_path is not None:
|
| 417 |
+
raw_path = Path(raw_predictions_path)
|
| 418 |
+
raw_path.parent.mkdir(parents=True, exist_ok=True)
|
| 419 |
+
pred.to_csv(raw_path, index=False)
|
| 420 |
+
print("raw_predictions_pre_score_csv =", raw_path)
|
| 421 |
+
print("raw_predictions_pre_score_rows =", len(pred))
|
| 422 |
+
|
| 423 |
+
merged = prepare_merged_predictions(solution, pred)
|
| 424 |
+
if "answer" not in merged.columns:
|
| 425 |
+
raise RuntimeError("merged predictions are missing answer column after join")
|
| 426 |
+
merged["correct"] = merged.apply(lambda r: verify_answer(r["answer"], r["prediction"]), axis=1)
|
| 427 |
+
if "first_boxed_prediction" in merged.columns:
|
| 428 |
+
merged["first_boxed_correct"] = merged.apply(
|
| 429 |
+
lambda r: verify_answer(r["answer"], r["first_boxed_prediction"]),
|
| 430 |
+
axis=1,
|
| 431 |
+
)
|
| 432 |
+
if "strict_boxed_prediction" in merged.columns:
|
| 433 |
+
merged["strict_boxed_correct"] = merged.apply(
|
| 434 |
+
lambda r: exact_answer_match(r["answer"], r["strict_boxed_prediction"]),
|
| 435 |
+
axis=1,
|
| 436 |
+
)
|
| 437 |
+
merged["exact_prediction_correct"] = merged.apply(
|
| 438 |
+
lambda r: exact_answer_match(r["answer"], r["prediction"]),
|
| 439 |
+
axis=1,
|
| 440 |
+
)
|
| 441 |
+
if "strict_boxed_correct" not in merged.columns:
|
| 442 |
+
raise RuntimeError("merged predictions missing strict_boxed_correct")
|
| 443 |
+
merged["strict_boxed_correct"] = merged["strict_boxed_correct"].fillna(False).astype(bool)
|
| 444 |
+
merged["exact_prediction_correct"] = merged["exact_prediction_correct"].fillna(False).astype(bool)
|
| 445 |
+
merged["public_metric_only_false_gain"] = merged["correct"] & ~merged["strict_boxed_correct"]
|
| 446 |
+
max_tokens = int(config.get("max_tokens", 7680))
|
| 447 |
+
merged["truncated"] = merged.apply(
|
| 448 |
+
lambda r: is_truncated_completion(r.get("finish_reason", ""), r.get("completion_tokens", ""), max_tokens),
|
| 449 |
+
axis=1,
|
| 450 |
+
)
|
| 451 |
+
|
| 452 |
+
# ---- JOB B: PAINEL DIDATICO (sempre) + TRACE por-item (KG1_EVAL_TRACE=1) ----
|
| 453 |
+
# Reusa a metrica oficial via kg1_score_live. try/except: o juiz e o report do eval;
|
| 454 |
+
# isto e camada de leitura humana e NUNCA pode quebrar o eval.
|
| 455 |
+
try:
|
| 456 |
+
import sys as _sys
|
| 457 |
+
_sd = os.path.dirname(os.path.abspath(__file__))
|
| 458 |
+
if _sd not in _sys.path:
|
| 459 |
+
_sys.path.insert(0, _sd)
|
| 460 |
+
from kg1_score_live import compute_score_telemetry, render_dashboard
|
| 461 |
+
|
| 462 |
+
_fam_col = "family" if "family" in merged.columns else ("type" if "type" in merged.columns else None)
|
| 463 |
+
_recs = merged.to_dict("records")
|
| 464 |
+
_tel_rows = [
|
| 465 |
+
{
|
| 466 |
+
"id": str(r.get("id", "")),
|
| 467 |
+
"raw_output": r.get("raw_output", "") or "",
|
| 468 |
+
"answer": r.get("answer", ""),
|
| 469 |
+
"family": (str(r.get(_fam_col, "unknown")) if _fam_col else "unknown"),
|
| 470 |
+
"finish_reason": r.get("finish_reason", ""),
|
| 471 |
+
"completion_tokens": r.get("completion_tokens", 0),
|
| 472 |
+
}
|
| 473 |
+
for r in _recs
|
| 474 |
+
]
|
| 475 |
+
_tel = compute_score_telemetry(_tel_rows, step=None, max_step=None)
|
| 476 |
+
_title = "JOB B - EVAL full947 [" + os.path.basename(str(adapter_dir).rstrip("/")) + "]"
|
| 477 |
+
print(render_dashboard(_tel, title=_title, source="vLLM greedy full947 (JUIZ OFICIAL)"), flush=True)
|
| 478 |
+
if os.environ.get("KG1_EVAL_TRACE", "0") == "1":
|
| 479 |
+
print(
|
| 480 |
+
f"[KG1-EVAL-TRACE] por-item ({len(_recs)} itens) -- familia | id | correct | trunc | pred -> gold",
|
| 481 |
+
flush=True,
|
| 482 |
+
)
|
| 483 |
+
for r in _recs:
|
| 484 |
+
_fam = (str(r.get(_fam_col, "?")) if _fam_col else "?")
|
| 485 |
+
print(
|
| 486 |
+
f"[TRACE] {_fam:<18} {str(r.get('id', ''))[:10]:<10} "
|
| 487 |
+
f"correct={'Y' if bool(r.get('correct')) else 'N'} "
|
| 488 |
+
f"trunc={'Y' if bool(r.get('truncated')) else 'N'} "
|
| 489 |
+
f"pred={str(r.get('prediction', ''))[:40]!r} gold={str(r.get('answer', ''))[:40]!r}",
|
| 490 |
+
flush=True,
|
| 491 |
+
)
|
| 492 |
+
except Exception as _exc: # diagnostico NUNCA quebra o eval
|
| 493 |
+
print(f"[KG1-EVAL-PANEL] falhou (ignorado, eval segue): {type(_exc).__name__}: {_exc}", flush=True)
|
| 494 |
+
|
| 495 |
+
total_tokens = int(merged["completion_tokens"].fillna(0).sum())
|
| 496 |
+
boxed_rows = int(merged["boxed_count"].fillna(0).astype(int).gt(0).sum()) if "boxed_count" in merged else 0
|
| 497 |
+
malformed_boxed_rows = (
|
| 498 |
+
int(merged["malformed_boxed"].fillna(False).astype(bool).sum())
|
| 499 |
+
if "malformed_boxed" in merged
|
| 500 |
+
else 0
|
| 501 |
+
)
|
| 502 |
+
no_box_fallback_rows = (
|
| 503 |
+
int(merged["no_box_fallback_used"].fillna(False).astype(bool).sum())
|
| 504 |
+
if "no_box_fallback_used" in merged
|
| 505 |
+
else int(len(merged))
|
| 506 |
+
)
|
| 507 |
+
first_boxed_correct = (
|
| 508 |
+
int(merged["first_boxed_correct"].fillna(False).astype(bool).sum())
|
| 509 |
+
if "first_boxed_correct" in merged
|
| 510 |
+
else 0
|
| 511 |
+
)
|
| 512 |
+
strict_boxed_correct = int(merged["strict_boxed_correct"].sum())
|
| 513 |
+
exact_prediction_correct = int(merged["exact_prediction_correct"].sum())
|
| 514 |
+
public_metric_only_false_gain_rows = int(merged["public_metric_only_false_gain"].sum())
|
| 515 |
+
summary = {
|
| 516 |
+
"generated_at_utc": utc_now(),
|
| 517 |
+
"base_model_path": str(base_model_path),
|
| 518 |
+
"adapter_dir": str(adapter_dir),
|
| 519 |
+
"rows": int(len(merged)),
|
| 520 |
+
"correct": int(merged["correct"].sum()),
|
| 521 |
+
"accuracy": float(merged["correct"].mean()) if len(merged) else 0.0,
|
| 522 |
+
"truncated": int(merged["truncated"].sum()),
|
| 523 |
+
"truncation_rate": float(merged["truncated"].mean()) if len(merged) else 0.0,
|
| 524 |
+
"boxed_rows": boxed_rows,
|
| 525 |
+
"boxed_rate": float(boxed_rows / len(merged)) if len(merged) else 0.0,
|
| 526 |
+
"malformed_boxed_rows": malformed_boxed_rows,
|
| 527 |
+
"malformed_boxed_rate": float(malformed_boxed_rows / len(merged)) if len(merged) else 0.0,
|
| 528 |
+
"no_box_fallback_rows": no_box_fallback_rows,
|
| 529 |
+
"no_box_fallback_rate": float(no_box_fallback_rows / len(merged)) if len(merged) else 0.0,
|
| 530 |
+
"first_boxed_correct": first_boxed_correct,
|
| 531 |
+
"first_boxed_accuracy": float(first_boxed_correct / len(merged)) if len(merged) else 0.0,
|
| 532 |
+
"strict_boxed_correct": strict_boxed_correct,
|
| 533 |
+
"strict_boxed_accuracy": float(strict_boxed_correct / len(merged)) if len(merged) else 0.0,
|
| 534 |
+
"exact_prediction_correct": exact_prediction_correct,
|
| 535 |
+
"exact_prediction_accuracy": float(exact_prediction_correct / len(merged)) if len(merged) else 0.0,
|
| 536 |
+
"public_metric_only_false_gain_rows": public_metric_only_false_gain_rows,
|
| 537 |
+
"public_metric_only_false_gain_rate": (
|
| 538 |
+
float(public_metric_only_false_gain_rows / len(merged)) if len(merged) else 0.0
|
| 539 |
+
),
|
| 540 |
+
"completion_tokens": total_tokens,
|
| 541 |
+
"generation_elapsed_s": gen_elapsed,
|
| 542 |
+
"tokens_per_second": float(total_tokens / gen_elapsed) if gen_elapsed > 0 else 0.0,
|
| 543 |
+
"seed": int(seed),
|
| 544 |
+
"config": config,
|
| 545 |
+
}
|
| 546 |
+
print("summary =", json.dumps(summary, indent=2, sort_keys=True))
|
| 547 |
+
return summary, merged
|
| 548 |
+
|
| 549 |
+
|
| 550 |
+
def summarize_per_task(frame: pd.DataFrame) -> pd.DataFrame:
|
| 551 |
+
rows: list[dict[str, Any]] = []
|
| 552 |
+
grouped = frame.groupby("type", dropna=False)
|
| 553 |
+
for family, group in grouped:
|
| 554 |
+
total = int(len(group))
|
| 555 |
+
correct = int(group["correct"].sum())
|
| 556 |
+
truncated = int(group["truncated"].sum()) if "truncated" in group else 0
|
| 557 |
+
rows.append(
|
| 558 |
+
{
|
| 559 |
+
"task_type": str(family),
|
| 560 |
+
"total": total,
|
| 561 |
+
"correct": correct,
|
| 562 |
+
"accuracy": correct / total if total else 0.0,
|
| 563 |
+
"truncated": truncated,
|
| 564 |
+
"truncation_rate": truncated / total if total else 0.0,
|
| 565 |
+
}
|
| 566 |
+
)
|
| 567 |
+
total = int(len(frame))
|
| 568 |
+
correct = int(frame["correct"].sum()) if "correct" in frame else 0
|
| 569 |
+
truncated = int(frame["truncated"].sum()) if "truncated" in frame else 0
|
| 570 |
+
rows.append(
|
| 571 |
+
{
|
| 572 |
+
"task_type": "OVERALL",
|
| 573 |
+
"total": total,
|
| 574 |
+
"correct": correct,
|
| 575 |
+
"accuracy": correct / total if total else 0.0,
|
| 576 |
+
"truncated": truncated,
|
| 577 |
+
"truncation_rate": truncated / total if total else 0.0,
|
| 578 |
+
}
|
| 579 |
+
)
|
| 580 |
+
return pd.DataFrame(rows)
|
| 581 |
+
|
| 582 |
+
|
| 583 |
+
def main() -> int:
|
| 584 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 585 |
+
parser.add_argument("--solution-csv", type=Path, required=True)
|
| 586 |
+
parser.add_argument("--questions-csv", type=Path, default=None)
|
| 587 |
+
parser.add_argument("--adapter", type=Path, required=True)
|
| 588 |
+
parser.add_argument("--base-model-path", default="")
|
| 589 |
+
parser.add_argument("--label", default="adapter")
|
| 590 |
+
parser.add_argument("--seed", type=int, default=42)
|
| 591 |
+
parser.add_argument("--limit", type=int, default=0)
|
| 592 |
+
parser.add_argument("--output-dir", type=Path, required=True)
|
| 593 |
+
parser.add_argument("--max-tokens", type=int, default=0, help="Diagnostic override for generation max_tokens.")
|
| 594 |
+
parser.add_argument("--max-model-len", type=int, default=0, help="Diagnostic override for vLLM max_model_len.")
|
| 595 |
+
parser.add_argument("--max-num-seqs", type=int, default=0, help="Diagnostic override for vLLM max_num_seqs.")
|
| 596 |
+
parser.add_argument("--gpu-memory-utilization", type=float, default=0.0, help="Diagnostic override for vLLM memory fraction.")
|
| 597 |
+
parser.add_argument("--warmup-rows", type=int, default=4, help="Number of explicit warmup rows before measured generation.")
|
| 598 |
+
parser.add_argument("--disable-thinking", action="store_true", help="Diagnostic prompt rendering with enable_thinking=False.")
|
| 599 |
+
parser.add_argument("--prompt-suffix", default="", help="Diagnostic override for the prompt suffix.")
|
| 600 |
+
parser.add_argument("--no-prompt-suffix", action="store_true", help="Diagnostic override: render prompts without the default suffix.")
|
| 601 |
+
args = parser.parse_args()
|
| 602 |
+
|
| 603 |
+
args.output_dir.mkdir(parents=True, exist_ok=True)
|
| 604 |
+
solution = read_csv_str(args.solution_csv)
|
| 605 |
+
if args.limit > 0:
|
| 606 |
+
solution = solution.head(args.limit).copy()
|
| 607 |
+
questions = read_csv_str(args.questions_csv or args.solution_csv)
|
| 608 |
+
if args.limit > 0:
|
| 609 |
+
ids = set(solution[row_id_column(solution)].astype(str))
|
| 610 |
+
q_id = row_id_column(questions)
|
| 611 |
+
questions = questions[questions[q_id].astype(str).isin(ids)].copy()
|
| 612 |
+
|
| 613 |
+
label = args.label.replace("/", "_").replace("\\", "_")
|
| 614 |
+
raw_predictions_path = args.output_dir / f"{label}_raw_predictions_pre_score.csv"
|
| 615 |
+
eval_config = dict(OFFICIAL_INFERENCE_CONFIG)
|
| 616 |
+
if args.max_tokens > 0:
|
| 617 |
+
eval_config["max_tokens"] = int(args.max_tokens)
|
| 618 |
+
if args.max_model_len > 0:
|
| 619 |
+
eval_config["max_model_len"] = int(args.max_model_len)
|
| 620 |
+
if args.max_num_seqs > 0:
|
| 621 |
+
eval_config["max_num_seqs"] = int(args.max_num_seqs)
|
| 622 |
+
if args.gpu_memory_utilization > 0:
|
| 623 |
+
eval_config["gpu_memory_utilization"] = float(args.gpu_memory_utilization)
|
| 624 |
+
eval_config["warmup_rows"] = max(0, int(args.warmup_rows))
|
| 625 |
+
if args.disable_thinking:
|
| 626 |
+
eval_config["enable_thinking"] = False
|
| 627 |
+
if args.no_prompt_suffix:
|
| 628 |
+
eval_config["prompt_suffix"] = ""
|
| 629 |
+
elif args.prompt_suffix:
|
| 630 |
+
eval_config["prompt_suffix"] = args.prompt_suffix
|
| 631 |
+
|
| 632 |
+
summary, predictions = evaluate_adapter(
|
| 633 |
+
solution,
|
| 634 |
+
questions,
|
| 635 |
+
lora_path=str(args.adapter),
|
| 636 |
+
base_model_path=resolve_base_model_path(args.base_model_path),
|
| 637 |
+
config=eval_config,
|
| 638 |
+
seed=args.seed,
|
| 639 |
+
raw_predictions_path=raw_predictions_path,
|
| 640 |
+
)
|
| 641 |
+
predictions_path = args.output_dir / f"{label}_predictions.csv"
|
| 642 |
+
per_task_path = args.output_dir / f"{label}_per_task.csv"
|
| 643 |
+
report_path = args.output_dir / f"{label}_eval_report.json"
|
| 644 |
+
predictions.to_csv(predictions_path, index=False)
|
| 645 |
+
summarize_per_task(predictions).to_csv(per_task_path, index=False)
|
| 646 |
+
report = {
|
| 647 |
+
**summary,
|
| 648 |
+
"label": args.label,
|
| 649 |
+
"inputs": {
|
| 650 |
+
"solution_csv": str(args.solution_csv),
|
| 651 |
+
"questions_csv": str(args.questions_csv or args.solution_csv),
|
| 652 |
+
"adapter": str(args.adapter),
|
| 653 |
+
"limit": args.limit,
|
| 654 |
+
},
|
| 655 |
+
"outputs": {
|
| 656 |
+
"raw_predictions_pre_score_csv": str(raw_predictions_path),
|
| 657 |
+
"predictions_csv": str(predictions_path),
|
| 658 |
+
"per_task_csv": str(per_task_path),
|
| 659 |
+
"report_json": str(report_path),
|
| 660 |
+
},
|
| 661 |
+
}
|
| 662 |
+
report_path.write_text(json.dumps(report, indent=2, sort_keys=True), encoding="utf-8")
|
| 663 |
+
print("predictions_csv =", predictions_path)
|
| 664 |
+
print("per_task_csv =", per_task_path)
|
| 665 |
+
print("report_json =", report_path)
|
| 666 |
+
return 0
|
| 667 |
+
|
| 668 |
+
|
| 669 |
+
if __name__ == "__main__":
|
| 670 |
+
raise SystemExit(main())
|
runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/scripts/evaluate_lora_adapters_batch.py
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Batch weak-evaluate multiple LoRA adapters with one vLLM model load.
|
| 3 |
+
|
| 4 |
+
This is evaluation-only. It exists for candidate triage: load the Nemotron base
|
| 5 |
+
model once, iterate adapters with LoRARequest, and write the same report shape
|
| 6 |
+
used by ``evaluate_lora_adapter.py`` for each candidate plus an aggregate CSV.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import argparse
|
| 12 |
+
import json
|
| 13 |
+
import os
|
| 14 |
+
import sys
|
| 15 |
+
import time
|
| 16 |
+
import traceback
|
| 17 |
+
from datetime import datetime, timezone
|
| 18 |
+
from pathlib import Path
|
| 19 |
+
from typing import Any
|
| 20 |
+
|
| 21 |
+
import pandas as pd
|
| 22 |
+
|
| 23 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 24 |
+
if str(ROOT) not in sys.path:
|
| 25 |
+
sys.path.insert(0, str(ROOT))
|
| 26 |
+
|
| 27 |
+
from scripts.evaluate_lora_adapter import ( # noqa: E402
|
| 28 |
+
_sampling_params,
|
| 29 |
+
apply_vllm_runtime_safety_settings,
|
| 30 |
+
exact_answer_match,
|
| 31 |
+
is_truncated_completion,
|
| 32 |
+
normalize_questions,
|
| 33 |
+
prepare_merged_predictions,
|
| 34 |
+
read_csv_str,
|
| 35 |
+
render_prompts,
|
| 36 |
+
resolve_base_model_path,
|
| 37 |
+
resolve_model_revision,
|
| 38 |
+
row_id_column,
|
| 39 |
+
summarize_per_task,
|
| 40 |
+
validate_adapter_dir,
|
| 41 |
+
)
|
| 42 |
+
from src.competition_utils import ( # noqa: E402
|
| 43 |
+
OFFICIAL_INFERENCE_CONFIG,
|
| 44 |
+
classify_puzzle,
|
| 45 |
+
extract_boxed_answers,
|
| 46 |
+
extract_final_answer,
|
| 47 |
+
extract_final_boxed_answer,
|
| 48 |
+
has_closed_boxed_answer,
|
| 49 |
+
verify_answer,
|
| 50 |
+
verify_strict_boxed_answer,
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def utc_now() -> str:
|
| 55 |
+
return datetime.now(timezone.utc).isoformat()
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def load_candidates(path: Path) -> list[dict[str, Any]]:
|
| 59 |
+
data = json.loads(path.read_text(encoding="utf-8"))
|
| 60 |
+
if isinstance(data, dict):
|
| 61 |
+
data = data.get("candidates", [])
|
| 62 |
+
if not isinstance(data, list):
|
| 63 |
+
raise ValueError("candidates JSON must be a list or {'candidates': [...]}")
|
| 64 |
+
candidates: list[dict[str, Any]] = []
|
| 65 |
+
for idx, item in enumerate(data):
|
| 66 |
+
if not isinstance(item, dict):
|
| 67 |
+
raise ValueError(f"candidate {idx} is not an object")
|
| 68 |
+
name = str(item.get("name") or item.get("id") or f"candidate_{idx + 1}").strip()
|
| 69 |
+
adapter = str(item.get("adapter") or item.get("adapter_path") or "").strip()
|
| 70 |
+
if not name:
|
| 71 |
+
raise ValueError(f"candidate {idx} missing name")
|
| 72 |
+
if not adapter:
|
| 73 |
+
raise ValueError(f"candidate {name} missing adapter")
|
| 74 |
+
candidates.append({**item, "name": name, "adapter": adapter})
|
| 75 |
+
return candidates
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def safe_label(value: str) -> str:
|
| 79 |
+
return value.replace("/", "_").replace("\\", "_").replace(" ", "_")
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
def build_eval_config(args: argparse.Namespace) -> dict[str, Any]:
|
| 83 |
+
config = dict(OFFICIAL_INFERENCE_CONFIG)
|
| 84 |
+
if args.max_tokens > 0:
|
| 85 |
+
config["max_tokens"] = int(args.max_tokens)
|
| 86 |
+
if args.max_model_len > 0:
|
| 87 |
+
config["max_model_len"] = int(args.max_model_len)
|
| 88 |
+
if args.max_num_seqs > 0:
|
| 89 |
+
config["max_num_seqs"] = int(args.max_num_seqs)
|
| 90 |
+
if args.gpu_memory_utilization > 0:
|
| 91 |
+
config["gpu_memory_utilization"] = float(args.gpu_memory_utilization)
|
| 92 |
+
config["warmup_rows"] = max(0, int(args.warmup_rows))
|
| 93 |
+
if args.disable_thinking:
|
| 94 |
+
config["enable_thinking"] = False
|
| 95 |
+
if args.no_prompt_suffix:
|
| 96 |
+
config["prompt_suffix"] = ""
|
| 97 |
+
elif args.prompt_suffix:
|
| 98 |
+
config["prompt_suffix"] = args.prompt_suffix
|
| 99 |
+
return config
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def main() -> int:
|
| 103 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 104 |
+
parser.add_argument("--solution-csv", type=Path, required=True)
|
| 105 |
+
parser.add_argument("--questions-csv", type=Path, default=None)
|
| 106 |
+
parser.add_argument("--candidates-json", type=Path, required=True)
|
| 107 |
+
parser.add_argument("--base-model-path", default="")
|
| 108 |
+
parser.add_argument("--label-prefix", default="batch")
|
| 109 |
+
parser.add_argument("--seed", type=int, default=42)
|
| 110 |
+
parser.add_argument("--limit", type=int, default=0)
|
| 111 |
+
parser.add_argument("--output-dir", type=Path, required=True)
|
| 112 |
+
parser.add_argument("--max-tokens", type=int, default=0)
|
| 113 |
+
parser.add_argument("--max-model-len", type=int, default=0)
|
| 114 |
+
parser.add_argument("--max-num-seqs", type=int, default=0)
|
| 115 |
+
parser.add_argument("--gpu-memory-utilization", type=float, default=0.0)
|
| 116 |
+
parser.add_argument("--warmup-rows", type=int, default=4)
|
| 117 |
+
parser.add_argument("--disable-thinking", action="store_true")
|
| 118 |
+
parser.add_argument("--prompt-suffix", default="")
|
| 119 |
+
parser.add_argument("--no-prompt-suffix", action="store_true")
|
| 120 |
+
parser.add_argument("--continue-on-error", action="store_true")
|
| 121 |
+
args = parser.parse_args()
|
| 122 |
+
|
| 123 |
+
started_at = time.time()
|
| 124 |
+
args.output_dir.mkdir(parents=True, exist_ok=True)
|
| 125 |
+
config = build_eval_config(args)
|
| 126 |
+
base_model_path = resolve_base_model_path(args.base_model_path)
|
| 127 |
+
candidates = load_candidates(args.candidates_json)
|
| 128 |
+
|
| 129 |
+
print("========================================================================")
|
| 130 |
+
print("KG1 batch LoRA adapter evaluation")
|
| 131 |
+
print("========================================================================")
|
| 132 |
+
print("generated_at_utc =", utc_now())
|
| 133 |
+
print("base_model_path =", base_model_path)
|
| 134 |
+
print("candidates_json =", args.candidates_json)
|
| 135 |
+
print("candidate_count =", len(candidates))
|
| 136 |
+
print("seed =", args.seed)
|
| 137 |
+
print("limit =", args.limit)
|
| 138 |
+
print("output_dir =", args.output_dir)
|
| 139 |
+
print("config =", json.dumps(config, indent=2, sort_keys=True))
|
| 140 |
+
print(
|
| 141 |
+
"vllm_runtime_safety_settings =",
|
| 142 |
+
json.dumps(apply_vllm_runtime_safety_settings(), indent=2, sort_keys=True),
|
| 143 |
+
)
|
| 144 |
+
|
| 145 |
+
solution = read_csv_str(args.solution_csv)
|
| 146 |
+
if args.limit > 0:
|
| 147 |
+
solution = solution.head(args.limit).copy()
|
| 148 |
+
questions = read_csv_str(args.questions_csv or args.solution_csv)
|
| 149 |
+
if args.limit > 0:
|
| 150 |
+
ids = set(solution[row_id_column(solution)].astype(str))
|
| 151 |
+
q_id = row_id_column(questions)
|
| 152 |
+
questions = questions[questions[q_id].astype(str).isin(ids)].copy()
|
| 153 |
+
questions = normalize_questions(solution, questions, limit=0)
|
| 154 |
+
solution = solution.copy()
|
| 155 |
+
id_col = row_id_column(solution)
|
| 156 |
+
if id_col != "id":
|
| 157 |
+
solution = solution.rename(columns={id_col: "id"})
|
| 158 |
+
solution["id"] = solution["id"].astype(str)
|
| 159 |
+
if "answer" not in solution.columns:
|
| 160 |
+
raise RuntimeError(
|
| 161 |
+
"solution CSV is missing the answer column; refusing to emit an all-false accuracy report."
|
| 162 |
+
)
|
| 163 |
+
print("rows =", len(questions))
|
| 164 |
+
|
| 165 |
+
valid_candidates: list[dict[str, Any]] = []
|
| 166 |
+
preflight_rows: list[dict[str, Any]] = []
|
| 167 |
+
for item in candidates:
|
| 168 |
+
row = {"name": item["name"], "adapter": item["adapter"], "preflight_ok": False, "error": ""}
|
| 169 |
+
try:
|
| 170 |
+
adapter_dir = validate_adapter_dir(item["adapter"])
|
| 171 |
+
row["adapter"] = str(adapter_dir)
|
| 172 |
+
row["preflight_ok"] = True
|
| 173 |
+
valid_candidates.append({**item, "adapter": str(adapter_dir)})
|
| 174 |
+
except Exception as exc:
|
| 175 |
+
row["error"] = repr(exc)
|
| 176 |
+
print("candidate_preflight_failed =", json.dumps(row, sort_keys=True), flush=True)
|
| 177 |
+
if not args.continue_on_error:
|
| 178 |
+
raise
|
| 179 |
+
preflight_rows.append(row)
|
| 180 |
+
pd.DataFrame(preflight_rows).to_csv(args.output_dir / "candidate_preflight.csv", index=False)
|
| 181 |
+
print("valid_candidate_count =", len(valid_candidates))
|
| 182 |
+
if not valid_candidates:
|
| 183 |
+
raise RuntimeError("no valid candidates to evaluate")
|
| 184 |
+
|
| 185 |
+
from vllm import LLM
|
| 186 |
+
from vllm.lora.request import LoRARequest
|
| 187 |
+
|
| 188 |
+
llm_kwargs = {
|
| 189 |
+
"model": str(base_model_path),
|
| 190 |
+
"tensor_parallel_size": int(config.get("tensor_parallel_size", 1)),
|
| 191 |
+
"max_num_seqs": int(config.get("max_num_seqs", 64)),
|
| 192 |
+
"gpu_memory_utilization": float(config.get("gpu_memory_utilization", 0.85)),
|
| 193 |
+
"dtype": config.get("dtype", "auto"),
|
| 194 |
+
"max_model_len": int(config.get("max_model_len", 8192)),
|
| 195 |
+
"trust_remote_code": bool(config.get("trust_remote_code", True)),
|
| 196 |
+
"enable_lora": True,
|
| 197 |
+
"max_lora_rank": int(config.get("max_lora_rank", 32)),
|
| 198 |
+
"enable_prefix_caching": bool(config.get("enable_prefix_caching", True)),
|
| 199 |
+
"enable_chunked_prefill": bool(config.get("enable_chunked_prefill", True)),
|
| 200 |
+
}
|
| 201 |
+
model_revision = resolve_model_revision(str(base_model_path), config)
|
| 202 |
+
if model_revision:
|
| 203 |
+
llm_kwargs["revision"] = model_revision
|
| 204 |
+
llm_kwargs["tokenizer_revision"] = model_revision
|
| 205 |
+
print("llm_revision =", llm_kwargs.get("revision", "local_path_or_default"))
|
| 206 |
+
if config.get("enforce_eager") is not None:
|
| 207 |
+
llm_kwargs["enforce_eager"] = bool(config["enforce_eager"])
|
| 208 |
+
|
| 209 |
+
load_start = time.time()
|
| 210 |
+
llm = LLM(**llm_kwargs)
|
| 211 |
+
tokenizer = llm.get_tokenizer()
|
| 212 |
+
print(f"vLLM loaded in {time.time() - load_start:.1f}s")
|
| 213 |
+
rendered = render_prompts(tokenizer, questions, config)
|
| 214 |
+
sampling_params = _sampling_params(config, int(args.seed))
|
| 215 |
+
|
| 216 |
+
aggregate_rows: list[dict[str, Any]] = []
|
| 217 |
+
for lora_id, candidate in enumerate(valid_candidates, start=1):
|
| 218 |
+
label = safe_label(f"{args.label_prefix}_{candidate['name']}")
|
| 219 |
+
candidate_dir = args.output_dir / safe_label(candidate["name"])
|
| 220 |
+
candidate_dir.mkdir(parents=True, exist_ok=True)
|
| 221 |
+
print("------------------------------------------------------------------------")
|
| 222 |
+
print("candidate_start =", json.dumps(candidate, sort_keys=True))
|
| 223 |
+
cand_start = time.time()
|
| 224 |
+
try:
|
| 225 |
+
lora_request = LoRARequest(candidate["name"], lora_id, str(candidate["adapter"]))
|
| 226 |
+
warmup_rows = int(config.get("warmup_rows", 4))
|
| 227 |
+
if rendered and warmup_rows > 0:
|
| 228 |
+
warmup_n = min(warmup_rows, len(rendered))
|
| 229 |
+
print(f"warmup_rows = {warmup_n}")
|
| 230 |
+
warmup_start = time.time()
|
| 231 |
+
_ = llm.generate(rendered[:warmup_n], sampling_params=sampling_params, lora_request=lora_request)
|
| 232 |
+
print(f"warmup_elapsed_s = {time.time() - warmup_start:.1f}")
|
| 233 |
+
else:
|
| 234 |
+
print("warmup_rows = 0")
|
| 235 |
+
|
| 236 |
+
gen_start = time.time()
|
| 237 |
+
outputs = llm.generate(rendered, sampling_params=sampling_params, lora_request=lora_request)
|
| 238 |
+
gen_elapsed = time.time() - gen_start
|
| 239 |
+
print(f"generation_elapsed_s = {gen_elapsed:.1f}")
|
| 240 |
+
|
| 241 |
+
rows: list[dict[str, Any]] = []
|
| 242 |
+
for row, output in zip(questions.itertuples(index=False), outputs):
|
| 243 |
+
completion = output.outputs[0]
|
| 244 |
+
raw_output = completion.text
|
| 245 |
+
prompt = str(getattr(row, "prompt"))
|
| 246 |
+
expected = getattr(row, "answer", None)
|
| 247 |
+
prediction = extract_final_answer(raw_output)
|
| 248 |
+
boxed_answers = [item.strip() for item in extract_boxed_answers(raw_output)]
|
| 249 |
+
strict_boxed_prediction = extract_final_boxed_answer(raw_output)
|
| 250 |
+
well_formed_boxed = has_closed_boxed_answer(raw_output)
|
| 251 |
+
rows.append(
|
| 252 |
+
{
|
| 253 |
+
"id": str(getattr(row, "id")),
|
| 254 |
+
"prompt": prompt,
|
| 255 |
+
"raw_output": raw_output,
|
| 256 |
+
"prediction": prediction,
|
| 257 |
+
"strict_boxed_prediction": strict_boxed_prediction,
|
| 258 |
+
"strict_boxed_correct": (
|
| 259 |
+
verify_strict_boxed_answer(expected, raw_output)
|
| 260 |
+
if expected is not None
|
| 261 |
+
else False
|
| 262 |
+
),
|
| 263 |
+
"exact_prediction_correct": (
|
| 264 |
+
exact_answer_match(expected, prediction)
|
| 265 |
+
if expected is not None
|
| 266 |
+
else False
|
| 267 |
+
),
|
| 268 |
+
"boxed_count": len(boxed_answers),
|
| 269 |
+
"first_boxed_prediction": boxed_answers[0] if boxed_answers else "",
|
| 270 |
+
"well_formed_boxed": well_formed_boxed,
|
| 271 |
+
"malformed_boxed": len(boxed_answers) > 0 and not well_formed_boxed,
|
| 272 |
+
"no_box_fallback_used": len(boxed_answers) == 0,
|
| 273 |
+
"prompt_tokens": len(getattr(output, "prompt_token_ids", []) or []),
|
| 274 |
+
"completion_tokens": len(getattr(completion, "token_ids", []) or []),
|
| 275 |
+
"finish_reason": completion.finish_reason or "",
|
| 276 |
+
"type": classify_puzzle(prompt),
|
| 277 |
+
}
|
| 278 |
+
)
|
| 279 |
+
|
| 280 |
+
pred = pd.DataFrame(rows)
|
| 281 |
+
raw_predictions_path = candidate_dir / f"{label}_raw_predictions_pre_score.csv"
|
| 282 |
+
pred.to_csv(raw_predictions_path, index=False)
|
| 283 |
+
merged = prepare_merged_predictions(solution, pred)
|
| 284 |
+
if "answer" not in merged.columns:
|
| 285 |
+
raise RuntimeError("merged predictions are missing answer column after join")
|
| 286 |
+
merged["correct"] = merged.apply(lambda r: verify_answer(r["answer"], r["prediction"]), axis=1)
|
| 287 |
+
if "first_boxed_prediction" in merged.columns:
|
| 288 |
+
merged["first_boxed_correct"] = merged.apply(
|
| 289 |
+
lambda r: verify_answer(r["answer"], r["first_boxed_prediction"]),
|
| 290 |
+
axis=1,
|
| 291 |
+
)
|
| 292 |
+
if "strict_boxed_prediction" in merged.columns:
|
| 293 |
+
merged["strict_boxed_correct"] = merged.apply(
|
| 294 |
+
lambda r: exact_answer_match(r["answer"], r["strict_boxed_prediction"]),
|
| 295 |
+
axis=1,
|
| 296 |
+
)
|
| 297 |
+
merged["exact_prediction_correct"] = merged.apply(
|
| 298 |
+
lambda r: exact_answer_match(r["answer"], r["prediction"]),
|
| 299 |
+
axis=1,
|
| 300 |
+
)
|
| 301 |
+
if "strict_boxed_correct" not in merged.columns:
|
| 302 |
+
raise RuntimeError("merged predictions missing strict_boxed_correct")
|
| 303 |
+
merged["strict_boxed_correct"] = merged["strict_boxed_correct"].fillna(False).astype(bool)
|
| 304 |
+
merged["exact_prediction_correct"] = merged["exact_prediction_correct"].fillna(False).astype(bool)
|
| 305 |
+
merged["public_metric_only_false_gain"] = merged["correct"] & ~merged["strict_boxed_correct"]
|
| 306 |
+
max_tokens = int(config.get("max_tokens", 7680))
|
| 307 |
+
merged["truncated"] = merged.apply(
|
| 308 |
+
lambda r: is_truncated_completion(
|
| 309 |
+
r.get("finish_reason", ""),
|
| 310 |
+
r.get("completion_tokens", ""),
|
| 311 |
+
max_tokens,
|
| 312 |
+
),
|
| 313 |
+
axis=1,
|
| 314 |
+
)
|
| 315 |
+
|
| 316 |
+
predictions_path = candidate_dir / f"{label}_predictions.csv"
|
| 317 |
+
per_task_path = candidate_dir / f"{label}_per_task.csv"
|
| 318 |
+
report_path = candidate_dir / f"{label}_eval_report.json"
|
| 319 |
+
merged.to_csv(predictions_path, index=False)
|
| 320 |
+
per_task = summarize_per_task(merged)
|
| 321 |
+
per_task.to_csv(per_task_path, index=False)
|
| 322 |
+
total_tokens = int(merged["completion_tokens"].fillna(0).sum())
|
| 323 |
+
boxed_rows = int(merged["boxed_count"].fillna(0).astype(int).gt(0).sum()) if "boxed_count" in merged else 0
|
| 324 |
+
malformed_boxed_rows = (
|
| 325 |
+
int(merged["malformed_boxed"].fillna(False).astype(bool).sum())
|
| 326 |
+
if "malformed_boxed" in merged
|
| 327 |
+
else 0
|
| 328 |
+
)
|
| 329 |
+
no_box_fallback_rows = (
|
| 330 |
+
int(merged["no_box_fallback_used"].fillna(False).astype(bool).sum())
|
| 331 |
+
if "no_box_fallback_used" in merged
|
| 332 |
+
else int(len(merged))
|
| 333 |
+
)
|
| 334 |
+
first_boxed_correct = (
|
| 335 |
+
int(merged["first_boxed_correct"].fillna(False).astype(bool).sum())
|
| 336 |
+
if "first_boxed_correct" in merged
|
| 337 |
+
else 0
|
| 338 |
+
)
|
| 339 |
+
strict_boxed_correct = int(merged["strict_boxed_correct"].sum())
|
| 340 |
+
exact_prediction_correct = int(merged["exact_prediction_correct"].sum())
|
| 341 |
+
public_metric_only_false_gain_rows = int(merged["public_metric_only_false_gain"].sum())
|
| 342 |
+
report = {
|
| 343 |
+
"generated_at_utc": utc_now(),
|
| 344 |
+
"label": label,
|
| 345 |
+
"candidate_name": candidate["name"],
|
| 346 |
+
"base_model_path": str(base_model_path),
|
| 347 |
+
"adapter_dir": str(candidate["adapter"]),
|
| 348 |
+
"rows": int(len(merged)),
|
| 349 |
+
"correct": int(merged["correct"].sum()),
|
| 350 |
+
"accuracy": float(merged["correct"].mean()) if len(merged) else 0.0,
|
| 351 |
+
"truncated": int(merged["truncated"].sum()),
|
| 352 |
+
"truncation_rate": float(merged["truncated"].mean()) if len(merged) else 0.0,
|
| 353 |
+
"boxed_rows": boxed_rows,
|
| 354 |
+
"boxed_rate": float(boxed_rows / len(merged)) if len(merged) else 0.0,
|
| 355 |
+
"malformed_boxed_rows": malformed_boxed_rows,
|
| 356 |
+
"malformed_boxed_rate": float(malformed_boxed_rows / len(merged)) if len(merged) else 0.0,
|
| 357 |
+
"no_box_fallback_rows": no_box_fallback_rows,
|
| 358 |
+
"no_box_fallback_rate": float(no_box_fallback_rows / len(merged)) if len(merged) else 0.0,
|
| 359 |
+
"first_boxed_correct": first_boxed_correct,
|
| 360 |
+
"first_boxed_accuracy": float(first_boxed_correct / len(merged)) if len(merged) else 0.0,
|
| 361 |
+
"strict_boxed_correct": strict_boxed_correct,
|
| 362 |
+
"strict_boxed_accuracy": float(strict_boxed_correct / len(merged)) if len(merged) else 0.0,
|
| 363 |
+
"exact_prediction_correct": exact_prediction_correct,
|
| 364 |
+
"exact_prediction_accuracy": float(exact_prediction_correct / len(merged)) if len(merged) else 0.0,
|
| 365 |
+
"public_metric_only_false_gain_rows": public_metric_only_false_gain_rows,
|
| 366 |
+
"public_metric_only_false_gain_rate": (
|
| 367 |
+
float(public_metric_only_false_gain_rows / len(merged)) if len(merged) else 0.0
|
| 368 |
+
),
|
| 369 |
+
"completion_tokens": total_tokens,
|
| 370 |
+
"generation_elapsed_s": gen_elapsed,
|
| 371 |
+
"tokens_per_second": float(total_tokens / gen_elapsed) if gen_elapsed > 0 else 0.0,
|
| 372 |
+
"candidate_elapsed_s": time.time() - cand_start,
|
| 373 |
+
"seed": int(args.seed),
|
| 374 |
+
"config": config,
|
| 375 |
+
"outputs": {
|
| 376 |
+
"raw_predictions_pre_score_csv": str(raw_predictions_path),
|
| 377 |
+
"predictions_csv": str(predictions_path),
|
| 378 |
+
"per_task_csv": str(per_task_path),
|
| 379 |
+
"report_json": str(report_path),
|
| 380 |
+
},
|
| 381 |
+
}
|
| 382 |
+
report_path.write_text(json.dumps(report, indent=2, sort_keys=True), encoding="utf-8")
|
| 383 |
+
by_task = {str(r["task_type"]): r for _, r in per_task.iterrows()}
|
| 384 |
+
aggregate = {
|
| 385 |
+
"name": candidate["name"],
|
| 386 |
+
"adapter": str(candidate["adapter"]),
|
| 387 |
+
"status": "ok",
|
| 388 |
+
"correct": report["correct"],
|
| 389 |
+
"accuracy": report["accuracy"],
|
| 390 |
+
"strict_boxed_correct": report["strict_boxed_correct"],
|
| 391 |
+
"exact_prediction_correct": report["exact_prediction_correct"],
|
| 392 |
+
"public_metric_only_false_gain_rows": report["public_metric_only_false_gain_rows"],
|
| 393 |
+
"truncated": report["truncated"],
|
| 394 |
+
"truncation_rate": report["truncation_rate"],
|
| 395 |
+
"equation_transform_correct": int(by_task.get("equation_transform", {}).get("correct", 0)),
|
| 396 |
+
"bit_manipulation_correct": int(by_task.get("bit_manipulation", {}).get("correct", 0)),
|
| 397 |
+
"completion_tokens": report["completion_tokens"],
|
| 398 |
+
"tokens_per_second": report["tokens_per_second"],
|
| 399 |
+
"report_json": str(report_path),
|
| 400 |
+
"error": "",
|
| 401 |
+
}
|
| 402 |
+
aggregate_rows.append(aggregate)
|
| 403 |
+
print("candidate_summary =", json.dumps(aggregate, indent=2, sort_keys=True))
|
| 404 |
+
print("candidate_per_task =")
|
| 405 |
+
print(per_task.to_string(index=False))
|
| 406 |
+
except Exception as exc:
|
| 407 |
+
error_text = "".join(traceback.format_exception_only(type(exc), exc)).strip()
|
| 408 |
+
print("candidate_failed =", candidate["name"], error_text, flush=True)
|
| 409 |
+
aggregate_rows.append(
|
| 410 |
+
{
|
| 411 |
+
"name": candidate["name"],
|
| 412 |
+
"adapter": str(candidate["adapter"]),
|
| 413 |
+
"status": "failed",
|
| 414 |
+
"correct": 0,
|
| 415 |
+
"accuracy": 0.0,
|
| 416 |
+
"truncated": 999999,
|
| 417 |
+
"truncation_rate": 1.0,
|
| 418 |
+
"equation_transform_correct": 0,
|
| 419 |
+
"bit_manipulation_correct": 0,
|
| 420 |
+
"completion_tokens": 0,
|
| 421 |
+
"tokens_per_second": 0.0,
|
| 422 |
+
"report_json": "",
|
| 423 |
+
"error": error_text,
|
| 424 |
+
}
|
| 425 |
+
)
|
| 426 |
+
if not args.continue_on_error:
|
| 427 |
+
raise
|
| 428 |
+
|
| 429 |
+
aggregate = pd.DataFrame(aggregate_rows)
|
| 430 |
+
aggregate_csv = args.output_dir / "batch_candidate_summary.csv"
|
| 431 |
+
aggregate_json = args.output_dir / "batch_candidate_summary.json"
|
| 432 |
+
aggregate.to_csv(aggregate_csv, index=False)
|
| 433 |
+
aggregate_json.write_text(
|
| 434 |
+
json.dumps(
|
| 435 |
+
{
|
| 436 |
+
"generated_at_utc": utc_now(),
|
| 437 |
+
"elapsed_s": time.time() - started_at,
|
| 438 |
+
"base_model_path": str(base_model_path),
|
| 439 |
+
"solution_csv": str(args.solution_csv),
|
| 440 |
+
"questions_csv": str(args.questions_csv or args.solution_csv),
|
| 441 |
+
"candidates_json": str(args.candidates_json),
|
| 442 |
+
"config": config,
|
| 443 |
+
"rows": aggregate_rows,
|
| 444 |
+
},
|
| 445 |
+
indent=2,
|
| 446 |
+
sort_keys=True,
|
| 447 |
+
),
|
| 448 |
+
encoding="utf-8",
|
| 449 |
+
)
|
| 450 |
+
print("aggregate_csv =", aggregate_csv)
|
| 451 |
+
print("aggregate_json =", aggregate_json)
|
| 452 |
+
return 0
|
| 453 |
+
|
| 454 |
+
|
| 455 |
+
if __name__ == "__main__":
|
| 456 |
+
raise SystemExit(main())
|
runs/v1244-ckpt120-vs-086-subset200-20260615T203643Z/workspace/scripts/kg1_score_live.py
ADDED
|
@@ -0,0 +1,511 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""KG1 SCORE TELEMETRY -- live exact-match canary metric computer (PROTOTYPE).
|
| 3 |
+
|
| 4 |
+
This module is the *metric computer* half of the in-training score canary. It is
|
| 5 |
+
DELIBERATELY decoupled from generation: it receives a list of already-generated
|
| 6 |
+
greedy outputs as (id, raw_output, answer, family, finish_reason, completion_tokens)
|
| 7 |
+
and produces the parseable telemetry JSON that the training job logs every N steps.
|
| 8 |
+
|
| 9 |
+
It reuses the OFFICIAL metric semantics verbatim (extract_final_answer + verify)
|
| 10 |
+
so the exact-match number it reports IS the score number (on the eval-set it sees).
|
| 11 |
+
|
| 12 |
+
It does NOT load any model, does NOT do teacher forcing, and does NOT compute loss.
|
| 13 |
+
Loss is intentionally absent: the whole point is to stop trusting loss.
|
| 14 |
+
|
| 15 |
+
Source of metric semantics (verbatim):
|
| 16 |
+
artifacts/official_metric_audit_20260605/nvidia_nemotron_metric_extracted.py
|
| 17 |
+
Official inference surface (verbatim):
|
| 18 |
+
docs KG1_SCORE_DETERMINANTS_AUDIT_2026_06_13.md (temp=0.0, top_p=1.0,
|
| 19 |
+
max_tokens=7680, max_model_len=8192) -> greedy.
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
from __future__ import annotations
|
| 23 |
+
|
| 24 |
+
import json
|
| 25 |
+
import math
|
| 26 |
+
import re
|
| 27 |
+
from collections import defaultdict
|
| 28 |
+
from typing import Any, Iterable
|
| 29 |
+
|
| 30 |
+
# ---------------------------------------------------------------------------
|
| 31 |
+
# OFFICIAL METRIC SEMANTICS (verbatim from nvidia_nemotron_metric_extracted.py)
|
| 32 |
+
# ---------------------------------------------------------------------------
|
| 33 |
+
|
| 34 |
+
def extract_final_answer(text: str | None) -> str:
|
| 35 |
+
if text is None:
|
| 36 |
+
return "NOT_FOUND"
|
| 37 |
+
boxed_starts = list(re.finditer(r"\\boxed\{", text))
|
| 38 |
+
matches: list[str] = []
|
| 39 |
+
for i, m in enumerate(boxed_starts):
|
| 40 |
+
start = m.end()
|
| 41 |
+
end = boxed_starts[i + 1].start() if i + 1 < len(boxed_starts) else len(text)
|
| 42 |
+
segment = text[start:end]
|
| 43 |
+
last_brace = segment.rfind("}")
|
| 44 |
+
matches.append(segment[:last_brace] if last_brace != -1 else segment)
|
| 45 |
+
if matches:
|
| 46 |
+
non_empty = [m.strip() for m in matches if m.strip()]
|
| 47 |
+
if non_empty:
|
| 48 |
+
return non_empty[-1]
|
| 49 |
+
return matches[-1].strip()
|
| 50 |
+
patterns = [
|
| 51 |
+
r"The final answer is:\s*([^\n]+)",
|
| 52 |
+
r"Final answer is:\s*([^\n]+)",
|
| 53 |
+
r"Final answer\s*[::]\s*([^\n]+)",
|
| 54 |
+
r"final answer\s*[::]\s*([^\n]+)",
|
| 55 |
+
]
|
| 56 |
+
for pattern in patterns:
|
| 57 |
+
m = re.findall(pattern, text, re.IGNORECASE)
|
| 58 |
+
if m:
|
| 59 |
+
return m[-1].strip()
|
| 60 |
+
m = re.findall(r"-?\d+(?:\.\d+)?", text)
|
| 61 |
+
if m:
|
| 62 |
+
return m[-1]
|
| 63 |
+
lines = [line.strip() for line in text.splitlines() if line.strip()]
|
| 64 |
+
return lines[-1] if lines else "NOT_FOUND"
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def verify(stored_answer: str, predicted: str) -> bool:
|
| 68 |
+
stored_answer = str(stored_answer).strip()
|
| 69 |
+
predicted = str(predicted).strip()
|
| 70 |
+
if re.fullmatch(r"[01]+", stored_answer):
|
| 71 |
+
return predicted.lower() == stored_answer.lower()
|
| 72 |
+
try:
|
| 73 |
+
stored_num = float(stored_answer)
|
| 74 |
+
predicted_num = float(predicted)
|
| 75 |
+
return math.isclose(stored_num, predicted_num, rel_tol=1e-2, abs_tol=1e-5)
|
| 76 |
+
except Exception:
|
| 77 |
+
return predicted.lower() == stored_answer.lower()
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
# ---------------------------------------------------------------------------
|
| 81 |
+
# FORMAT / TRUNCATION DIAGNOSTICS (score-facing, not loss)
|
| 82 |
+
# ---------------------------------------------------------------------------
|
| 83 |
+
|
| 84 |
+
TRUNCATION_FINISH_REASONS = {
|
| 85 |
+
"length", "max_tokens", "max_output_tokens", "token_limit", "truncated",
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
# Official surface (greedy). Truncation == reached generation cap before EOS.
|
| 89 |
+
OFFICIAL_MAX_TOKENS = 7680
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
def is_truncated(finish_reason: str | None, completion_tokens: int | None,
|
| 93 |
+
max_tokens: int = OFFICIAL_MAX_TOKENS) -> bool:
|
| 94 |
+
fr = (str(finish_reason).strip().lower() if finish_reason is not None else "")
|
| 95 |
+
if fr in TRUNCATION_FINISH_REASONS:
|
| 96 |
+
return True
|
| 97 |
+
if completion_tokens is not None:
|
| 98 |
+
try:
|
| 99 |
+
if int(completion_tokens) >= int(max_tokens):
|
| 100 |
+
return True
|
| 101 |
+
except (TypeError, ValueError):
|
| 102 |
+
pass
|
| 103 |
+
return False
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
def count_boxed(text: str | None) -> int:
|
| 107 |
+
if text is None:
|
| 108 |
+
return 0
|
| 109 |
+
return len(re.findall(r"\\boxed\{", text))
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def has_unclosed_box(text: str | None) -> bool:
|
| 113 |
+
"""A \\boxed{ with no matching } anywhere after the LAST \\boxed{ start."""
|
| 114 |
+
if text is None:
|
| 115 |
+
return False
|
| 116 |
+
starts = list(re.finditer(r"\\boxed\{", text))
|
| 117 |
+
if not starts:
|
| 118 |
+
return False
|
| 119 |
+
tail = text[starts[-1].end():]
|
| 120 |
+
return "}" not in tail
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
def box_status(text: str | None) -> str:
|
| 124 |
+
n = count_boxed(text)
|
| 125 |
+
if n == 0:
|
| 126 |
+
return "no_box"
|
| 127 |
+
if has_unclosed_box(text):
|
| 128 |
+
return "unclosed_box"
|
| 129 |
+
if n == 1:
|
| 130 |
+
return "single_box"
|
| 131 |
+
return "double_box" # n >= 2
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
# ---------------------------------------------------------------------------
|
| 135 |
+
# TELEMETRY COMPUTER
|
| 136 |
+
# ---------------------------------------------------------------------------
|
| 137 |
+
|
| 138 |
+
def _new_fam_counter() -> dict[str, Any]:
|
| 139 |
+
return {
|
| 140 |
+
"rows": 0, "correct": 0, "truncated": 0,
|
| 141 |
+
"has_box": 0, "single_box": 0, "extract_ok": 0,
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def compute_score_telemetry(
|
| 146 |
+
rows: Iterable[dict[str, Any]],
|
| 147 |
+
*,
|
| 148 |
+
baseline_per_family: dict[str, int] | None = None,
|
| 149 |
+
baseline_truncation_per_family: dict[str, float] | None = None,
|
| 150 |
+
step: int | None = None,
|
| 151 |
+
max_step: int | None = None,
|
| 152 |
+
max_tokens: int = OFFICIAL_MAX_TOKENS,
|
| 153 |
+
weak_families: tuple[str, ...] = ("bit_manipulation", "equation_transform"),
|
| 154 |
+
protected_families: tuple[str, ...] = (
|
| 155 |
+
"gravity_constant", "unit_conversion", "numeral_system", "text_encryption",
|
| 156 |
+
),
|
| 157 |
+
) -> dict[str, Any]:
|
| 158 |
+
"""Compute the live score telemetry JSON.
|
| 159 |
+
|
| 160 |
+
rows: iterable of dicts with keys:
|
| 161 |
+
id, raw_output, answer, family, finish_reason (opt), completion_tokens (opt)
|
| 162 |
+
baseline_per_family: {family: correct_count} for the 086 baseline on THIS eval-set.
|
| 163 |
+
"""
|
| 164 |
+
by_fam: dict[str, dict[str, Any]] = defaultdict(_new_fam_counter)
|
| 165 |
+
total = _new_fam_counter()
|
| 166 |
+
# global format anomalies
|
| 167 |
+
fmt = {"no_box": 0, "single_box": 0, "double_box": 0, "unclosed_box": 0,
|
| 168 |
+
"extract_not_found": 0}
|
| 169 |
+
|
| 170 |
+
for r in rows:
|
| 171 |
+
fam = str(r.get("family", "unknown"))
|
| 172 |
+
raw = r.get("raw_output")
|
| 173 |
+
ans = r.get("answer", "")
|
| 174 |
+
fr = r.get("finish_reason")
|
| 175 |
+
ct = r.get("completion_tokens")
|
| 176 |
+
|
| 177 |
+
extracted = extract_final_answer(raw)
|
| 178 |
+
ok = verify(ans, extracted)
|
| 179 |
+
trunc = is_truncated(fr, ct, max_tokens)
|
| 180 |
+
bstat = box_status(raw)
|
| 181 |
+
has_box = bstat in ("single_box", "double_box", "unclosed_box")
|
| 182 |
+
single = bstat == "single_box"
|
| 183 |
+
extract_ok = extracted != "NOT_FOUND"
|
| 184 |
+
|
| 185 |
+
c = by_fam[fam]
|
| 186 |
+
for tgt in (c, total):
|
| 187 |
+
tgt["rows"] += 1
|
| 188 |
+
tgt["correct"] += int(ok)
|
| 189 |
+
tgt["truncated"] += int(trunc)
|
| 190 |
+
tgt["has_box"] += int(has_box)
|
| 191 |
+
tgt["single_box"] += int(single)
|
| 192 |
+
tgt["extract_ok"] += int(extract_ok)
|
| 193 |
+
|
| 194 |
+
fmt[bstat] = fmt.get(bstat, 0) + 1
|
| 195 |
+
if not extract_ok:
|
| 196 |
+
fmt["extract_not_found"] += 1
|
| 197 |
+
|
| 198 |
+
def pct(num: int, den: int) -> float:
|
| 199 |
+
return round(num / den, 6) if den else 0.0
|
| 200 |
+
|
| 201 |
+
fam_report: dict[str, dict[str, Any]] = {}
|
| 202 |
+
exact_delta_by_family: dict[str, int] = {}
|
| 203 |
+
for fam, c in sorted(by_fam.items()):
|
| 204 |
+
base = (baseline_per_family or {}).get(fam)
|
| 205 |
+
delta = (c["correct"] - base) if base is not None else None
|
| 206 |
+
if delta is not None:
|
| 207 |
+
exact_delta_by_family[fam] = delta
|
| 208 |
+
fam_report[fam] = {
|
| 209 |
+
"rows": c["rows"],
|
| 210 |
+
"correct": c["correct"],
|
| 211 |
+
"accuracy": pct(c["correct"], c["rows"]),
|
| 212 |
+
"baseline_correct": base,
|
| 213 |
+
"exact_delta": delta,
|
| 214 |
+
"truncation_rate": pct(c["truncated"], c["rows"]),
|
| 215 |
+
"boxed_rate": pct(c["has_box"], c["rows"]),
|
| 216 |
+
"single_boxed_rate": pct(c["single_box"], c["rows"]),
|
| 217 |
+
"extract_ok_rate": pct(c["extract_ok"], c["rows"]),
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
# Aggregate deltas
|
| 221 |
+
def agg_delta(fams: tuple[str, ...]) -> int | None:
|
| 222 |
+
vals = [exact_delta_by_family[f] for f in fams if f in exact_delta_by_family]
|
| 223 |
+
return sum(vals) if vals else (0 if baseline_per_family else None)
|
| 224 |
+
|
| 225 |
+
weak_delta = agg_delta(weak_families)
|
| 226 |
+
protected_delta = agg_delta(protected_families)
|
| 227 |
+
bit_delta = exact_delta_by_family.get("bit_manipulation")
|
| 228 |
+
eq_delta = exact_delta_by_family.get("equation_transform")
|
| 229 |
+
overall_baseline = (sum(baseline_per_family.values())
|
| 230 |
+
if baseline_per_family else None)
|
| 231 |
+
overall_delta = (total["correct"] - overall_baseline
|
| 232 |
+
if overall_baseline is not None else None)
|
| 233 |
+
|
| 234 |
+
overall_trunc_rate = pct(total["truncated"], total["rows"])
|
| 235 |
+
baseline_overall_trunc = None
|
| 236 |
+
if baseline_truncation_per_family:
|
| 237 |
+
# weighted by current per-fam rows
|
| 238 |
+
num = 0.0
|
| 239 |
+
for fam, c in by_fam.items():
|
| 240 |
+
num += baseline_truncation_per_family.get(fam, 0.0) * c["rows"]
|
| 241 |
+
baseline_overall_trunc = round(num / total["rows"], 6) if total["rows"] else 0.0
|
| 242 |
+
|
| 243 |
+
# ---- ABORT RULES (exact-match based; NEVER loss) ----
|
| 244 |
+
abort = evaluate_abort(
|
| 245 |
+
overall_delta=overall_delta,
|
| 246 |
+
protected_delta=protected_delta,
|
| 247 |
+
bit_delta=bit_delta,
|
| 248 |
+
eq_delta=eq_delta,
|
| 249 |
+
weak_delta=weak_delta,
|
| 250 |
+
overall_trunc_rate=overall_trunc_rate,
|
| 251 |
+
baseline_overall_trunc=baseline_overall_trunc,
|
| 252 |
+
has_baseline=baseline_per_family is not None,
|
| 253 |
+
)
|
| 254 |
+
|
| 255 |
+
out = {
|
| 256 |
+
"schema_version": "kg1_score_live_v1",
|
| 257 |
+
"kind": "exact_match_greedy_canary",
|
| 258 |
+
"step": step,
|
| 259 |
+
"max_step": max_step,
|
| 260 |
+
"eval_rows": total["rows"],
|
| 261 |
+
"exact_match": {
|
| 262 |
+
"correct": total["correct"],
|
| 263 |
+
"rows": total["rows"],
|
| 264 |
+
"accuracy": pct(total["correct"], total["rows"]),
|
| 265 |
+
"baseline_correct": overall_baseline,
|
| 266 |
+
"overall_exact_delta": overall_delta,
|
| 267 |
+
},
|
| 268 |
+
"exact_delta": {
|
| 269 |
+
"overall": overall_delta,
|
| 270 |
+
"weak": weak_delta,
|
| 271 |
+
"bit_manipulation": bit_delta,
|
| 272 |
+
"equation_transform": eq_delta,
|
| 273 |
+
"protected": protected_delta,
|
| 274 |
+
},
|
| 275 |
+
"truncation": {
|
| 276 |
+
"rate": overall_trunc_rate,
|
| 277 |
+
"count": total["truncated"],
|
| 278 |
+
"baseline_rate": baseline_overall_trunc,
|
| 279 |
+
"max_tokens": max_tokens,
|
| 280 |
+
},
|
| 281 |
+
"boxed": {
|
| 282 |
+
"boxed_rate": pct(total["has_box"], total["rows"]),
|
| 283 |
+
"exactly_one_boxed_rate": pct(total["single_box"], total["rows"]),
|
| 284 |
+
"extract_ok_rate": pct(total["extract_ok"], total["rows"]),
|
| 285 |
+
},
|
| 286 |
+
"format_anomalies": {
|
| 287 |
+
"no_box": fmt["no_box"],
|
| 288 |
+
"double_boxed": fmt["double_box"],
|
| 289 |
+
"unclosed_box": fmt["unclosed_box"],
|
| 290 |
+
"extract_not_found": fmt["extract_not_found"],
|
| 291 |
+
},
|
| 292 |
+
"by_family": fam_report,
|
| 293 |
+
"abort": abort,
|
| 294 |
+
}
|
| 295 |
+
return out
|
| 296 |
+
|
| 297 |
+
|
| 298 |
+
def evaluate_abort(
|
| 299 |
+
*,
|
| 300 |
+
overall_delta: int | None,
|
| 301 |
+
protected_delta: int | None,
|
| 302 |
+
bit_delta: int | None,
|
| 303 |
+
eq_delta: int | None,
|
| 304 |
+
weak_delta: int | None,
|
| 305 |
+
overall_trunc_rate: float,
|
| 306 |
+
baseline_overall_trunc: float | None,
|
| 307 |
+
has_baseline: bool,
|
| 308 |
+
) -> dict[str, Any]:
|
| 309 |
+
"""ABORT rules are exact-match based. Never loss.
|
| 310 |
+
|
| 311 |
+
A checkpoint is SAFE-TO-CONTINUE only if ALL hold (when baseline is known):
|
| 312 |
+
1. protected exact_delta >= 0 (no protected-family regression)
|
| 313 |
+
2. overall exact_delta >= 0 (total did not drop)
|
| 314 |
+
3. target exact_delta >= 0 (bit OR equation improved net non-negative)
|
| 315 |
+
4. truncation rate <= baseline truncation (+ small tol)
|
| 316 |
+
Without a real baseline we CANNOT abort on regression (only on hard format/trunc
|
| 317 |
+
collapse). The status then is WATCH, not OK -- the absence of a baseline is itself
|
| 318 |
+
a reported blocker (baseline per-item is a hard prerequisite).
|
| 319 |
+
"""
|
| 320 |
+
TRUNC_TOL = 0.01 # allow 1pp jitter
|
| 321 |
+
reasons: list[str] = []
|
| 322 |
+
blockers: list[str] = []
|
| 323 |
+
|
| 324 |
+
if not has_baseline:
|
| 325 |
+
blockers.append("baseline_per_item_missing")
|
| 326 |
+
|
| 327 |
+
# Hard format/truncation collapse can abort even without baseline.
|
| 328 |
+
hard_trunc_cap = 0.20
|
| 329 |
+
if overall_trunc_rate > hard_trunc_cap:
|
| 330 |
+
reasons.append(f"truncation_rate>{hard_trunc_cap}:{overall_trunc_rate}")
|
| 331 |
+
|
| 332 |
+
if has_baseline:
|
| 333 |
+
if protected_delta is not None and protected_delta < 0:
|
| 334 |
+
reasons.append(f"protected_regression:{protected_delta}")
|
| 335 |
+
if overall_delta is not None and overall_delta < 0:
|
| 336 |
+
reasons.append(f"overall_regression:{overall_delta}")
|
| 337 |
+
# target: bit E equation INDIVIDUALMENTE nao podem regredir (gate full947_089 exige
|
| 338 |
+
# +1 em CADA; agregado mascararia regressao de uma familia compensada pela outra).
|
| 339 |
+
if bit_delta is not None and bit_delta < 0:
|
| 340 |
+
reasons.append(f"bit_individual_regression:{bit_delta}")
|
| 341 |
+
if eq_delta is not None and eq_delta < 0:
|
| 342 |
+
reasons.append(f"eq_individual_regression:{eq_delta}")
|
| 343 |
+
if weak_delta is not None and weak_delta < 0:
|
| 344 |
+
reasons.append(f"weak_target_regression:{weak_delta}")
|
| 345 |
+
if baseline_overall_trunc is not None and overall_trunc_rate > baseline_overall_trunc + TRUNC_TOL:
|
| 346 |
+
reasons.append(
|
| 347 |
+
f"truncation_above_baseline:{overall_trunc_rate}>"
|
| 348 |
+
f"{baseline_overall_trunc}+{TRUNC_TOL}")
|
| 349 |
+
|
| 350 |
+
if reasons:
|
| 351 |
+
decision = "ABORT"
|
| 352 |
+
elif blockers:
|
| 353 |
+
decision = "WATCH"
|
| 354 |
+
else:
|
| 355 |
+
decision = "OK"
|
| 356 |
+
|
| 357 |
+
return {
|
| 358 |
+
"decision": decision,
|
| 359 |
+
"abort_reasons": reasons,
|
| 360 |
+
"blockers": blockers,
|
| 361 |
+
"rule": ("never_loss; protected>=0 AND overall>=0 AND bit>=0 AND eq>=0 (individual) AND "
|
| 362 |
+
"weak>=0 AND trunc<=baseline+tol; hard_trunc_cap=0.20"),
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
def render_marker(telemetry: dict[str, Any]) -> str:
|
| 367 |
+
"""Single parseable machine line + a human heartbeat line."""
|
| 368 |
+
em = telemetry["exact_match"]
|
| 369 |
+
d = telemetry["exact_delta"]
|
| 370 |
+
t = telemetry["truncation"]
|
| 371 |
+
b = telemetry["boxed"]
|
| 372 |
+
a = telemetry["abort"]
|
| 373 |
+
machine = "KG1_SCORE_LIVE_JSON " + json.dumps(telemetry, ensure_ascii=False)
|
| 374 |
+
human = (
|
| 375 |
+
f"KG1_SCORE_LIVE_HEARTBEAT step={telemetry.get('step')}/{telemetry.get('max_step')} "
|
| 376 |
+
f"EM={em['correct']}/{em['rows']}({em['accuracy']:.3f}) "
|
| 377 |
+
f"d_overall={d['overall']} d_bit={d['bit_manipulation']} d_eq={d['equation_transform']} "
|
| 378 |
+
f"d_protected={d['protected']} trunc={t['rate']:.3f} "
|
| 379 |
+
f"box1={b['exactly_one_boxed_rate']:.3f} -> {a['decision']}"
|
| 380 |
+
)
|
| 381 |
+
status = f"KG1_SCORE_LIVE_STATUS={a['decision']}"
|
| 382 |
+
return machine + "\n" + human + "\n" + status
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
# ---------------------------------------------------------------------------
|
| 386 |
+
# DASHBOARD DIDATICO (Use a Cabeca) -- camada de leitura HUMANA, muito detalhada.
|
| 387 |
+
# Reusado no treino (SCORE-LIVE) e no Job B (eval full947). Nao substitui os
|
| 388 |
+
# marcadores de maquina (render_marker); complementa.
|
| 389 |
+
# ---------------------------------------------------------------------------
|
| 390 |
+
|
| 391 |
+
FULL947_FAMILY_SIZE = {"bit_manipulation": 160, "equation_transform": 155}
|
| 392 |
+
FULL947_PROTECTED_TOTAL = 632
|
| 393 |
+
FULL947_TOTAL = 947
|
| 394 |
+
SCORE_TARGETS = {"086_piso": 823, "meta_0.87": 824, "stretch_0.89": 843}
|
| 395 |
+
PROTECTED_FAMILIES = ("gravity_constant", "unit_conversion", "numeral_system", "text_encryption")
|
| 396 |
+
WEAK_FAMILIES = ("bit_manipulation", "equation_transform")
|
| 397 |
+
_FAMILY_LABEL = {
|
| 398 |
+
"bit_manipulation": "bit (ALVO)",
|
| 399 |
+
"equation_transform": "equation (ALVO)",
|
| 400 |
+
"gravity_constant": "gravity (protegida)",
|
| 401 |
+
"unit_conversion": "unit (protegida)",
|
| 402 |
+
"numeral_system": "numeral (protegida)",
|
| 403 |
+
"text_encryption": "text (protegida)",
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
|
| 407 |
+
def _bar(frac: float | None, width: int = 12) -> str:
|
| 408 |
+
f = 0.0 if frac is None else max(0.0, min(1.0, float(frac)))
|
| 409 |
+
n = int(round(f * width))
|
| 410 |
+
return "[" + "#" * n + "." * (width - n) + "]"
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
def _delta_icon(delta: int | None) -> str:
|
| 414 |
+
if delta is None:
|
| 415 |
+
return " ?"
|
| 416 |
+
if delta > 0:
|
| 417 |
+
return f"+{delta} UP"
|
| 418 |
+
if delta < 0:
|
| 419 |
+
return f"{delta} DOWN"
|
| 420 |
+
return " 0 ="
|
| 421 |
+
|
| 422 |
+
|
| 423 |
+
def project_full947(tel: dict[str, Any]) -> dict[str, Any]:
|
| 424 |
+
"""Projecao INDICATIVA do full947 a partir das taxas por familia (amostra pequena =>
|
| 425 |
+
ruidosa). Termometro -- o juiz real e o Notebook B (vLLM full947)."""
|
| 426 |
+
fam = tel.get("by_family") or {}
|
| 427 |
+
|
| 428 |
+
def acc(name: str) -> float | None:
|
| 429 |
+
f = fam.get(name)
|
| 430 |
+
return float(f["accuracy"]) if f and f.get("rows") else None
|
| 431 |
+
|
| 432 |
+
bit_acc, eq_acc = acc("bit_manipulation"), acc("equation_transform")
|
| 433 |
+
prot_correct = sum(fam[f]["correct"] for f in PROTECTED_FAMILIES if f in fam)
|
| 434 |
+
prot_rows = sum(fam[f]["rows"] for f in PROTECTED_FAMILIES if f in fam)
|
| 435 |
+
prot_acc = (prot_correct / prot_rows) if prot_rows else None
|
| 436 |
+
proj = 0.0
|
| 437 |
+
if bit_acc is not None:
|
| 438 |
+
proj += bit_acc * FULL947_FAMILY_SIZE["bit_manipulation"]
|
| 439 |
+
if eq_acc is not None:
|
| 440 |
+
proj += eq_acc * FULL947_FAMILY_SIZE["equation_transform"]
|
| 441 |
+
if prot_acc is not None:
|
| 442 |
+
proj += prot_acc * FULL947_PROTECTED_TOTAL
|
| 443 |
+
projected = int(round(proj))
|
| 444 |
+
return {
|
| 445 |
+
"projected_correct": projected,
|
| 446 |
+
"projected_score": round(projected / FULL947_TOTAL, 4),
|
| 447 |
+
"bit_acc": bit_acc, "eq_acc": eq_acc, "protected_acc": prot_acc,
|
| 448 |
+
"gap_to_0_87": SCORE_TARGETS["meta_0.87"] - projected,
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
|
| 452 |
+
def render_dashboard(tel: dict[str, Any], *, title: str = "PAINEL SCORE-LIVE",
|
| 453 |
+
source: str = "geracao real (greedy oficial)") -> str:
|
| 454 |
+
"""Dashboard humano MUITO detalhado e didatico (Use a Cabeca)."""
|
| 455 |
+
em = tel.get("exact_match", {}); ed = tel.get("exact_delta", {})
|
| 456 |
+
tr = tel.get("truncation", {}); bx = tel.get("boxed", {})
|
| 457 |
+
fa = tel.get("format_anomalies", {}); ab = tel.get("abort", {})
|
| 458 |
+
fam = tel.get("by_family") or {}
|
| 459 |
+
L: list[str] = []
|
| 460 |
+
L.append("=" * 80)
|
| 461 |
+
L.append(f" {title} | step {tel.get('step')}/{tel.get('max_step')} | fonte: {source}")
|
| 462 |
+
L.append(" (acerto = boxed exact-match OFICIAL, NAO loss. 'loss bom != score bom')")
|
| 463 |
+
L.append("=" * 80)
|
| 464 |
+
acc = float(em.get("accuracy") or 0.0)
|
| 465 |
+
L.append("[1] PLACAR GERAL (no eval-set):")
|
| 466 |
+
L.append(f" acerto = {em.get('correct')}/{em.get('rows')} = {acc * 100:.1f}% {_bar(acc)}")
|
| 467 |
+
if em.get("baseline_correct") is not None:
|
| 468 |
+
L.append(f" vs 086 (baseline): delta {_delta_icon(ed.get('overall'))} (>=0 = nao regrediu)")
|
| 469 |
+
expl = {"OK": "pode seguir", "WATCH": "observar (falta baseline ou em duvida)",
|
| 470 |
+
"ABORT": "score real REGREDIU -> PARAR"}.get(str(ab.get("decision")), "?")
|
| 471 |
+
L.append(f" STATUS: {ab.get('decision')} -> {expl}")
|
| 472 |
+
if ab.get("abort_reasons"):
|
| 473 |
+
L.append(" motivos: " + "; ".join(str(x) for x in ab["abort_reasons"]))
|
| 474 |
+
if ab.get("blockers"):
|
| 475 |
+
L.append(" pendencias: " + "; ".join(str(x) for x in ab["blockers"]))
|
| 476 |
+
L.append("-" * 80)
|
| 477 |
+
L.append("[2] POR FAMILIA (onde esta o ganho/risco):")
|
| 478 |
+
L.append(f" {'familia':<20}{'acerto':<12}{'barra':<14}{'trunc':<7}{'boxed':<7}{'vs086'}")
|
| 479 |
+
for name in list(WEAK_FAMILIES) + list(PROTECTED_FAMILIES):
|
| 480 |
+
f = fam.get(name)
|
| 481 |
+
if not f:
|
| 482 |
+
continue
|
| 483 |
+
a = float(f.get("accuracy") or 0.0)
|
| 484 |
+
L.append(
|
| 485 |
+
f" {_FAMILY_LABEL.get(name, name):<20}"
|
| 486 |
+
f"{str(f.get('correct')) + '/' + str(f.get('rows')):<12}{_bar(a, 10):<14}"
|
| 487 |
+
f"{f.get('truncation_rate', 0) * 100:>3.0f}% {f.get('boxed_rate', 0) * 100:>3.0f}% "
|
| 488 |
+
f"{_delta_icon(f.get('exact_delta'))}"
|
| 489 |
+
)
|
| 490 |
+
pj = project_full947(tel)
|
| 491 |
+
L.append("-" * 80)
|
| 492 |
+
L.append("[3] PROJECAO full947 (INDICATIVA -- amostra pequena; juiz real = Notebook B):")
|
| 493 |
+
L.append(f" se as taxas se mantiverem: ~{pj['projected_correct']}/947 = {pj['projected_score']:.4f}")
|
| 494 |
+
L.append(" referencias: 086(piso)=823/0.869 | meta=824/0.870 | stretch=843/0.890")
|
| 495 |
+
g = pj["gap_to_0_87"]
|
| 496 |
+
L.append(f" p/ bater 0.87: " + (f"FALTAM +{g} itens" if g > 0 else f"JA NO ALVO ({-g} acima)"))
|
| 497 |
+
L.append("-" * 80)
|
| 498 |
+
L.append("[4] SAUDE DE FORMATO (impacta o score direto):")
|
| 499 |
+
L.append(f" truncacao geral: {tr.get('rate', 0) * 100:.1f}% ({tr.get('count')} cortados antes do boxed)")
|
| 500 |
+
L.append(f" tem boxed: {bx.get('boxed_rate', 0) * 100:.0f}% | exatamente 1 boxed: "
|
| 501 |
+
f"{bx.get('exactly_one_boxed_rate', 0) * 100:.0f}% | extracao ok: {bx.get('extract_ok_rate', 0) * 100:.0f}%")
|
| 502 |
+
L.append(f" anomalias: sem_box={fa.get('no_box')} box_duplo={fa.get('double_boxed')} "
|
| 503 |
+
f"box_aberto={fa.get('unclosed_box')} nao_extraiu={fa.get('extract_not_found')}")
|
| 504 |
+
L.append("-" * 80)
|
| 505 |
+
L.append("[5] COMO LER (didatico):")
|
| 506 |
+
L.append(" - bit/equation = ALVOS (tem headroom). Protegidas devem ficar ~100%.")
|
| 507 |
+
L.append(" - truncacao alta = resposta cortada antes do boxed -> perde ponto.")
|
| 508 |
+
L.append(" - box_aberto/sem_box = formato quebrado -> a metrica nao acha a resposta.")
|
| 509 |
+
L.append(" - mede o SCORE REAL; confirme sempre no Notebook B (vLLM full947).")
|
| 510 |
+
L.append("=" * 80)
|
| 511 |
+
return "\n".join(L)
|
runs/v1244-ckpt120-vs-086-subset200-20260615T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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Shared metric utilities for the NVIDIA Nemotron reasoning challenge.
|
| 2 |
+
|
| 3 |
+
The score-facing answer extraction and verification functions intentionally
|
| 4 |
+
mirror the downloaded public Kaggle metric notebook. Diagnostic helpers such
|
| 5 |
+
as strict boxed extraction remain stricter than the official metric and must
|
| 6 |
+
not replace ``extract_final_answer`` for score/promotion decisions.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
from __future__ import annotations
|
| 10 |
+
|
| 11 |
+
import math
|
| 12 |
+
import re
|
| 13 |
+
import unicodedata
|
| 14 |
+
from pathlib import Path
|
| 15 |
+
from typing import Any
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
REPO_ROOT = Path(__file__).resolve().parent.parent
|
| 19 |
+
DEFAULT_DATA_DIR = REPO_ROOT / "data"
|
| 20 |
+
|
| 21 |
+
MODEL_NAME = "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16"
|
| 22 |
+
MODEL_REVISION = "cbd3fa9f933d55ef16a84236559f4ee2a0526848"
|
| 23 |
+
|
| 24 |
+
OFFICIAL_INFERENCE_CONFIG: dict[str, Any] = {
|
| 25 |
+
"model_name": MODEL_NAME,
|
| 26 |
+
"model_revision": MODEL_REVISION,
|
| 27 |
+
"max_lora_rank": 32,
|
| 28 |
+
"max_tokens": 7680,
|
| 29 |
+
"temperature": 0.0,
|
| 30 |
+
"top_p": 1.0,
|
| 31 |
+
"max_model_len": 8192,
|
| 32 |
+
"max_num_seqs": 64,
|
| 33 |
+
"gpu_memory_utilization": 0.85,
|
| 34 |
+
"enable_prefix_caching": True,
|
| 35 |
+
"enable_chunked_prefill": True,
|
| 36 |
+
"trust_remote_code": True,
|
| 37 |
+
"dtype": "auto",
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
PROMPT_SUFFIX = (
|
| 41 |
+
"\nPlease put your final answer inside `\\boxed{}`. "
|
| 42 |
+
"For example: `\\boxed{your answer}`"
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def ensure_prompt_suffix(prompt: object, suffix: str = PROMPT_SUFFIX) -> str:
|
| 47 |
+
"""Append the scoring prompt suffix exactly when it is absent."""
|
| 48 |
+
|
| 49 |
+
text = str(prompt or "")
|
| 50 |
+
if not suffix:
|
| 51 |
+
return text
|
| 52 |
+
if suffix.strip() in text:
|
| 53 |
+
return text
|
| 54 |
+
return text + suffix
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
FAMILIES = (
|
| 58 |
+
"gravity_constant",
|
| 59 |
+
"unit_conversion",
|
| 60 |
+
"numeral_system",
|
| 61 |
+
"text_encryption",
|
| 62 |
+
"bit_manipulation",
|
| 63 |
+
"equation_transform",
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
FAMILY_ALIASES = {
|
| 67 |
+
"gravity": "gravity_constant",
|
| 68 |
+
"grav": "gravity_constant",
|
| 69 |
+
"gravity_constant": "gravity_constant",
|
| 70 |
+
"unit": "unit_conversion",
|
| 71 |
+
"units": "unit_conversion",
|
| 72 |
+
"unit_conversion": "unit_conversion",
|
| 73 |
+
"numeral": "numeral_system",
|
| 74 |
+
"roman": "numeral_system",
|
| 75 |
+
"roman_numeral": "numeral_system",
|
| 76 |
+
"number_system": "numeral_system",
|
| 77 |
+
"numeral_system": "numeral_system",
|
| 78 |
+
"cipher": "text_encryption",
|
| 79 |
+
"encryption": "text_encryption",
|
| 80 |
+
"text": "text_encryption",
|
| 81 |
+
"text_cipher": "text_encryption",
|
| 82 |
+
"text_encryption": "text_encryption",
|
| 83 |
+
"bit": "bit_manipulation",
|
| 84 |
+
"bits": "bit_manipulation",
|
| 85 |
+
"bit_manipulation": "bit_manipulation",
|
| 86 |
+
"eq": "equation_transform",
|
| 87 |
+
"equation": "equation_transform",
|
| 88 |
+
"equation_rules": "equation_transform",
|
| 89 |
+
"symbol_transform": "equation_transform",
|
| 90 |
+
"equation_symbolic": "equation_transform",
|
| 91 |
+
"equation_numeric": "equation_transform",
|
| 92 |
+
"equation_numeric_deduce": "equation_transform",
|
| 93 |
+
"equation_numeric_guess": "equation_transform",
|
| 94 |
+
"cryptarithm_deduce": "equation_transform",
|
| 95 |
+
"cryptarithm_guess": "equation_transform",
|
| 96 |
+
"equation_transform": "equation_transform",
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def _normalize_key(value: object) -> str:
|
| 101 |
+
text = unicodedata.normalize("NFKC", str(value or "")).strip().lower()
|
| 102 |
+
return re.sub(r"[\s\-]+", "_", text)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def canonical_family(value: object) -> str:
|
| 106 |
+
key = _normalize_key(value)
|
| 107 |
+
return FAMILY_ALIASES.get(key, key or "unknown")
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
def classify_puzzle(prompt: str) -> str:
|
| 111 |
+
low = str(prompt or "").lower()
|
| 112 |
+
if "bit manipulation" in low or "8-bit binary" in low:
|
| 113 |
+
return "bit_manipulation"
|
| 114 |
+
if "encryption" in low or "decrypt the following text" in low or "cipher" in low:
|
| 115 |
+
return "text_encryption"
|
| 116 |
+
if "numeral system" in low or "converted into a different numeral" in low:
|
| 117 |
+
return "numeral_system"
|
| 118 |
+
if "gravitational" in low or "gravity" in low:
|
| 119 |
+
return "gravity_constant"
|
| 120 |
+
if "transformation rule" in low or "transformation rules" in low:
|
| 121 |
+
return "equation_transform"
|
| 122 |
+
if "unit conversion" in low or "measurement" in low:
|
| 123 |
+
return "unit_conversion"
|
| 124 |
+
return "unknown"
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
def _extend_compact_symbolic_box_end(value: str, start: int, end: int) -> int:
|
| 128 |
+
r"""Extend a boxed payload across literal close-braces in symbol answers."""
|
| 129 |
+
|
| 130 |
+
cursor = end + 1
|
| 131 |
+
if cursor >= len(value) or value[cursor].isspace() or value[cursor] == "{":
|
| 132 |
+
return end
|
| 133 |
+
|
| 134 |
+
index = cursor
|
| 135 |
+
last_close: int | None = None
|
| 136 |
+
while index < len(value):
|
| 137 |
+
char = value[index]
|
| 138 |
+
if char.isspace() or char == "{":
|
| 139 |
+
break
|
| 140 |
+
if char == "\\":
|
| 141 |
+
if index + 1 < len(value) and not value[index + 1].isalnum() and not value[index + 1].isspace():
|
| 142 |
+
index += 2
|
| 143 |
+
continue
|
| 144 |
+
break
|
| 145 |
+
if char == "}":
|
| 146 |
+
last_close = index
|
| 147 |
+
elif char.isalpha():
|
| 148 |
+
break
|
| 149 |
+
index += 1
|
| 150 |
+
|
| 151 |
+
if last_close is None or last_close <= end:
|
| 152 |
+
return end
|
| 153 |
+
candidate = value[start:last_close]
|
| 154 |
+
if len(candidate) <= 64 and not any(item.isalpha() for item in candidate):
|
| 155 |
+
return last_close
|
| 156 |
+
return end
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
def extract_boxed_answers(text: str | None) -> list[str]:
|
| 160 |
+
if text is None:
|
| 161 |
+
return []
|
| 162 |
+
value = str(text)
|
| 163 |
+
matches: list[str] = []
|
| 164 |
+
marker = r"\boxed{"
|
| 165 |
+
cursor = 0
|
| 166 |
+
while True:
|
| 167 |
+
marker_pos = value.find(marker, cursor)
|
| 168 |
+
if marker_pos == -1:
|
| 169 |
+
break
|
| 170 |
+
start = marker_pos + len(marker)
|
| 171 |
+
minimal_end: int | None = None
|
| 172 |
+
index = start
|
| 173 |
+
while index < len(value):
|
| 174 |
+
char = value[index]
|
| 175 |
+
if char == "\\" and index + 1 < len(value):
|
| 176 |
+
index += 2
|
| 177 |
+
continue
|
| 178 |
+
if char == "}":
|
| 179 |
+
minimal_end = index
|
| 180 |
+
break
|
| 181 |
+
index += 1
|
| 182 |
+
|
| 183 |
+
depth = 1
|
| 184 |
+
index = start
|
| 185 |
+
while index < len(value):
|
| 186 |
+
char = value[index]
|
| 187 |
+
if char == "\\" and index + 1 < len(value):
|
| 188 |
+
index += 2
|
| 189 |
+
continue
|
| 190 |
+
if char == "{":
|
| 191 |
+
depth += 1
|
| 192 |
+
elif char == "}":
|
| 193 |
+
depth -= 1
|
| 194 |
+
if depth == 0:
|
| 195 |
+
break
|
| 196 |
+
index += 1
|
| 197 |
+
if depth == 0:
|
| 198 |
+
end = _extend_compact_symbolic_box_end(value, start, index)
|
| 199 |
+
while end + 1 < len(value) and value[end + 1] == "}":
|
| 200 |
+
end += 1
|
| 201 |
+
while (
|
| 202 |
+
end + 3 < len(value)
|
| 203 |
+
and value[end + 1] == "\\"
|
| 204 |
+
and not value[end + 2].isalnum()
|
| 205 |
+
and not value[end + 2].isspace()
|
| 206 |
+
and value[end + 3] == "}"
|
| 207 |
+
):
|
| 208 |
+
end += 3
|
| 209 |
+
matches.append(value[start:end])
|
| 210 |
+
cursor = end + 1
|
| 211 |
+
else:
|
| 212 |
+
if minimal_end is not None:
|
| 213 |
+
matches.append(value[start:minimal_end])
|
| 214 |
+
cursor = minimal_end + 1
|
| 215 |
+
else:
|
| 216 |
+
matches.append(value[start:])
|
| 217 |
+
break
|
| 218 |
+
return matches
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
def extract_closed_boxed_answers(text: str | None) -> list[str]:
|
| 222 |
+
if text is None:
|
| 223 |
+
return []
|
| 224 |
+
value = str(text)
|
| 225 |
+
matches: list[str] = []
|
| 226 |
+
marker = r"\boxed{"
|
| 227 |
+
cursor = 0
|
| 228 |
+
while True:
|
| 229 |
+
marker_pos = value.find(marker, cursor)
|
| 230 |
+
if marker_pos == -1:
|
| 231 |
+
break
|
| 232 |
+
start = marker_pos + len(marker)
|
| 233 |
+
minimal_end: int | None = None
|
| 234 |
+
index = start
|
| 235 |
+
while index < len(value):
|
| 236 |
+
char = value[index]
|
| 237 |
+
if char == "\\" and index + 1 < len(value):
|
| 238 |
+
index += 2
|
| 239 |
+
continue
|
| 240 |
+
if char == "}":
|
| 241 |
+
minimal_end = index
|
| 242 |
+
break
|
| 243 |
+
index += 1
|
| 244 |
+
|
| 245 |
+
depth = 1
|
| 246 |
+
index = start
|
| 247 |
+
while index < len(value):
|
| 248 |
+
char = value[index]
|
| 249 |
+
if char == "\\" and index + 1 < len(value):
|
| 250 |
+
index += 2
|
| 251 |
+
continue
|
| 252 |
+
if char == "{":
|
| 253 |
+
depth += 1
|
| 254 |
+
elif char == "}":
|
| 255 |
+
depth -= 1
|
| 256 |
+
if depth == 0:
|
| 257 |
+
break
|
| 258 |
+
index += 1
|
| 259 |
+
if depth == 0:
|
| 260 |
+
end = _extend_compact_symbolic_box_end(value, start, index)
|
| 261 |
+
while end + 1 < len(value) and value[end + 1] == "}":
|
| 262 |
+
end += 1
|
| 263 |
+
while (
|
| 264 |
+
end + 3 < len(value)
|
| 265 |
+
and value[end + 1] == "\\"
|
| 266 |
+
and not value[end + 2].isalnum()
|
| 267 |
+
and not value[end + 2].isspace()
|
| 268 |
+
and value[end + 3] == "}"
|
| 269 |
+
):
|
| 270 |
+
end += 3
|
| 271 |
+
matches.append(value[start:end])
|
| 272 |
+
cursor = end + 1
|
| 273 |
+
elif minimal_end is not None:
|
| 274 |
+
matches.append(value[start:minimal_end])
|
| 275 |
+
cursor = minimal_end + 1
|
| 276 |
+
else:
|
| 277 |
+
break
|
| 278 |
+
return matches
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
def has_unclosed_boxed_answer(text: str | None) -> bool:
|
| 282 |
+
if text is None:
|
| 283 |
+
return False
|
| 284 |
+
value = str(text)
|
| 285 |
+
marker = r"\boxed{"
|
| 286 |
+
cursor = 0
|
| 287 |
+
while True:
|
| 288 |
+
marker_pos = value.find(marker, cursor)
|
| 289 |
+
if marker_pos == -1:
|
| 290 |
+
return False
|
| 291 |
+
start = marker_pos + len(marker)
|
| 292 |
+
minimal_end: int | None = None
|
| 293 |
+
index = start
|
| 294 |
+
while index < len(value):
|
| 295 |
+
char = value[index]
|
| 296 |
+
if char == "\\" and index + 1 < len(value):
|
| 297 |
+
index += 2
|
| 298 |
+
continue
|
| 299 |
+
if char == "}":
|
| 300 |
+
minimal_end = index
|
| 301 |
+
break
|
| 302 |
+
index += 1
|
| 303 |
+
|
| 304 |
+
depth = 1
|
| 305 |
+
index = start
|
| 306 |
+
while index < len(value):
|
| 307 |
+
char = value[index]
|
| 308 |
+
if char == "\\" and index + 1 < len(value):
|
| 309 |
+
index += 2
|
| 310 |
+
continue
|
| 311 |
+
if char == "{":
|
| 312 |
+
depth += 1
|
| 313 |
+
elif char == "}":
|
| 314 |
+
depth -= 1
|
| 315 |
+
if depth == 0:
|
| 316 |
+
break
|
| 317 |
+
index += 1
|
| 318 |
+
if depth != 0 and minimal_end is None:
|
| 319 |
+
return True
|
| 320 |
+
cursor = (index + 1) if depth == 0 else (minimal_end + 1 if minimal_end is not None else len(value))
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
def extract_final_boxed_answer(text: str | None) -> str:
|
| 324 |
+
if has_unclosed_boxed_answer(text):
|
| 325 |
+
return "NOT_FOUND"
|
| 326 |
+
matches = extract_closed_boxed_answers(text)
|
| 327 |
+
if not matches:
|
| 328 |
+
return "NOT_FOUND"
|
| 329 |
+
non_empty = [match.strip() for match in matches if match.strip()]
|
| 330 |
+
if non_empty:
|
| 331 |
+
return canonical_boxed_payload(non_empty[-1])
|
| 332 |
+
return canonical_boxed_payload(matches[-1].strip())
|
| 333 |
+
|
| 334 |
+
|
| 335 |
+
def verify_strict_boxed_answer(expected: object, raw_output: object) -> bool:
|
| 336 |
+
observed = extract_final_boxed_answer(str(raw_output or ""))
|
| 337 |
+
if observed == "NOT_FOUND":
|
| 338 |
+
return False
|
| 339 |
+
expected_text = canonical_answer(expected)
|
| 340 |
+
observed_text = canonical_answer(observed)
|
| 341 |
+
if not expected_text or not observed_text:
|
| 342 |
+
return False
|
| 343 |
+
return expected_text.lower() == observed_text.lower()
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
def has_closed_boxed_answer(text: str | None) -> bool:
|
| 347 |
+
if text is None:
|
| 348 |
+
return False
|
| 349 |
+
value = str(text)
|
| 350 |
+
marker = r"\boxed{"
|
| 351 |
+
cursor = 0
|
| 352 |
+
while True:
|
| 353 |
+
marker_pos = value.find(marker, cursor)
|
| 354 |
+
if marker_pos == -1:
|
| 355 |
+
return False
|
| 356 |
+
start = marker_pos + len(marker)
|
| 357 |
+
index = start
|
| 358 |
+
while index < len(value):
|
| 359 |
+
char = value[index]
|
| 360 |
+
if char == "\\" and index + 1 < len(value):
|
| 361 |
+
index += 2
|
| 362 |
+
continue
|
| 363 |
+
if char == "}":
|
| 364 |
+
return True
|
| 365 |
+
index += 1
|
| 366 |
+
cursor = start
|
| 367 |
+
|
| 368 |
+
|
| 369 |
+
def extract_final_answer(text: str | None) -> str:
|
| 370 |
+
"""Extract the final answer with the official Kaggle fallback order."""
|
| 371 |
+
|
| 372 |
+
if text is None:
|
| 373 |
+
return "NOT_FOUND"
|
| 374 |
+
value = str(text)
|
| 375 |
+
|
| 376 |
+
boxed_starts = list(re.finditer(r"\\boxed\{", value))
|
| 377 |
+
matches: list[str] = []
|
| 378 |
+
for i, match in enumerate(boxed_starts):
|
| 379 |
+
start = match.end()
|
| 380 |
+
end = boxed_starts[i + 1].start() if i + 1 < len(boxed_starts) else len(value)
|
| 381 |
+
segment = value[start:end]
|
| 382 |
+
last_brace = segment.rfind("}")
|
| 383 |
+
matches.append(segment[:last_brace] if last_brace != -1 else segment)
|
| 384 |
+
if matches:
|
| 385 |
+
non_empty = [match.strip() for match in matches if match.strip()]
|
| 386 |
+
if non_empty:
|
| 387 |
+
return non_empty[-1]
|
| 388 |
+
return matches[-1].strip()
|
| 389 |
+
|
| 390 |
+
patterns = [
|
| 391 |
+
r"The final answer is:\s*([^\n]+)",
|
| 392 |
+
r"Final answer is:\s*([^\n]+)",
|
| 393 |
+
r"Final answer\s*[::]\s*([^\n]+)",
|
| 394 |
+
r"final answer\s*[::]\s*([^\n]+)",
|
| 395 |
+
]
|
| 396 |
+
for pattern in patterns:
|
| 397 |
+
matches = re.findall(pattern, value, re.IGNORECASE)
|
| 398 |
+
if matches:
|
| 399 |
+
return matches[-1].strip()
|
| 400 |
+
|
| 401 |
+
matches = re.findall(r"-?\d+(?:\.\d+)?", value)
|
| 402 |
+
if matches:
|
| 403 |
+
return matches[-1]
|
| 404 |
+
|
| 405 |
+
lines = [line.strip() for line in value.splitlines() if line.strip()]
|
| 406 |
+
return lines[-1] if lines else "NOT_FOUND"
|
| 407 |
+
|
| 408 |
+
|
| 409 |
+
def verify_answer(stored_answer: object, predicted: object) -> bool:
|
| 410 |
+
"""Verify a prediction with the public Kaggle metric behavior."""
|
| 411 |
+
|
| 412 |
+
expected = str(stored_answer).strip()
|
| 413 |
+
observed = str(predicted).strip()
|
| 414 |
+
if re.fullmatch(r"[01]+", expected):
|
| 415 |
+
return observed.lower() == expected.lower()
|
| 416 |
+
try:
|
| 417 |
+
return math.isclose(float(expected), float(observed), rel_tol=1e-2, abs_tol=1e-5)
|
| 418 |
+
except Exception:
|
| 419 |
+
return observed.lower() == expected.lower()
|
| 420 |
+
|
| 421 |
+
|
| 422 |
+
def canonical_answer(value: object) -> str:
|
| 423 |
+
if value is None:
|
| 424 |
+
return ""
|
| 425 |
+
text = unicodedata.normalize("NFKC", str(value))
|
| 426 |
+
return re.sub(r"\s+", " ", text).strip()
|
| 427 |
+
|
| 428 |
+
|
| 429 |
+
def escape_boxed_answer(value: object) -> str:
|
| 430 |
+
return str(value).replace("\\", "\\\\").replace("{", "\\{").replace("}", "\\}")
|
| 431 |
+
|
| 432 |
+
|
| 433 |
+
def unescape_latex_braces(value: object) -> str:
|
| 434 |
+
return str(value).replace("\\{", "{").replace("\\}", "}").replace("\\\\", "\\")
|
| 435 |
+
|
| 436 |
+
|
| 437 |
+
def canonical_boxed_payload(value: object) -> str:
|
| 438 |
+
return canonical_answer(unescape_latex_braces(value))
|
| 439 |
+
|
| 440 |
+
|
| 441 |
+
def parse_finite_number(value: object) -> float | None:
|
| 442 |
+
text = canonical_answer(value).replace(",", "")
|
| 443 |
+
if not text:
|
| 444 |
+
return None
|
| 445 |
+
try:
|
| 446 |
+
number = float(text)
|
| 447 |
+
except ValueError:
|
| 448 |
+
return None
|
| 449 |
+
return number if math.isfinite(number) else None
|
| 450 |
+
|
| 451 |
+
|
| 452 |
+
def answers_equivalent(
|
| 453 |
+
expected: object,
|
| 454 |
+
observed: object,
|
| 455 |
+
*,
|
| 456 |
+
rel_tol: float = 1e-2,
|
| 457 |
+
abs_tol: float = 1e-5,
|
| 458 |
+
observed_is_boxed_payload: bool = False,
|
| 459 |
+
) -> bool:
|
| 460 |
+
expected_text = canonical_answer(expected)
|
| 461 |
+
observed_text = canonical_boxed_payload(observed) if observed_is_boxed_payload else canonical_answer(observed)
|
| 462 |
+
expected_number = parse_finite_number(expected_text)
|
| 463 |
+
observed_number = parse_finite_number(observed_text)
|
| 464 |
+
if expected_number is not None and observed_number is not None:
|
| 465 |
+
return math.isclose(expected_number, observed_number, rel_tol=rel_tol, abs_tol=abs_tol)
|
| 466 |
+
return expected_text.lower() == observed_text.lower()
|
| 467 |
+
|
| 468 |
+
|
| 469 |
+
def box_answer(value: object) -> str:
|
| 470 |
+
return f"\\boxed{{{escape_boxed_answer(value)}}}"
|