Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

DeepSeek-R1: Open-Source Reasoning Model Matches O1 at 1/30th Cost via Pure RL

This article analyzes DeepSeek-R1's architecture, revealing how pure reinforcement learning with GRPO, FP8 mixed-precision training, PTX assembly optimizations, and open-source MIT licensing enable OpenAI O1-level reasoning at 1/30th API cost, with hands-on demos in poetry, parallel prose, and database fault analysis.

DeepSeek-R1: Technical Architecture and Cost Breakthrough

DeepSeek, founded in 2022, released DeepSeek-R1 in January 2025. The model uses a 671B-parameter Mixture-of-Experts (MoE) architecture with 37B active parameters per token, targeting mathematics, coding, and natural-language reasoning. Unlike traditional models that rely on supervised fine-tuning with massive labeled datasets, DeepSeek-R1 applies large-scale reinforcement learning (RL) in post-training, requiring minimal labeled data to achieve strong reasoning — a sharp contrast to OpenAI's closed-source approach.

Open-Source Strategy and Distilled Models

DeepSeek-R1 is released under the permissive MIT license, providing both model weights and the ability to distill smaller models. The team has distilled 1.5B, 32B, and 70B variants; the 32B and 70B versions approach OpenAI o1-mini performance on certain tasks. This "open-source + low-cost" strategy has been likened to "Pinduoduo of AI," dramatically improving technology accessibility.

Core Technical Innovations

1. Pure Reinforcement Learning with GRPO

DeepSeek-R1 is the first large language model trained entirely via reinforcement learning. Traditional models depend on supervised learning with extensive labeled data. DeepSeek-R1 uses Group Relative Policy Optimization (GRPO), which compares relative advantages among outputs within a group, eliminating the need for a separate value network (Critic) and reducing memory and compute overhead. A cold-start phase initializes the model with a small set of high-quality long Chain-of-Thought (CoT) examples to stabilize training.

Why GRPO instead of PPO? PPO requires a value model to estimate state values for advantage computation, but language state spaces are too vast and complex for a reliable value model. GRPO only computes relative advantages over generated outputs, avoiding a value model entirely. PPO needs a trained reward model for evaluation; GRPO uses rule-based rewards that directly assess answer accuracy without training a reward model. Eliminating SFT, value models, and reward models yields a dramatic boost in training efficiency and a corresponding drop in resource consumption — the core reason for DeepSeek-R1's low training cost.

2. Dynamic Sparse Attention and Multi-Token Prediction

A variable sparsity strategy reduces computation on non-critical positions while preserving long-context capture. Combined with multi-token prediction, this further improves inference efficiency.

Engineering Breakthroughs

FP8 Mixed-Precision Training

FP8 training cuts memory usage by 60% compared to FP16/FP32 while maintaining numerical stability. Dynamic sequence-length adjustment automatically optimizes input length per task, avoiding redundant computation.

DualPipe Parallel Architecture

DualPipe leverages NVLink and InfiniBand dual-channel communication to reduce bottlenecks, increasing training speed by 40%. The MoE sparse activation design activates only task-relevant parameter subsets, improving memory utilization by 3x.

Data Efficiency Revolution

Knowledge Distillation with Curriculum Learning: Extracts knowledge from large models into lightweight ones, introducing data of increasing difficulty in stages, raising data utilization by 50%.

Self-Generated Data Loop: During RL, self-verification and reflection mechanisms combined with Rejection Sampling automatically produce high-quality training data, reducing reliance on external annotations.

Hardware-Level Extreme Optimization

PTX Assembly Optimization: Hand-written or auto-generated PTX assembly bypasses the CUDA framework to directly control GPU Streaming Multiprocessors (SMs), achieving instruction-level optimization with 10x hardware efficiency over conventional approaches.

Cluster Load Balancing: Dynamic task scheduling and fine-grained resource allocation lift GPU utilization from the industry average of 30% to 85%, cutting compute waste by 60%.

Regarding claims that DeepSeek "bypasses CUDA monopoly by optimizing for NVIDIA PTX": using PTX is not decoupling from NVIDIA but rather deeper optimization. PTX-to-assembly compilation depends entirely on NVIDIA's compiler; no known tool compiles PTX to other platforms' assembly. CUDA, by contrast, has proven cross-compilation tools.

Recently, SiliconFlow and Huawei Cloud jointly launched DeepSeek R1/V3 inference services on Ascend cloud, enabling DeepSeek to run on domestic GPUs.

End-to-End Cost Control

Training Marginal Cost: Innovative mixed-cloud training with elastic resource scheduling reduces per-run marginal cost to 30% of comparable models.

Inference Optimization: 4-bit quantization compresses model size to 1/8; inference reaches 3,872 tokens/second on a single H200 GPU. API pricing is 1/30 of OpenAI o1 (output tokens 16 yuan/M vs 438 yuan/M).

Performance Comparison with OpenAI O1 Pro

Parameter Scale: DeepSeek-R1 671B (MoE) vs O1 Pro undisclosed (estimated trillion+)

Context Window: 128K tokens vs 200K tokens

Open Source: Fully open (MIT) vs Closed

Inference Cost: 16 yuan/M output tokens vs 438 yuan/M output tokens

Math (MATH benchmark): 77.5% vs 76%-79%

Code Generation (Codeforces): 2029 rating (top 4% humans) vs O1-1217 63.4%

Hands-On Experience: Deep Thinking Demonstrations

1. Classical Chinese Poetry in Li Bai and Du Fu Styles

Prompt: "Today is Beginning of Spring. Write a seven-character quatrain on 'Beginning of Spring' imitating Li Bai and Du Fu." The model outputs structured reasoning (Chain-of-Thought) followed by poems:

Li Bai Style – "Beginning of Spring Journey" East wind shatters cold ice in one night, Ten thousand ridges, thousand mountains don emerald screens. Drunk leaning on green cliffs inviting cranes to dance, Wild song soars straight up to the nine heavens. Note: Mimics Li Bai's romantic grandeur; "shatters cold ice" and "ascends nine heavens" show unstoppable spring momentum; verbs "lean," "invite," "sing" reinforce uninhibited imagery.
Du Fu Style – "Yi-Si Beginning of Spring" Frozen fields thaw, oxen test the plow, Border tower's remnant snow reflects cold clothes. Old neighbor leans on staff asking about spring tax, Young child still hides last year's hunger. Note: Mimics Du Fu's realistic compassion; three vignettes — "test plow," "ask tax," "hide hunger" — expose people's hardship during war-torn Beginning of Spring.

The model displays its reasoning chain, comparing the two styles.

DeepSeek-R1 Chain-of-Thought comparison for Li Bai and Du Fu poems
DeepSeek-R1 Chain-of-Thought comparison for Li Bai and Du Fu poems

2. Parallel Prose: "Preface to Ascending Baiyun Mountain" in Wang Bo's Style

Prompt: "Imitate Wang Bo's 'Preface to the Pavilion of Prince Teng' to write a parallel prose piece about climbing Guangzhou's Baiyun Mountain." The model produces a full-length classical Chinese pianwen with strict tonal parallelism, allusions to Ge Hong's alchemy, Zheng Anqi's ascension, Su Shi's visit to Pujian, and Nanyue King legends, matching the original's structure, rhyme, and meter. The full text is reproduced below:

登白云山序
岭南故郡,云麓新秋。星分翼轸,地接衡湘。襟三江以通百越,带五岭而镇南溟。物华天粹,赤壤藏朱明之曜;人杰地灵,青崖起安期之云。烟霞翳日,光凝越秀之巅;草木含章,气贯罗浮之脉。都督雅望,棨戟遥临;高士仙踪,鹤鸾暂驻。时维九月,序属三秋。晨雾尽而苍龙现,朝霞飞而云海明。访仙踪于绝巘,踏云阶于重霄。临摩星之峻极,瞰珠水之逶迤。鹤唳松涛,响穷蒲涧之浦;泉鸣玉佩,声断九龙之渊。
遥襟甫畅,逸兴遄飞。箫鼓鸣而白云遏,松风起而衣袂扬。安期之舄,今安在哉?葛洪之鼎,曾照丹砂。天南一柱,俯察星沙之野;云外九重,仰观霄汉之图。四时殊色:春涧浮桃浪,夏壑泻银河,秋崖披锦绣,冬岫缀霜华。朝瞰溟渤,曙色染五羊之石;暮揽星河,流光映三城之郭。归鹤唳而暮云紫,寒钟动而晚山青。
嗟乎!时运不齐,命途多舛。冯唐谪于岭表,贾谊滞于湘滨。屈子怀沙,空悲楚泽;东坡啖荔,独啸罗浮。所赖君子安贫,达人知命。老当益壮,宁移摩星之心?穷且益坚,不坠凌霄之志。酌九龙而觉爽,饮蒲涧以犹欢。羊城虽远,扶摇可接;溟海虽深,星槎可通。孟尝高洁,空余越井之思;阮籍猖狂,岂效穷途之哭!
勃,三尺微命,一介书生。无终军之弱冠,有宗悫之长风。舍簪笏于尘寰,奉晨昏于云壑。非谢家之玉树,接葛氏之丹丘。他日趋庭,叨陪白鹿之宴;今朝捧袂,喜谒飞仙之踪。云山不逢,抚孤松而自惜;钟期既遇,奏流水以何惭?
呜呼!胜地不常,仙踪难再。葛洪旧馆,已埋碧草;景泰遗钟,空传幽谷。临别赠言,幸承恩于胜饯;登高作赋,是所望于群公。敢竭鄙怀,恭疏短引。一言均赋,四韵俱成:
白云千载绕羊城,丹灶犹温鹤唳清。
蒲涧流香苏子醉,摩星摘斗谪仙惊。
朝披霞色浮金阙,夜枕松涛听玉笙。
莫道南溟烟瘴重,木棉如火破天横。
(注:文中嵌摩星岭、九龙泉、蒲涧、景泰寺等白云山古迹,化用葛洪炼丹、郑安期飞升、苏轼游蒲涧、南越王传说等典故,骈俪句式与《滕王阁序》字句、平仄、用韵严格对应。)

The model's structural fidelity and cultural depth surpass 99% of human writers.

3. Professional Database Fault Diagnosis

The model demonstrates step-by-step root-cause analysis for a database failure, showing its reasoning process.

DeepSeek-R1 database fault diagnosis reasoning
DeepSeek-R1 database fault diagnosis reasoning

Note: DeepSeek's official web search is currently limited; the article suggests using Metaso.cn (https://metaso.cn/) combined with DeepSeek-R1 for search-augmented queries.

References

Official site: https://chat.deepseek.com/

Metaso.cn: https://metaso.cn/

ArXiv paper: https://arxiv.org/pdf/2501.12948v1

CSDN blog: https://blog.csdn.net/m0_59164520/article/details/145400613

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Mixture of ExpertsDeepSeek-R1Chain-of-ThoughtReinforcement LearningFP8GRPOOpen Source LLMPTX Assembly

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion