{
  "title": "Post-training cheat sheet",
  "url": "https://gavish.ai/lab/cheatsheet.html",
  "author": "Adam Gavish",
  "topics": [
    {
      "n": 1,
      "topic": "Models",
      "terms": [
        {
          "term": "Language model",
          "definition": "A program that predicts the next piece of text, one token (word piece) at a time."
        },
        {
          "term": "Transformer",
          "definition": "The neural-network design behind almost every modern language model."
        },
        {
          "term": "Parameters (weights)",
          "definition": "The numbers inside a model that training adjusts. Large models have billions of them."
        },
        {
          "term": "Pre-training",
          "definition": "The first, longest phase: learn to predict the next token of a very large body of text. It teaches language and facts, not a specific task."
        },
        {
          "term": "Prompt",
          "definition": "The input the model continues from."
        },
        {
          "term": "Sampling",
          "definition": "Drawing an answer from the model's probabilities, one token at a time. The same prompt can give a different answer each time."
        },
        {
          "term": "Temperature",
          "definition": "A dial on sampling: below 1 favours the model's top guesses, above 1 spreads probability out for more variety (and more mistakes)."
        },
        {
          "term": "Quantization (int8)",
          "definition": "Storing weights in fewer bits, for example 8-bit integers (int8) instead of 32-bit numbers: a 4× smaller file for almost the same answers."
        }
      ]
    },
    {
      "n": 2,
      "topic": "Evals",
      "terms": [
        {
          "term": "Eval",
          "definition": "A fixed set of problems used only to measure a model, never to train it."
        },
        {
          "term": "Held-out",
          "definition": "Kept out of all training on purpose, so a good score means the model learned the rule, not the answers."
        },
        {
          "term": "Grader",
          "definition": "Code that checks an answer and returns pass or fail plus a score. Also called a verifier."
        },
        {
          "term": "pass@1",
          "definition": "The chance that a single try is right. What a user experiences."
        },
        {
          "term": "pass@k",
          "definition": "The share of problems solved at least once in k tries. Shows whether the knowledge is in the model at all."
        },
        {
          "term": "Headroom",
          "definition": "pass@k minus pass@1: skill the model has but can't produce reliably. RL can turn it into pass@1."
        },
        {
          "term": "Checkpoint",
          "definition": "A saved copy of a model's weights at one point in training."
        }
      ]
    },
    {
      "n": 3,
      "topic": "Supervised fine-tuning (SFT)",
      "terms": [
        {
          "term": "SFT (supervised fine-tuning)",
          "definition": "Training on worked examples: show the right answer, train the model to predict it token by token."
        },
        {
          "term": "Training loss",
          "definition": "How surprised the model is by the correct tokens (cross-entropy). Training pushes it down; 0 would mean it predicts them perfectly."
        },
        {
          "term": "Step",
          "definition": "One update: run a batch of examples, measure the loss, nudge every weight a little."
        },
        {
          "term": "Learning rate",
          "definition": "How big each nudge to the weights is. Too big and training goes unstable; too small and it barely moves."
        },
        {
          "term": "Backpropagation",
          "definition": "The algorithm that works out how much each weight contributed to the loss, so each can be nudged the right way (its gradient)."
        },
        {
          "term": "Adam",
          "definition": "The standard optimizer: turns gradients into weight updates with a step size per weight. Short for adaptive moment estimation."
        },
        {
          "term": "Overfitting",
          "definition": "Doing better on the training examples than on new ones: the model memorized instead of learning the rule."
        }
      ]
    },
    {
      "n": 4,
      "topic": "LoRA",
      "terms": [
        {
          "term": "LoRA (low-rank adaptation)",
          "definition": "Freeze the model and train a small add-on for each weight matrix (W + A·B, with A and B thin). Trains a few percent of the weights."
        },
        {
          "term": "Rank",
          "definition": "How thin LoRA's add-on is. Rank 4 means A and B have 4 columns: higher rank, more capacity, more weights."
        },
        {
          "term": "Adapter",
          "definition": "The small set of trained LoRA weights. One base model can swap many adapters."
        },
        {
          "term": "Full fine-tuning",
          "definition": "Updating every weight in the model, the default way to do SFT."
        },
        {
          "term": "Forgetting",
          "definition": "Losing what pre-training taught while learning the new task. Often measured as the rise in loss on the original pre-training text."
        }
      ]
    },
    {
      "n": 5,
      "topic": "Rewards",
      "terms": [
        {
          "term": "Reward",
          "definition": "A score for one answer. RL makes high-scoring answers more likely."
        },
        {
          "term": "Proxy reward",
          "definition": "A cheaper stand-in for what you really want, like “shorter is better”. Easy to compute, easy to game."
        },
        {
          "term": "Reward hacking",
          "definition": "The model raises the reward without doing the task, by exploiting what the reward actually checks."
        },
        {
          "term": "GRPO",
          "definition": "Group Relative Policy Optimization: sample a group of answers per problem and push toward those that beat the group's average."
        },
        {
          "term": "Advantage",
          "definition": "How much better an answer scored than its group's average. Positive becomes more likely, negative less."
        },
        {
          "term": "Preference pair",
          "definition": "Two answers to one prompt, with a label saying which is better."
        },
        {
          "term": "Reward model",
          "definition": "A model trained on preference pairs to score any answer, standing in for people when no exact grader exists."
        },
        {
          "term": "Bradley-Terry",
          "definition": "The standard loss for reward models: train so the preferred answer scores higher than the rejected one."
        },
        {
          "term": "LLM-as-judge",
          "definition": "Using a large language model (LLM) to score answers, in place of a trained reward model or people."
        }
      ]
    },
    {
      "n": 6,
      "topic": "Reinforcement learning (RL)",
      "terms": [
        {
          "term": "RL (reinforcement learning)",
          "definition": "Training from scores instead of examples: the model tries, a reward scores each try, and training favours what scored well."
        },
        {
          "term": "Policy",
          "definition": "RL's word for the model being trained: it decides what to output."
        },
        {
          "term": "KL penalty",
          "definition": "A penalty for drifting from the starting model's probabilities (Kullback-Leibler divergence). β sets how strong it is."
        },
        {
          "term": "PPO",
          "definition": "Proximal Policy Optimization: RL with a separate value model and clipped updates. Powerful, harder to tune."
        },
        {
          "term": "RFT",
          "definition": "Rejection-sampling fine-tuning: sample many answers, keep the ones that pass, run SFT on them."
        },
        {
          "term": "Over-optimization",
          "definition": "Pushing a learned reward so hard that the real quality falls while the reward keeps rising (Gao et al., 2022)."
        },
        {
          "term": "Sharpening",
          "definition": "RL making answers the model could already find come out first, rather than teaching new ones. Seen when pass@k stops improving."
        }
      ]
    },
    {
      "n": 7,
      "topic": "Preference optimization (DPO)",
      "terms": [
        {
          "term": "DPO (Direct Preference Optimization)",
          "definition": "Learns from preference pairs directly, without a reward model or RL: raise the chosen answer's likelihood relative to the rejected one."
        },
        {
          "term": "β (beta)",
          "definition": "A strength dial. In DPO and the KL penalty, higher β keeps the model closer to where it started."
        },
        {
          "term": "Alignment tax",
          "definition": "Capability lost while training for preferences or safety."
        }
      ]
    },
    {
      "n": 8,
      "topic": "Model souping",
      "terms": [
        {
          "term": "Model souping",
          "definition": "Averaging the weights of models fine-tuned from the same parent, with no extra training."
        },
        {
          "term": "Specialist",
          "definition": "A model fine-tuned on one slice of the task."
        },
        {
          "term": "WiSE-FT",
          "definition": "Weight-space ensembling: interpolate between a base model and its fine-tune to keep the best of both (Wortsman et al., 2022)."
        }
      ]
    },
    {
      "n": 9,
      "topic": "Distillation",
      "terms": [
        {
          "term": "Distillation",
          "definition": "Training a small student model to imitate a big teacher model."
        },
        {
          "term": "Teacher / student",
          "definition": "The big model that already works, and the small, cheaper model learning from it."
        },
        {
          "term": "Soft labels",
          "definition": "The teacher's full probability for every next token, not just its top answer. Carries more information per example."
        },
        {
          "term": "Dark knowledge",
          "definition": "What soft labels reveal beyond the right answer: which wrong answers the teacher found plausible (Hinton et al., 2015)."
        }
      ]
    },
    {
      "n": 10,
      "topic": "Test-time compute",
      "terms": [
        {
          "term": "Best-of-N",
          "definition": "Sample N answers and keep one. No training, more inference."
        },
        {
          "term": "Test-time compute",
          "definition": "Spending more computation per answer (more samples, longer reasoning) instead of more training."
        },
        {
          "term": "Majority vote",
          "definition": "Pick the answer that appears most often among the samples (self-consistency). Needs no grader."
        }
      ]
    },
    {
      "n": 11,
      "topic": "Benchmarks",
      "terms": [
        {
          "term": "Benchmark",
          "definition": "A public, fixed eval that people trust to compare models. Examples: AIME, HumanEval, τ-bench, FinQA, LegalBench and AgentDojo."
        },
        {
          "term": "Contamination",
          "definition": "Benchmark problems leaking into training data, which inflates scores."
        }
      ]
    },
    {
      "n": 12,
      "topic": "Training mechanics",
      "terms": [
        {
          "term": "Batch",
          "definition": "The examples processed together in one step."
        },
        {
          "term": "Gradient",
          "definition": "For each weight, the direction and size of change that would lower the loss."
        }
      ]
    }
  ]
}
