Diagrams — Module FTDD-07: DeepSeek-R1

Module: FTDD-07 — DeepSeek-R1 Diagram count: 4 Tool: Mermaid (primary). Each diagram validated in Mermaid Live Editor.


Diagram 1 — R1-Zero: Reasoning Emerges From RL Alone

Type: Process / emergence Purpose: The single most important diagram in this module. R1-Zero applies GRPO directly to a base model with verifiable rewards and no supervised traces. Long, self-correcting chain-of-thought emerges. Reading the diagram: Top = the only inputs (base + verifiable rewards + a minimal <think> template). Middle = the GRPO loop. Bottom = what emerged — unprompted.

flowchart TD
  Base["DeepSeek-V3-Base\n671B MoE (37B active)\nNO instruction tuning\nNO supervised reasoning traces"]
  Template["Minimal prompt template:\n<question> + <think></think>\nscaffold"]
  Rewards["Verifiable rewards ONLY\nmath correctness · code execution\nLeetCode verdicts\nNO reward model, NO judge"]

  Base --> RL["GRPO reasoning RL loop"]
  Template --> RL
  Rewards --> RL

  RL --> Emergence["WHAT EMERGED (unprompted):\nlong chain-of-thought growth\nself-correction ('wait, let me reconsider')\nre-derivation, answer substitution\nthe 'aha moment'"]

  style Base fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style Template fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Rewards fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style RL fill:#08080c,stroke:rgba(94,234,212,0.4),stroke-dasharray:4 2,color:#5eead4
  style Emergence fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#5eead4

Diagram 2 — The Four-Stage R1 Pipeline

Type: Sequential pipeline Purpose: R1-Zero was the proof; R1 is the product. Four stages, each fixing a specific failure of the one before. Reading the diagram: Left to right. Read the "fixes" note under each stage — that is the reason the stage exists.

flowchart LR
  S1["STAGE 1\nCold-start SFT\nthousands of curated\nlong-CoT examples"]
  S2["STAGE 2\nReasoning RL (GRPO)\nverifiable rewards\nmath · code · logic"]
  S3["STAGE 3\nRejection-sampling SFT\ngenerate · filter correct\nfilter readable\n~800K clean traces"]
  S4["STAGE 4\nFinal RL\nfull distribution\nreasoning + assistant\npreference alignment"]

  S1 -->|"anchors format\n(fixes R1-Zero's messiness)"| S2
  S2 -->|"scales capability\n(fills the anchored shape)"| S3
  S3 -->|"cleans the data\n(teacher's best, reliably)"| S4
  S4 -->|"aligns whole model\n(turns reasoner into product)"| Ship["Shippable R1"]

  style S1 fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style S2 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style S3 fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style S4 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Ship fill:#08080c,stroke:#5eead4,stroke-width:1.5px,color:#5eead4

Diagram 3 — The Distillation: SFT-Only Transfer

Type: One-to-many fan-out Purpose: The result that made CoT distillation standard. ~800K curated traces from the teacher, plain SFT into six dense bases, no RL on the students. R1-Distill-Qwen-32B beats o1-mini. Reading the diagram: Top = the teacher's curated trace set (Stage 3 output). Arrows fan out to six students. All are SFT-only. The 32B result is highlighted.

flowchart TD
  Traces["~800K curated reasoning traces\n(from R1 Stage 3 rejection sampling)\n+ non-reasoning SFT data"]
  Method["SFT ONLY\nno GRPO · no reward model\nno RL loop on students"]

  Traces --> Method
  Method --> Q15["R1-Distill-Qwen-1.5B"]
  Method --> Q7["R1-Distill-Qwen-7B"]
  Method --> Q14["R1-Distill-Qwen-14B"]
  Method --> Q32["R1-Distill-Qwen-32B\nBEATS o1-mini on AIME 2024"]
  Method --> L8["R1-Distill-Llama-8B"]
  Method --> L70["R1-Distill-Llama-70B"]

  Note["RL on the students:\nmarginal gains only.\nThe teacher's traces were\nalready near-optimal steering."]

  style Traces fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style Method fill:#08080c,stroke:rgba(94,234,212,0.4),stroke-dasharray:4 2,color:#5eead4
  style Q32 fill:#14141f,stroke:#5eead4,stroke-width:2px,color:#5eead4
  style Q15 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Q7 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Q14 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style L8 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style L70 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Note fill:#08080c,stroke:rgba(255,255,255,0.12),color:#9494a0

Diagram 4 — R1 vs Qwen3: The Two Reasoning References

Type: Comparison Purpose: R1 and Qwen3 are the two canonical reasoning references. They prove different things and complement each other. Reading the diagram: Left = R1 (the distillation reference). Right = Qwen3 (the hybrid reference). The bottom annotation is the practitioner's decision.

flowchart LR
  subgraph R1["R1 — the DISTILLATION reference"]
    R1a["Teacher pipeline + SFT-only transfer\nReasoning emerges from RL (R1-Zero)\nDistill into any dense base"]
    R1b["Use when:\nbuilding a reasoner by\ndistilling from a teacher"]
  end
  subgraph Q3["Qwen3 — the HYBRID reference"]
    Q3a["One model, fused modes\nthinking + non-thinking\nthinking-budget adaptive compute"]
    Q3b["Use when:\nshipping a production model\nthat adapts compute\nto the question"]
  end

  Decision["PRACTITIONER'S CHOICE\nDistill from a strong teacher -> R1 blueprint\nAdaptive in-weights compute -> Qwen3 blueprint\nKnow both."]

  R1 --> Decision
  Q3 --> Decision

  style R1a fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style R1b fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Q3a fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style Q3b fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Decision fill:#08080c,stroke:rgba(94,234,212,0.4),stroke-dasharray:4 2,color:#5eead4

Validation notes

# Diagrams — Module FTDD-07: DeepSeek-R1

**Module**: FTDD-07 — DeepSeek-R1
**Diagram count**: 4
**Tool**: Mermaid (primary). Each diagram validated in [Mermaid Live Editor](https://mermaid.live).

---

## Diagram 1 — R1-Zero: Reasoning Emerges From RL Alone

**Type**: Process / emergence
**Purpose**: The single most important diagram in this module. R1-Zero applies GRPO directly to a base model with verifiable rewards and *no* supervised traces. Long, self-correcting chain-of-thought emerges.
**Reading the diagram**: Top = the only inputs (base + verifiable rewards + a minimal `<think>` template). Middle = the GRPO loop. Bottom = what emerged — unprompted.

```mermaid
flowchart TD
  Base["DeepSeek-V3-Base\n671B MoE (37B active)\nNO instruction tuning\nNO supervised reasoning traces"]
  Template["Minimal prompt template:\n<question> + <think></think>\nscaffold"]
  Rewards["Verifiable rewards ONLY\nmath correctness · code execution\nLeetCode verdicts\nNO reward model, NO judge"]

  Base --> RL["GRPO reasoning RL loop"]
  Template --> RL
  Rewards --> RL

  RL --> Emergence["WHAT EMERGED (unprompted):\nlong chain-of-thought growth\nself-correction ('wait, let me reconsider')\nre-derivation, answer substitution\nthe 'aha moment'"]

  style Base fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style Template fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Rewards fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style RL fill:#08080c,stroke:rgba(94,234,212,0.4),stroke-dasharray:4 2,color:#5eead4
  style Emergence fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#5eead4
```

---

## Diagram 2 — The Four-Stage R1 Pipeline

**Type**: Sequential pipeline
**Purpose**: R1-Zero was the proof; R1 is the product. Four stages, each fixing a specific failure of the one before.
**Reading the diagram**: Left to right. Read the "fixes" note under each stage — that is the reason the stage exists.

```mermaid
flowchart LR
  S1["STAGE 1\nCold-start SFT\nthousands of curated\nlong-CoT examples"]
  S2["STAGE 2\nReasoning RL (GRPO)\nverifiable rewards\nmath · code · logic"]
  S3["STAGE 3\nRejection-sampling SFT\ngenerate · filter correct\nfilter readable\n~800K clean traces"]
  S4["STAGE 4\nFinal RL\nfull distribution\nreasoning + assistant\npreference alignment"]

  S1 -->|"anchors format\n(fixes R1-Zero's messiness)"| S2
  S2 -->|"scales capability\n(fills the anchored shape)"| S3
  S3 -->|"cleans the data\n(teacher's best, reliably)"| S4
  S4 -->|"aligns whole model\n(turns reasoner into product)"| Ship["Shippable R1"]

  style S1 fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style S2 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style S3 fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style S4 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Ship fill:#08080c,stroke:#5eead4,stroke-width:1.5px,color:#5eead4
```

---

## Diagram 3 — The Distillation: SFT-Only Transfer

**Type**: One-to-many fan-out
**Purpose**: The result that made CoT distillation standard. ~800K curated traces from the teacher, plain SFT into six dense bases, no RL on the students. R1-Distill-Qwen-32B beats o1-mini.
**Reading the diagram**: Top = the teacher's curated trace set (Stage 3 output). Arrows fan out to six students. All are SFT-only. The 32B result is highlighted.

```mermaid
flowchart TD
  Traces["~800K curated reasoning traces\n(from R1 Stage 3 rejection sampling)\n+ non-reasoning SFT data"]
  Method["SFT ONLY\nno GRPO · no reward model\nno RL loop on students"]

  Traces --> Method
  Method --> Q15["R1-Distill-Qwen-1.5B"]
  Method --> Q7["R1-Distill-Qwen-7B"]
  Method --> Q14["R1-Distill-Qwen-14B"]
  Method --> Q32["R1-Distill-Qwen-32B\nBEATS o1-mini on AIME 2024"]
  Method --> L8["R1-Distill-Llama-8B"]
  Method --> L70["R1-Distill-Llama-70B"]

  Note["RL on the students:\nmarginal gains only.\nThe teacher's traces were\nalready near-optimal steering."]

  style Traces fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style Method fill:#08080c,stroke:rgba(94,234,212,0.4),stroke-dasharray:4 2,color:#5eead4
  style Q32 fill:#14141f,stroke:#5eead4,stroke-width:2px,color:#5eead4
  style Q15 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Q7 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Q14 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style L8 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style L70 fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Note fill:#08080c,stroke:rgba(255,255,255,0.12),color:#9494a0
```

---

## Diagram 4 — R1 vs Qwen3: The Two Reasoning References

**Type**: Comparison
**Purpose**: R1 and Qwen3 are the two canonical reasoning references. They prove different things and complement each other.
**Reading the diagram**: Left = R1 (the distillation reference). Right = Qwen3 (the hybrid reference). The bottom annotation is the practitioner's decision.

```mermaid
flowchart LR
  subgraph R1["R1 — the DISTILLATION reference"]
    R1a["Teacher pipeline + SFT-only transfer\nReasoning emerges from RL (R1-Zero)\nDistill into any dense base"]
    R1b["Use when:\nbuilding a reasoner by\ndistilling from a teacher"]
  end
  subgraph Q3["Qwen3 — the HYBRID reference"]
    Q3a["One model, fused modes\nthinking + non-thinking\nthinking-budget adaptive compute"]
    Q3b["Use when:\nshipping a production model\nthat adapts compute\nto the question"]
  end

  Decision["PRACTITIONER'S CHOICE\nDistill from a strong teacher -> R1 blueprint\nAdaptive in-weights compute -> Qwen3 blueprint\nKnow both."]

  R1 --> Decision
  Q3 --> Decision

  style R1a fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style R1b fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Q3a fill:#14141f,stroke:#5eead4,stroke-width:1.5px,color:#e4e4e8
  style Q3b fill:#14141f,stroke:rgba(94,234,212,0.5),color:#e4e4e8
  style Decision fill:#08080c,stroke:rgba(94,234,212,0.4),stroke-dasharray:4 2,color:#5eead4
```

---

## Validation notes

- All four diagrams use the course design system colors: `#14141f` panel fill, `#5eead4` accent for primary, `rgba(94,234,212,0.5)` for secondary borders, `#e4e4e8` / `#9494a0` for text.
- Paste each into [Mermaid Live Editor](https://mermaid.live) to render. All use stable Mermaid syntax (`flowchart`) supported in current Mermaid (v10.4+).
- For the slide deck (artifact 03), these are rendered as static SVG/PNG captures from Mermaid Live, inlined into reveal.js.