Datasets:
Add files using upload-large-folder tool
Browse files- DATA.md +305 -0
- fixed_program/qwen15_moe_a27b/seed1/diff1.json +0 -0
- fixed_program/qwen15_moe_a27b/seed1/diff2.json +0 -0
- fixed_program/qwen15_moe_a27b/seed1/diff3.json +0 -0
- fixed_program/qwen15_moe_a27b/seed1/diff4.json +0 -0
- fixed_program/qwen15_moe_a27b/seed1/diff5.json +0 -0
- fixed_program/qwen15_moe_a27b/seed42/diff1.json +0 -0
- fixed_program/qwen15_moe_a27b/seed42/diff2.json +0 -0
- fixed_program/qwen15_moe_a27b/seed42/diff3.json +0 -0
- fixed_program/qwen15_moe_a27b/seed42/diff4.json +0 -0
- fixed_program/qwen15_moe_a27b/seed42/diff5.json +0 -0
- fixed_program/qwen15_moe_a27b/seed7/diff1.json +0 -0
- fixed_program/qwen15_moe_a27b/seed7/diff2.json +0 -0
- fixed_program/qwen15_moe_a27b/seed7/diff3.json +0 -0
- fixed_program/qwen15_moe_a27b/seed7/diff4.json +0 -0
- fixed_program/qwen15_moe_a27b/seed7/diff5.json +0 -0
- fixed_program/qwen25_7b/seed1/diff1.json +0 -0
- fixed_program/qwen25_7b/seed1/diff2.json +0 -0
- fixed_program/qwen25_7b/seed1/diff3.json +0 -0
- fixed_program/qwen25_7b/seed1/diff4.json +0 -0
- fixed_program/qwen25_7b/seed1/diff5.json +0 -0
- fixed_program/qwen25_7b/seed42/diff1.json +0 -0
- fixed_program/qwen25_7b/seed7/diff1.json +0 -0
- fixed_program/qwen25_7b/seed7/diff2.json +0 -0
- fixed_program/qwen25_7b/seed7/diff3.json +0 -0
- fixed_program/qwen25_7b/seed7/diff4.json +0 -0
- fixed_program/qwen25_7b/seed7/diff5.json +0 -0
- fixed_program/qwen3_32b/seed1/diff2.json +0 -0
- fixed_program/qwen3_32b/seed1/diff3.json +0 -0
- fixed_program/qwen3_32b/seed1/diff5.json +0 -0
- fixed_program/qwen3_32b/seed42/diff1.json +0 -0
- fixed_program/qwen3_32b/seed42/diff2.json +0 -0
- fixed_program/qwen3_32b/seed42/diff3.json +0 -0
- fixed_program/qwen3_32b/seed42/diff4.json +0 -0
- fixed_program/qwen3_32b/seed42/diff5.json +0 -0
- fixed_program/qwen3_8b/seed1/diff1.json +0 -0
- fixed_program/qwen3_8b/seed1/diff2.json +0 -0
- fixed_program/qwen3_8b/seed1/diff3.json +0 -0
- fixed_program/qwen3_8b/seed1/diff4.json +0 -0
- fixed_program/qwen3_8b/seed1/diff5.json +0 -0
- fixed_program/qwen3_8b/seed42/diff1.json +0 -0
- fixed_program/qwen3_8b/seed42/diff2.json +0 -0
- fixed_program/qwen3_8b/seed42/diff3.json +0 -0
- fixed_program/qwen3_8b/seed42/diff4.json +0 -0
- fixed_program/qwen3_8b/seed42/diff5.json +0 -0
- fixed_program/qwen3_8b/seed7/diff1.json +0 -0
- fixed_program/qwen3_8b/seed7/diff2.json +0 -0
- fixed_program/qwen3_8b/seed7/diff3.json +0 -0
- fixed_program/qwen3_8b/seed7/diff4.json +0 -0
- fixed_program/qwen3_8b/seed7/diff5.json +0 -0
DATA.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Data
|
| 2 |
+
|
| 3 |
+
Everything the paper's MCTS searches, routers and fixed programs produced. For each
|
| 4 |
+
DART-Math question: every program-of-layers a search evaluated with its verdict, the model's
|
| 5 |
+
generated answer behind each verdict, the trained routers with their test results, the
|
| 6 |
+
fixed program per level, and the menu cross-execution of Finding 5. The data comes in three groups: the main track, Li et
|
| 7 |
+
al.'s setup on the PoLar split, and the cross-checks between the two.
|
| 8 |
+
|
| 9 |
+
The small id files below are in this repository; everything else (about 6 GB) is hosted as
|
| 10 |
+
the Hugging Face dataset [`SWAMBIT/re-polar`](https://huggingface.co/datasets/SWAMBIT/re-polar)
|
| 11 |
+
and downloads into `data/` (all of it, or only the parts you need):
|
| 12 |
+
|
| 13 |
+
```bash
|
| 14 |
+
pip install -U huggingface_hub
|
| 15 |
+
hf download SWAMBIT/re-polar --repo-type dataset --local-dir data
|
| 16 |
+
hf download SWAMBIT/re-polar --repo-type dataset --local-dir data --include "router_results/*" "fixed_program/*"
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
data/
|
| 21 |
+
dart_math_splits.json our split: query_ids per level and train/val/test
|
| 22 |
+
polar_split_ids.json Li et al.'s split: query_ids per level (pool, train/val/test)
|
| 23 |
+
sample_qwen3_8b_dart_math_diff1.json 5 records of one MCTS file, to see the shape
|
| 24 |
+
|
| 25 |
+
# main track: our split, our search, oneshot prompt (paper Sections 3-4)
|
| 26 |
+
mcts_results/<model>/seed<S>/dart-math-diff-<L>/merged_mcts_samples.json.gz
|
| 27 |
+
generated_answers/<model>/seed<S>/diff<L>.jsonl.gz
|
| 28 |
+
router_checkpoints/<model>/seed<S>/diff<L>.pt
|
| 29 |
+
router_results/<model>/seed<S>/diff<L>.json
|
| 30 |
+
fixed_program/<model>/seed<S>/diff<L>.json
|
| 31 |
+
menu_crossexec/<model>/diff<L>.json.gz (seed 42, in-sample)
|
| 32 |
+
menu_crossexec_heldout/<model>/diff<L>.json.gz (seed 42, held-out)
|
| 33 |
+
|
| 34 |
+
# PoLar split: Li et al.'s search, prompts and questions (paper Appendix B)
|
| 35 |
+
polar_split/mcts_results/<model>/<prompt>/seed<S>/dart-math-diff-<L>/merged_mcts_samples.json.gz
|
| 36 |
+
polar_split/generated_answers/<model>/<prompt>/seed<S>/diff<L>.jsonl.gz
|
| 37 |
+
polar_split/router_results/<model>/<prompt>/seed<S>/diff<L>/{fold0..fold3,split}.json
|
| 38 |
+
polar_split/fixed_program/<model>/<prompt>/seed<S>/diff<L>/fold{0..3}.json
|
| 39 |
+
polar_split/router_checkpoints/<model>/<prompt>/seed<S>/diff<L>.pt (trained on `split`)
|
| 40 |
+
polar_split/ood/<model>/{router.pt, router_asdiv_mawps.json, fixed_program.json,
|
| 41 |
+
router_and_fixed_mmlu_pro.json}
|
| 42 |
+
|
| 43 |
+
# cross-checks (paper Appendix B.4)
|
| 44 |
+
cross_checks/their_search_our_split/{mcts_results,generated_answers,router_results,fixed_program}/<model>/<prompt>/...
|
| 45 |
+
cross_checks/our_search_polar_split/{mcts_results,router_results,fixed_program}/qwen3_8b/<prompt>/...
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
- `<model>`: `qwen15_moe_a27b`, `qwen25_3b`, `qwen25_7b`, `qwen3_8b`, `qwen3_32b`,
|
| 49 |
+
`llama32_3b` (main track); `qwen15_moe_a27b`, `qwen25_3b`, `qwen3_8b`, `llama32_3b`
|
| 50 |
+
(PoLar split). `<S>`: search seed `42`, `1`, `7`. `<L>`: difficulty level 1-5.
|
| 51 |
+
- `<prompt>`: `polar_default` (Li et al.'s prompt, code key `raw`) or `oneshot` (ours, one
|
| 52 |
+
`1+1` demo, code key `paper_minimal_fewshot`). The main track uses `oneshot` throughout.
|
| 53 |
+
- Search configuration: main track = `run_search_dart_math` defaults (`--split all`);
|
| 54 |
+
PoLar split = `--polar-fidelity --split train` on the level's whole question pool;
|
| 55 |
+
their search on our split = `--polar-fidelity --split trainval`; our search on the
|
| 56 |
+
PoLar split = `--polar-fidelity --widening-search`.
|
| 57 |
+
- Batch shape (it only bounds memory, but batched bf16 decoding is not bit-identical across
|
| 58 |
+
shapes, so an exact rerun needs the same values): `--masked-batch-buckets` 8, except DM-5 of
|
| 59 |
+
LLaMA-3.2-3B (all seeds) and of Qwen3-32B (seeds 1 and 7), 16; each generated-answer row's
|
| 60 |
+
`batch_size` records the bucket it was decoded in. `--masked-batch-max-group-size` of the
|
| 61 |
+
seed-1/7 runs: 192 for Qwen2.5-3B/7B, 64 for Qwen1.5-MoE and LLaMA-3.2-3B, 128 for Qwen3-32B
|
| 62 |
+
(DM-5: 64), 768 for Qwen3-8B; PoLar split: 64. Qwen3-8B seed 42 of the main track ran without
|
| 63 |
+
the KV cache (`--no-masked-batch-kv`); every other run used it.
|
| 64 |
+
- Software: torch 2.11.0 (CUDA 12.8), flash-attn 2.8.3, transformers 5.12.1 and 5.17.0 for the
|
| 65 |
+
searches, 5.17.0 for routers, fixed programs and baselines (`requirements.txt` pins it).
|
| 66 |
+
Runs used A100, H100, H200 and B200 GPUs; greedy decoding differs slightly across
|
| 67 |
+
architectures, so an exact rerun needs the same one. Router and menu result files name it in
|
| 68 |
+
`checkpoint` / `gpu_arch`.
|
| 69 |
+
- Not available: answer texts for Qwen3-8B with `polar_default` (all seeds) and for
|
| 70 |
+
our search on the PoLar split; those runs did not log answers. Their programs and
|
| 71 |
+
router results are released.
|
| 72 |
+
|
| 73 |
+
## Getting the questions
|
| 74 |
+
|
| 75 |
+
Question text and reference answers aren't stored in any file here. The MATH half of
|
| 76 |
+
DART-Math traces back to `hendrycks/competition_math`, which is no longer distributed
|
| 77 |
+
(paper Appendix A.1), so we release scripts that rebuild both splits from the public
|
| 78 |
+
DART-Math pool instead:
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
python -m re_polar.datasets.dart_math --out-dir ./data/dart_math --include-gsm8k
|
| 82 |
+
python -m re_polar.datasets.polar_split --out-dir ./data/polar_split_questions
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
`dart_math` writes `diff{1..5}/{train,val,test}.json` (1250/250/500 questions each) plus a
|
| 86 |
+
`manifest.json`. Each record:
|
| 87 |
+
|
| 88 |
+
| field | type | meaning |
|
| 89 |
+
|---|---|---|
|
| 90 |
+
| `query_id` | str | stable id, the join key into every file below |
|
| 91 |
+
| `question` | str | the input question text |
|
| 92 |
+
| `gt_ans` | str | ground-truth answer |
|
| 93 |
+
| `domain` | str | math subject area |
|
| 94 |
+
| `math_level` | int or null | MATH's own difficulty level (1-5); `null` for GSM8K questions, which don't have one |
|
| 95 |
+
| `source` | str | `"math"` or `"gsm8k"` |
|
| 96 |
+
| `fail_rate` | float | DART-Math's own per-query fail rate, used to bin questions into difficulty 1 (easiest) through 5 (hardest) |
|
| 97 |
+
| `tot_n_samples` | int | how many responses DART-Math sampled to compute `fail_rate` |
|
| 98 |
+
| `difficulty` | int | 1-5, the difficulty tier this record was binned into |
|
| 99 |
+
|
| 100 |
+
`polar_split` writes `pool/diff{1..5}/train.json` (every question of the level, 565 /
|
| 101 |
+
1349 / 1579 / 1537 / 1577, MATH only; the search input) and `split/diff{1..5}/{train,val,
|
| 102 |
+
test}.json` (Li et al.'s inferred train/val/test cut, test 141 / 337 / 395 / 384 / 394),
|
| 103 |
+
same record fields. The router's 4-fold cross-validation over the pool is
|
| 104 |
+
`re_polar.router.fold_data.fold_qids(pool_query_ids, fold)`.
|
| 105 |
+
|
| 106 |
+
`dart_math_splits.json` and `polar_split_ids.json` record the same membership as plain
|
| 107 |
+
`query_id` lists, to check a rebuild without the question text.
|
| 108 |
+
|
| 109 |
+
## MCTS results (`mcts_results/`, `polar_split/mcts_results/`, `cross_checks/*/mcts_results/`)
|
| 110 |
+
|
| 111 |
+
For every question, every distinct program-of-layers the search evaluated, and whether it
|
| 112 |
+
answered correctly. This is what the routers and fixed programs are trained on. One file
|
| 113 |
+
per (model, [prompt,] seed, level): 2000 questions on our split, in the order train
|
| 114 |
+
(1250), val (250), test (500); the level's whole pool on the PoLar split.
|
| 115 |
+
|
| 116 |
+
Format:
|
| 117 |
+
|
| 118 |
+
```json
|
| 119 |
+
{"samples": [ { ... one record per question ... } ]}
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
Each record:
|
| 123 |
+
|
| 124 |
+
| field | type | meaning |
|
| 125 |
+
|---|---|---|
|
| 126 |
+
| `final_valid_transitions` | list of int-lists | every distinct **layer path** the search found that reaches the correct answer |
|
| 127 |
+
| `final_invalid_transitions` | list of int-lists | every distinct layer path the search tried that did *not* reach the correct answer |
|
| 128 |
+
| `initial_transition_metric` | float | reward of the identity program (all layers kept, in order); `0.0` means the model gets this question wrong even with no layer edits at all |
|
| 129 |
+
| `sample_info` | dict | `query_id` (the join key back into the reconstructed DART-Math data), `domain`, `math_level`, `source`, `fail_rate`, `tot_n_samples`, `difficulty`, `split` (`train`/`val`/`test` of our split; `train` for every PoLar-split question, whose search runs over the level's whole pool) |
|
| 130 |
+
| `search_trajectory` | list of dicts | the raw MCTS visit log, one entry per simulation: `{"path", "parent_path", "reward"}`. Lets you replay the exact tree the search built, not just its final valid/invalid path sets. |
|
| 131 |
+
|
| 132 |
+
A **layer path** is a flat list of layer indices, the exact sequence of
|
| 133 |
+
transformer layers the model ran, in order. It's what
|
| 134 |
+
`re_polar.core.layer_engine.LayerEngine.apply_layer_rerouting()` executes
|
| 135 |
+
directly:
|
| 136 |
+
|
| 137 |
+
- The identity path is `[0, 1, 2, ..., num_layers - 1]`, every layer once, in order.
|
| 138 |
+
- A **skipped** layer is simply missing from the path.
|
| 139 |
+
- A **repeated** layer appears consecutively more than once.
|
| 140 |
+
|
| 141 |
+
For example, `search_trajectory[0]["path"]` for one record in the sample
|
| 142 |
+
file is:
|
| 143 |
+
|
| 144 |
+
```
|
| 145 |
+
[0, 1, 2, 3, 4, 4, 4, 5, 6, ...]
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
Layer 4 runs 3 times in a row (a repeat), everything else in that stretch
|
| 149 |
+
runs once.
|
| 150 |
+
|
| 151 |
+
This flat path is the *ground truth* the search records. `re_polar.core`
|
| 152 |
+
(`Program`/`Segment`, see [`re_polar/core/ir.py`](https://github.com/DATEXIS/RE-PoLar/blob/main/re_polar/core/ir.py))
|
| 153 |
+
re-expresses the same information as contiguous ≤4-layer segments, each
|
| 154 |
+
tagged `keep`/`skip`/`repeat` — the structured form the router is trained
|
| 155 |
+
to predict. Every path in this data round-trips through it
|
| 156 |
+
(`re_polar.router.train.program_from_layer_path` decodes a path back to a
|
| 157 |
+
`Program`; `Program.to_layer_path()` must reproduce the original path
|
| 158 |
+
exactly).
|
| 159 |
+
|
| 160 |
+
### Generated text (`generated_answers/`)
|
| 161 |
+
|
| 162 |
+
`final_valid_transitions`/`final_invalid_transitions` say *whether* a
|
| 163 |
+
program was correct, not what the model generated to earn that label. The model's
|
| 164 |
+
output for every evaluation of a search is here, one file per (model, [prompt,] seed,
|
| 165 |
+
level). The text is the model's continuation only (capped at 2,000 characters); under the
|
| 166 |
+
`oneshot` prompt it often goes on to write a new, made-up problem after its answer.
|
| 167 |
+
|
| 168 |
+
The model sometimes restates its question, so restatements are redacted: every run of 10 or
|
| 169 |
+
more words that copies a question of our split or the PoLar split (case-insensitive, whitespace
|
| 170 |
+
normalised) is replaced by `[question]`, and so is a full copy of the row's own question when
|
| 171 |
+
that question has fewer than 10 words. About 5% of the answers are affected; `reward` is the
|
| 172 |
+
verdict on the original, unredacted text.
|
| 173 |
+
|
| 174 |
+
One JSON object per line:
|
| 175 |
+
|
| 176 |
+
| field | meaning |
|
| 177 |
+
|---|---|
|
| 178 |
+
| `query_id` | same id as `mcts_results/`'s `sample_info.query_id` and the reconstructed DART-Math data's `query_id` — join directly on this |
|
| 179 |
+
| `path` | the layer path that was executed |
|
| 180 |
+
| `reward` | 0.0 or 1.0, same meaning as `final_valid_transitions`/`initial_transition_metric` |
|
| 181 |
+
| `text` | the model's generated output for this (question, path), restatements of the question replaced by `[question]` (above) |
|
| 182 |
+
| `batch_id`, `batch_pos`, `batch_size` | which generation batch this row was part of, and its position in it — batch composition affects bf16 rounding, so this lets an exact batch be reconstructed if needed |
|
| 183 |
+
| `difficulty` | 1-5, redundant with the file path, kept so a row is self-contained |
|
| 184 |
+
|
| 185 |
+
## Router results (`router_results/`)
|
| 186 |
+
|
| 187 |
+
`re_polar.router.infer --top-k-paths 5` on the test questions (main track: the 500 test
|
| 188 |
+
questions of the level; PoLar split: the fold's test quarter, or Li et al.'s test set in
|
| 189 |
+
`split.json`).
|
| 190 |
+
|
| 191 |
+
```json
|
| 192 |
+
{"model": str, "checkpoint": str, "per_difficulty": [ {...} ], "overall": {...},
|
| 193 |
+
"programs": {"<level>": [ {...one entry per test question...} ]}}
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
`per_difficulty`: `n`, `identity_acc`, `router_acc` (pass@1), `pass_at` (pass@1..5),
|
| 197 |
+
`router_acc_at_k`, `rescue_at1` / `harm_at1` (questions where the top-1 program is right
|
| 198 |
+
and identity wrong, and vice versa), `mcnemar_p`, `n_nonidentity_top1`,
|
| 199 |
+
`n_distinct_top1`, `top_nonidentity_share`, and program-shape statistics. `programs`:
|
| 200 |
+
per question `query_id`, the top-1 `layer_path`, `identity_correct`, `nonidentity`, and
|
| 201 |
+
`candidates` (the 5 programs, top-1 first, each with `layer_path` and `correct`).
|
| 202 |
+
|
| 203 |
+
## Fixed programs (`fixed_program/`)
|
| 204 |
+
|
| 205 |
+
`re_polar.router.fixed_program`: one program per level, the same for every question,
|
| 206 |
+
picked on the validation questions among the 20 programs with the highest shrunk success
|
| 207 |
+
rate on the training questions.
|
| 208 |
+
|
| 209 |
+
```json
|
| 210 |
+
{"difficulty": int, "menu_size": int, "prompt_style": str, "n": {"train", "val", "test"},
|
| 211 |
+
"methods": {"fixed": {"winner": {"layer_path", "train_prior", ...},
|
| 212 |
+
"val": {...}, "test": {...}, "all_val": [...]}}}
|
| 213 |
+
```
|
| 214 |
+
|
| 215 |
+
`test`: `identity_acc`, `pass_at` (pass@1 is the fixed program's accuracy), `rescue_at1`,
|
| 216 |
+
`harm_at1`, `mcnemar_p`, and `per_question` (`query_id`, `identity_correct`,
|
| 217 |
+
`top1_correct`). `all_val`: every candidate's validation result.
|
| 218 |
+
|
| 219 |
+
## Out-of-distribution routers (`polar_split/ood/<model>/`)
|
| 220 |
+
|
| 221 |
+
One router and one fixed program per model, trained on all five levels of Li et al.'s
|
| 222 |
+
train/val split with the `polar_default` prompt (seed-42 search), evaluated on ASDiv and
|
| 223 |
+
MAWPS (`router_asdiv_mawps.json`, `fixed_program.json`) and MMLU-Pro
|
| 224 |
+
(`router_and_fixed_mmlu_pro.json`, from `analysis.mmlu_pro_track.infer_router_mmlu
|
| 225 |
+
--fixed-program-json`). Paper Appendix B.7.
|
| 226 |
+
|
| 227 |
+
## Reading the data
|
| 228 |
+
|
| 229 |
+
Every large file ships gzip-compressed. Decompressing one gives back exactly the
|
| 230 |
+
plain-text JSON or JSONL described above. `re_polar.datasets.schemas.load_samples` and
|
| 231 |
+
`re_polar.mcts.analysis.loader.load_menu_crosschecks` accept a `.gz` path directly. To
|
| 232 |
+
inspect a file yourself:
|
| 233 |
+
|
| 234 |
+
```python
|
| 235 |
+
import json, gzip
|
| 236 |
+
json.load(gzip.open("path/to/file.json.gz", "rt")) # mcts_results/, menu_crossexec/
|
| 237 |
+
[json.loads(l) for l in gzip.open("path/to/file.jsonl.gz", "rt")] # generated_answers/
|
| 238 |
+
```
|
| 239 |
+
|
| 240 |
+
## Joining questions back onto the MCTS results
|
| 241 |
+
|
| 242 |
+
Rebuild the questions (above), then join, per model:
|
| 243 |
+
|
| 244 |
+
```bash
|
| 245 |
+
python -m re_polar.datasets.attach_mcts_questions \
|
| 246 |
+
--mcts-dir data/mcts_results/qwen3_8b --dart-math-dir ./data/dart_math \
|
| 247 |
+
--out-dir ./data/mcts_results_full/qwen3_8b
|
| 248 |
+
python -m re_polar.datasets.attach_mcts_questions \
|
| 249 |
+
--mcts-dir data/polar_split/mcts_results/qwen3_8b/oneshot \
|
| 250 |
+
--dart-math-dir ./data/polar_split_questions/pool \
|
| 251 |
+
--out-dir ./data/mcts_results_full/polar_split/qwen3_8b/oneshot
|
| 252 |
+
```
|
| 253 |
+
|
| 254 |
+
This writes the same directory layout (`seed<S>/dart-math-diff-<L>/`), with
|
| 255 |
+
`question`/`gt_ans` added to every record: the format `re_polar.router.train`,
|
| 256 |
+
`re_polar.router.fixed_program` and everything under [`analysis/`](https://github.com/DATEXIS/RE-PoLar/blob/main/analysis/) expect.
|
| 257 |
+
For the PoLar-split routers, `re_polar.router.fold_data` joins the text itself.
|
| 258 |
+
|
| 259 |
+
## Menu cross-execution data (`menu_crossexec/`, `menu_crossexec_heldout/`)
|
| 260 |
+
|
| 261 |
+
Rank programs, identity included, by how many questions they solved during the seed-42
|
| 262 |
+
search, take the top 100, then execute each of them against every question of a question set
|
| 263 |
+
(not just the ones the search happened to try it on), with the search's own `oneshot`
|
| 264 |
+
prompt. Produced by
|
| 265 |
+
[`analysis/mcts_design/menu_coverage.py`](https://github.com/DATEXIS/RE-PoLar/blob/main/analysis/mcts_design/menu_coverage.py); both
|
| 266 |
+
sets are compared by [`analysis/mcts_design/menu_heldout.py`](https://github.com/DATEXIS/RE-PoLar/blob/main/analysis/mcts_design/menu_heldout.py).
|
| 267 |
+
|
| 268 |
+
- `menu_crossexec/<model>/diff<L>.json.gz`: in-sample, ranked and executed on all 2,000
|
| 269 |
+
questions of the level (`--rank-pool all --eval-pool all`; paper Fig. 4a and Fig. 9).
|
| 270 |
+
- `menu_crossexec_heldout/<model>/diff<L>.json.gz`: held-out, ranked on the 1,500 train+val
|
| 271 |
+
questions and executed on the 500 test questions (`--rank-pool trainval --eval-pool test`).
|
| 272 |
+
Cells already in the in-sample grid were taken from it (`--reuse-grid`, provenance `g`).
|
| 273 |
+
|
| 274 |
+
```json
|
| 275 |
+
{"model": str, "k": int, "prompt_style": str, "schema": "menu_crossexec_v2",
|
| 276 |
+
"per_difficulty": [ { ...one entry per difficulty... } ]}
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
Each `per_difficulty` entry:
|
| 280 |
+
|
| 281 |
+
| field | meaning |
|
| 282 |
+
|---|---|
|
| 283 |
+
| `difficulty`, `n_pool`, `n_train`, `n_val`, `n_test` | pool size and split sizes for this difficulty (same split as `dart_math_splits.json`) |
|
| 284 |
+
| `k_requested` / `k_actual` | requested vs. actually-ranked menu size |
|
| 285 |
+
| `qids` | every pool question's `query_id`, in a fixed order — everything below indexes positionally against this list |
|
| 286 |
+
| `per_program` | one entry per menu program: `path` (its layer path), `rewards` (one 0/1 per `qids` position) and `provenance` (one letter per `qids` position saying where that 0/1 comes from: `v` / `i` = the search already ran this program on this question (valid / invalid), so it was not run again; `f` = run for this grid, because the search tried each program on only some questions; `g` = copied from another grid that already ran this program on this question: the in-sample grid for held-out grids (`reuse_grid`), the earlier grid of the same level for the LLaMA-3.2-3B and Qwen1.5-MoE DM-5 in-sample grids) |
|
| 287 |
+
| `provenance_legend` | the same letter meanings, stored in the file |
|
| 288 |
+
| `n_reused_cells` / `n_new_cells` | how many reused (`v`/`i`/`g`) vs. `f` cells, across the whole grid |
|
| 289 |
+
| `rank_pool`, `eval_pool`, `reuse_grid` | held-out grids only: `trainval`, `test`, and the in-sample grid the `g` cells come from |
|
| 290 |
+
| `real_topk_coverage_curve`, `final_real_coverage` | coverage vs. menu size K |
|
| 291 |
+
|
| 292 |
+
## Router checkpoints (`router_checkpoints/`, `polar_split/router_checkpoints/`, `polar_split/ood/`)
|
| 293 |
+
|
| 294 |
+
Trained router weights (PyTorch state dict). Load via
|
| 295 |
+
`re_polar.router.train.load_checkpoint` (used by
|
| 296 |
+
`re_polar/router/infer.py --checkpoint`).
|
| 297 |
+
|
| 298 |
+
```json
|
| 299 |
+
{"state_dict": {...}, "meta": {"num_layers", "n_ops", "d_model", "nheads",
|
| 300 |
+
"n_layer_blocks", "embed_dim", "embedding_model_name", "max_question_tokens",
|
| 301 |
+
"ops"}, "train_meta": {...training config and val metrics...}}
|
| 302 |
+
```
|
| 303 |
+
|
| 304 |
+
`state_dict` holds only the trainable head; the frozen embedding encoder
|
| 305 |
+
(`meta.embedding_model_name`) reloads its own weights from Hugging Face.
|
fixed_program/qwen15_moe_a27b/seed1/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed1/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed1/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed1/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed1/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed42/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed42/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed42/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed42/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed42/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed7/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed7/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed7/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed7/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen15_moe_a27b/seed7/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed1/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed1/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed1/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed1/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed1/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed42/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed7/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed7/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed7/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed7/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen25_7b/seed7/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed1/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed1/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed1/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed42/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed42/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed42/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed42/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_32b/seed42/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed1/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed1/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed1/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed1/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed1/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed42/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed42/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed42/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed42/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed42/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed7/diff1.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed7/diff2.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed7/diff3.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed7/diff4.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
fixed_program/qwen3_8b/seed7/diff5.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|