Intro

An LLM checkpoint is the output of a particular architecture, tokenizer, objective, and training pipeline. The weights are not a self-describing program that any inference runtime can load. To reproduce the model, the runtime must build the compatible computation graph, interpret every tensor correctly, tokenize text with the matching vocabulary and special-token rules, and implement the operators used by that architecture and quantization scheme.

The common transformer families differ in which tokens can attend to which context and where generation happens. Keep that distinction separate from scale: a large encoder is still not an autoregressive decoder.

Transformer families

FamilyTraining and attention boundaryOutput pathTypical use
Encoder-onlyBidirectional contextual encoding; BERT pretrains with masked-token prediction and sentence-level objectivesOne contextual vector per input token or a pooled representationClassification, extraction, reranking, embeddings
Encoder-decoderEncoder reads the source bidirectionally; decoder generates target tokens autoregressively while attending to encoder outputGenerated target sequenceTranslation, summarization, text-to-text tasks
Decoder-onlyCausal attention exposes only earlier tokens during next-token predictionGenerated continuationChat, code, completion, tool-call generation

BERT is encoder-only. It predicts masked tokens during pretraining and then exposes contextual representations to a task head; it has no autoregressive decoder for open-ended generation.

T5 is generative encoder-decoder. It pretrains with a span-corruption text-to-text objective: the encoder consumes corrupted input, and the decoder autoregressively generates the missing target spans. Translation and summarization are natural fits because generation is conditioned on a separately encoded source.

GPT-style models are decoder-only. A causal mask makes each position predict from earlier positions, so the same stack can continue a prompt one token at a time.

Checkpoint is more than weights

Loading succeeds only when these contracts agree:

  • Architecture and configuration — layer count, hidden size, attention heads, positional encoding, normalization, activation, vocabulary size, and expert layout.
  • Tensor contract — parameter names, shapes, axis layout, serialization format, numerical type, sharding, and any fused or transposed representation.
  • Tokenizer contract — vocabulary, normalization, pre-tokenization, merge rules, byte fallback, and identifiers for beginning, end, padding, unknown, and chat-control tokens.
  • Adaptation and quantization metadata — adapter targets, ranks, scaling, quantization groups, scales, zero points, and calibration assumptions.
  • Runtime operators — implementations for the model’s attention, rotary or relative position logic, mixture-of-experts routing, normalization, quantized matrix operations, and cache layout on the target hardware.

A .safetensors file only defines a safe tensor container. It does not say which model class to instantiate or which tokenizer turns text into the expected ids. Loading Llama-shaped tensors into a GPT-2 graph fails on names and shapes; using the wrong tokenizer can produce valid tensor dimensions while mapping the same text to different ids and silently corrupting behavior.

Portable graph formats such as ONNX make operators and tensor interfaces explicit, but compatibility still depends on the runtime supporting the graph’s operator versions, data types, custom operators, and hardware kernels. “The file opened” is weaker evidence than a known-answer inference test against the source runtime.

Training pipeline

Training is usually discussed in three stages, although real model families combine and repeat them.

  1. Pretraining fits the architecture’s language objective over a large corpus. A decoder-only base model learns causal next-token prediction; BERT and T5 use the objectives described above. The output is a base checkpoint, not automatically a conversational assistant.
  2. Supervised fine-tuning (SFT) trains on instruction-response or task examples. It teaches the model which continuation or target sequence should answer an instruction. Fine-tuning covers full and parameter-efficient updates, data contracts, and evaluation.
  3. Preference or reward optimization uses comparisons or verifiable rewards to favor some outputs over others. Preference Alignment covers RLHF and DPO; GRPO covers group-relative online reinforcement learning.
base checkpoint = architecture + tokenizer + pretrained tensors + configuration
instruction model = compatible base checkpoint + SFT + optional preference/reward stage
deployable artifact = model bundle + compatible runtime + release evaluation

Training provenance matters at deployment. Record the base revision, data version, tokenizer files, configuration, adapters, quantization recipe, runtime version, and evaluation result. A model name without those versions is not enough to reproduce output or investigate a regression.

Failure modes

Architecture mismatch — tensor names or shapes fail during load, or a permissive loader leaves expected parameters uninitialized.

Tokenizer mismatch — loading appears successful, but prompts use different token ids, special markers, or normalization and quality collapses.

Runtime mismatch — unsupported operators, cache layout, precision, or quantization kernels cause load failure, numerical drift, or a slow fallback path.

Training-stage ambiguity — benchmark results for a base checkpoint are compared with an instruction or preference-aligned variant as though they were the same model.

Questions

References