Loss Function

RawGraph

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 Y\mathcal{Y} be an outcome space, A\mathcal{A} an action or prediction space, and

:A×YR\ell:\mathcal{A}\times\mathcal{Y}\rightarrow\overline{\mathbb{R}}

a possibly extended-real loss function. Finite-valued losses are common, while assigning ++\infty can represent an impossible report or a violated hard requirement. If a predictor ff maps an input XX to an action f(X)f(X), its population risk under a joint distribution PP is, whenever the expectation is defined,

RP(f)=E(X,Y)P(f(X),Y).R_P(f)=\mathbb{E}_{(X,Y)\sim P}\ell\left(f(X),Y\right).

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 xx minimizes conditional risk:

aP(x)arg minaAEYP(X=x)(a,Y).a_P^\star(x)\in\operatorname*{arg\,min}_{a\in\mathcal{A}} \mathbb{E}_{Y\sim P(\,\cdot\mid X=x)}\ell(a,Y).

The set notation is deliberate: a loss can have more than one minimizing action.[1][2]

For observations zi=(xi,yi)z_i=(x_i,y_i) with i=1,,ni=1,\ldots,n, empirical risk minimization replaces the population expectation with a sample average:

R^n(f)=1ni=1n(f(xi),yi).\widehat R_n(f)=\frac{1}{n}\sum_{i=1}^{n}\ell\left(f(x_i),y_i\right).

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]

QuantityTypical meaningImportant qualification
Per-example loss(f(xi),yi)\ell\left(f(x_i),y_i\right) for one observed caseA structured example can itself contain many tokens, pixels, or time steps.
Population riskExpected loss under a specified distribution PPIt is generally unknown and must be estimated or bounded.
Empirical riskAn aggregate of losses on an observed sampleThe aggregate may be a mean, sum, weighted mean, or another documented reduction.
Training objectiveThe quantity passed to an optimizerIt can include empirical loss, regularization, auxiliary terms, or constraints. It may also be written as a maximization problem.
Evaluation metricA reported measure used to compare systemsIt can be discontinuous or nondifferentiable and need not equal the training loss.

Under a common minimization convention, a regularized objective has the form

J(θ)=R^n(fθ)+λΩ(θ),J(\theta)=\widehat R_n(f_\theta)+\lambda\Omega(\theta),

where Ω\Omega is a penalty and λ\lambda controls its contribution. In other conventions, an author may call JJ 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 aa:

  • 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 τ\tau is minimized by a conditional τ\tau-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,

(a,y)=c(a,y)+bwithc>0,\ell'(a,y)=c\ell(a,y)+b \qquad\text{with}\qquad c>0,

preserves expected-risk minimizers when bb 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 μ\mu and standard deviation σ>0\sigma>0, the per-observation negative log-likelihood is

(μ,σ;y)=12log(2πσ2)+(yμ)22σ2.\ell(\mu,\sigma;y)= \frac{1}{2}\log\left(2\pi\sigma^2\right) +\frac{(y-\mu)^2}{2\sigma^2}.

If σ\sigma is a fixed constant, minimizing this expression over μ\mu is equivalent to minimizing squared error. If σ\sigma is learned or varies with the input, both the log-scale term and the division by σ2\sigma^2 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 r=yar=y-a. Common scalar regression losses include:

LossPer-example formPopulation target or behavior
Squared loss(a,y)=r2\ell(a,y)=r^2Targets a conditional mean and increases quadratically with residual magnitude.
L1 loss(a,y)=r\ell(a,y)=\lvert r\rvertTargets a conditional median and increases linearly with residual magnitude.
Huber lossQuadratic near zero and linear in the tailsLimits the influence of large residuals relative to squared loss; its scale parameter must be specified.
Pinball lossτ(a,y)=max(τr,(τ1)r)\ell_\tau(a,y)=\max\left(\tau r,(\tau-1)r\right)Targets a conditional τ\tau-quantile for 0<τ<10<\tau<1.

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

δ(r)={12r2,rδ,δ(r12δ),r>δ.\ell_\delta(r)= \begin{cases} \frac{1}{2}r^2, & \lvert r\rvert\leq\delta,\\ \delta\left(\lvert r\rvert-\frac{1}{2}\delta\right), & \lvert r\rvert>\delta. \end{cases}

This function is convex and continuously differentiable, but its second derivative changes at r=δ\lvert r\rvert=\delta. Different libraries can scale or name related piecewise losses differently, so δ\delta and the exact formula belong in a reproducible specification.[10]

Koenker and Bassett's regression-quantile formulation uses asymmetric absolute penalties. For τ=0.5\tau=0.5, pinball loss is proportional to absolute loss; for other values of τ\tau, 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 y{1,+1}y\in\{-1,+1\} and a real-valued score ss, zero-one loss is

01(s,y)=1(ys0),\ell_{01}(s,y)=\mathbb{1}\left(ys\leq 0\right),

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

log(s,y)=log(1+exp(ys)),\ell_{\log}(s,y)=\log\left(1+\exp(-ys)\right),

and the binary hinge loss is

hinge(s,y)=max(0,1ys).\ell_{\mathrm{hinge}}(s,y)=\max(0,1-ys).

Hinge loss is convex but not differentiable at ys=1ys=1. 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 pp and a reported distribution qq over classes, cross-entropy loss is

H(p,q)=kpklogqk.H(p,q)=-\sum_{k}p_k\log q_k.

When pp is fixed,

H(p,q)=H(p)+DKL(pq),H(p,q)=H(p)+D_{\mathrm{KL}}(p\parallel q),

provided the expressions are defined. Thus minimizing cross-entropy over qq is equivalent to minimizing the forward Kullback-Leibler divergence from pp to qq. If pp 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,

DKL(pq)=kpklogpkqk,D_{\mathrm{KL}}(p\parallel q)=\sum_k p_k\log\frac{p_k}{q_k},

and it is infinite if qk=0q_k=0 for a class with pk>0p_k>0. 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 ptp_t:

focal=αt(1pt)γlogpt.\ell_{\mathrm{focal}}=-\alpha_t(1-p_t)^\gamma\log p_t.

Lin and colleagues introduced it for dense object detection, where many easy background examples overwhelmed training. For γ>0\gamma>0, the modulating factor reduces the contribution of well-classified examples; for γ=0\gamma=0, 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 Y=0Y=0 denotes a similar pair:

=12(1Y)D2+12Ymax(0,mD)2,\ell=\frac{1}{2}(1-Y)D^2+ \frac{1}{2}Y\max(0,m-D)^2,

where DD is the learned distance and mm 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 aa, a positive pp, and a negative nn. Its hinge-style term can be written

=max(0,f(a)f(p)22f(a)f(n)22+α).\ell=\max\left(0, \left\lVert f(a)-f(p)\right\rVert_2^2 -\left\lVert f(a)-f(n)\right\rVert_2^2+\alpha \right).

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

NCE=logexp(s(q,k+)/τ)exp(s(q,k+)/τ)+j=1Kexp(s(q,kj)/τ),\ell_{\mathrm{NCE}}= -\log \frac{\exp\left(s(q,k^+)/\tau\right)} {\exp\left(s(q,k^+)/\tau\right)+ \sum_{j=1}^{K}\exp\left(s(q,k_j^-)/\tau\right)},

where the score function ss, temperature τ\tau, 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 pip_i and binary ground-truth values gig_i, their coefficient is

D=2ipigiipi2+igi2.D=\frac{2\sum_i p_i g_i} {\sum_i p_i^2+\sum_i g_i^2}.

Maximizing DD is equivalent to minimizing D-D or 1D1-D. A formula whose denominator is instead ipi+igi\sum_i p_i+\sum_i g_i 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

LVAE=Ezqϕ(zx)logpθ(xz)+DKL(qϕ(zx)p(z)).\mathcal{L}_{\mathrm{VAE}}= -\mathbb{E}_{z\sim q_\phi(z\mid x)} \log p_\theta(x\mid z) +D_{\mathrm{KL}}\left(q_\phi(z\mid x)\parallel p(z)\right).

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

ExPrf(x)EzPzf(gθ(z))\mathbb{E}_{x\sim P_r}f(x)- \mathbb{E}_{z\sim P_z}f\left(g_\theta(z)\right)

over an approximation to 1-Lipschitz functions. If software minimizes a critic loss, the sign of this expression must be reversed. The generator minimizes

EzPzf(gθ(z)).-\mathbb{E}_{z\sim P_z}f\left(g_\theta(z)\right).

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

Ω1(θ)=jθjandΩ2(θ)=jθj2.\Omega_1(\theta)=\sum_j\lvert\theta_j\rvert \qquad\text{and}\qquad \Omega_2(\theta)=\sum_j\theta_j^2.

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

J(θ)=t=1TλtLt(θ).J(\theta)=\sum_{t=1}^{T}\lambda_t L_t(\theta).

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:

GoalCandidate lossQuestion to settle before use
Conditional mean of a real outcomeSquared lossAre quadratic error costs and sensitivity to large residuals appropriate?
Conditional medianAbsolute lossIs a median the required action, and how will non-unique medians be handled?
Conditional quantilePinball lossWhich quantile levels and crossing constraints are required?
Class probabilitiesLog loss or another strictly proper scoring ruleAre probabilities evaluated on the same population, and will weighting alter the target?
Binary decisionsA calibrated surrogate plus a decision ruleWhat are the error costs, prevalence, and threshold protocol?
Margin-based classifierHinge-type lossIs a margin score, rather than a probability report, the desired object?
Embedding geometryPair, triplet, or contrastive objectiveHow are positives, negatives, margins, and batches constructed?
Structured outputA likelihood, marginal likelihood, or task-specific surrogateWhich 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 xx, preferred response ywy_w, rejected response yly_l, policy πθ\pi_\theta, reference policy πref\pi_{\mathrm{ref}}, and coefficient β\beta, its empirical term is

LDPO(θ)=E(x,yw,yl)Dlogσ(βlogπθ(ywx)πref(ywx)βlogπθ(ylx)πref(ylx)).\mathcal{L}_{\mathrm{DPO}}(\theta)= -\mathbb{E}_{(x,y_w,y_l)\sim\mathcal{D}} \log\sigma\left( \beta\log\frac{\pi_\theta(y_w\mid x)} {\pi_{\mathrm{ref}}(y_w\mid x)} -\beta\log\frac{\pi_\theta(y_l\mid x)} {\pi_{\mathrm{ref}}(y_l\mid x)} \right).

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:

  1. the exact per-example or per-structure formula, including sign conventions;
  2. label encoding, units, masks, smoothing constants, margins, temperatures, and clipping;
  3. the reduction and its denominator;
  4. class, sample, token, or task weights and how they were obtained;
  5. every regularization, auxiliary, and constraint term;
  6. whether the implementation consumes logits, probabilities, scores, or distances;
  7. the optimization direction and framework version;
  8. 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

  1. ^Wald, A. (1950). *Statistical Decision Functions*. John Wiley & Sons. WorldCat record
  2. ^Berger, J. O. (1985). *Statistical Decision Theory and Bayesian Analysis*, 2nd ed. Springer. doi.org/...978-1-4757-4286-2
  3. ^Shalev-Shwartz, S., & Ben-David, S. (2014). *Understanding Machine Learning: From Theory to Algorithms*. Cambridge University Press. Author-hosted PDF
  4. ^Goodfellow, I., Bengio, Y., & Courville, A. (2016). *Deep Learning*. MIT Press. deeplearningbook.org
  5. ^Murphy, K. P. (2022). *Probabilistic Machine Learning: An Introduction*. MIT Press. probml.github.io/...book1
  6. ^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
  7. ^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
  8. ^Boyd, S., & Vandenberghe, L. (2004). *Convex Optimization*. Cambridge University Press. Author site
  9. ^Reid, M. D., & Williamson, R. C. (2010). "Composite Binary Losses." *Journal of Machine Learning Research*, 11, 2387-2422. jmlr.org/...reid10a
  10. ^Huber, P. J. (1964). "Robust Estimation of a Location Parameter." *Annals of Mathematical Statistics*, 35(1), 73-101. doi.org/...1177703732
  11. ^Koenker, R., & Bassett, G., Jr. (1978). "Regression Quantiles." *Econometrica*, 46(1), 33-50. doi.org/...1913643
  12. ^Kullback, S., & Leibler, R. A. (1951). "On Information and Sufficiency." *Annals of Mathematical Statistics*, 22(1), 79-86. doi.org/...1177729694
  13. ^Cortes, C., & Vapnik, V. (1995). "Support-vector networks." *Machine Learning*, 20, 273-297. doi.org/...BF00994018
  14. ^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
  15. ^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
  16. ^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
  17. ^van den Oord, A., Li, Y., & Vinyals, O. (2018). "Representation Learning with Contrastive Predictive Coding." arXiv:1807.03748. arxiv.org/...1807.03748
  18. ^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
  19. ^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
  20. ^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
  21. ^Kingma, D. P., & Welling, M. (2014). "Auto-Encoding Variational Bayes." *2nd International Conference on Learning Representations*. arxiv.org/...1312.6114
  22. ^Arjovsky, M., Chintala, S., & Bottou, L. (2017). "Wasserstein Generative Adversarial Networks." *Proceedings of the 34th International Conference on Machine Learning*, 214-223. PMLR
  23. ^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
  24. ^Loshchilov, I., & Hutter, F. (2019). "Decoupled Weight Decay Regularization." *7th International Conference on Learning Representations*. OpenReview
  25. ^Sener, O., & Koltun, V. (2018). "Multi-Task Learning as Multi-Objective Optimization." *Advances in Neural Information Processing Systems 31*. NeurIPS proceedings
  26. ^PyTorch. "CrossEntropyLoss." *PyTorch documentation*. docs.pytorch.org/...torch.nn.CrossEntropyLoss
  27. ^TensorFlow. "tf.keras.Loss." *TensorFlow API documentation*. tensorflow.org/...Loss
  28. ^PyTorch. "torch.logsumexp." *PyTorch documentation*. docs.pytorch.org/...torch.logsumexp
  29. ^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
  30. ^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

Suggest edit