논문 정리) DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning
1. 원문 링크
2. 논문 리뷰
Abstract
- DeepSeek-R1-Zero and DeepSeek-R1, DeepSeek-R1-Zero 모델은 SFT(supervised fine-tuning) 없이 RL(reinforcement learning)만으로 좋은 추론 능력을 도출할 수 있음을 증명함.
- 원문 : We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1. DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without super vised fine-tuning (SFT) as a preliminary step, demonstrates remarkable reasoning capabilities.
- 그러나 부족한 읽기 능력을 갖추게 되었고, 이를 위해 ‘cold-start data(학습하지 않은 데이터)’와 multi-stage training(다단계 학습 구조)’기법을 활용하여 해결함
- 원문 : Through RL, DeepSeek-R1-Zero naturally emerges with numerous powerful and intriguing reasoning behaviors. However, it encounters challenges such as poor readability, and language mixing. To address these issues and further enhance reasoning performance, we introduce DeepSeek-R1, which incorporates multi-stage training and cold-start data before RL
- 용어 정리
- SFT : 지도학습 방식의 파인튜닝
- RL : 강화학습
- cold-start data : 학습하지 않은 데이터
- multi-stage training : 다단계 학습 구조(2RL + 2SFT)
- 사용한 평가지표
- AIME 2024 : American Invitational Mathematics Examination
- 분야 : 고등 수준 수학 추론
- 평가지표 : 정답률
- Codeforces : Codeforces Programming Contest Platform
- 분야 : 알고리즘 문제 해결
- 세부 설명 : 입출력 형식, 메모리 제한, 시간 복잡도 모두 만족해야함.
- 평가지표 : 문제별 통과 여부
- GPQA Diamond : Graduate-level Physics Question Answering
- 분야 : 대학원 수준의 물리학
- 평가지표 : 정답률
- MATH-500 : Mathematics Dataset by hendrycks et al.
- 분야 : 중고등 ~ 대학 수준 수학
- 평가지표 : 한 번에 맞힐 확률
- MMLU : Massive Multitask Language Understanding
- 분야 : 일반 지식 전반(역사, 법, 공학 등)
- 평가지표 : 정확도
- SWE-bench Verified : Software Engineering Benchmark
- 분야 : 소프트웨어 유지보수, 버그 수정 등
- 평가지표 : 정답률(테스트 케이스 + 인간 평가)
- AIME 2024 : American Invitational Mathematics Examination
Introduction
- 이전 연구들이 process-based reward models, reinforcement learning, Monte Carlo Tree Search and Beam Search 등 다양한 방법을 썻지만 OpenAI’s o1 series models에 비할 바가 안됨.
- 원문 : Several prior works have explored various approaches, including process-based reward models (Lightman et al., 2023; Uesato et al., 2022; Wang et al., 2023), reinforcement learning (Kumar et al., 2024), and search algorithms such as Monte Carlo Tree Search and Beam Search (Feng et al., 2024; Trinh et al., 2024; Xin et al., 2024). However, none of these methods has achieved general reasoning performance comparable to OpenAI’s o1 series models.
- ‘GRPO’ 강화학습 프레임워크로 수천번의 steps 끝에 AIME 2024 평가지표에서 15.6% → 71.0%로 향상시킴. ‘majority voting’과 함께 86.7%까지 달성함.
- 원문
- we use DeepSeek-V3-Base as the base model and employ GRPO (Shao et al., 2024) as the RL framework to improve model performance in reasoning.
- AfterthousandsofRLsteps, DeepSeek-R1-Zeroexhibitssuperperformance on reasoning benchmarks. For instance, the pass@1 score on AIME 2024 increases from 15.6% to 71.0%, and with majority voting, the score further improves to 86.7%
- 원문
- 이렇게 학습 시킨 DeepSeek-R1-Zero는 언어 섞임과 부족한 읽기 능력을 가지게 됨.
- 원문 : However, DeepSeek-R1-Zero encounters challenges such as poor readability, and language mixing
- DeepSeek-R1은 DeepSeek-R1-Zero의 가독성 및 언어 혼용 문제를 해결하고 추론 성능을 높이기 위해, cold-start 데이터로 SFT를 진행한 후 reasoning 중심의 RL, ‘리젝션 샘플링 기반 SFT’, 추가 RL을 거치는 멀티 스테이지 학습 과정을 통해 OpenAI-o1-1217 수준의 성능을 달성한 모델임(base model은 DeepSeek-V3-Base).
- 학습 프로세스 : 강화학습(모델 개선 및 SFT용 데이터 생성) → SFT → RL로 미세조정(다양한 프롬프트를 통해)
- 원문
- we perform reasoning-oriented RL like DeepSeek-R1 Zero. Upon nearing convergence in the RL process, we create new SFT data through rejection sampling on the RL checkpoint, combined with supervised data from DeepSeek-V3
- After fine-tuning with the new data, the checkpoint undergoes an additional RL process, taking into account prompts from all scenarios
- DeepSeek-R1에서 Qwen2.5-32B 등 작은 모델로 직접 지식 증류(distillation)를 수행한 결과, 강화학습을 적용하는 것보다 더 뛰어난 추론 성능을 보여주었으며, 이를 통해 대형 모델이 학습한 추론 패턴의 중요성을 입증
- 원문
- We further explore distillation from DeepSeek-R1 to smaller dense models. Using Qwen2.5 32B(Qwen,2024b) as the basemodel, direct distillation from DeepSeek-R1 outperforms applying RL on it
- Notably, our distilled 14B model outperforms state-of-the-art open-source
- 원문
1) Contributions
Post-Training: Large-Scale Reinforcement Learning on the Base Model
- DeepSeek-R1-Zero는 SFT없이 RL만으로 CoT(chain of thought)를 통해 복잡한 문제를 해결하도록 함. 검증, 반영, Long CoTs이 가능한 모델.
- 원문 : Wedirectly apply RL to the base model without relying on supervised fine-tuning (SFT) as a preliminary step. This approach allows the model to explore chain-of-thought (CoT) for solving complex problems, resulting in the development of DeepSeek-R1-Zero. DeepSeek R1-Zero demonstrates capabilities such as self-verification, reflection, and generating long CoTs, marking a significant milestone for the research community
- DeepSeek-R1은 두 단계의 RL과 두 단계의 SFT를 포함한 파이프라인을 통해 추론 능력과 인간 선호도 정렬을 향상함.
- 실제 학습 과정 : 1차 RL(추론능력 강화) → 1차 SFT(리젝션 샘플링) → 2차 RL(인간 선호 기반 보상 학습) → 2차 SFT(writing, factual QA, self-cognition 등 task)
- 원문 : Weintroduce our pipeline to develop DeepSeek-R1. The pipeline incorporates two RL stages aimed at discovering improved reasoning patterns and aligning with human pref erences, as well as two SFT stages that serve as the seed for the model’s reasoning and non-reasoning capabilities.
Distillation: Smaller Models Can Be Powerful Too
- DeepSeek-R1의 추론 데이터를 활용해 여러 소형 dense 모델(Qwen2.5 및 LLaMA3 기반)을 파인튜닝한 결과, 이들 distilled 모델이 RL만 적용한 소형 모델보다 뛰어난 추론 성능을 보였음.
- 원문 : Using the reasoning data generated by DeepSeek-R1, we fine-tuned several dense models that are widely used in the research community. The evaluation results demonstrate that the distilled smaller dense models perform exceptionally well on benchmarks
- AIME 2024, MATH-500, LiveCodeBench 등 주요 벤치마크에서 기존 오픈소스 모델을 능가하는 성과를 기록
- 원문 : DeepSeek R1-Distill-Qwen-7B achieves 55.5% on AIME 2024, surpassing QwQ-32B-Preview. Addi tionally, DeepSeek-R1-Distill-Qwen-32B scores 72.6% on AIME 2024, 94.3% on MATH-500, and 57.2% on LiveCodeBench
Summary of Evaluation Results
Category | Benchmark | Performance |
---|---|---|
Reasoning | AIME 2024 | 79.8% Pass@1 |
Reasoning | MATH-500 | 97.3% |
Coding | Codeforces | 2,029 Elo (Top 96.3%) |
Engineering | Engineering tasks | Slightly better than DeepSeek-V3 |
Knowledge | MMLU | 90.8% |
Knowledge | MMLU-Pro | 84.0% |
Knowledge | GPQA Diamond | 71.5% |
Knowledge | SimpleQA | Better than DeepSeek-V3 |
General QA / Creative | AlpacaEval 2.0 | 87.6% win-rate |
General QA / Creative | ArenaHard | 92.3% win-rate |
Long Context | Long-context tasks | Substantially better than DeepSeek-V3 |
- 용어 정리
- GRPO : 여러 개의 응답을 생성한 후 상대적인 우열을 비교하여 가장 우수한 응답을 기준으로 정책을 업데이트하는, 가치 함수 없이 작동하는 비교 기반 강화학습
- majority voting : GRPO에서 생성된 여러 응답들 중 가장 우수한 응답을 상대평가로 선택하기 위해 사용되는 전략
Approach
DeepSeek-R1-Zero: Reinforcement Learning on the Base Model
- 1. Reinforcement Learning Algorithm : Group Relative Policy Optimization
- 필요 가정
- 여러 질문(q)를 가진 임베딩 공간이 있다 가정
$q$ = 질문
$P(Q)$ = 질문 분포 확률(추가설명 : q가 나올 확률, 이론적 모델링)
$o_i$ = 답변(output)
$\pi_{\theta}(O|q)$ = 답변 분포 확률(o가 나올 확률)
부가설명 : ref : Base 모델 / old : step 이전 모델 / 미표기 : step 이후 모델
$D_{KL}$ = 변형된 KL divergence
$A_i$ = group 기준으로 정규화 된 reward
- 여러 질문(q)를 가진 임베딩 공간이 있다 가정
- 수식 설명
- min/clip 장치를 통해 reward 앞에 곱해지는 비율 발산 방지(단, 작아 지는덴 한계 없음)
- $\beta$와 $D_{KL}$ 통해 base모델과 멀어지는 것을 방지 → base 모델의 logit과 멀어질수록 큰 수 부여
- 변형된 KL divergence 그래프 예시
\n
읽는 중 ㅎㅎㅎ
댓글남기기