NanoGPT Slowrun: 10x Data Efficiency with Infinite Compute
TL;DR Highlight
Achieved 10x data efficiency in a few weeks — training a 1.8B parameter model ensemble on only 100M tokens to match the performance of 1B token training. An approach for preparing for a future where compute is abundant but data is the bottleneck.
Who Should Read
ML researchers and engineers who run LLM pretraining experiments directly, and AI developers who need to build better models with limited data.
Core Mechanics
- Using an ensemble of 1.8B parameter models trained on different data subsets, then distilling into a single model, achieves performance comparable to a model trained on 10x more data.
- The key insight is that data diversity — training different ensemble members on different data slices — matters more than raw data quantity for matching larger-data baselines.
- The approach is particularly effective in the 'low data regime' (under 500M tokens), where the ensemble benefit is largest and diminishes at higher data volumes.
- The experiment was completed in weeks rather than months due to the small model size (1.8B) and data volume, making it accessible for smaller teams.
- The 'compute-rich, data-poor' future the authors anticipate — where synthetic data and careful data curation matter more than scale — motivates why this direction is worth exploring.
Evidence
- The researchers shared training curves showing the ensemble approach's performance vs. a single model at various data scales — the gap narrows as data volume increases.
- Commenters noted this is consistent with established findings in ensemble learning, applied to the pretraining context — the technique isn't new, but the application to LLM pretraining with extreme data efficiency is novel.
- ML engineers appreciated the accessibility: the experiment runs on a modest GPU cluster, unlike most pretraining research that requires hundreds of GPUs.
- Some questioned whether the gains hold at larger scales (7B+, 70B+) or only apply to the 1.8B parameter range tested.
How to Apply
- If you're limited to a small dataset, train multiple smaller models on different random subsets of the data, then ensemble their outputs or distill into a single model.
- Prioritize data diversity over data quantity when curating your training set — covering different domains and writing styles matters more than having more of the same.
- Use this approach for domain-specific models where data is scarce: medical, legal, or niche technical domains where 100M tokens of high-quality data may be all you can get.
- Run ablations at small scale (1B parameters) before committing to larger experiments — the data efficiency gains should be visible even at smaller scales.
Code Example
# Chain Distillation Ensemble training loop (pseudocode)
def train_chain_distillation_ensemble(data, num_models=8, alpha=0.5, T=1.0):
models = []
# First model: trained with standard cross-entropy loss
M1 = train_model(data, loss_fn='cross_entropy')
models.append(M1)
# Subsequent models: use the immediately preceding model as teacher
for k in range(2, num_models + 1):
teacher = models[-1] # Use only the previous model as teacher (memory efficient)
freeze(teacher)
def distill_loss(student_logits, teacher_logits, labels):
ce_loss = cross_entropy(student_logits, labels)
kl_loss = T**2 * kl_divergence(
student_logits / T,
teacher_logits / T
)
return (1 - alpha) * ce_loss + alpha * kl_loss
M_k = train_model(data, loss_fn=distill_loss, teacher=teacher)
models.append(M_k)
del teacher # Remove teacher from memory
return models
def ensemble_inference(models, input_tokens):
# Average logits from all models to produce final prediction
all_logits = [model(input_tokens) for model in models]
return sum(all_logits) / len(all_logits)
# Looped Transformer configuration example (based on 30 layers)
# Layers 0-14: normal pass-through
# Layers 15-24: repeated 4 times
# Layers 25-29: normal pass-through (last layers are not repeated)
loop_config = {
'total_layers': 30,
'loop_start': 15,
'loop_end': 24,
'loop_count': 4
}Terminology
Related Papers
Is One Layer Enough? A Single Transformer Layer Matches Full-Parameter RL Train
LLM의 RL 후처리 학습(post-training)에서 성능 향상의 대부분이 중간 레이어 소수에 집중되며, 단 하나의 레이어만 학습해도 전체 파라미터 학습과 비슷하거나 더 나은 결과를 낼 수 있다는 연구 결과. 이는 RL 학습 비용을 대폭 줄일 수 있는 가능성을 시사한다.
Knowledge Distillation of Black-Box Large Language Models (2024)
GPT-4 같은 내부 구조에 접근할 수 없는 독점 LLM에서 작은 모델로 지식을 효과적으로 전달하는 Proxy-KD 기법을 소개하는 논문으로, 전통적인 White-Box 방식보다 성능이 높다는 점에서 주목할 만하다.
Show HN: NanoEuler – GPT-2 scale model in pure C/CUDA from scratch
PyTorch나 autograd 없이 C와 CUDA만으로 GPT-2 수준의 LLM을 처음부터 구현한 교육용 프로젝트로, 역전파·BPE 토크나이저·FlashAttention까지 직접 손으로 작성했다.
Show HN: Neural Particle Automata
고정된 격자 대신 움직이는 파티클 위에서 동작하는 Neural Cellular Automata의 확장 버전으로, 형태 생성·포인트 클라우드 분류·텍스처 합성 등 다양한 작업에서 자기조직화 동작을 학습할 수 있다.
The annotated PyTorch training loop
PyTorch 학습 루프의 각 코드 줄이 왜 그 위치에 있어야 하는지, 순서를 바꾸거나 빠뜨렸을 때 어떤 문제가 생기는지를 단계별로 설명한 심층 가이드다.
When Good Verifiers Go Bad: Self-Improving VLMs Can Regress on New Tasks
VLM 자가학습 루프에서 verifier가 특정 태스크에 맞지 않으면 학습할수록 오히려 성능이 떨어지는데, DPO 손실값은 멀쩡히 내려가서 눈치채기도 어렵다.