Skip to content

    Cross-Entropy Loss

    AI fundamentals & modelsCross entropy loss functionCross entropy
    Editorially reviewed on: 1 source
    Your reading view

    The short answer · 13 words

    In short

    Loss function that compares predicted class distributions to target classes or target distributions.

    Flow-alerta.cab (2026): Cross-Entropy Loss. https://flow-alerta.cab/en/glossar/cross-entropy-loss. Editorially reviewed on: 09 October 2026.

    How much detail would you like?

    Practical

    Relevant for training classifiers and predicting tokens.

    Example scenario: A ticket model learns concern classes based on labeled examples with cross-entropy loss.

    Ensure label definition and data quality; additionally evaluate confusion matrix, recall and technical error costs on independent data.

    At a glance

    Core
    For a unique target class, cross entropy penalises a low predicted probability for that class. For multiclass classification, PyTorch CrossEntropyLoss expects unnormalized logits and processes the necessary normalization internally. Training loss and practical classification quality are different sizes.
    Use
    Relevant for training classifiers and predicting tokens.
    Example
    Example scenario: A ticket model learns concern classes based on labeled examples with cross-entropy loss.
    Limits
    Double-apply Softmax before PyTorch CrossEntropyLoss; false label types or shapes; ignore class imbalance and data errors.

    In context

    Questions about this term

    Is smaller loss always higher accuracy?

    No.

    Are logits probabilities?

    No.

    Does each classification need the same loss variant?

    No.

    All details and background

    For a unique target class, cross entropy penalises a low predicted probability for that class. For multiclass classification, PyTorch CrossEntropyLoss expects unnormalized logits and processes the necessary normalization internally. Training loss and practical classification quality are different sizes.

    ELI5 – Explained simply

    A self-confident wrong answer gets a stronger correction than a suitable prediction.

    Why it matters in practice

    Relevant for training classifiers and predicting tokens.

    Example

    Example scenario: A ticket model learns concern classes based on labeled examples with cross-entropy loss.

    Pitfalls and limits

    • Double-apply Softmax before PyTorch CrossEntropyLoss; false label types or shapes; ignore class imbalance and data errors.

    Origin & history

    Based on concepts of information theory and became a standard loss function in training probabilistic classifiers.

    Use in mid-sized companies

    • Ensure label definition and data quality; additionally evaluate confusion matrix, recall and technical error costs on independent data.

    Related terms

    • Softmax
    • Logits
    • Negative log likelihood
    • Classification
    • Label smoothing
    • Accuracy

    Matching Flow-alerta service

    TrainingAI consulting – harmonize training goals and technically relevant model metrics.

    Matching tool / use case

    View use casesTool: PyTorch CrossEntropyLoss; Use Case: Training of a ticket classifier.

    Sources

    Quellenprüfung: 09.10.2026. Definition und dokumentierte Einordnung abgeglichen; Beispiele beschreiben mögliche Anwendungen.

    Editorially reviewed on:

    Next step

    Put knowledge into practice