How Long Does It Take to Train GPT-2 From Scratch Locally?
A GPT-2 level model trained from scratch on one local machine: 5h40m of training, 8.5 hours total, a CORE score near 0.25, and what UL2 changed.
For Engineering

How long does it take to train a GPT-2 level model from scratch on one machine?
On a single high-end local machine, about a working day or less. In the run covered here, a 20-layer model of roughly 900 million parameters was pretrained on 5.2 billion tokens in about 5 hours 40 minutes, and the whole project took about 8.5 hours. It scored about 0.25 on the CORE benchmark, against 0.26 for the original GPT-2 1.5B. The hardware was an HP ZGX Fury with an Nvidia GB300, a machine the creator was lent and who made the video as a sponsored project with HP and Nvidia. The code was a fork of nanochat.
TL;DR
- Pretraining a GPT-2 class model is now an overnight job. The run took 5 hours 40 minutes of training and about 8.5 hours in total, on one machine in an office.
- The model is smaller than GPT-2's biggest version but scores close to it. About 900M parameters reached a CORE score near 0.25, versus about 0.26 for GPT-2 1.5B.
- Throughput was about 290,000 tokens per second, with a peak memory use of 135 GB. Most of that memory goes to working space during training, not to the model itself.
- A UL2-style denoising experiment finished slightly behind the standard approach. It was an interesting test, not an improvement.
- For most businesses, fine-tuning is still the better move than pretraining. Training from scratch is mainly useful for learning, research, and very specialized needs.
What is nanochat?
nanochat is an open-source project from Andrej Karpathy, a well-known AI researcher. It is a small, readable codebase that covers the whole pipeline of building a chatbot: preparing data, pretraining a language model, fine-tuning it to follow instructions, evaluating it, and chatting with it. The point is that one person can read all of it and understand what is happening.
The run described here used a fork of nanochat, meaning a copy someone modified for their own purposes. This article focuses on the pretraining stage, where a model starts with random numbers and learns language by predicting the next word, billions of times.
What did the run actually look like?
Here are the reported figures in one place.
| Item | Reported figure |
|---|---|
| Model size | About 900M parameters, 20 layers |
| Training data | 5.2 billion tokens |
| Throughput | About 290,000 tokens per second |
| Peak memory | 135 GB |
| Pretraining time | 5 hours 40 minutes |
| Total time | About 8.5 hours |
| CORE score | About 0.25 |
| Comparison: GPT-2 1.5B | About 0.26 |
A few terms, briefly. A parameter is one of the adjustable numbers inside a model. More parameters usually means more capacity. A token is a chunk of text, often a bit less than one word. So 5.2 billion tokens is a few billion words of reading material. Throughput is how many tokens the machine processes each second.
The gap between 5 hours 40 minutes and 8.5 hours is worth noting. The material available for this article doesn't break down what fills the difference. Setup, data preparation, and evaluation commonly sit around the core training loop, but treat that as a reasonable guess. If you plan your own run, budget for more than the headline training time.
Why does the model use 135 GB of memory when it is only 900M parameters?
Because training needs far more memory than the finished model does. The video makes this point with a rule of thumb: a full training run with the Adam optimizer in mixed precision needs roughly 16 bytes per parameter. That covers the weights, the gradients, a full-precision copy of the weights, and two optimizer states. For a 27B model, the creator calculates that this comes to 430 GB before counting activations.
Apply the same rule to 900 million parameters and you get roughly 14 to 15 GB. The reported peak of 135 GB is far above that. The rest is mostly activations, the intermediate results the model keeps while processing each batch of text so it can learn from its mistakes. Bigger batches and longer text sequences mean more activations. That is a rough estimate, not a measured breakdown, but it explains why memory, not just raw speed, decides what you can train on a given machine.
The practical lesson holds on any hardware: do this arithmetic before you rent or buy anything.
How does it score against the original GPT-2?
GPT-2 was released by OpenAI in 2019, and its largest version has 1.5 billion parameters. It became a common yardstick for "a model that is competent at language."
The CORE score is an aggregate benchmark. It averages results across a set of language tasks, adjusted so that random guessing scores zero. It comes from the DCLM research project, and nanochat uses it to compare models with GPT-2. A higher number is better.
The reported result is about 0.25 for the 900M model and about 0.26 for GPT-2 1.5B. That is very close, with a smaller model. The likely reason is that training data and training recipes have improved a lot since 2019. A modern recipe can get more out of fewer parameters. That is a general explanation, not something this single run proves.
Two cautions. First, "GPT-2 level" means level with a 2019 model, which is far behind today's assistants. Second, one benchmark is one view. CORE tells you about general language ability, not whether the model will do your job well.
What is UL2 denoising, and why did it come out behind?
Standard pretraining for chat-style models asks the model to predict the next token, reading left to right. UL2 is a research approach from Google that mixes several training tasks. In a denoising task, parts of the text are hidden or corrupted and the model must fill them in or reconstruct them. UL2 blends different kinds of these tasks with the goal of making the model more versatile.
In this run, the UL2-style version came out slightly behind the standard next-token version. The reported result is only that it trailed slightly, and no number is given here. This is a normal and useful kind of result. A single experiment at one small scale does not say that UL2 is worse in general. It says that, for this model size, this data, and this training budget, the simple approach held up. Being able to run that comparison in an afternoon is the real value of a setup like this.
Why would anyone train a model from scratch?
Usually, you wouldn't. For most workplace needs, fine-tuning an existing model is cheaper and faster. The same creator argues for local training on three grounds: privacy (your data stays on your hardware), cost (a small model trained for your task can match a bigger general one on that task, with no per-token bill), and control (your model doesn't change because a provider deprecated something).
Those reasons apply mostly to fine-tuning. The video itself covers fine-tuning a 27B model with LoRA, which freezes the base model and trains small add-on layers, typically under 1% of the model. LoRA is good at teaching behavior, such as tone, formatting, and which tool to call. It is a poor way to store facts like prices, which is a job for retrieval (RAG).
Pretraining from scratch makes sense when:
- You want to understand how models work, and a small run is the best teacher.
- You are researching training methods, like the UL2 test above.
- You need full control over what data the model has ever seen.
- You work in a language or domain that existing models handle badly.
What does this mean for you?
If you are a manager or leader weighing AI strategy: the cost of experimenting has dropped. A model that matched a flagship 2019 system now trains in less than a day on one machine. That does not mean you should train your own. It means the "we would need a cloud cluster" objection is weaker than it used to be, especially for privacy-sensitive work.
If you work with data, analytics, or IT: learn the memory math. Knowing roughly 16 bytes per parameter for full training, and why activations add to that, helps you size hardware and challenge vendor quotes. Start with fine-tuning on a task you actually have.
If you are simply curious: nanochat is built to be read. You can follow the whole path from raw text to a working chatbot without a research background, even if you never run it.
What to do next: pick one small, real task (classifying support tickets, say), try fine-tuning before pretraining, and keep a log of each experiment's settings and results. The logging habit matters more than the hardware.
Can you build a tracker for experiments like these without another subscription?
Anyone running several training or fine-tuning experiments ends up with a spreadsheet of settings, run times, memory use, and scores, which gets messy fast. With Remy, you describe the tool in plain English, for example an experiment log with fields for model size, tokens, throughput, peak memory, and benchmark score, plus a comparison view and a simple request form for who gets machine time. Remy builds the full-stack app and deploys it to a live URL, so your team has one shared place instead of scattered files.
Frequently Asked Questions
Can I train a GPT-2 level model on a normal laptop?
Not in the way described here. The reported run used 135 GB of peak memory on a GB300 machine. Smaller versions of nanochat-style training can run on lesser hardware, but they use fewer parameters and less data, and the results will be weaker.
Is a CORE score of 0.25 good?
It is close to GPT-2 1.5B at about 0.26, which is the point of the comparison. It is not close to modern commercial assistants. Treat it as "roughly 2019 flagship quality," trained in under a day.
Should my company pretrain its own model?
Probably not first. Fine-tuning an existing open model on your data is cheaper and usually enough. Pretraining from scratch is for research, learning, or highly specialized needs.
Why did UL2 finish behind the standard method?
The source reports only that it came out slightly behind. One run at one small scale can't show why, or whether the result would hold at other sizes. It is a data point, not a verdict on UL2.
Why is the total time longer than the training time?
The reported totals are 5 hours 40 minutes of training and about 8.5 hours overall. The source doesn't itemize the difference. Setup, data prep, and evaluation are common contributors in projects like this.
Useful for
How we source, write, and correct our articles. Editorial standards



