What's the strongest AI model you can train on a laptop in five minutes?
TL;DR Highlight
Training a 1.8M-param GPT on a MacBook for five minutes produced coherent kids' stories.
Who Should Read
An LLM app developer who wants to train a small model locally and is curious about laptop GPU limits
Core Mechanics
- Best 5-minute model: 1.8M params
- A GPT-style transformer trained on about 20M TinyStories tokens.
- It reached about 9.6 perplexity (how confused the model is predicting the next token; lower is better) on a held-out split.
- The output isn't perfect but is grammatical short stories.
- Math optimizations didn't help
- torch.compile and float16 either slowed training or had no meaningful effect.
- Gradient accumulation (summing several batches before one update) slowed training by an order of magnitude.
- Switching from PyTorch to MLX didn't meaningfully improve speed.
- The bottleneck was GPU launches
- The first GPT-2-style model ran at about 3000 tokens per second on Apple MPS.
- The author found that launches (telling the GPU to do work) were the biggest bottleneck.
- TinyStories was the right dataset
- Simple English Wikipedia produced text obsessed with proper nouns.
- TinyStories has coherent 4-year-old-level stories, which suits small models.
- SwiGLU and shallow layers worked best
- SwiGLU made a noticeable difference and 2-3 layer models did best.
- Learning rates of 0.001-0.002 worked well and learned positional embeddings beat RoPE.
- LSTMs reached higher perplexity than same-size transformers.
- Diffusion failed completely
- D3PM diffusion language models output random tokens.
- Transformers and LSTMs produced grammatical-looking text after one minute.
- The sweet spot was around 2M params
- Larger models didn't converge in five minutes and smaller ones stopped improving after the first minute.
- By Chinchilla (optimal size = training tokens / 20), a 2.6M model was overkill.
- A 1M model at 100k tokens/s had an ideal size of 1.5M, was closer, and scored better.
Community Reactions
- Small-model training matters for LLM science
- One commenter compared it to studying yeast in biology: we need the simplest transformers that show behaviors of interest.
- GPT-2 speedrun tricks could go further
- One commenter suggested Muon, better init and careful learning rate tuning.
- They linked the modded-nanogpt repo.
- Compare by energy, not time
- One commenter suggested a Joule budget so the MBP and H100 are on even footing.
- Separate overfitting from the time limit
- One commenter wanted to see model-size curves trained until perplexity plateaus.
- They asked whether large models lose from overfitting or from the fixed five minutes.
- A one-day version exists
- A commenter linked the 'cramming' paper, which trains the best model in a day on a laptop.
How to Apply
- Run a five-minute TinyStories experiment
- Train a 2-3 layer GPT of about 1-2M params on a TinyStories subset for five minutes.
- Record perplexity as your baseline.
- Measure bottlenecks before optimizing
- If small-model training is slow, check GPU launch counts before torch.compile or float16.
- Turn off gradient accumulation and size the batch to fit memory.
- Try small models on domain data
- Pick consistent internal domain data instead of general wikis for a small model.
- Compare 0.5M, 1M and 2M params under the same time budget.
Try It
# Paste into Claude or ChatGPT (simplified version of the post's method: plan a 5-minute small-model run)
I want to train a small GPT-style language model in 5 minutes on a laptop with {{laptop specs}}.
The dataset is {{dataset name}}.
Write a PyTorch training script and experiment plan with these constraints.
- 2-3 layer transformer, SwiGLU, learned positional embeddings, no dropout
- learning rate between 0.001 and 0.002
- no torch.compile, float16 or gradient accumulation
- compare 0.5M, 1M and 2M params by held-out perplexity after 5 minutes
- for each size, check against Chinchilla (optimal size = training tokens / 20)Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls