Cross-Entropy Loss
A loss function used to measure the difference between probability distributions, commonly applied in classification and language model training. In language models it computes the difference between the predicted probability distribution over the next token and the true distribution, imposing a larger penalty on confident incorrect predictions.
Core Facts
The cross-entropy loss in classification tasks is essentially the negative of the log-likelihood function, and minimizing cross-entropy is equivalent to maximizing the log-likelihood of the model on the training data.
Cross-entropy loss is the most commonly used loss function in classification tasks, rooted in information theory, and measures the distance between the model's predicted probability distribution and the true distribution.
Modern large language models are based on the Transformer architecture and generate text by predicting the probability distribution of the next token, with the training objective of minimizing cross-entropy loss
Timeline (last 90 days)
Existing scaling laws almost all focus on the cross-entropy loss at the endpoint checkpoint, that is, the static evaluation after training ends.
The relationship between evaluation metrics such as downstream task accuracy and generation quality and loss is not linear.
In QuirkyMind, the InfoNCE loss is responsible for identity consistency in the latent space, while the cross-entropy loss is responsible for expressive fidelity in the explicit space; the two are optimized alternately to form a complementarity.
The exponential decay of the offset term stems from the saturation property of softmax: as the weights increase along the preferred-class direction, the correct-class probability approaches 1 and the cross-entropy tends to 0, with the convergence rate determined by the mean surprisal of that class.
The paper proposes a hybrid objective function that combines cross-entropy loss with KL divergence, encouraging adversarial examples to simultaneously破坏 prediction accuracy and output distribution consistency.
Digit recognition is a multi-class problem, and the output layer should use a Softmax activation together with cross-entropy loss.
Cross-entropy loss measures the difference between the predicted distribution and the true label (usually one-hot encoded), and its gradient form is simple (predicted value minus true value), effectively avoiding vanishing gradients.
When cross-entropy loss is combined with Softmax, the output layer gradient takes the form ∂L/∂z = ŷ - y, which avoids the vanishing gradient problem of MSE when the output layer is saturated.
The second model's architecture is expanded to 784→40→40→10, MSE is replaced with cross-entropy, softmax is added to the output layer, the optimizer remains plain gradient descent, and the accuracy is about 96% after 2000 epochs.
The minimum mathematical knowledge needed to train an MNIST model includes understanding vector and matrix multiplication, derivatives and the chain rule, the concept of loss functions, and an intuitive understanding of gradient descent.
6 more timeline events
All Facts (20)
The cross-entropy loss in classification tasks is essentially the negative of the log-likelihood function, and minimizing cross-entropy is equivalent to maximizing the log-likelihood of the model on the training data.
90%VerifiedCross-entropy loss is the most commonly used loss function in classification tasks, rooted in information theory, and measures the distance between the model's predicted probability distribution and the true distribution.
75%VerifiedModern large language models are based on the Transformer architecture and generate text by predicting the probability distribution of the next token, with the training objective of minimizing cross-entropy loss
75%UnverifiedThe binary cross-entropy loss formula is -[y·log(p) + (1-y)·log(1-p)], where y is the true label and p is the model's predicted probability for the positive class.
70%UnverifiedConventional training (such as cross-entropy loss) only penalizes incorrect predictions without constraining probability calibration quality, causing models to be overconfident or overly conservative.
60%UnverifiedCross-entropy loss is the most commonly used loss function for classification tasks; rooted in information theory, it has gradient properties better suited to classification problems than MSE.
60%UnverifiedThe relationship between evaluation metrics such as downstream task accuracy and generation quality and loss is not linear.
50%UnverifiedExisting scaling laws almost all focus on the cross-entropy loss at the endpoint checkpoint, that is, the static evaluation after training ends.
50%UnverifiedIn QuirkyMind, the InfoNCE loss is responsible for identity consistency in the latent space, while the cross-entropy loss is responsible for expressive fidelity in the explicit space; the two are optimized alternately to form a complementarity.
50%UnverifiedThe exponential decay of the offset term stems from the saturation property of softmax: as the weights increase along the preferred-class direction, the correct-class probability approaches 1 and the cross-entropy tends to 0, with the convergence rate determined by the mean surprisal of that class.
50%UnverifiedThe paper proposes a hybrid objective function that combines cross-entropy loss with KL divergence, encouraging adversarial examples to simultaneously破坏 prediction accuracy and output distribution consistency.
50%UnverifiedCross-entropy loss measures the difference between the predicted distribution and the true label (usually one-hot encoded), and its gradient form is simple (predicted value minus true value), effectively avoiding vanishing gradients.
50%UnverifiedDigit recognition is a multi-class problem, and the output layer should use a Softmax activation together with cross-entropy loss.
50%UnverifiedThe second model's architecture is expanded to 784→40→40→10, MSE is replaced with cross-entropy, softmax is added to the output layer, the optimizer remains plain gradient descent, and the accuracy is about 96% after 2000 epochs.
50%UnverifiedWhen cross-entropy loss is combined with Softmax, the output layer gradient takes the form ∂L/∂z = ŷ - y, which avoids the vanishing gradient problem of MSE when the output layer is saturated.
50%UnverifiedFor multi-class tasks like MNIST, cross-entropy combined with a softmax output layer provides a smooth loss surface with good gradients.
50%UnverifiedThe minimum mathematical knowledge needed to train an MNIST model includes understanding vector and matrix multiplication, derivatives and the chain rule, the concept of loss functions, and an intuitive understanding of gradient descent.
50%UnverifiedIn language model training, minimizing cross-entropy and maximizing likelihood are two ways of saying the same thing, and CrossEntropyLoss in PyTorch directly computes the negative log-likelihood.
50%UnverifiedSFT is an alignment method that updates model parameters using paired inputs and outputs and a cross-entropy loss, without relying on a reward model or preference comparisons.
50%UnverifiedThe joint training of this method uses only cross-entropy loss, simultaneously accounting for both accuracy and calibration quality, at the cost of introducing only one additional hyperparameter: the calibrator learning rate.
50%