Developer recreates DeepSeek-V3 in 190 lines of pure JAX
OtherPublished: Source: Hacker News (100+ points)
TL;DR:A developer published a 190-line, pure-JAX implementation of the DeepSeek-V3 architecture, trained from scratch on public-domain detective fiction using a MacBook Air M5 with 24 GB of memory.
A developer published a 190-line, pure-JAX implementation of the DeepSeek-V3 architecture, trained from scratch on public-domain detective fiction using a MacBook Air M5 with 24 GB of memory. The 36.2-million-parameter model trained for 12,000 steps on about 98 million tokens in roughly 2.6 hours, reaching a validation loss of 3.51. The implementation demonstrates MLA, DeepSeekMoE, expert balancing and multi-token prediction, while omitting large-scale optimizations and remaining far smaller than the original 671-billion-parameter model.
Key points
- The implementation uses pure JAX, with no Flax, Equinox or PyTorch.
- The model has 36.2M parameters and 13.6M active parameters per token; its training corpus contains 21.7M tokens.
- On a MacBook Air M5, training ran for 12,000 steps and about 2.6 hours, at a median speed of around 10.7k tokens per second.
- Expert balancing bias made expert loads more even without materially changing validation loss in the 2,000-step comparison.
- The project is an architecture demonstration, not a capable general-purpose language model; the original DeepSeek-V3 has 671B parameters.
Why it matters
The project makes several DeepSeek-V3 design choices inspectable and reproducible on consumer hardware, offering developers a compact way to study latent attention, mixture-of-experts routing and training trade-offs. Its scale and simplifications make it a learning reference rather than a substitute for the full model.
Companies and models mentioned
- DeepSeek-V3
- JAX
- Vaibhaav Tiwari
- Apple MacBook Air M5