sunrainyg/RandOpt
Official Codebase for "Neural Thickets: Diverse Task Experts Are Dense Around Pretrained Weights" (ICML 2026 Spotlight)
RandOpt – Randomized Optimization for Diverse Task Experts
What it is
- RandOpt is the code release for the paper Neural Thickets: Diverse Task Experts Are Dense Around Pretrained Weights (Gan & Isola, 2026). The project explores how many specialized “task experts” can be found near a single pretrained model by randomly sampling weight perturbations and selecting the best performing ones.
Key capabilities
- Iterative RandOpt (new in July 2026): an improved version that repeatedly refines the sampled models, available on the
iterative-randoptbranch. - Works with existing verl or huggingface/trl pipelines via a pip‑installable package.
- Supports both single‑node and multi‑node training (Slurm scripts provided) and a local run mode.
- Includes utilities for:
- Post‑training on custom or standard datasets.
- Distilling the top‑k sampled models into a single compact model.
- Running baseline methods for comparison.
Installation
- Conda/Python:
pip install -r requirements.txt(optionally inside a conda env). - Docker: Build with the provided Dockerfile (
docker/Dockerfile_vllm) and run with GPU support. A volume mount can be used to expose your data directory.
Typical workflow
- Prepare data – either follow
CUSTOM_DATASET_GUIDE.mdfor your own data or download the standard dataset referenced indata/README.md. - Run RandOpt – choose one of the provided scripts:
sbatch scripts/single_node.shfor a single‑node Slurm job.sbatch scripts/multiple_nodes.shfor a multi‑node job.bash scripts/local_run.shfor a quick local test without Slurm.
- Distill – after sampling many models, use the distillation script (
distillation/README.md) to merge the top‑k performers into one model. - Compare – run baseline implementations via
baselines/README.mdto see how RandOpt stacks up.
How to get help
- Open an issue on the GitHub repo: https://github.com/sunrainyg/RandOpt/issues.
Citation
@misc{gan2026neuralthickets,
title={Neural Thickets: Diverse Task Experts Are Dense Around Pretrained Weights},
author={Yulu Gan and Phillip Isola},
year={2026},
eprint={2603.12228},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2603.12228}
}
Related
- Project
- Project
- Project
- Project