DeepSeek 상륙작전 : 딥앀 부터 시작하는 LLM 도장깨기

남지방·2025년 1월 31일

Computer Vision으로 석사학위를 받으며...
다른건 몰라도 논문읽기에는 꽤나 친숙해졌는데,

세간에서는 주로 새 분야에 대해 공부해보겠노라 하면..
관련 분야 대표논문 여러개를 훑어보거나,
특히 시대적인 흐름을 다시 따라가 (이를 테면 Attention is All you need 부터..) 최신 논문 (DeepSeek)에 이르는 방법을 정석이라 하겠다.

참고로 난 LLM은 커녕 NLP도 잘 모른다.

근데 DeepSeek 부터 읽을 거다.
대신 처음부터 끝까지 한줄한줄 곱씹어가며, 저자의 시야에서 각 문장과 각 용어를 왜 이렇게 배치했는지, DeepSeek 개발 연구팀과 그 생각과 시야를 동기화 시키겠노라 하는 마음으로 읽어보겠다.
이 순간 만큼은 DeepSeek를 개발한 석사 1년차이자, 신입 연구 인턴의 마음으로..

LLM을 정복하기 위한 이른바,
DeepSeek 상륙작전 이다.

Abstract

We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1.

보아하니 이 DeepSeek은 generation reasoning model인것 같은데, first- 라고 하는걸 보면 지들이 지어낸 용어인가보다.

DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without supervised fine-tuning (SFT) as a preliminary step, demonstrates remarkable reasoning capabilities.

딥싴-R1 일반모델이 있고, Zero 모델이 있는데 Zero 모델 설명이 나온다.
SFT를 쓰지 않고 large-scale RL을 쓴것만으로 성능 향상을 이뤘다고 하는데, 아마 기존에 SOTA 방법론들이 SFT 위주였고 large-scale RL을 하는게 novel 한 포인트 인가보지?
이것이 preliminary step 이라는걸 보면 몇 step 더 있나 본데 일단 차치하고, "reasoning"에서 유의미한 결과가 있었다고 하니 여기서 벤치마크 삼는건 모종의 "reasoning" 관련 데이터 일것이다.

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.

RL로 뭔가를 해보겠다는게 실은 엄청나게 novel 하진 않을거다. (RL이 만만치 않다는건 대충이라도 알고 있지만서도..) 근데 그동안 쓰지 않았던거는 뭔가 극복하기 어려운 장애물이 있었겠지?
마침 여기서 알려준다.
가독성 개선하고 "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.

그걸 해결하려고 학습 스테이지를 나누고, "cold-start data" 라는것을 사용했는데 이런 기법을 모조리 넣은 하나의 풀패키지를 DeepSeek-R1 이라고 한댄다.
그니까 Zero 버전은 Baseline 이고 얘가 대표모델 인거지.

DeepSeekR1 achieves performance comparable to OpenAI-o1-1217 on reasoning tasks.

암튼 o1 만큼 쩐대.. 근데 comparable 이란거 보면 성능은 조금 떨어지더라도 cost가 더 낮나보지

To support the
research community, we open-source DeepSeek-R1-Zero, DeepSeek-R1, and six dense models
(1.5B, 7B, 8B, 14B, 32B, 70B) distilled from DeepSeek-R1 based on Qwen and Llama.

pretrained 공개하면서 무려 to support research community~ 랜다ㅋㅋ
OpenAI 돌려까 주면서..

Distilled 모델들을 같이 올려 줬는데 Qwen 이랑 Llama를 썼다니,
얘네 둘이 이쪽 업계에서는
아주 유명한 그... ㅆ..
ㅆ..ㅡ튜던트 네트워크 인가보다.

Introduction

In recent years, Large Language Models (LLMs) have been undergoing rapid iteration and
evolution (Anthropic, 2024; Google, 2024; OpenAI, 2024a), progressively diminishing the gap
towards Artificial General Intelligence (AGI).

빅테크들의 LLM은 AGI를 향해간다..

Recently, post-training has emerged as an important component of the full training pipeline.
It has been shown to enhance accuracy on reasoning tasks, align with social values, and adapt
to user preferences, all while requiring relatively minimal computational resources against
pre-training.

요즘은 post-training이 중요하댄다.
사회적 가치에 부합하게 하던 고객 맞춤형으로 가던, 정확도를 높이기 위해서라도 pre-training 보다는 post-training 쪽이 가성비 라는거다.
그래 중요해 보인다.. 학교에 있을때만해도 post-training은 커녕 fine "tuning" 이니 adaptation이니 어디가서 training 명함도 못내밀었는데 post-training 이라는 엄청난 이름을 얻었구나..

In the context of reasoning capabilities, OpenAI’s o1 (OpenAI, 2024b) series models
were the first to introduce inference-time scaling by increasing the length of the Chain-of-Thought reasoning process.

이 DeepSeek가 명함을 내민 여기, "reasoning" 씬에서는 어떤 post-training이 대세일까?
그건 바로 "Chain-of-Thought" 이라는 기법으로 추론 시간을 (의미있게) 늘리는거다.

Chain-of-thought을 간단히 알아보니 질문에 대한 답으로 단답을 내도록 하는것 보다는 서술형 답안을 보는것이 더 정확도가 높다고 한다.
우리도 기왕 답안지를 외울거라면 단답형 답안지를 달달 외우기보다는 서술형 답을 보는게 도움이 되겠지..

그러나 실은 LLM에게 서술을 시킨다는것은 generate 해야하는 단어 수가 늘어나는거니까 연산량은 늘어나는 거다. 대신, 성능이 높아지는 trade-off 관계가 생긴다는 것.

근데 Computer vision 연구를 했던 내 기억상 한번 Train을 하면, 동일한 모델 하에서 Inference 연산량은 거의 고정이다. 내가 원하는 성능에 따라, 동일한 pre-trained 모델을 가지고도 Inference time만 늘리거나 줄여서 성능을 조절한다? 이거.. 물건이(었)구나..

This approach has achieved significant improvements in various
reasoning tasks, such as mathematics, coding, and scientific reasoning. However, the challenge
of effective test-time scaling remains an open question for the research community.

그래.. 신나서 연구 했을 것 같다..
trade-off 관계가 생겼으니 가성비 있는 구간이나 기법을 찾아 보겠다는것도 당연지사

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)

Post Training을 잘해보자는 새 지평이 열리니까 강한자만이 살아남은 옛 시절의 탐색 알고리즘이 다시 대두되었고, RL도 이미 선행연구가 있다.

반가운 얼굴들 이구만.. 이래서 ML 엔지니어도 알고리즘 코테를 봐야한다

However, none of these methods has achieved general reasoning
performance comparable to OpenAI’s o1 series models.

그러나 은둔의 OpenAI를 이기지 못했다..

In this paper,

we take the first step toward improving language model reasoning capabilities
using pure reinforcement learning (RL).

일단 RL을 써서 개선한다. 아마도 Kumar et al. 기반으로?

profile
금쪽같은 ML 모델계의 오은영 박사님을 꿈꿉니다.

0개의 댓글