Formula

Fine-Tuning Objective as Log-Likelihood Maximization

A popular method for fine-tuning a model is to find the optimal parameters, θ^\hat{\theta}, by maximizing the total conditional log-likelihood over a dataset D\mathcal{D} of prompt-response pairs. This approach, equivalent to minimizing the negative log-likelihood loss, seeks parameters that make the observed outputs y\mathbf{y} most probable given the inputs x\mathbf{x}. In some cases, the prompt x\mathbf{x} is decomposed into an instruction c\mathbf{c} and a user input z\mathbf{z}, such that x=(c,z)\mathbf{x} = (\mathbf{c}, \mathbf{z}). The formal expression is: θ^=argmaxθ(x,y)DlogPrθ(yx)=argmaxθ(x,y)DlogPrθ(yc,z)\hat{\theta} = \arg \max_{\theta} \sum_{(\mathbf{x},\mathbf{y}) \in \mathcal{D}} \log \mathrm{Pr}_{\theta}(\mathbf{y}|\mathbf{x}) = \arg \max_{\theta} \sum_{(\mathbf{x},\mathbf{y}) \in \mathcal{D}} \log \mathrm{Pr}_{\theta}(\mathbf{y}|\mathbf{c}, \mathbf{z}) where Prθ()\mathrm{Pr}_{\theta}(\cdot|\cdot) is the probability predicted by an LLM with the parameters θ\theta.

Image 0

0

1

Updated 2026-04-30

Contributors are:

Who are from:

Tags

Ch.3 Prompting - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences