Auto-regressive Decomposition of Conditional Log-Likelihood
The conditional log-likelihood, often used as an objective function in sequence modeling, is computed by decomposing the probability of the entire output sequence into a product of conditional probabilities for each token. In log space, this product becomes a sum. Specifically, the log-probability of sequence given input is the sum of the log-probabilities of each token , conditioned on the input and all previously generated tokens . The formula, parameterized by , is: where is the length of the sequence .

0
1
Tags
Ch.4 Alignment - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
Auto-regressive Decomposition of Conditional Log-Likelihood
A machine learning engineer is fine-tuning two language models, Model A and Model B, on the same dataset of 100 prompt-response pairs. The goal is to select the model whose parameters are best optimized to make the observed responses most probable given the prompts. After one epoch of training, the engineer calculates the sum of the conditional log-probabilities for the entire dataset for each model:
- Model A: -150
- Model B: -200
Which model is performing better according to this objective, and why?
Evaluating the Log-Likelihood Maximization Objective
If a language model's parameters are perfectly optimized by maximizing the total conditional log-likelihood on a given training dataset, it means the model will assign a probability of 1.0 to every correct response sequence in that dataset.
Learn After
Mathematical Formulation of LLM Inference
Equivalence of Maximizing Auto-regressive Log-Likelihood and Minimizing Cross-Entropy Loss
Conditional vs. Joint Probability Objectives in Language Modeling
Notational Convention for Autoregressive Conditional Probability
Modeling and Efficient Computation of Conditional Token Probabilities
A language model is generating a response sequence 'y' given an input context 'x'. The model generates the two-token sequence y = ('deep', 'learning'). The model's calculated log-probabilities for each step of the generation are as follows:
- Log-probability of the first token:
log Pr(y₁='deep' | x) = -0.7 - Log-probability of the second token, given the first:
log Pr(y₂='learning' | x, y₁='deep') = -0.4
Based on the standard method for calculating the probability of a full sequence, what is the total conditional log-likelihood of the entire sequence 'y', i.e.,
log Pr(y|x)?- Log-probability of the first token:
Comparing Model Confidence via Log-Likelihood
Analyzing a Flawed Log-Likelihood Calculation