Loss Function
A loss function assigns a numerical cost to a prediction, decision, or action after an outcome is observed. Under the usual minimization convention, smaller values represent decisions that are preferable for the modeled task. In statistical learning, a per-example loss is combined with a data distribution or a sample to form a risk, and a training objective function may add penalties or constraints. These terms are often used loosely, but they are not interchangeable in every source or software library.[1][2][3][4]
The loss specifies what errors matter to the learning procedure. It does not by itself specify the data distribution, model class, optimization algorithm, or evaluation protocol. Consequently, a model can attain a low training objective without attaining low deployment risk, and the numerical minimum need not be zero.[2][3][4]
Formal definition
Let be an outcome space, an action or prediction space, and
a possibly extended-real loss function. Finite-valued losses are common, while assigning can represent an impossible report or a violated hard requirement. If a predictor maps an input to an action , its population risk under a joint distribution is, whenever the expectation is defined,
A risk-minimizing predictor is defined relative to the distribution, action space, and loss. In decision theory, when the infimum is attained, a Bayes action at an observed input minimizes conditional risk:
The set notation is deliberate: a loss can have more than one minimizing action.[1][2]
For observations with , empirical risk minimization replaces the population expectation with a sample average:
The sample need not be independent and identically distributed in every application, but the interpretation and statistical guarantees then depend on the sampling process. In the standard independent setting, empirical risk is a sample estimate of population risk.[3][4]
Loss, risk, objective, and metric
Authors and libraries do not enforce a universal vocabulary. The following distinctions are useful, provided that a particular paper or implementation may use different names.[3][4][5]
| Quantity | Typical meaning | Important qualification |
|---|---|---|
| Per-example loss | for one observed case | A structured example can itself contain many tokens, pixels, or time steps. |
| Population risk | Expected loss under a specified distribution | It is generally unknown and must be estimated or bounded. |
| Empirical risk | An aggregate of losses on an observed sample | The aggregate may be a mean, sum, weighted mean, or another documented reduction. |
| Training objective | The quantity passed to an optimizer | It can include empirical loss, regularization, auxiliary terms, or constraints. It may also be written as a maximization problem. |
| Evaluation metric | A reported measure used to compare systems | It can be discontinuous or nondifferentiable and need not equal the training loss. |
Under a common minimization convention, a regularized objective has the form
where is a penalty and controls its contribution. In other conventions, an author may call a loss or cost. Negative log-likelihood is commonly minimized, while log-likelihood is maximized; the two encode the same fitted-model preference after a change of sign. Adding a constant or multiplying the complete objective by a positive constant preserves its exact minimizers, although it changes reported values and can change the behavior of a fixed-step optimization algorithm.[4][5][8]
An evaluation metric answers a reporting question, whereas a training loss supplies an optimization and statistical target. Accuracy, exact match, and other discrete metrics may have flat regions with respect to model parameters. A differentiable surrogate can therefore be optimized during training while the task metric is reported separately. Whether minimizing the surrogate is statistically aligned with the target decision rule is a calibration question, not a consequence of differentiability alone.[6][7][9]
What different losses estimate
Changing a loss can change the population quantity selected by risk minimization. For a real-valued outcome and a prediction :
- Squared-error risk is minimized by a conditional mean when that mean and the relevant second moment exist.
- Absolute-error risk is minimized by a conditional median; the minimizer need not be unique when the distribution has a flat median interval.
- Pinball loss at level is minimized by a conditional -quantile, again with possible non-uniqueness.
- Strictly proper probabilistic losses are minimized, in expectation, by reporting the true probability distribution, subject to the stated domain and integrability conditions.[5][6][10][11]
These are population statements. Finite-sample estimates can differ because of sampling variation, model misspecification, optimization error, regularization, or constraints on the predictor.[2][3][5]
Transformations and likelihood constants
Loss values have a scale and, often, physical or informational units. Squared error has squared units of the target, absolute error has the target's units, and a natural-log likelihood is measured in nats. Comparing raw values across different loss definitions is therefore generally meaningless. A zero value is not required: negative-valued losses and losses with positive irreducible minima can define valid decision problems, provided that the associated risk and optimization problem are well posed.[2][5]
A positive affine transformation of every per-example loss,
preserves expected-risk minimizers when is constant with respect to both the action and outcome. An arbitrary increasing nonlinear transformation does not generally preserve them because expectation and nonlinear transformation do not commute. Applying an increasing transformation to one already-aggregated finite-sample objective preserves its exact ordering, but can alter gradients, curvature, stochastic decomposition, and optimizer behavior. It should not be presented as the same training loss without qualification.[2][5][8]
Negative log-likelihood illustrates why parameter-dependent terms cannot be discarded casually. For a Gaussian observation with predicted mean and standard deviation , the per-observation negative log-likelihood is
If is a fixed constant, minimizing this expression over is equivalent to minimizing squared error. If is learned or varies with the input, both the log-scale term and the division by affect the optimum. Only terms independent of every optimized parameter may be removed without changing maximum-likelihood estimates.[5]
Point-prediction examples
Let the residual be . Common scalar regression losses include:
| Loss | Per-example form | Population target or behavior |
|---|---|---|
| Squared loss | Targets a conditional mean and increases quadratically with residual magnitude. | |
| L1 loss | Targets a conditional median and increases linearly with residual magnitude. | |
| Huber loss | Quadratic near zero and linear in the tails | Limits the influence of large residuals relative to squared loss; its scale parameter must be specified. |
| Pinball loss | Targets a conditional -quantile for . |
The empirical mean of squared losses is often called mean squared error, while a sum is often called a residual sum of squares. Those reductions have the same unregularized minimizers when the sample size is fixed, but not the same numerical scale. Under an independent Gaussian observation model with fixed variance, minimizing the summed squared residuals is equivalent to maximizing the likelihood with respect to the location parameters. This likelihood interpretation depends on the model assumptions; it is not a general proof that squared loss is appropriate for every regression problem.[4][5]
Huber's 1964 robust-estimation analysis introduced a loss whose derivative is clipped outside a central region. One widely used parameterization is
This function is convex and continuously differentiable, but its second derivative changes at . Different libraries can scale or name related piecewise losses differently, so and the exact formula belong in a reproducible specification.[10]
Koenker and Bassett's regression-quantile formulation uses asymmetric absolute penalties. For , pinball loss is proportional to absolute loss; for other values of , underprediction and overprediction receive different slopes. Fitting several quantiles can describe parts of a conditional distribution, but separately fitted quantiles can cross unless the model or fitting method imposes additional structure.[11]
Classification and probabilistic prediction
For binary labels and a real-valued score , zero-one loss is
up to a chosen convention at zero. Direct empirical minimization of zero-one loss is difficult for many model classes, and the loss supplies no graded penalty once the predicted side of the boundary is fixed. Convex surrogate losses such as logistic and hinge loss are therefore used in many classification procedures. Convexity alone is not enough for alignment with classification error; classification calibration supplies the relevant population condition.[3][7][9]
The binary logistic loss is
and the binary hinge loss is
Hinge loss is convex but not differentiable at . Its subgradient is sufficient for standard convex optimization methods, and the support-vector-machine objective combines hinge-type empirical loss with a norm penalty. Squaring the positive hinge term produces squared hinge loss, which changes both its sensitivity to margin violations and its optimization properties.[3][13]
For a categorical target distribution and a reported distribution over classes, cross-entropy loss is
When is fixed,
provided the expressions are defined. Thus minimizing cross-entropy over is equivalent to minimizing the forward Kullback-Leibler divergence from to . If is one-hot, the per-example expression becomes the negative log probability assigned to the observed class. The logarithm base changes the scale but not the minimizer.[5][12]
Kullback-Leibler divergence is asymmetric. In the discrete case,
and it is infinite if for a class with . The order of the distributions must therefore be stated; the phrase "KL loss" is incomplete without that direction and the way the distributions are obtained.[5][12]
Log loss and the Brier score are strictly proper scoring rules on their usual probability domains. After adopting a loss orientation, reporting the true distribution uniquely minimizes expected loss. Properness is a population incentive property. It does not guarantee that a finite model is calibrated after misspecified training, distribution shift, regularization, or incomplete optimization.[6]
Focal loss modifies the log loss for a class with assigned probability :
Lin and colleagues introduced it for dense object detection, where many easy background examples overwhelmed training. For , the modulating factor reduces the contribution of well-classified examples; for , the expression reduces to an alpha-weighted log loss. The focusing parameter and any class weights are part of the loss definition and should be reported.[14]
Class weighting, resampling, and threshold selection solve different problems. Weighting a class inside the training loss changes the empirical objective and, unless it corrects a known sampling scheme, can change the population quantity being estimated. A decision threshold can instead encode downstream error costs after a probability model has been fitted. The appropriate choice depends on whether the goal is probability estimation, ranking, a particular operating point, or a specified cost-sensitive decision.[2][6][7]
Representation and structured-output losses
Losses for embeddings compare pairs, triplets, or larger collections rather than a single scalar target. Hadsell, Chopra, and LeCun used a contrastive loss with one label convention in which denotes a similar pair:
where is the learned distance and is a margin. Reversing the label convention without changing the formula reverses its meaning, so the convention must be recorded.[15]
FaceNet trained embeddings with triplets consisting of an anchor , a positive , and a negative . Its hinge-style term can be written
The loss depends on triplet selection as well as its formula. FaceNet describes online selection of informative triplets because many already-satisfied triplets contribute zero.[16]
Contrastive Predictive Coding introduced InfoNCE to distinguish a positive sample from candidates. A common one-positive form is
where the score function , temperature , candidate construction, and number of negatives affect the objective. SimCLR uses a related temperature-scaled cross-entropy objective over augmented views. "InfoNCE loss" therefore identifies a family only after the positive-pair, negative-pool, similarity, normalization, and reduction conventions are specified.[17][18]
Connectionist Temporal Classification defines the conditional probability of an output label sequence by summing probabilities over alignment paths that collapse to that sequence, including paths containing a blank symbol. The CTC loss is the negative log of that summed probability. Its assumptions include a particular conditional independence factorization across output time steps given the input representation; CTC does not supply an arbitrary sequence-to-sequence alignment model.[19]
For segmentation, Milletari and colleagues optimized a differentiable objective derived from the Dice overlap coefficient in V-Net. For predicted voxel values and binary ground-truth values , their coefficient is
Maximizing is equivalent to minimizing or . A formula whose denominator is instead is a different soft-overlap variant, not V-Net's displayed equation. Smoothing constants, per-class aggregation, and batch aggregation are further implementation choices. An experiment should state the exact variant instead of treating "Dice loss" as one fixed formula.[20]
Generative-model objectives
Variational autoencoders optimize a variational lower bound on log evidence. Under a minimization convention, the negative evidence lower bound is commonly expressed as
The first term is determined by the observation likelihood, not by a universal "reconstruction loss"; for example, Gaussian and Bernoulli likelihood models imply different negative log-likelihood terms. Weighting the KL term changes the objective from the original evidence lower bound unless that weighting follows from another stated model or criterion.[21]
In the original Wasserstein GAN, the critic is trained to maximize
over an approximation to 1-Lipschitz functions. If software minimizes a critic loss, the sign of this expression must be reversed. The generator minimizes
The original algorithm enforced the Lipschitz restriction by clipping critic weights. WGAN-GP instead penalized deviations of the input-gradient norm from one on sampled interpolation points. These objectives are related but not interchangeable, and a generic Wasserstein loss label does not specify the constraint mechanism or coefficient.[22][23]
Regularization and composite objectives
A penalty is part of the training objective but is not necessarily a prediction loss. Two common forms are
The parameter subset, normalization, and coefficient matter. Biases, normalization parameters, or embeddings may be excluded in some implementations. Comparing only a reported data-loss value can therefore conceal a difference in the actual optimized objective.[4]
L2 penalization and weight decay are equivalent under particular update rules, but not under all optimizers. Loshchilov and Hutter showed that adding an L2 term to the loss is not equivalent to decoupled weight decay for adaptive methods such as Adam; AdamW applies the decay separately from the gradient-based parameter update. Calling every L2 penalty "weight decay" can therefore misdescribe the algorithm.[24]
Multi-task learning often forms a weighted sum
The weights encode tradeoffs and interact with the scales, noise, and gradients of the task losses. A single weighted sum identifies one scalarization of a multi-objective problem, not a neutral combination of tasks. Sener and Koltun formulate multi-task learning explicitly as multi-objective optimization and show why a Pareto-oriented treatment can differ from fixed scalar weights.[25]
Constraints can also define the objective. A constrained problem may be addressed through a Lagrangian, penalty, barrier, projection, or specialized solver. A finite penalty coefficient generally does not make a constrained and unconstrained problem identical without further conditions. The chosen formulation and constraint tolerances are therefore part of the learning specification.[8]
Optimization properties
Differentiability is convenient, not a universal requirement for a loss function. Hinge and absolute losses are nonsmooth at particular points, yet subgradient, proximal, coordinate, and other methods can optimize objectives containing them. Conversely, a smooth loss does not guarantee easy optimization after composition with a nonlinear model.[3][8]
Convexity must be assessed for the complete objective as a function of the optimized variables. Squared loss composed with a linear predictor yields a convex empirical-risk term, but the same loss composed with a neural network usually does not. A convex objective can have multiple global minimizers; strict or strong convexity, together with domain conditions, supplies stronger uniqueness statements. Gradient-descent convergence also requires assumptions about such matters as smoothness, step size, and existence of a solution. Convexity alone does not imply that an arbitrary gradient-descent run reaches a unique best point.[3][8]
The numerical value of a loss is not meaningful without its reduction. A library may return an unreduced tensor, a sum, a mean over examples, or a mean over non-masked elements. TensorFlow's base Keras loss documents several reductions, with sum_over_batch_size as its default. PyTorch's cross-entropy interface documents none, mean, and sum, and its weighted mean uses a denominator determined by applicable target weights rather than simply the batch size.[26][27]
Probability losses should normally be implemented from logits with stable fused operations when the framework supplies them. PyTorch's cross-entropy combines log-softmax with negative log-likelihood semantics, while its logsumexp operation uses numerical stabilization. Computing softmax probabilities and then taking their logarithm can overflow or underflow sooner, and applying softmax before an interface that already expects logits changes the computation.[26][28]
For variable-length or partially labeled data, masking and normalization jointly define the optimized quantity. Averaging each sequence and then averaging sequences gives every sequence equal weight; averaging all valid tokens gives longer sequences more weight. Neither reduction is universally correct. The choice should match the intended statistical unit and be held constant when training and validation losses are compared.[4][27]
Selecting a loss
Loss selection begins with the decision or distributional quantity to be estimated, not with a universal default:
| Goal | Candidate loss | Question to settle before use |
|---|---|---|
| Conditional mean of a real outcome | Squared loss | Are quadratic error costs and sensitivity to large residuals appropriate? |
| Conditional median | Absolute loss | Is a median the required action, and how will non-unique medians be handled? |
| Conditional quantile | Pinball loss | Which quantile levels and crossing constraints are required? |
| Class probabilities | Log loss or another strictly proper scoring rule | Are probabilities evaluated on the same population, and will weighting alter the target? |
| Binary decisions | A calibrated surrogate plus a decision rule | What are the error costs, prevalence, and threshold protocol? |
| Margin-based classifier | Hinge-type loss | Is a margin score, rather than a probability report, the desired object? |
| Embedding geometry | Pair, triplet, or contrastive objective | How are positives, negatives, margins, and batches constructed? |
| Structured output | A likelihood, marginal likelihood, or task-specific surrogate | Which alignments, factorizations, masks, or relaxations are assumed? |
No loss can compensate for a target that does not represent the intended task. Label errors, selective observation, distribution shift, and proxy targets can all make exact optimization of the stated objective undesirable for deployment. Validation should therefore measure the downstream quantities of interest and examine relevant subgroups, not only reproduce the training reduction.[2][4][6]
If an application has asymmetric real-world consequences, the asymmetry should be derived from a documented decision model when possible. A class weight chosen only to equalize counts is not automatically the same as an error-cost ratio. Likewise, optimizing a threshold-dependent metric indirectly through a surrogate requires checking the resulting operating point on data reserved for that purpose.[2][6][7]
Interpreting loss curves
A loss curve is a record of a specified loss reduction over optimization steps, epochs, or elapsed computation. The training loss, validation loss, and test loss have different roles. Training loss affects parameter updates; validation results can affect model selection or stopping; a test set is intended for final evaluation under a fixed protocol.[3][4]
Curve shapes are evidence, not deterministic diagnoses. Falling training loss alongside rising validation loss is compatible with overfitting, but can also reflect a mismatch in preprocessing, augmentation, regularization terms, or reductions. A plateau can arise from a small gradient, an unsuitable learning rate, saturation, limited model capacity, noisy estimates, or a genuine optimum. Oscillation can reflect stochastic batches as well as an excessive step size. The curve alone does not identify which explanation is correct.[4]
Before comparing curves, check that both axes and both loss definitions match. Useful diagnostics include the unreduced distribution of example losses, the number of valid elements in each reduction, the data split, gradient norms, finite-value checks, a simple baseline, and a small-data test in which the model is expected to fit. A train-validation gap is interpretable only when the two reported quantities differ solely in intended ways.[4][26][27]
A loss surface is the objective viewed as a function of parameters. Visual or local geometric descriptions can help study an optimizer, but parameter symmetries and reparameterizations can change apparent curvature without changing the represented predictor. Claims that one solution is "flat" or "sharp" therefore require a specified parameterization and measurement.[4][8]
Preference-learning objectives
InstructGPT used several distinct objectives: supervised next-token log loss, a reward model trained from ranked human comparisons, and reinforcement-learning fine-tuning that maximized the learned reward while penalizing divergence from a reference policy. Calling the entire procedure one "RLHF loss" hides the separate datasets, models, and coefficients used in its stages.[29]
Direct Preference Optimization derives a policy objective from a particular KL-regularized reward-maximization model. For prompt , preferred response , rejected response , policy , reference policy , and coefficient , its empirical term is
DPO trains the policy directly from preference pairs without fitting a separate explicit reward model in that training procedure. The reference policy, preference-data construction, coefficient, sequence log-probability convention, and any extra supervised term remain material parts of an implementation.[30]
Reproducibility checklist
A complete loss specification should record:
- the exact per-example or per-structure formula, including sign conventions;
- label encoding, units, masks, smoothing constants, margins, temperatures, and clipping;
- the reduction and its denominator;
- class, sample, token, or task weights and how they were obtained;
- every regularization, auxiliary, and constraint term;
- whether the implementation consumes logits, probabilities, scores, or distances;
- the optimization direction and framework version;
- which quantity is reported for training, validation, model selection, and final evaluation.
Without these details, two systems described as using the same named loss can optimize different objectives.[4][14][20][24][26][27]
See also
References
- ^Wald, A. (1950). *Statistical Decision Functions*. John Wiley & Sons. WorldCat record
- ^Berger, J. O. (1985). *Statistical Decision Theory and Bayesian Analysis*, 2nd ed. Springer. doi.org/...978-1-4757-4286-2
- ^Shalev-Shwartz, S., & Ben-David, S. (2014). *Understanding Machine Learning: From Theory to Algorithms*. Cambridge University Press. Author-hosted PDF
- ^Goodfellow, I., Bengio, Y., & Courville, A. (2016). *Deep Learning*. MIT Press. deeplearningbook.org
- ^Murphy, K. P. (2022). *Probabilistic Machine Learning: An Introduction*. MIT Press. probml.github.io/...book1
- ^Gneiting, T., & Raftery, A. E. (2007). "Strictly Proper Scoring Rules, Prediction, and Estimation." *Journal of the American Statistical Association*, 102(477), 359-378. doi.org/...016214506000001437
- ^Bartlett, P. L., Jordan, M. I., & McAuliffe, J. D. (2006). "Convexity, Classification, and Risk Bounds." *Journal of the American Statistical Association*, 101(473), 138-156. doi.org/...016214505000000907
- ^Boyd, S., & Vandenberghe, L. (2004). *Convex Optimization*. Cambridge University Press. Author site
- ^Reid, M. D., & Williamson, R. C. (2010). "Composite Binary Losses." *Journal of Machine Learning Research*, 11, 2387-2422. jmlr.org/...reid10a
- ^Huber, P. J. (1964). "Robust Estimation of a Location Parameter." *Annals of Mathematical Statistics*, 35(1), 73-101. doi.org/...1177703732
- ^Koenker, R., & Bassett, G., Jr. (1978). "Regression Quantiles." *Econometrica*, 46(1), 33-50. doi.org/...1913643
- ^Kullback, S., & Leibler, R. A. (1951). "On Information and Sufficiency." *Annals of Mathematical Statistics*, 22(1), 79-86. doi.org/...1177729694
- ^Cortes, C., & Vapnik, V. (1995). "Support-vector networks." *Machine Learning*, 20, 273-297. doi.org/...BF00994018
- ^Lin, T.-Y., Goyal, P., Girshick, R., He, K., & Dollar, P. (2017). "Focal Loss for Dense Object Detection." *Proceedings of the IEEE International Conference on Computer Vision*, 2980-2988. CVF Open Access
- ^Hadsell, R., Chopra, S., & LeCun, Y. (2006). "Dimensionality Reduction by Learning an Invariant Mapping." *Proceedings of the 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition*, 1735-1742. Author-hosted PDF
- ^Schroff, F., Kalenichenko, D., & Philbin, J. (2015). "FaceNet: A Unified Embedding for Face Recognition and Clustering." *Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition*, 815-823. CVF Open Access
- ^van den Oord, A., Li, Y., & Vinyals, O. (2018). "Representation Learning with Contrastive Predictive Coding." arXiv:1807.03748. arxiv.org/...1807.03748
- ^Chen, T., Kornblith, S., Norouzi, M., & Hinton, G. (2020). "A Simple Framework for Contrastive Learning of Visual Representations." *Proceedings of the 37th International Conference on Machine Learning*, 1597-1607. PMLR
- ^Graves, A., Fernandez, S., Gomez, F., & Schmidhuber, J. (2006). "Connectionist Temporal Classification: Labelling Unsegmented Sequence Data with Recurrent Neural Networks." *Proceedings of the 23rd International Conference on Machine Learning*, 369-376. doi.org/...1143844.1143891
- ^Milletari, F., Navab, N., & Ahmadi, S.-A. (2016). "V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation." *2016 Fourth International Conference on 3D Vision*, 565-571. arxiv.org/...1606.04797
- ^Kingma, D. P., & Welling, M. (2014). "Auto-Encoding Variational Bayes." *2nd International Conference on Learning Representations*. arxiv.org/...1312.6114
- ^Arjovsky, M., Chintala, S., & Bottou, L. (2017). "Wasserstein Generative Adversarial Networks." *Proceedings of the 34th International Conference on Machine Learning*, 214-223. PMLR
- ^Gulrajani, I., Ahmed, F., Arjovsky, M., Dumoulin, V., & Courville, A. (2017). "Improved Training of Wasserstein GANs." *Advances in Neural Information Processing Systems 30*. NeurIPS proceedings
- ^Loshchilov, I., & Hutter, F. (2019). "Decoupled Weight Decay Regularization." *7th International Conference on Learning Representations*. OpenReview
- ^Sener, O., & Koltun, V. (2018). "Multi-Task Learning as Multi-Objective Optimization." *Advances in Neural Information Processing Systems 31*. NeurIPS proceedings
- ^PyTorch. "CrossEntropyLoss." *PyTorch documentation*. docs.pytorch.org/...torch.nn.CrossEntropyLoss
- ^TensorFlow. "tf.keras.Loss." *TensorFlow API documentation*. tensorflow.org/...Loss
- ^PyTorch. "torch.logsumexp." *PyTorch documentation*. docs.pytorch.org/...torch.logsumexp
- ^Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C. L., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., Schulman, J., Hilton, J., Kelton, F., Miller, L., Simens, M., Askell, A., Welinder, P., Christiano, P., Leike, J., & Lowe, R. (2022). "Training language models to follow instructions with human feedback." *Advances in Neural Information Processing Systems 35*, 27730-27744. arxiv.org/...2203.02155
- ^Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C. D., & Finn, C. (2023). "Direct Preference Optimization: Your Language Model is Secretly a Reward Model." *Advances in Neural Information Processing Systems 36*. NeurIPS proceedings
Improve this article
Add missing citations, update stale details, or suggest a clearer explanation. Every suggestion is reviewed for sourcing before it goes live.
12 revisions · v13 · 4,383 words · full history
Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify
Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here
Reviewer note: Independent fact-check completed against 30 academic, primary, and official sources; all 96 citation calls, 30 references, 19 canonical internal links, 31 material claim groups, 95 rendered math regions, and four visually inspected PDF pages were separately reviewed.
Cite this page: AI Wiki. "Loss Function." aiwiki.ai, updated 29 Jul 2026, fact-checked 29 Jul 2026. CC BY 4.0. https://aiwiki.ai/wiki/loss_function