Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

s1

> 编程语言
Open source

s1: Simple test-time scaling

6.7K stars0 likes0 views
WebsiteGitHub

About

s1: Simple test-time scaling



Updates:

  • 2025-03: Released 2 videos on s1: TWIML Podcast (Sam Charrington & Niklas Muennighoff) & Microsoft GenAI Talk (Niklas Muennighoff)
  • 2025-02: We released s1.1 a better model than s1 by reusing the same s1K questions but with reasoning traces generated by r1 instead of Gemini: s1K-1.1. Check this tweet for details
  • 2025-01: We released our paper announced via this tweet.

This repository provides an overview of all resources for the paper "s1: Simple test-time scaling".

  • Artifacts
  • Structure
  • Inference
    • vLLM
    • vLLM with budget forcing
    • transformers
  • Training
  • Evaluation
  • Data
  • Visuals
  • Known Issues
  • Citation

Artifacts

  • Paper: https://arxiv.org/abs/2501.19393
  • Model: https://hf.co/simplescaling/s1.1-32B (Old: https://hf.co/simplescaling/s1-32B)
  • Data: https://hf.co/datasets/simplescaling/s1K-1.1 (Old: https://hf.co/datasets/simplescaling/s1K)
    • s1-prob: https://hf.co/datasets/simplescaling/s1-prob
    • s1-teasers: https://hf.co/datasets/simplescaling/s1-teasers
    • Full 59K: https://hf.co/datasets/simplescaling/data_ablation_full59K

Structure

  • eval/: Evaluation scripts
  • data/: Synthetic data creation scripts & co
  • train/: Training scripts

Inference

vLLM

Install the vllm library and run:

…

vLLM with budget forcing

…

transformers

Install the transformers & torch libraries and run:

…

Training

To run training, you can find our script at train/sft.py which you can invoke via one of the train/sft*sh scripts which in turn you can launch via train/launch.sh if you are on a SLURM cluster (requires editing the file for your cluster setup).

To train s1-32B/s1.1-32B, we recommend 16 H100 GPUs i.e. 2 nodes with 8 each. For s1.1, we set the block size to 20000 to avoid OOM (https://github.com/simplescaling/s1/blob/0ad4b3de32507b4aa0d4be28f336276ee99b2315/train/sft.sh#L17); Check the wandb logs here.

Quick start:

bash
git clone https://github.com/simplescaling/s1.git
cd s1
pip3 install -r requirements.txt
bash train/sft.sh

Note: If you encounter an out-of-memory (OOM) issue with 8 GPUs, consider enabling gradient checkpointing by adding the following line to your script: --gradient_checkpointing=True.

Evaluation

We cloned lm-evaluation-harness at commit 4cec66e4e468d15789473d6d63c3a61a751fa524 and modified it. Setup:

bash
cd eval/lm-evaluation-harness
pip install -e .[math,vllm]

All commands are in eval/commands.sh. For AIME24 we always pick the aime24_nofigures result, which uses a dataset that only contains the AIME24 figures if they are important for the task.

If you want to compute statistics (avg thinking tokens etc) for an evaluation run you can use python eval/compute_sample_stats.py path_to_samples_file.jsonl

All our evaluation result files are at: https://hf.co/datasets/simplescaling/results

To run REBASE: commands are in eval/rebase/run.sh Note that for the evaluations in the Discussion section with REBASE we used https://huggingface.co/simplescaling/step-conditional-control-old trained on an older version of our dataset https://huggingface.co/datasets/simplescaling/s1K-step-conditional-control-old and run on an older version of our evaluation using https://huggingface.co/datasets/Maxwell-Jia/AIME_2024.

Data

To recreate s1K follow the steps below. In various files you will have to rename the organizations simplescaling and qfq with an organization that you own. Note that s1K-1.1 is a better dataset generated with r1 traces instead of Gemini traces.

  1. Run data/collect_data.py followed by data/fix_gpqa.py & data/add_aime.py to collect the questions; Make sure to change the hub path in the respective files to one of your own.
  2. Generate traces with Gemini via python data/gemini.py. This step will use https://hf.co/datasets/qfq/train which should be roughly equivalent to the dataet you have produced in 1.
  3. Generate answers with Qwen via python data/bulk_inference.py that can be launched with data/bulk_inference.sh.
  4. Add features by running python data/featurization.py.
  5. Run final filtering via going through data/filter.ipynb.
  6. If you want to run grading on the final questions to produce e.g. a gemini_grade column as in this dataset, you can use data/grading.ipynb.

Visuals

All figures and some tables are created via this colab equivalent to visuals/visuals.ipynb. Some are subsequently edited via the visuals/s1.fig file, which you can load in Figma. The output figures are in visuals/ in pdf or png format.

Known Issues

  • vLLM throws ValueError: Token id XXXXX is out of vocabulary
    • This can happen with budget forcing, especially when running with temperature 1, where the model will sometimes do crazy stuff and predict a vocab id that is larger than its max token id but still within its embedding size i.e. anything <152064, >151664; When we refeed the model's previous outputs to it which is done when setting e.g. max_thinking_tokens in the evaluation then this will cause the error cuz vLLM does this check even though it would only be an issue for IDs >152064. To fix it you can just uncomment the vLLM ValueError (It is the line if max_input_id > tokenizer.max_token_id: in vllm/engine/llm_engine.py)

Citation

bibtex
@misc{muennighoff2025s1simpletesttimescaling,
      title={s1: Simple test-time scaling}, 
      author={Niklas Muennighoff and Zitong Yang and Weijia Shi and Xiang Lisa Li and Li Fei-Fei and Hannaneh Hajishirzi and Luke Zettlemoyer and Percy Liang and Emmanuel Candès and Tatsunori Hashimoto},
      year={2025},
      eprint={2501.19393},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.19393}, 
}

Issues· 76 open

View all issuesOpen on GitHub
  • #135

    แนะนำ 11 สล็อต pg เว็บตรง แตกหนัก 2026 อันดับ 1 เชื่อถือได้ 999%

    Updated Apr 29, 2026
  • #134

    Inconsistent AIME scores when porting evaluation to newer vLLM versions

    Updated Mar 13, 2026
  • #133

    Cannot find simplescaling/s1-7B available / renamed / removed?

    Updated Feb 18, 2026
  • #132

    Performance on Qwen2.5-7B-Instruct

    Updated Feb 14, 2026
  • #130

    DeepSeek-R1 trace generation details

    Updated Jan 14, 2026
  • #128

    I tried to finetune qwen3-1.7B on implescaling/s1K-1.1_tokenized datasets , by using this repository code , cannot figure out why do I got worse inferrence result ?

    Updated Oct 22, 2025
  • #127

    does the budget forcing works?

    Updated Oct 8, 2025
  • #126

    final answer extraction from the solution for aime24 dataset

    Updated Oct 2, 2025
  • #124

    Thanks for your work, can I use "Qwen/Qwen2.5-32B-Instruct" instead of gpt-4o-mini for evaluation? If yes, what codes need to be changed?

    Updated Jul 22, 2025
  • #108

    Issue Reproducing s1.1-32B Training Loss (Observed vs. WandB)

    Updated Jul 3, 2025

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 23, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言