Paper Implementations

Reproducing the core ideas behind landmark AI papers from scratch — the algorithms, the math, and working code you can run. Starting with DeepSeek-R1's GRPO.

Reinforcement LearningGRPOLLMsDeepSeekPyTorch
01
14 min read

Implementing GRPO from Scratch: DeepSeek-R1's Reinforcement Learning Engine

A hands-on walkthrough of Group Relative Policy Optimization — the algorithm behind DeepSeek-R1's reasoning. I build the full GRPO training loop in pure PyTorch on a distilled 1.5B model, from verifiable rewards to the clipped objective, and explain why it drops the critic network entirely.

Reinforcement LearningGRPOLLMsDeepSeekPyTorch