Pre-training

Pre-training is the first, largest stage of building an AI model, in which it learns general patterns from a huge dataset before specialised training.

Modern AI models are built in stages, and pre-training comes first. A large language model is given a vast amount of text and one simple task: predict the next token. It does this across billions of examples, adjusting its parameters whenever it guesses wrong. Nobody has to label the data, because the text itself supplies the right answers. That is what makes training at this scale possible.

The result is a base model. It has absorbed grammar, facts and patterns of reasoning, but it is a next-token predictor, not yet a helpful assistant. It continues text rather than following instructions. Google's machine learning glossary describes some freshly pre-trained models as clumsy giants that need refining. Fine-tuning and RLHF do that refining, turning a base model into something a business can use.

Think of pre-training as a broad general education and fine-tuning as on-the-job training. The education takes years and costs a great deal, but it gives the worker a foundation for almost any role. The job-specific training is short and cheap by comparison, and it only works because the foundation is already there.

The approach took hold in language work in 2018. In June that year OpenAI researchers published Improving Language Understanding by Generative Pre-Training, the paper behind GPT-1, which pre-trained a transformer on a large collection of books and then fine-tuned it for specific tasks. BERT followed later the same year. The P and T in GPT stand for pre-trained and transformer.

Pre-training is where most of the money goes. Training GPT-2 in 2019 cost about $50,000. Training the 540 billion parameter PaLM in 2022 cost about $8 million. Only a few companies can afford to pre-train the largest models, so most businesses start from a pre-trained model someone else built and adapt it.

Common questions

What is the difference between pre-training and fine-tuning?

Pre-training teaches a model general knowledge from a huge, broad dataset and is by far the most expensive stage. Fine-tuning comes afterwards and adjusts that pre-trained model for a narrower purpose using a much smaller, focused dataset. Pre-training builds the foundation once; fine-tuning can be repeated cheaply for many different uses of the same base model.

What is a base model?

A base model is a model straight out of pre-training, before fine-tuning or RLHF. It predicts the next piece of text well but does not reliably follow instructions or behave like an assistant. Developers use base models as starting points for their own fine-tuning, while most products people use are built on versions that have been further trained.

Why is pre-training so expensive?

It means running a very large model over an enormous dataset, adjusting billions of parameters again and again, which needs a large cluster of specialised chips and the power to run them. Costs have climbed with model size: GPT-2 cost about $50,000 to train in 2019, while PaLM cost about $8 million in 2022.

Should my business pre-train its own model?

Almost certainly not. Pre-training a capable language model takes data, chips and expertise on a scale few organisations have. Businesses get far more from starting with an existing pre-trained model and adapting it through prompting, retrieval of their own documents or fine-tuning. Building from scratch only makes sense for unusual data that no existing model handles.

Finding more

Search for "generative pre-training", "self-supervised learning language models" or "base model vs instruct model" to see how the stage works and what comes after it. Reliable sources include the original research papers on arXiv, encyclopedia articles that cite them, and machine learning glossaries from Google and similar providers. Treat training cost figures with care when they come without a source, because estimates vary widely depending on what is counted.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.