Datasets:
|
Download README.md from SWAMBIT/re-polar: direct link, hf CLI and curl.
- Browser
- Download file 13.5 kB
-
https://huggingface.co/datasets/SWAMBIT/re-polar/resolve/main/README.md
- Command line
-
hf download hf://datasets/SWAMBIT/re-polar/README.md
-
curl -L -o README.md https://huggingface.co/datasets/SWAMBIT/re-polar/resolve/main/README.md
13.5 kB
| pretty_name: RE-PoLar | |
| license: cc-by-nc-4.0 | |
| language: | |
| - en | |
| tags: | |
| - llm | |
| - layer-skipping | |
| - layer-repetition | |
| - programs-of-layers | |
| - mcts | |
| - routing | |
| - reproduction | |
| - math-reasoning | |
| task_categories: | |
| - text-generation | |
| size_categories: | |
| - 10M<n<100M | |
| configs: | |
| - config_name: programs_qwen15_moe_a27b | |
| field: samples | |
| data_files: | |
| - split: seed42 | |
| path: mcts_results/qwen15_moe_a27b/seed42/*/merged_mcts_samples.json.gz | |
| - split: seed1 | |
| path: mcts_results/qwen15_moe_a27b/seed1/*/merged_mcts_samples.json.gz | |
| - split: seed7 | |
| path: mcts_results/qwen15_moe_a27b/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: programs_qwen25_3b | |
| field: samples | |
| data_files: | |
| - split: seed42 | |
| path: mcts_results/qwen25_3b/seed42/*/merged_mcts_samples.json.gz | |
| - split: seed1 | |
| path: mcts_results/qwen25_3b/seed1/*/merged_mcts_samples.json.gz | |
| - split: seed7 | |
| path: mcts_results/qwen25_3b/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: programs_qwen25_7b | |
| field: samples | |
| data_files: | |
| - split: seed42 | |
| path: mcts_results/qwen25_7b/seed42/*/merged_mcts_samples.json.gz | |
| - split: seed1 | |
| path: mcts_results/qwen25_7b/seed1/*/merged_mcts_samples.json.gz | |
| - split: seed7 | |
| path: mcts_results/qwen25_7b/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: programs_qwen3_8b | |
| field: samples | |
| data_files: | |
| - split: seed42 | |
| path: mcts_results/qwen3_8b/seed42/*/merged_mcts_samples.json.gz | |
| - split: seed1 | |
| path: mcts_results/qwen3_8b/seed1/*/merged_mcts_samples.json.gz | |
| - split: seed7 | |
| path: mcts_results/qwen3_8b/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: programs_qwen3_32b | |
| field: samples | |
| data_files: | |
| - split: seed42 | |
| path: mcts_results/qwen3_32b/seed42/*/merged_mcts_samples.json.gz | |
| - split: seed1 | |
| path: mcts_results/qwen3_32b/seed1/*/merged_mcts_samples.json.gz | |
| - split: seed7 | |
| path: mcts_results/qwen3_32b/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: programs_llama32_3b | |
| field: samples | |
| data_files: | |
| - split: seed42 | |
| path: mcts_results/llama32_3b/seed42/*/merged_mcts_samples.json.gz | |
| - split: seed1 | |
| path: mcts_results/llama32_3b/seed1/*/merged_mcts_samples.json.gz | |
| - split: seed7 | |
| path: mcts_results/llama32_3b/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: answers_qwen15_moe_a27b | |
| data_files: | |
| - split: seed42 | |
| path: generated_answers/qwen15_moe_a27b/seed42/*.jsonl.gz | |
| - split: seed1 | |
| path: generated_answers/qwen15_moe_a27b/seed1/*.jsonl.gz | |
| - split: seed7 | |
| path: generated_answers/qwen15_moe_a27b/seed7/*.jsonl.gz | |
| - config_name: answers_qwen25_3b | |
| data_files: | |
| - split: seed42 | |
| path: generated_answers/qwen25_3b/seed42/*.jsonl.gz | |
| - split: seed1 | |
| path: generated_answers/qwen25_3b/seed1/*.jsonl.gz | |
| - split: seed7 | |
| path: generated_answers/qwen25_3b/seed7/*.jsonl.gz | |
| - config_name: answers_qwen25_7b | |
| data_files: | |
| - split: seed42 | |
| path: generated_answers/qwen25_7b/seed42/*.jsonl.gz | |
| - split: seed1 | |
| path: generated_answers/qwen25_7b/seed1/*.jsonl.gz | |
| - split: seed7 | |
| path: generated_answers/qwen25_7b/seed7/*.jsonl.gz | |
| - config_name: answers_qwen3_8b | |
| data_files: | |
| - split: seed42 | |
| path: generated_answers/qwen3_8b/seed42/*.jsonl.gz | |
| - split: seed1 | |
| path: generated_answers/qwen3_8b/seed1/*.jsonl.gz | |
| - split: seed7 | |
| path: generated_answers/qwen3_8b/seed7/*.jsonl.gz | |
| - config_name: answers_qwen3_32b | |
| data_files: | |
| - split: seed42 | |
| path: generated_answers/qwen3_32b/seed42/*.jsonl.gz | |
| - split: seed1 | |
| path: generated_answers/qwen3_32b/seed1/*.jsonl.gz | |
| - split: seed7 | |
| path: generated_answers/qwen3_32b/seed7/*.jsonl.gz | |
| - config_name: answers_llama32_3b | |
| data_files: | |
| - split: seed42 | |
| path: generated_answers/llama32_3b/seed42/*.jsonl.gz | |
| - split: seed1 | |
| path: generated_answers/llama32_3b/seed1/*.jsonl.gz | |
| - split: seed7 | |
| path: generated_answers/llama32_3b/seed7/*.jsonl.gz | |
| - config_name: polar_split_programs_qwen15_moe_a27b | |
| field: samples | |
| data_files: | |
| - split: polar_default_seed42 | |
| path: polar_split/mcts_results/qwen15_moe_a27b/polar_default/seed42/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed1 | |
| path: polar_split/mcts_results/qwen15_moe_a27b/polar_default/seed1/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed7 | |
| path: polar_split/mcts_results/qwen15_moe_a27b/polar_default/seed7/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed42 | |
| path: polar_split/mcts_results/qwen15_moe_a27b/oneshot/seed42/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed1 | |
| path: polar_split/mcts_results/qwen15_moe_a27b/oneshot/seed1/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed7 | |
| path: polar_split/mcts_results/qwen15_moe_a27b/oneshot/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: polar_split_programs_qwen25_3b | |
| field: samples | |
| data_files: | |
| - split: polar_default_seed42 | |
| path: polar_split/mcts_results/qwen25_3b/polar_default/seed42/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed1 | |
| path: polar_split/mcts_results/qwen25_3b/polar_default/seed1/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed7 | |
| path: polar_split/mcts_results/qwen25_3b/polar_default/seed7/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed42 | |
| path: polar_split/mcts_results/qwen25_3b/oneshot/seed42/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed1 | |
| path: polar_split/mcts_results/qwen25_3b/oneshot/seed1/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed7 | |
| path: polar_split/mcts_results/qwen25_3b/oneshot/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: polar_split_programs_qwen3_8b | |
| field: samples | |
| data_files: | |
| - split: polar_default_seed42 | |
| path: polar_split/mcts_results/qwen3_8b/polar_default/seed42/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed1 | |
| path: polar_split/mcts_results/qwen3_8b/polar_default/seed1/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed7 | |
| path: polar_split/mcts_results/qwen3_8b/polar_default/seed7/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed42 | |
| path: polar_split/mcts_results/qwen3_8b/oneshot/seed42/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed1 | |
| path: polar_split/mcts_results/qwen3_8b/oneshot/seed1/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed7 | |
| path: polar_split/mcts_results/qwen3_8b/oneshot/seed7/*/merged_mcts_samples.json.gz | |
| - config_name: polar_split_programs_llama32_3b | |
| field: samples | |
| data_files: | |
| - split: polar_default_seed42 | |
| path: polar_split/mcts_results/llama32_3b/polar_default/seed42/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed1 | |
| path: polar_split/mcts_results/llama32_3b/polar_default/seed1/*/merged_mcts_samples.json.gz | |
| - split: polar_default_seed7 | |
| path: polar_split/mcts_results/llama32_3b/polar_default/seed7/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed42 | |
| path: polar_split/mcts_results/llama32_3b/oneshot/seed42/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed1 | |
| path: polar_split/mcts_results/llama32_3b/oneshot/seed1/*/merged_mcts_samples.json.gz | |
| - split: oneshot_seed7 | |
| path: polar_split/mcts_results/llama32_3b/oneshot/seed7/*/merged_mcts_samples.json.gz | |
| # RE-PoLar: every program-of-layers our searches evaluated | |
| - **Authors:** Justus Westerhoff\*, Stephan Olbrich\*, Hatem Oraby, Walter Senn, Matthew E. Larkum, Felix Alexander Gers | |
| - \*Shared first authorship; order chosen at random. | |
| - **Affiliations:** Berliner Hochschule für Technik (BHT), Humboldt-Universität zu Berlin, University of Bern | |
| - **Project page (interactive search-tree explorer):** https://datexis.github.io/RE-PoLar/ | |
| - **Code:** https://github.com/DATEXIS/RE-PoLar | |
| - **Paper:** [*Programs-of-Layers in LLMs through the Lens of Cortical Areas*](https://arxiv.org/abs/2609.31360) | |
| - **Reproduced work:** [PoLar](https://arxiv.org/abs/2606.06574) (Li et al., ICML 2026) | |
| ## Overview | |
| A *program-of-layers* runs a transformer's layers in a different order than the standard | |
| forward pass: some layers are skipped, some segments repeated. PoLar finds such programs per | |
| question with a Monte Carlo Tree Search (MCTS) and trains a router that predicts one from the | |
| question. This dataset holds everything our reproduction's searches, routers and fixed | |
| programs produced: | |
| - **Main track** (our DART-Math split, our search, `oneshot` prompt): 6 models × 3 search | |
| seeds × 5 difficulty levels × 2,000 questions. Every program each search evaluated, with | |
| its verdict (**56.6M programs in the whole dataset, 4.6M of them solving their question**), | |
| the model's generated answer behind each verdict (53.2M answers), the trained routers | |
| and their test results, the best fixed program per level, and the menu cross-execution. | |
| - **PoLar split** (`polar_split/`, paper Appendix B): Li et al.'s released search on their own | |
| MATH question sets, 4 models × 2 prompts (`polar_default`, `oneshot`) × 3 seeds, with | |
| 4-fold cross-validated routers and fixed programs, and routers evaluated out of | |
| distribution (ASDiv, MAWPS, MMLU-Pro). | |
| - **Cross-checks** (`cross_checks/`): their search on our split and our search on theirs. | |
| Models: Qwen1.5-MoE-A2.7B-Chat, Qwen2.5-3B-Instruct, Qwen2.5-7B-Instruct, Qwen3-8B, Qwen3-32B, | |
| LLaMA-3.2-3B-Instruct. | |
| <p align="center"><img src="assets/method_overview.png" width="720" alt="A router reads the prompt and picks a per-layer skip/keep/repeat program before the frozen transformer runs."></p> | |
| ## Explore the search trees | |
| The dataset viewer above shows the searches as tables: pick `programs_<model>` for the | |
| programs and verdicts of each question (split = search seed), `answers_<model>` for the | |
| generated answers, `polar_split_programs_<model>` for the PoLar split. The search trees | |
| themselves, node by node, are on the | |
| [project page's interactive explorer](https://datexis.github.io/RE-PoLar/). | |
| ## Layout | |
| ``` | |
| mcts_results/<model>/seed<S>/dart-math-diff-<L>/merged_mcts_samples.json.gz programs + verdicts per question | |
| generated_answers/<model>/seed<S>/diff<L>.jsonl.gz one generated answer per evaluation | |
| router_checkpoints/<model>/seed<S>/diff<L>.pt trained routers (weights only) | |
| router_results/<model>/seed<S>/diff<L>.json router test results, per question | |
| fixed_program/<model>/seed<S>/diff<L>.json fixed-program baseline, per question | |
| menu_crossexec/<model>/diff<L>.json.gz top-100 programs x 2,000 questions | |
| menu_crossexec_heldout/<model>/diff<L>.json.gz top-100 by train+val, run on the 500 test questions | |
| polar_split/... same artifacts under <model>/<prompt>/seed<S>/ | |
| cross_checks/{their_search_our_split,our_search_polar_split}/... | |
| DATA.md full schema of every file | |
| ``` | |
| `<model>`: `qwen15_moe_a27b`, `qwen25_3b`, `qwen25_7b`, `qwen3_8b`, `qwen3_32b`, `llama32_3b`; | |
| `<S>`: search seed 42, 1, 7; `<L>`: difficulty level 1-5. [`DATA.md`](DATA.md) documents every | |
| field, the search configurations and which runs have no answer texts. | |
| ## Download and use | |
| The code expects the files under `data/` of a clone of the repository: | |
| ```bash | |
| git clone https://github.com/DATEXIS/RE-PoLar && cd RE-PoLar | |
| pip install -U huggingface_hub | |
| hf download SWAMBIT/re-polar --repo-type dataset --local-dir data # everything, ~6 GB | |
| hf download SWAMBIT/re-polar --repo-type dataset --local-dir data --include "router_results/*" "fixed_program/*" | |
| ``` | |
| One file with the `datasets` library, or directly: | |
| ```python | |
| from datasets import load_dataset | |
| programs = load_dataset("SWAMBIT/re-polar", "programs_qwen3_8b", split="seed42") | |
| print(programs[0]["sample_info"]["query_id"], len(programs[0]["final_valid_transitions"])) | |
| import gzip, json | |
| router = json.load(open("data/router_results/qwen3_8b/seed42/diff1.json")) | |
| print(router["overall"]) # Base tau=0, router p@1 and p@5 on the 500 test questions | |
| with gzip.open("data/generated_answers/qwen3_8b/seed42/diff1.jsonl.gz", "rt") as f: | |
| print(json.loads(next(f))) | |
| ``` | |
| ## Questions are not included | |
| No file holds question text or reference answers, only `query_id`s. The MATH half of the | |
| DART-Math pool traces back to the delisted `hendrycks/competition_math`, so the questions are | |
| rebuilt locally from the public pool with the repository's code and joined on `query_id` | |
| (`re_polar.datasets.dart_math`, `re_polar.datasets.polar_split`, | |
| `re_polar.datasets.attach_mcts_questions`; see the repository README). The models sometimes | |
| restate their question in a generated answer; such restatements are replaced by | |
| `[question]` (DATA.md, "Generated text"). | |
| ## Citation | |
| ```bibtex | |
| @article{westerhoff2026repolar, | |
| title={Programs-of-Layers in LLMs through the Lens of Cortical Areas}, | |
| author={Westerhoff, Justus and Olbrich, Stephan and Oraby, Hatem and Senn, Walter and Larkum, Matthew Evan and Gers, Felix Alexander}, | |
| journal={arXiv preprint arXiv:2609.31360}, | |
| year={2026} | |
| } | |
| ``` | |
| ## License | |
| **CC BY-NC 4.0.** The generated answers and verdicts are outputs of the models above and | |
| also fall under their licenses: Qwen1.5-MoE-A2.7B-Chat (Tongyi Qianwen License), | |
| Qwen2.5-3B-Instruct (Qwen Research License), Qwen2.5-7B-Instruct, Qwen3-8B and Qwen3-32B | |
| (Apache 2.0), LLaMA-3.2-3B-Instruct (Llama 3.2 Community License; Built with Llama). The routers embed | |
| questions with Qwen3-Embedding-0.6B (Apache 2.0). The code is MIT-licensed, see the repository. | |