AI Model Wiki

    Skip to main content
    Back to Glossary

    Pre-training

    Pre-training is the first and most computationally intensive phase of building a large AI model, in which the model is trained on a massive, general-purpose corpus - billions of web pages, books, and code - to learn statistical patterns in language, images, or other modalities. During this phase, the model adjusts hundreds of billions of parameters by minimising a self-supervised objective such as predicting the next token, giving it broad world knowledge before it has ever seen a task-specific instruction. The result is a foundation model whose internal representations can be adapted far more cheaply than training from scratch.

    Think of it like a child spending years in school absorbing reading, maths, science, and history before starting a specialised apprenticeship. The schooling does not train the child for one job - it builds the cognitive foundation that makes every later specialisation faster and more reliable.

    A typical pre-training run for a 7-billion-parameter model might consume trillions of tokens over weeks on thousands of GPUs. Once done, the same checkpoint can be fine-tuned into a customer-support bot, a code assistant, or a medical summariser with a fraction of the original compute:

    # Hugging Face pattern - load a pre-trained checkpoint and fine-tune
    from transformers import AutoModelForCausalLM, AutoTokenizer
    model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3-8b")
    tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3-8b")
    # fine-tune on domain data ...
    

    Pre-training is tightly coupled with concepts like the Transformer architecture that makes large-scale training tractable, Tokenization which converts raw text into learnable units, and Fine-tuning which specialises the resulting checkpoint. The sheer cost of pre-training is also why Knowledge Distillation and LoRA have become popular alternatives to retraining from scratch.

    You will encounter pre-training discussions whenever a new foundation model is released - researchers publish pre-training data mixes, compute budgets (measured in FLOPs), and training loss curves to justify design decisions. If you are choosing between models for a downstream task, understanding their pre-training corpora helps predict where they will excel or fail.

    AI Terminology
    Glossary