Archive of AI

Source Snapshot / 2025-01-28-huggingface-open-r1-2

Open-R1 第一周进展

Linked event: 2025-01-28 · Hugging Face Launches Open-R1 Initiative to Fully Reproduce Reasoning Model Training Recipes in the Open

Publisher
Hugging Face Open-R1 团队
Archived
2026-11-23
Capture Method
Direct page capture
HTTP / SHA-256
200 / 85e9701f3eb52268
Original URL
Open source ↗
Wayback Backup
Not archived
This page preserves a plain-text static snapshot against link rot. When citing figures, tables, or full legal terms, verify against the original URL and Wayback Machine archive.

[来源关键摘录] 2 月 2 日更新分别报告评测、训练管线和合成数据的进展,说明这些工作仍在逐步推进。

[正文前段节选] Hugging Face

Search models, datasets, users... ⌘K

Back to Articles

Open-R1: Update #1

Team Article

February 2, 2025

Leandro von Werra

Lewis Tunstall

Quentin Gallouédec

Guilherme Penedo

Edward Beeching

Anton Lozhkov

Brigitte Tousignant

BrigitteTousi

Daniel van Strien

It’s been two weeks since the release of DeepSeek R1 and just a week since we started the open-r1 project to replicate the missing pieces, namely the training pipeline and the synthetic data. This post summarizes:

the progress of Open-R1 to replicate the DeepSeek-R1 pipeline and dataset

what we learned about DeepSeek-R1 and discussions around it

cool projects the community has built since the release of DeepSeek-R1

It should serve both as an update on the project and as a collection of interesting resources around DeepSeek-R1.

Progress after 1 Week

Let’s start by looking at the progress we made on Open-R1. We started Open-R1 just one week ago and people across the teams as well as the community came together to work on it and we have some progress to report.

The first step in reproduction is to verify that we can match the evaluation scores. We are able to reproduce Deepseek's reported results on the MATH-500 Benchmark:

MATH-500 (HF lighteval)

MATH-500 (DeepSeek Reported)

DeepSeek-R1-Distill-Qwen-1.5B

DeepSeek-R1-Distill-Qwen-7B

DeepSeek-R1-Distill-Qwen-14B

DeepSeek-R1-Distill-Qwen-32B

DeepSeek-R1-Distill-Llama-8B

DeepSeek-R1-Distill-Llama-70B

You can find the instructions to run these evaluations in the open-r1 repository.

One observation we have made is the enormous size of the generations from the DeepSeek models, which makes even evaluating the model challenging. Here we show DeepSeek-R1 response lengths in the OpenThoughts dataset:

Distribution of R1’s responses shows that they are on average very long with the average response being 6,000 tokens long and some responses containing more than 20,000 tokens. Worth noting that the average page contains ~500 words and one token is on average slightly less than a word, which means the many reponses are over 10 pages long. (src: https://x.com/gui_penedo/status/1884953463051649052)

The length of responses will make GPRO training challenging, as we will have to generate long completions which will require a significant proportion of GPU memory to store the activations / gradients for the optimization step.

In order to share our progress publicly, we have created an open-r1 evaluation leaderboard, so the community can follow our reproduction efforts (space is here):

Training Pipeline

Following the release of Open R1, GRPO (Grouped Relative Policy Optimization) was integrated into the latest TRL release (version 0.14). This integration enables training any model with one or multiple reward functions or models. The GRPO implementation integrates with DeepSpeed ZeRO 1/2/3 for parallelized training that scales to many GPUs, and uses vLLM for fast generation, which is the primary bottleneck in online training methods.

from datasets import load_dataset

from trl import GRPOConfig, GRPOTrainer

dataset = load_dataset("trl-lib/tldr", split="train")

# Dummy reward: rewards completions that are close to 20 characters

def reward_len(completions, **kwargs):

return [-abs(20 - len(completion)) for completion in completions]

training_args = GRPOConfig(output_dir="Qwen2-0.5B-GRPO", logging_steps=10)

trainer = GRPOTrainer(

model="Qwen/Qwen2-0.5B-Instruct",

reward_funcs=reward_len,

args=training_args,

train_dataset=dataset,

trainer.train()

There are still some limitations relating to the use of high memory usage, and progress is being made to profile and reduce them.

Synthetic Data Generation

One of the most exciting findings of the R1 report was that the main model can be used to generate synthetic reasoning traces and smaller models fine-tuned on this dataset see similar performance gains as the main model. So naturally we want to re-create the synthetic reasoning dataset as well such that the community can fine-tune other models on it.

With a model as big as R1 the main challenge is scaling up generation efficiently and fast. We spent a week tinkering with various setups and configurations.

The model fits on two 8xH100 nodes so naturally we started experimenting with that setup and used vLLM as inference server. However, we quickly noticed that this configuration is not ideal: the throughput is sub-optimal and only allows for 8 parallel request, because the GPU KV cache fills up too quickly. What happens when the cache fills up ist that the requests which use a lot of cache are preempted and if the config uses PreemptionMode.RECOMPUTE the requests are scheduled again later when more VRAM is available.

We then switched to a setup with 4x 8xH100 nodes, so 32 GPUs in total. This leaves enough spare VRAM for 32 requests running in parallel with barely any of them getting rescheduled due to 100% cache utilization.

Originally we started querying the vLLM servers with batches of requests but noticed quickly, that straggles in the batches would cause the GPU utiliziation to vary since a new batch would only start processing once the last sample of the previous batch is done. Switching the batched inference to streaming helped stabilize the GPU utilization significantly:

It only required changing the code sending requests to the vLLM servers. The code for batched inference:

# send requests in batches of 500

for batch in batch_generator(dataset, bs=500):

active_tasks = []

for row in batch:

task = asyncio.create_task(send_requests(row))

active_tasks.add(task)

if active_tasks:

await asyncio.gather(*active_tasks)

The new code for streaming requests:

for row in dataset:

# keep the total active requests under 500

while len(active_tasks) >= 500:

done, active_tasks = await asyncio.wait(

active_tasks,

return_when=asyncio.FIRST_COMPLETED

# wait for all remaining tasks to complete

We are generating at a fairly constant rate but might still explore a bit further if for example switching to the CPU cache is a better strategy when long queries get preempted.

The current inference code can be found here.

There has been wide interest in open-r1, including from the media so various team members have been in the news in the past week:

Lewis was live (!) on CNN: https://x.com/_lewtun/status/1884377909038833894?s=46

Thom appeared on Bloomberg: https://x.com/Thom_Wolf/status/1884353433865777520

Leandro chatted on NPR’s Money Planet (at ~21min): https://www.npr.org/2024/11/29/1215793948/deepseek-ai-china-us-semiconductors-stock-nvidia

Other mentions: Washington Post, Financial Times, Financial Times, Fortune, Fortune, The Verge, Financial Review, Tech Crunch, Die Zeit, Financial Times, New York Times, The Wall Street Journal, EuroNews, Barrons, New York Times, Vox, Nature, SwissInfo, Handelsblatt, Business Insider, IEEE Spectrum, MIT Tech Review, LeMonde.

What have we learned about DeepSeek-R1?

While the community is still digesting DeepSeek-R1’s results and report, DeepSeek has captured broader public attention just two weeks after its release.

Responses to R1

After a relatively calm first week post-release, the second week saw significant market reactions, prompting responses from multiple AI research labs:

Stock market took a hit on Monday but stabilized or recovered in the days that followed: https://x.com/KobeissiLetter/status/1883831022149927352

Sam Altman, CEO of OpenAI, congratulated DeepSeek and announced that they’ll move up the timeline to release some new things soon: https://x.com/sama/status/1884066337103962416

Mark Chen, Chief Research Officer of OpenAI, commented on how DeepSeek discovered similar ideas as the ones OpenAI used for o1: https://x.com/markchen90/status/1884303237186216272

Dario Amodei, CEO of Anthropic, used the occasion to double down on export controls, painting a picture of a bi-polar or uni-polar world: https://x.com/DarioAmodei/status/1884636410839535967

[...内容已截断,完整版请查看原文或 Wayback 快照]