Cramming: Training a Language Model on a Single GPU in One Day
Summary
Cramming: train a transformer MLM from scratch on one consumer GPU in 24h with no pretrained checkpoints. Scaling laws still hold at this budget, so architecture swaps barely move loss; gains come from faster steps at similar size (PreNorm, no QKV/FFN biases, sparse MLM head), a one-cycle LR, dropout-off, and filtered/sorted C4. A6000 1-day GLUE-dev 78.6 vs fully trained BERT-base 80.9 (MNLI 83.9/84.1 vs 83.2/83.4). Code https://github.com/JonasGeiping/cramming.
- Venue
- arXiv / University of Maryland
- Purpose
- See how close a 24-hour single-GPU MLM run can get to BERT-base on GLUE
- Scale
- 1× RTX 2080 Ti / A4000 / A6000 for 24h (~5/8/13 exaFLOP peak). Seq 128, vocab 32768, packed MLM. GLUE-dev minus WNLI; 5-epoch FT with global hparams. 2-day 8×A6000 follow-up also reported.
- Time period
- 2022-12-28 (arXiv 2212.14034 v1). Comment: 22 pages. HF paper publishedAt 2022-12-28.
- Added
- Oct 1, 2026
- Research status
- done
From the source
- Published
- Dec 28, 2022
- arXiv categories
- cs.CL, cs.LG
- Author comment
- 22 pages, we provide code at https://github.com/JonasGeiping/cramming
- Citations
- 123 (17 influential)
- References
- 146
- Published in
- International Conference on Machine Learning
Abstract (from arXiv)
Recent trends in language modeling have focused on increasing performance through scaling, and have resulted in an environment where training language models is out of reach for most researchers and practitioners. While most in the community are asking how to push the limits of extreme computation, we ask the opposite question: How far can we get with a single GPU in just one day? We investigate the downstream performance achievable with a transformer-based language model trained completely from scratch with masked language modeling for a single day on a single consumer GPU. Aside from re-analyzing nearly all components of the pretraining pipeline for this scenario and providing a modified pipeline with performance close to BERT, we investigate why scaling down is hard, and which modifications actually improve performance in this scenario. We provide evidence that even in this constrained setting, performance closely follows scaling laws observed in large-compute settings. Through the lens of scaling laws, we categorize a range of recent improvements to training and architecture and discuss their merit and practical applicability (or lack thereof) for the limited compute setting.
Tags
Topics
efficient pretraining, BERT, scaling laws
Research notes
- Primary: arxiv abs (cs.CL; also cs.LG). License: arXiv.org perpetual non-exclusive on HTML at check. Comment: 22 pages; code at https://github.com/JonasGeiping/cramming (HF githubRepo; 1,368 stars at check; no LICENSE file at check). UMD; correspondence jgeiping@umd.edu, tomg@umd.edu. HF paper page 0 upvotes; official-looking linked models JonasGeiping/crammed-bert and crammed-bert-legacy not copied into hf_* fields. Linked HF tokenized-Pile shards (the_pile_WordPiecex32768_*) are processed public Pile, not a new hosted corpus, so no datasets_local row. Discord posted PDF. License field left blank per catalog convention.
Similar entries
- Paper ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
- Model Contrastive Language Models (CLM): A System One Model for Fast and Generalizable Decision-Making
- Post >10x More Efficient Pretraining
- Paper How Much Is an AI Token Worth? Scaling Laws for Wild AI-Generated Web Text
- Paper Understanding Reasoning from Pretraining to Post-Training
- Paper How Much Is One Recurrence Worth? Iso-Depth Scaling Laws for Looped Language Models