Degree of Heretication
The Heresy Index weighs the resulting model's corruption by the process (KL Divergence & PIQA, Manual Response Eval) and its abolition of doctrine (Refusals) for a final verdict in classification.
Table with columns: Index Entry, Classification, Analysis| Index Entry | Classification | Analysis |
|---|
 | Absolute Heresy | Near zero overt and secondary refusals with minimal to no model damage |
 | Tainted Heresy | Some residual secondary refusals and/or moderate model damage |
 | Impotent Heresy | Lingering overt refusals and high model damage |
Note: This is an arbitrary and subjective classification inspired by Warhammer 40K, indended to serve as a signpost towards the model's performance.
Appendix
Empty system prompt.
Custom datasets (harmful+harmless)
[Trial 136] Refusals: 1/101, KL divergence: 0.1136
» [Trial 377] Refusals: 2/101, KL divergence: 0.0759
[Trial 300] Refusals: 3/101, KL divergence: 0.0613
[Trial 318] Refusals: 6/101, KL divergence: 0.0577
[Trial 277] Refusals: 8/101, KL divergence: 0.0559
[Trial 367] Refusals: 9/101, KL divergence: 0.0477
[Trial 89] Refusals: 12/101, KL divergence: 0.0447
[Trial 355] Refusals: 17/101, KL divergence: 0.0325
[Trial 327] Refusals: 20/101, KL divergence: 0.0302
[Trial 134] Refusals: 24/101, KL divergence: 0.0245
[Trial 358] Refusals: 32/101, KL divergence: 0.0217
[Trial 283] Refusals: 43/101, KL divergence: 0.0211
[Trial 201] Refusals: 44/101, KL divergence: 0.0190
[Trial 119] Refusals: 62/101, KL divergence: 0.0104
[Trial 306] Refusals: 99/101, KL divergence: 0.0078
[Trial 293] Refusals: 100/101, KL divergence: 0.0067
[Trial 3] Refusals: 101/101, KL divergence: 0.0005
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T377 ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8118 │ 0.8101 │
│ │ acc_stderr,none │ 0.0091 │ 0.0092 │
│ │ acc_norm,none │ 0.8188 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0090 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T136 ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8118 │ 0.8101 │
│ │ acc_stderr,none │ 0.0091 │ 0.0092 │
│ │ acc_norm,none │ 0.8166 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0090 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T318 ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8096 │ 0.8101 │
│ │ acc_stderr,none │ 0.0092 │ 0.0092 │
│ │ acc_norm,none │ 0.8166 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0090 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T300 ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8074 │ 0.8101 │
│ │ acc_stderr,none │ 0.0092 │ 0.0092 │
│ │ acc_norm,none │ 0.8166 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0090 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T277 ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8090 │ 0.8101 │
│ │ acc_stderr,none │ 0.0092 │ 0.0092 │
│ │ acc_norm,none │ 0.8150 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0091 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
**RERUNS**
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T377-RE ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8118 │ 0.8101 │
│ │ acc_stderr,none │ 0.0091 │ 0.0092 │
│ │ acc_norm,none │ 0.8188 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0090 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Benchmark ┃ Metric ┃ T318-RE ┃ Original model ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ PIQA │ name │ piqa │ piqa │
│ │ sample_len │ 1838 │ 1838 │
│ │ acc,none │ 0.8096 │ 0.8101 │
│ │ acc_stderr,none │ 0.0092 │ 0.0092 │
│ │ acc_norm,none │ 0.8166 │ 0.8161 │
│ │ acc_norm_stderr,none │ 0.0090 │ 0.0090 │
└───────────┴──────────────────────┴────────────┴────────────────┘
LM-Eval Testing @ Q4_K_M
RC1 (T377):
|-----|------:|------|-----:|--------|---|-----:|---|-----:|
|piqa | 1|none | 0|acc |↑ |0.4951|± |0.0117|
| | |none | 0|acc_norm|↑ |0.4951|± |0.0117|
|Tasks|Version|Filter|n-shot|Metric| |Value| |Stderr|
|-----|------:|------|-----:|------|---|----:|---|-----:|
|copa | 1|none | 0|acc |↑ | 0.55|± | 0.05|
| Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
|----------|------:|------|-----:|------|---|-----:|---|-----:|
|winogrande| 1|none | 0|acc |↑ |0.4957|± |0.0141|
RC2 (T318):
|-----|------:|------|-----:|--------|---|-----:|---|-----:|
|piqa | 1|none | 0|acc |↑ |0.4951|± |0.0117|
| | |none | 0|acc_norm|↑ |0.4951|± |0.0117|
|Tasks|Version|Filter|n-shot|Metric| |Value| |Stderr|
|-----|------:|------|-----:|------|---|----:|---|-----:|
|copa | 1|none | 0|acc |↑ | 0.55|± | 0.05|
| Tasks |Version|Filter|n-shot|Metric| |Value | |Stderr|
|----------|------:|------|-----:|------|---|-----:|---|-----:|
|winogrande| 1|none | 0|acc |↑ |0.4957|± |0.0141|
Residual Geometry
┏━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
┃ Layer ┃ S(g,b) ┃ S(g*,b*) ┃ S(g,r) ┃ S(g*,r*) ┃ S(b,r) ┃ S(b*,r*) ┃ |g| ┃ |g*| ┃ |b| ┃ |b*| ┃ |r| ┃ |r*| ┃ Silh ┃
┡━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
│ 1 │ 0.9989 │ 0.9989 │ -0.2326 │ -0.2426 │ -0.1858 │ -0.1963 │ 1.53 │ 1.53 │ 1.51 │ 1.51 │ 0.07 │ 0.07 │ 0.0535 │
│ 2 │ 0.9986 │ 0.9987 │ -0.1045 │ -0.1203 │ -0.0525 │ -0.0691 │ 3.07 │ 3.07 │ 3.06 │ 3.06 │ 0.16 │ 0.16 │ 0.0454 │
│ 3 │ 0.9984 │ 0.9985 │ -0.1917 │ -0.2168 │ -0.1364 │ -0.1629 │ 5.25 │ 5.25 │ 5.20 │ 5.20 │ 0.30 │ 0.29 │ 0.0335 │
│ 4 │ 0.9888 │ 0.9891 │ -0.0674 │ -0.0759 │ 0.0821 │ 0.0717 │ 6.87 │ 6.87 │ 6.88 │ 6.87 │ 1.03 │ 1.01 │ 0.0631 │
│ 5 │ 0.9891 │ 0.9893 │ -0.0488 │ -0.0618 │ 0.0991 │ 0.0842 │ 7.69 │ 7.70 │ 7.72 │ 7.71 │ 1.14 │ 1.13 │ 0.0645 │
│ 6 │ 0.9900 │ 0.9903 │ -0.0485 │ -0.0660 │ 0.0926 │ 0.0735 │ 8.35 │ 8.36 │ 8.37 │ 8.37 │ 1.18 │ 1.17 │ 0.0635 │
│ 7 │ 0.9908 │ 0.9910 │ -0.0796 │ -0.0957 │ 0.0562 │ 0.0384 │ 8.97 │ 8.99 │ 8.96 │ 8.95 │ 1.22 │ 1.20 │ 0.0624 │
│ 8 │ 0.9856 │ 0.9856 │ -0.0916 │ -0.1052 │ 0.0783 │ 0.0645 │ 9.39 │ 9.42 │ 9.38 │ 9.38 │ 1.60 │ 1.60 │ 0.0648 │
│ 9 │ 0.9825 │ 0.9826 │ -0.1195 │ -0.1321 │ 0.0674 │ 0.0541 │ 9.67 │ 9.69 │ 9.62 │ 9.62 │ 1.80 │ 1.80 │ 0.0643 │
│ 10 │ 0.9791 │ 0.9793 │ -0.1007 │ -0.1146 │ 0.1040 │ 0.0888 │ 10.11 │ 10.15 │ 10.12 │ 10.12 │ 2.07 │ 2.06 │ 0.0602 │
│ 11 │ 0.9757 │ 0.9758 │ -0.0899 │ -0.1056 │ 0.1306 │ 0.1142 │ 11.00 │ 11.05 │ 11.05 │ 11.06 │ 2.43 │ 2.43 │ 0.0648 │
│ 12 │ 0.9631 │ 0.9632 │ -0.1559 │ -0.1703 │ 0.1157 │ 0.1008 │ 11.88 │ 11.94 │ 11.82 │ 11.83 │ 3.22 │ 3.23 │ 0.0693 │
│ 13 │ 0.9552 │ 0.9557 │ -0.1589 │ -0.1737 │ 0.1404 │ 0.1237 │ 13.38 │ 13.46 │ 13.34 │ 13.36 │ 4.00 │ 3.99 │ 0.0769 │
│ 14 │ 0.9567 │ 0.9572 │ -0.1356 │ -0.1532 │ 0.1588 │ 0.1394 │ 15.26 │ 15.37 │ 15.32 │ 15.34 │ 4.50 │ 4.49 │ 0.0782 │
│ 15 │ 0.9500 │ 0.9502 │ -0.1105 │ -0.1235 │ 0.2053 │ 0.1919 │ 16.16 │ 16.25 │ 16.42 │ 16.43 │ 5.16 │ 5.16 │ 0.0855 │
│ 16 │ 0.9407 │ 0.9410 │ -0.1103 │ -0.1190 │ 0.2335 │ 0.2241 │ 16.85 │ 16.91 │ 17.22 │ 17.23 │ 5.88 │ 5.87 │ 0.0891 │
│ 17 │ 0.9339 │ 0.9338 │ -0.0900 │ -0.1008 │ 0.2720 │ 0.2618 │ 18.27 │ 18.36 │ 18.91 │ 18.92 │ 6.79 │ 6.80 │ 0.1045 │
│ 18 │ 0.9192 │ 0.9180 │ -0.0750 │ -0.0912 │ 0.3237 │ 0.3111 │ 22.25 │ 22.43 │ 23.45 │ 23.50 │ 9.26 │ 9.36 │ 0.1347 │
│ 19 │ 0.9187 │ 0.9172 │ -0.0758 │ -0.0890 │ 0.3241 │ 0.3153 │ 23.62 │ 23.79 │ 24.90 │ 24.97 │ 9.86 │ 9.99 │ 0.1343 │
│ 20 │ 0.9129 │ 0.9105 │ -0.1301 │ -0.1402 │ 0.2861 │ 0.2816 │ 24.55 │ 24.69 │ 25.40 │ 25.48 │ 10.46 │ 10.64 │ 0.1109 │
│ 21 │ 0.8869 │ 0.8837 │ -0.1099 │ -0.1206 │ 0.3616 │ 0.3582 │ 24.75 │ 24.88 │ 26.39 │ 26.46 │ 12.26 │ 12.48 │ 0.1220 |
│ 22 │ 0.8680 │ 0.8632 │ -0.1130 │ -0.1221 │ 0.3953 │ 0.3956 │ 25.36 │ 25.49 │ 27.43 │ 27.55 │ 13.71 │ 14.01 │ 0.1349 │
│ 23 │ 0.8785 │ 0.8734 │ -0.1257 │ -0.1379 │ 0.3635 │ 0.3620 │ 26.07 │ 26.23 │ 27.76 │ 27.87 │ 13.37 │ 13.71 │ 0.1327 │
│ 24 │ 0.8701 │ 0.8630 │ -0.1454 │ -0.1573 │ 0.3611 │ 0.3632 │ 26.04 │ 26.14 │ 27.63 │ 27.71 │ 13.76 │ 14.18 │ 0.1218 │
│ 25 │ 0.8502 │ 0.8404 │ -0.1213 │ -0.1323 │ 0.4194 │ 0.4261 │ 25.70 │ 25.82 │ 28.10 │ 28.29 │ 14.91 │ 15.47 │ 0.1416 │
│ 26 │ 0.8371 │ 0.8250 │ -0.1265 │ -0.1368 │ 0.4367 │ 0.4470 │ 25.28 │ 25.39 │ 27.87 │ 28.12 │ 15.37 │ 16.04 │ 0.1517 │
│ 27 │ 0.8261 │ 0.8125 │ -0.1026 │ -0.1095 │ 0.4758 │ 0.4906 │ 26.58 │ 26.70 │ 30.06 │ 30.46 │ 17.03 │ 17.87 │ 0.1723 │
│ 28 │ 0.7640 │ 0.7469 │ -0.1111 │ -0.1136 │ 0.5564 │ 0.5758 │ 26.82 │ 26.94 │ 32.08 │ 32.74 │ 20.83 │ 21.91 │ 0.2063 │
│ 29 │ 0.7567 │ 0.7359 │ -0.2096 │ -0.2143 │ 0.4806 │ 0.5036 │ 31.24 │ 31.40 │ 34.83 │ 35.50 │ 23.29 │ 24.60 │ 0.2275 │
│ 30 │ 0.7541 │ 0.7322 │ -0.2154 │ -0.2240 │ 0.4789 │ 0.4997 │ 33.91 │ 34.11 │ 37.72 │ 38.38 │ 25.37 │ 26.82 │ 0.2257 │
│ 31 │ 0.7466 │ 0.7248 │ -0.2357 │ -0.2436 │ 0.4705 │ 0.4917 │ 35.42 │ 35.68 │ 39.01 │ 39.74 │ 26.71 │ 28.23 │ 0.2294 │
│ 32 │ 0.7405 │ 0.7184 │ -0.2849 │ -0.2915 │ 0.4332 │ 0.4560 │ 38.44 │ 38.74 │ 40.88 │ 41.64 │ 28.66 │ 30.28 │ 0.2275 │
│ 33 │ 0.7375 │ 0.7173 │ -0.2999 │ -0.3069 │ 0.4231 │ 0.4430 │ 39.86 │ 40.26 │ 41.97 │ 42.74 │ 29.71 │ 31.29 │ 0.2245 │
│ 34 │ 0.6822 │ 0.6641 │ -0.2866 │ -0.2966 │ 0.5050 │ 0.5170 │ 41.34 │ 41.78 │ 45.89 │ 46.61 │ 35.02 │ 36.49 │ 0.2621 │
│ 35 │ 0.6808 │ 0.6659 │ -0.2497 │ -0.2612 │ 0.5393 │ 0.5462 │ 43.90 │ 44.48 │ 50.49 │ 51.25 │ 38.19 │ 39.61 │ 0.2782 │
│ 36 │ 0.6423 │ 0.6284 │ -0.2543 │ -0.2611 │ 0.5780 │ 0.5869 │ 46.86 │ 47.21 │ 55.54 │ 56.29 │ 44.02 │ 45.36 │ 0.2514 │
│ 37 │ 0.6212 │ 0.6064 │ -0.2352 │ -0.2445 │ 0.6156 │ 0.6227 │ 51.19 │ 51.71 │ 63.13 │ 64.08 │ 50.90 │ 52.55 │ 0.2734 │
│ 38 │ 0.6002 │ 0.5842 │ -0.2367 │ -0.2472 │ 0.6351 │ 0.6421 │ 53.15 │ 53.83 │ 66.86 │ 68.03 │ 55.04 │ 56.99 │ 0.2802 │
│ 39 │ 0.6017 │ 0.5858 │ -0.2304 │ -0.2421 │ 0.6386 │ 0.6445 │ 51.15 │ 51.85 │ 64.68 │ 65.80 │ 53.09 │ 54.96 │ 0.2778 │
│ 40 │ 0.5954 │ 0.5800 │ -0.2461 │ -0.2551 │ 0.6322 │ 0.6397 │ 50.48 │ 51.07 │ 63.15 │ 64.24 │ 52.34 │ 54.12 │ 0.2565 │
│ 41 │ 0.6078 │ 0.5926 │ -0.2600 │ -0.2696 │ 0.6087 │ 0.6159 │ 49.35 │ 49.96 │ 60.06 │ 61.06 │ 49.39 │ 51.08 │ 0.2461 │
│ 42 │ 0.6234 │ 0.6087 │ -0.2783 │ -0.2898 │ 0.5775 │ 0.5830 │ 51.14 │ 51.81 │ 60.16 │ 61.03 │ 48.98 │ 50.60 │ 0.2468 │
│ 43 │ 0.6239 │ 0.6096 │ -0.2624 │ -0.2742 │ 0.5904 │ 0.5951 │ 51.35 │ 52.03 │ 61.39 │ 62.26 │ 49.71 │ 51.32 │ 0.2461 │
│ 44 │ 0.6092 │ 0.5948 │ -0.2580 │ -0.2712 │ 0.6090 │ 0.6124 │ 52.15 │ 52.87 │ 63.52 │ 64.37 │ 52.14 │ 53.76 │ 0.2494 │
│ 45 │ 0.6108 │ 0.5975 │ -0.2222 │ -0.2355 │ 0.6363 │ 0.6386 │ 54.07 │ 54.84 │ 68.33 │ 69.26 │ 55.49 │ 57.14 │ 0.2602 │
│ 46 │ 0.5993 │ 0.5862 │ -0.2192 │ -0.2325 │ 0.6497 │ 0.6517 │ 57.03 │ 57.90 │ 73.20 │ 74.24 │ 60.06 │ 61.85 │ 0.2715 │
│ 47 │ 0.6014 │ 0.5877 │ -0.2086 │ -0.2218 │ 0.6559 │ 0.6585 │ 59.28 │ 60.23 │ 76.80 │ 78.04 │ 62.73 │ 64.75 │ 0.2756 │
│ 48 │ 0.5992 │ 0.5848 │ -0.2375 │ -0.2505 │ 0.6354 │ 0.6388 │ 63.53 │ 64.53 │ 79.92 │ 81.20 │ 65.87 │ 68.04 │ 0.2620 │
│ 49 │ 0.5997 │ 0.5852 │ -0.2406 │ -0.2539 │ 0.6324 │ 0.6357 │ 67.55 │ 68.61 │ 84.64 │ 85.97 │ 69.78 │ 72.07 │ 0.2589 │
│ 50 │ 0.5931 │ 0.5790 │ -0.2462 │ -0.2590 │ 0.6343 │ 0.6375 │ 71.43 │ 72.46 │ 89.55 │ 90.84 │ 74.39 │ 76.68 │ 0.2484 │
│ 51 │ 0.6133 │ 0.5993 │ -0.2460 │ -0.2613 │ 0.6147 │ 0.6161 │ 81.26 │ 82.46 │ 99.86 │ 101.05 │ 81.37 │ 83.80 │ 0.2404 │
│ 52 │ 0.5803 │ 0.5676 │ -0.2498 │ -0.2621 │ 0.6436 │ 0.6458 │ 88.89 │ 89.97 │ 112.47 │ 113.72 │ 94.59 │ 97.01 │ 0.2238 │
│ 53 │ 0.5788 │ 0.5658 │ -0.2214 │ -0.2343 │ 0.6671 │ 0.6689 │ 99.15 │ 100.46 │ 129.78 │ 131.38 │ 108.53 │ 111.43 │ 0.2310 │
│ 54 │ 0.5747 │ 0.5620 │ -0.2061 │ -0.2185 │ 0.6823 │ 0.6844 │ 107.90 │ 109.34 │ 144.42 │ 146.33 │ 120.78 │ 124.03 │ 0.2290 │
│ 55 │ 0.5466 │ 0.5343 │ -0.1913 │ -0.2024 │ 0.7174 │ 0.7197 │ 118.01 │ 119.53 │ 166.27 │ 168.59 │ 141.86 │ 145.53 │ 0.2451 │
│ 56 │ 0.5383 │ 0.5258 │ -0.1893 │ -0.1997 │ 0.7256 │ 0.7285 │ 121.37 │ 122.90 │ 173.20 │ 175.78 │ 148.66 │ 152.59 │ 0.2332 │
│ 57 │ 0.5423 │ 0.5303 │ -0.1747 │ -0.1844 │ 0.7325 │ 0.7355 │ 132.35 │ 133.96 │ 191.43 │ 194.32 │ 163.34 │ 167.63 │ 0.2389 │
│ 58 │ 0.5377 │ 0.5260 │ -0.1692 │ -0.1792 │ 0.7400 │ 0.7425 │ 138.03 │ 139.76 │ 202.25 │ 205.27 │ 173.01 │ 177.46 │ 0.2419 │
│ 59 │ 0.5464 │ 0.5346 │ -0.1626 │ -0.1735 │ 0.7375 │ 0.7395 │ 142.30 │ 144.21 │ 207.91 │ 210.99 │ 176.48 │ 181.06 │ 0.2323 │
│ 60 │ 0.5505 │ 0.5390 │ -0.1552 │ -0.1644 │ 0.7392 │ 0.7422 │ 150.19 │ 151.86 │ 220.32 │ 223.51 │ 186.18 │ 190.86 │ 0.2244 │
│ 61 │ 0.5526 │ 0.5417 │ -0.1539 │ -0.1626 │ 0.7385 │ 0.7413 │ 163.38 │ 165.10 │ 239.41 │ 242.73 │ 201.95 │ 206.79 │ 0.2235 │
│ 62 │ 0.5612 │ 0.5509 │ -0.1432 │ -0.1515 │ 0.7388 │ 0.7415 │ 175.53 │ 177.29 │ 257.77 │ 261.17 │ 215.58 │ 220.51 │ 0.2198 │
│ 63 │ 0.5800 │ 0.5705 │ -0.1102 │ -0.1188 │ 0.7457 │ 0.7477 │ 199.42 │ 201.31 │ 297.48 │ 301.03 │ 243.81 │ 249.00 │ 0.2251 │
│ 64 │ 0.7000 │ 0.6925 │ -0.0811 │ -0.0882 │ 0.6550 │ 0.6575 │ 84.05 │ 84.61 │ 110.86 │ 111.85 │ 79.43 │ 81.01 │ 0.1935 │
└───────┴────────┴──────────┴─────────┴──────────┴─────────┴──────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
g = mean of residual vectors for good prompts
g* = geometric median of residual vectors for good prompts
b = mean of residual vectors for bad prompts
b* = geometric median of residual vectors for bad prompts
r = refusal direction for means (i.e., b - g)
r* = refusal direction for geometric medians (i.e., b* - g*)
S(x,y) = cosine similarity of x and y
|x| = L2 norm of x
Silh = Mean silhouette coefficient of residuals for good/bad clusters
Qwen3.8-27B
[!Note]
This repository contains model weights and configuration files for the post-trained model in the Hugging Face Transformers format.
These artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, TokenSpeed, etc.
[!Tip]
For users seeking managed, scalable inference without infrastructure maintenance, the official Qwen API service is provided by Qwen Cloud.
In particular, Qwen3.8-27B will be available as a hosted version with more production features, e.g., 1M context length by default, official built-in tools. For more information, please refer to the Qwen3.8-27B Overview. The service is coming soon. Stay tuned for updates.
Following the widespread community adoption of the Qwen3.5 and Qwen3.6 series, we are pleased to introduce Qwen3.8, the most capable generation in the Qwen open-model family to date.
Built on the architectural foundation of Qwen3.5, Qwen3.8 delivers substantial gains across coding, professional work, research, and long-horizon agentic tasks. Qwen3.8-27B brings these advances to a compact, deployment-friendly dense model: a native vision-language model that understands images and videos, with flexible thinking control, designed to carry complex, multi-step tasks through to completion with greater reliability.
Qwen3.8 Highlights
Qwen3.8-27B features the following enhancements:
- Core Capabilities: Comprehensive improvements across coding, professional work, research, and long-horizon agentic tasks.
- Agent Execution: Stronger autonomous planning and better handling of environment feedback, leading to more reliable end-to-end task completion.
- Downstream Compatibility: Broader support for popular harnesses and development tools, making it easier to integrate into your existing stack.
- Flexible Thinking Control: Thinking mode is on by default and can be disabled per request; reasoning depth can be tuned with
reasoning_effort, and reasoning context from historical messages is retained via preserve_thinking.
- Vision-Language Understanding: Native support for image and video understanding, from STEM diagrams and documents to hour-scale videos.
Model Overview
- Type: Causal Language Model with Vision Encoder
- Training Stage: Pre-training & Post-training
- Language Model
- Number of Parameters: 27B
- Hidden Dimension: 5120
- Token Embedding: 248,320 (Padded)
- Number of Layers: 64
- Hidden Layout: 16 × (3 × (Gated DeltaNet → FFN) → 1 × (Gated Attention → FFN))
- Gated DeltaNet:
- Number of Linear Attention Heads: 48 for V and 16 for QK
- Head Dimension: 128
- Gated Attention:
- Number of Attention Heads: 24 for Q and 4 for KV
- Head Dimension: 256
- Rotary Position Embedding Dimension: 64
Benchmark Results
Text Performance
Quickstart
For streamlined integration, we recommend using Qwen3.8 via APIs.
Serving Qwen3.8
[!Important]
Inference efficiency and throughput vary significantly across frameworks.
We recommend using the latest framework versions to ensure optimal performance and compatibility.
For production workloads or high-throughput scenarios, dedicated serving engines such as SGLang, vLLM, or TokenSpeed are recommended.
Qwen3.8 can be deployed with popular inference frameworks, e.g.:
API Usage
[!Important]
Qwen3.8 models operate in thinking mode by default, generating thinking content signified by <think>\n...</think>\n\n before producing the final response.
To disable thinking content and obtain a direct response, refer to the examples here.
[!Tip]
We recommend using the following sets of sampling parameters for generation:
- Thinking Mode:
temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0
- Instruct (or non-thinking) mode:
temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0
Please note that the support for sampling parameters varies according to inference frameworks.
Qwen3.8 comes with official support for reasoning_effort, which can be used to adjust reasoning depth and control cost:
xhigh (default): for complex tasks demanding thorough analysis
medium: balancing accuracy and speed
low: efficient reasoning optimizing for speed and cost
In addition, preserve_thinking is enabled by default for all workloads for the best out-of-the-box experience. To disable preserved thinking, refer to the examples here.
[!Tip]
In multi-turn agentic tasks, lower reasoning effort does not always reduce overall task completion time. Although it may produce faster per-turn responses, it can also lead to insufficient analysis, more failures, and repeated retries, which may increase total latency and token consumption.
Chat Completions API
The Chat Completions API can be used with most inference frameworks, as well as Qwen Cloud.
Before starting, make sure the OpenAI Python SDK is installed and the API key and the API base URL are configured, e.g.:
pip install -U openai
# Set the following accordingly
export OPENAI_BASE_URL='your-base-url'
export OPENAI_API_KEY='your-api-key'
Text-Only Input
from openai import OpenAI
client = OpenAI()
messages = [{"role": "user", "content": "Write a Python function to merge two sorted linked lists."}]
completion = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=messages,
extra_body={
"chat_template_kwargs": {
"enable_thinking": True,
"preserve_thinking": True,
},
},
reasoning_effort="xhigh",
stream=True,
stream_options={"include_usage": True},
)
reasoning_content = ""
answer_content = ""
is_answering = False
print("\n" + "=" * 20 + "Reasoning" + "=" * 20 + "\n")
for chunk in completion:
if not chunk.choices:
print("\nUsage:")
print(chunk.usage)
continue
delta = chunk.choices[0].delta
if hasattr(delta, "reasoning_content") and delta.reasoning_content is not None:
if not is_answering:
print(delta.reasoning_content, end="", flush=True)
reasoning_content += delta.reasoning_content
elif hasattr(delta, "reasoning") and delta.reasoning is not None:
if not is_answering:
print(delta.reasoning, end="", flush=True)
reasoning_content += delta.reasoning
if hasattr(delta, "content") and delta.content:
if not is_answering:
print("\n" + "=" * 20 + "Answer" + "=" * 20 + "\n")
is_answering = True
print(delta.content, end="", flush=True)
answer_content += delta.content
messages.append({
"role": "assistant",
"content": answer_content,
"reasoning_content": reasoning_content,
"reasoning": reasoning_content,
})
from openai import OpenAI
client = OpenAI()
messages = [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/CI_Demo/mathv-1327.jpg"
}
},
{
"type": "text",
"text": "The centres of the four illustrated circles are in the corners of the square. The two big circles touch each other and also the two little circles. With which factor do you have to multiply the radii of the little circles to obtain the radius of the big circles?\nChoices:\n(A) $\\frac{2}{9}$\n(B) $\\sqrt{5}$\n(C) $0.8 \\cdot \\pi$\n(D) 2.5\n(E) $1+\\sqrt{2}$"
}
]
}
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=messages,
)
print("Chat response:", chat_response)
from openai import OpenAI
client = OpenAI()
messages = [
{
"role": "user",
"content": [
{
"type": "video_url",
"video_url": {
"url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/video/N1cdUjctpG8.mp4"
}
},
{
"type": "text",
"text": "How many porcelain jars were discovered in the niches located in the primary chamber of the tomb?"
}
]
}
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=messages,
)
print("Chat response:", chat_response)
Instruct (or Non-Thinking) Mode
Qwen3.8-27B will think by default before responding.
You can obtain a direct response from the model without thinking by configuring the API parameters.
For example,
from openai import OpenAI
client = OpenAI()
messages = [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.5/demo/RealWorld/RealWorld-04.png"
}
},
{
"type": "text",
"text": "Where is this?"
}
]
}
]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=messages,
temperature=0.7,
top_p=0.8,
presence_penalty=1.5,
extra_body={
"top_k": 20,
"chat_template_kwargs": {"enable_thinking": False},
},
)
print("Chat response:", chat_response)
[!Note]
If you are using APIs from Qwen Cloud, in addition to changing model, please use "enable_thinking": False instead of "chat_template_kwargs": {"enable_thinking": False}.
Disable Preserved Thinking
By default, Qwen3.8 retains thinking blocks from all historical messages, maintaining a complete reasoning trace across the conversation. This behavior, known as preserved thinking, ensures full context continuity and is especially beneficial for agent scenarios where decision consistency and reduced redundant reasoning are critical. It also improves KV cache utilization, optimizing inference efficiency in both thinking and non-thinking modes.
If you prefer to retain only the thinking blocks from the latest user message, you can disable this behavior by setting preserve_thinking to False:
from openai import OpenAI
client = OpenAI()
messages = [...]
chat_response = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=messages,
extra_body={
"chat_template_kwargs": {"preserve_thinking": False},
},
)
print("Chat response:", chat_response)
[!Note]
If you are using APIs from Qwen Cloud, in addition to changing model, please use "preserve_thinking": False directly instead of wrapping it in chat_template_kwargs.
Best Practices
To achieve optimal performance, we recommend the following settings:
-
Sampling Parameters: We suggest using the following sets of sampling parameters:
- Thinking Mode:
temperature=1.0, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0
- Instruct (or non-thinking) mode:
temperature=0.7, top_p=0.80, top_k=20, min_p=0.0, presence_penalty=1.5, repetition_penalty=1.0
For supported frameworks, you can adjust the parameter between 0 and 2 to reduce endless repetition. However, using a higher value may occasionally result in language mixing and a slight decrease in model performance.
Citation
If you find our work helpful, feel free to give us a cite.
@misc{qwen38,
title = {{Qwen3.8-Max}: A New Bar for Coding and Cowork},
url = {https://qwen.ai/blog?id=qwen3.8},
author = {{Qwen Team}},
month = {August},
year = {2026}
}