HackerPapers

arXiv:2212.14034cs.CL

Cramming: Training a Language Model on a Single GPU in One Day

Jonas Geiping, Tom Goldstein

Abstract

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.

arXiv comments
22 pages, we provide code at https://github.com/JonasGeiping/cramming
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.LGMachine Learning

On Hacker News

Linked by 4 identifiable commenters in 4 comments across 3 threads, from Jan 2023 to Aug 2025. Found in 6 HN submissions from Dec 2022 to Nov 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • This is evocative of “cramming”, a paper from a few years ago, where the author tried to find the best model they could train for a day on a modern laptop: https://arxiv.org/abs/2212.14034

      lsbView on HNParent context

    • I'm not on my desktop, but I used nanoGPT extensively on my RTX-4090. I trained a GPT2-small but with a small context window (125 > 90M params) at batch sizes of 1536 using gradient accumulation (3*512). This runs at just a smidge over 1 it/s. Some notes - Gradient checkpointing…

      onnodigcomplexView on HNParent context

  1. NanoGPT 2 comments
    • see also 'Cramming: Training a Language Model on a Single GPU in One Day' https://arxiv.org/abs/2212.14034 and https://github.com/JonasGeiping/cramming

      homarpView on HNParent context

    • A couple of weeks ago a new paper came out that shows how to train a high quality language model on a single GPU in one day. https://arxiv.org/abs/2212.14034

      jph00View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.