Log loss is a logarithmic evaluation metric that quantifies the accuracy of a probabilistic classifier by heavily penalizing confident but incorrect predictions. It measures the divergence between the predicted probability distribution and the true binary label, making it the standard loss function for training CTR prediction models.
Glossary
Log Loss

What is Log Loss?
Log loss, synonymous with binary cross-entropy, is the standard evaluation metric and loss function for probabilistic classifiers, particularly in click-through rate (CTR) prediction.
Unlike accuracy, log loss accounts for prediction confidence. A model predicting a 99% chance of a click that does not occur incurs a far higher penalty than one predicting a 51% chance. Minimizing log loss during training with optimizers like Adam directly calibrates a model's predicted probabilities to match empirical click frequencies.
Key Characteristics of Log Loss
Log Loss, also known as binary cross-entropy, is the standard loss function for training probabilistic classifiers. It quantifies the divergence between predicted probabilities and true binary labels, heavily penalizing confident misclassifications.
Mathematical Definition
Log Loss calculates the negative log-likelihood of the true labels given the predictions. For binary classification, the formula is:
- Formula:
-(y * log(p) + (1 - y) * log(1 - p)) - y: The true binary label (0 or 1).
- p: The model's predicted probability for the positive class (between 0 and 1).
- Perfect Model: A perfect model predicting the correct class with 100% certainty has a Log Loss of 0.
Penalizing Confidence and Error
The logarithmic nature of the metric creates an asymmetric penalty curve. It imposes a massive penalty for being both confident and wrong.
- Confident & Wrong: Predicting a 99% probability for a negative outcome results in a loss approaching infinity.
- Uncertain & Wrong: Predicting a 50% probability for a negative outcome results in a finite, manageable loss of ~0.693.
- Confident & Right: Predicting a 99% probability for a positive outcome results in a negligible loss of ~0.01.
Differentiation from Accuracy
Unlike accuracy, which only considers the final class decision, Log Loss evaluates the quality of the probability estimates themselves.
- Calibration Sensitivity: Two models with 90% accuracy can have vastly different Log Loss values if one is poorly calibrated (e.g., predicting 51% vs 99% for correct answers).
- Ranking Quality: A lower Log Loss directly correlates with a better ability to rank positive instances above negative ones, making it ideal for CTR prediction where ranking is paramount.
Role as a Training Objective
Log Loss serves as the primary objective function minimized during the training of deep CTR models. Optimization algorithms like Adam iteratively adjust model weights to reduce this loss.
- Gradient Signal: The steep gradient for confident errors provides a strong learning signal to correct the model's most egregious mistakes.
- Probabilistic Output: Minimizing Log Loss naturally pushes the final layer's sigmoid activation to output well-calibrated probabilities, which are essential for downstream tasks like Real-Time Bidding (RTB).
Relationship to Binary Cross-Entropy
Log Loss and Binary Cross-Entropy are mathematically identical terms used interchangeably in machine learning.
- Information Theory: Cross-entropy measures the average number of bits needed to identify an event from a set of possibilities, using an imperfect coding scheme (the model's predictions) instead of the true distribution.
- Synonym: In deep learning frameworks like TensorFlow and PyTorch, the
BinaryCrossentropyloss function implements the Log Loss calculation.
Interpretation and Benchmarking
A model's Log Loss must be compared against a naive baseline to be meaningful.
- Baseline Model: A model that always predicts the base rate (e.g., 10% CTR) serves as a minimum performance bar.
- Lower is Better: A Log Loss of 0.4 is better than 0.6. The value is unbounded on the upper end for extremely poor predictions.
- Monitoring: Tracking Log Loss on a live validation set is critical for detecting covariate shift or train-serving skew that silently degrades model calibration in production.
Log Loss vs. Other Evaluation Metrics
A comparison of log loss with other common evaluation metrics for binary classification and CTR prediction models.
| Feature | Log Loss | AUC | Accuracy |
|---|---|---|---|
What it measures | Calibration of predicted probabilities | Ranking quality (discrimination) | Overall correct predictions |
Penalizes confident errors | |||
Threshold-independent | |||
Sensitive to class imbalance | |||
Primary use case | Model training loss function | Model selection and evaluation | Business reporting |
Differentiable for gradient descent | |||
Typical value range | 0 to ∞ (lower is better) | 0.5 to 1.0 (higher is better) | 0% to 100% (higher is better) |
Interpretability for non-technical stakeholders | Low | Medium | High |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about log loss, the standard loss function for training and evaluating probabilistic classifiers in click-through rate prediction.
Log loss, also known as binary cross-entropy or logistic loss, is a logarithmic evaluation metric that quantifies the accuracy of a probabilistic classifier by measuring the divergence between predicted probabilities and actual binary labels. It works by calculating the negative log-likelihood of the true class given the model's predicted probability. For a binary classification problem, the formula is: - (y * log(p) + (1 - y) * log(1 - p)), where y is the true label (0 or 1) and p is the predicted probability of the positive class. The logarithmic penalty is asymmetric: a confident but incorrect prediction (e.g., predicting 0.99 when the true label is 0) incurs an exponentially large penalty, while a correct confident prediction yields a loss approaching zero. This property makes log loss the standard objective function for training CTR prediction models, as it forces the model to be well-calibrated rather than merely accurate in classification.
Related Terms
Mastering log loss requires understanding the broader ecosystem of evaluation metrics, optimization functions, and calibration techniques that govern probabilistic classification in CTR prediction.
Binary Cross-Entropy
A loss function synonymous with log loss for binary classification tasks. It measures the difference between two probability distributions—the predicted click probability and the true binary label. Mathematically identical to log loss, the term 'cross-entropy' is more common in deep learning frameworks like TensorFlow and PyTorch. It drives the optimization of CTR models by heavily penalizing confident misclassifications, making it the default choice for training neural networks on click prediction tasks.
Area Under the ROC Curve (AUC)
A threshold-independent evaluation metric that measures a binary classifier's ability to rank a randomly chosen positive instance higher than a randomly chosen negative one. Unlike log loss, AUC does not evaluate the calibration of predicted probabilities—a model can have perfect AUC while producing wildly miscalibrated probabilities. CTR teams use AUC alongside log loss: AUC assesses ranking quality, while log loss ensures probability estimates are trustworthy for downstream bidding and pricing decisions.
Calibration
The process of aligning a model's predicted probability with the true empirical frequency of the event. A well-calibrated model predicting a 5% CTR should see clicks approximately 5% of the time. Log loss is a proper scoring rule, meaning it is minimized when predicted probabilities match true probabilities—directly incentivizing calibration. Poor calibration manifests as overconfident or underconfident predictions, which log loss penalizes through its logarithmic penalty structure.
Overfitting
A modeling error where an algorithm learns noise and random fluctuations in training data rather than the underlying signal. In CTR prediction, overfitting manifests as extremely low log loss on training data but high log loss on validation data. The logarithmic penalty amplifies this gap—a model that assigns near-zero probability to a true positive event receives an explosively large loss value, making log loss a sensitive detector of overconfident, overfit predictions on unseen data.
Covariate Shift
A specific type of data distribution change where the input feature distribution differs between training and serving environments, even if the relationship between features and labels remains constant. Covariate shift causes log loss to degrade silently in production—the model's probability estimates become miscalibrated as user behavior patterns drift. Monitoring production log loss against a baseline is a critical observability practice for detecting when retraining is required.
Multi-Task Learning (MTL)
An inductive transfer learning paradigm where a single model is trained simultaneously on multiple related objectives, such as predicting both click-through and conversion rates. In MTL architectures, log loss often serves as the loss function for the CTR head while other objectives use different losses. The weighted sum of log loss components across tasks requires careful tuning—imbalanced weighting can cause one task's log loss to dominate gradient updates, degrading overall performance.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us