openskills.info
Course Preview

Large Language Model Training and Inference

LLM training and inference covers the infrastructure, techniques, and engineering required to train large language models on massive text corpora and serve their predictions efficiently. It addresses distributed training, hardware selection, optimization, quantization, and serving architectures.

itArtificial intelligence and machine learning

Don't Panic — Large Language Model Training and Inference

Large language models look like magic from the outside, but they are engineering projects with known constraints and tunable knobs. This course covers two specific mechanics: how the size of a training run gets decided, and what actually happens every time a model generates a response.

The first thing to know is that parameter count alone does not tell you what a model can do. For years, the assumption was to make models as large as possible. DeepMind's Chinchilla study proved that wrong: a 70-billion-parameter model trained on 1.4 trillion tokens beat a 280-billion-parameter model trained on a quarter of that data, using the same compute. The lesson is that model size and training data need to scale together, and a smaller model trained well can outperform a much larger one trained badly.

The second thing is that a freshly pretrained model is a text-completion engine, not an assistant. It predicts plausible next words; it does not inherently follow instructions or decline unsafe requests. Turning it into something useful requires a separate alignment step — RLHF, or reinforcement learning from human feedback — where human preference rankings train a reward model that guides the base model toward helpful, safe behavior. A 1.3-billion-parameter aligned model can beat a 175-billion-parameter unaligned one on human preference. Alignment is not a hack; it is a fundamentally different kind of training.

The third thing is that inference is a loop, not a single computation. Each token is generated one at a time, with a decoding strategy picking which token to append next. Temperature controls how creative or conservative that choice is. Top-p sampling adapts the pool of candidate tokens to the model's confidence. And a handful of engineering tricks — KV caching, speculative decoding, quantization — determine whether that loop runs at a cost you can actually afford.

If you remember nothing else: the gap between a research demo and a production system is almost never about model quality. It is about serving efficiency. Read the Cheatsheet for the parameter names, the Intro for the full explanation, and the Field Notes for the mistakes teams actually make.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources

  • https://deepmind.google/blog/an-empirical-analysis-of-compute-optimal-large-language-model-training/
  • https://arxiv.org/abs/2203.02155
  • https://huggingface.co/docs/transformers/main/en/generation_strategies
  • https://huggingface.co/blog/how-to-generate
  • https://huggingface.co/docs/transformers/main/en/llm_optims
  • https://arxiv.org/abs/2203.15556
  • https://arxiv.org/abs/2205.14135
  • https://arxiv.org/abs/2302.13971
  • https://arxiv.org/abs/2307.09288
  • https://arxiv.org/abs/2401.04088
  • https://arxiv.org/abs/2407.21783
  • https://github.com/microsoft/DeepSpeed
  • https://github.com/NVIDIA/Megatron-LM
  • https://docs.vllm.ai/
  • https://huggingface.co/docs/text-generation-inference/
  • https://nvidia.github.io/TensorRT-LLM/
  • https://github.com/TimDettmers/bitsandbytes
  • https://github.com/ggerganov/llama.cpp
  • https://ollama.com/
  • https://github.com/axolotl-ai-cloud/axolotl
  • https://modal.com/
  • https://www.together.ai/
  • https://www.anyscale.com/
  • https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf
  • https://arxiv.org/abs/2005.14165
  • https://arxiv.org/abs/2101.03961
  • https://arxiv.org/abs/2212.08073