Skip to publication

17 min read

cross-entropy loss — from information theory to gradient flow

When training neural networks, optimizing Mean Squared Error on class probabilities causes gradients to vanish near wrong predictions. Switching to cross-entropy loss restores non-zero gradients even when predictions are far from targets. How does an optimal coding metric from 1948 information theory eliminate gradient saturation in deep learning?

By the end you should be able to compute H(P,Q)H(P, Q) for categorical targets, trace how softmax cancellation prevents gradient saturation, and diagnose overconfidence using DKL(PQ)D_{KL}(P \| Q) decomposition.

Generated from model knowledge. Verify claims independently.
Contents

Measuring surprise with entropy

How does Shannon entropy H(P)H(P) define the theoretical minimum average bit length required to encode samples from distribution PP?

Imagine sending a stream of animal classifications for images where every image is guaranteed to be a cat, so the true distribution has P(cat)=1P(\text{cat}) = 1, P(dog)=0P(\text{dog}) = 0, and P(bird)=0P(\text{bird}) = 0. If we assign a fixed naive 2-bit code to each class—say 00 for cat, 01 for dog, and 10 for bird—every message costs exactly 22 bits . But because dog and bird never occur, sending 00 every single time is completely redundant; zero bits of information are conveyed because there is no uncertainty. Even in a more balanced case where cat occurs 80%80\% of the time while dog and bird occur 10%10\% each, allocating equal 2-bit codes to all three classes wastes transmission capacity on frequent events while under-utilizing rare ones.

To minimize the expected message length, information theory assigns variable-length binary codes based on event probability. An outcome xx occurring with true probability P(x)P(x) carries an information content—or surprise—measured in bits by L(x)=log2P(x)L(x) = -\log_2 P(x). When an event is certain (P(x)=1P(x) = 1), its surprise is log21=0-\log_2 1 = 0 bits, requiring no code space. When an outcome is less frequent, such as P(x)=0.125P(x) = 0.125, its surprise is log20.125=3-\log_2 0.125 = 3 bits, justifying a longer binary code.

Taking the expectation of this optimal code length across all possible outcomes sampled from true distribution establishes the theoretical lower bound on average message length, defined as Shannon entropy.

H(P)=xP(x)log2P(x)H(P) = - \sum_{x} P(x) \log_2 P(x)
The Shannon entropy H(P)H(P) is the expected optimal code length in bits for outcomes sampled from distribution P(x)P(x).

For our deterministic target distribution P=[1,0,0]P = [1, 0, 0], calculating entropy yields H(P)=1log2100=0H(P) = -1 \log_2 1 - 0 - 0 = 0 bits. Perfect certainty requires zero bits on average to transmit. If PP were instead a uniform distribution over four classes, P=[0.25,0.25,0.25,0.25]P = [0.25, 0.25, 0.25, 0.25], the entropy would reach H(P)=4×(0.25log20.25)=2H(P) = -4 \times (0.25 \log_2 0.25) = 2 bits, requiring 22 bits per outcome. Shannon's source coding theorem guarantees that no lossless compression scheme can achieve an average code length shorter than H(P)H(P) when messages are generated by distribution PP .

This establishes the absolute lower bound when our compression scheme knows the true distribution P(x)P(x) perfectly. In machine learning, however, the target distribution P(x)P(x) is hidden, and our model instead outputs an estimated distribution Q(x)Q(x). What average bit penalty do we pay when we construct our coding scheme using estimated model probabilities Q(x)Q(x) instead of the true distribution P(x)P(x)?

Cross-entropy loss

How does cross-entropy H(P,Q)H(P, Q) quantify the coding cost incurred when assuming distribution QQ instead of true distribution PP?

Consider classifying an image where the true target is cat, represented by target distribution true distribution =[1,0,0]= [1, 0, 0]. Suppose a neural network outputs predicted probabilities predicted distribution =[0.1,0.7,0.2]= [0.1, 0.7, 0.2], assigning 70%70\% probability to dog and only 10%10\% to the true cat label. If we evaluate this mistake using a naive linear difference like 1q1=0.91 - q_1 = 0.9, the metric penalizes all probability deficits uniformly. Under a linear metric, losing 0.10.1 probability when moving from q1=0.9q_1 = 0.9 to 0.80.8 incurs the exact same penalty as dropping from q1=0.1q_1 = 0.1 to 0.00.0. Yet these two failures represent fundamentally different model behaviors. Assigning q10q_1 \approx 0 to an event that actually occurs means the network considers the true outcome virtually impossible. In information theory, representing an event assigned probability q1q_1 requires a code word of length logQ(x)-\log Q(x) . As q1q_1 approaches zero, the required code length approaches infinity, a catastrophe that linear metrics completely fail to capture.

H(P,Q)=xP(x)logQ(x)H(P, Q) = -\sum_{x} P(x) \log Q(x)
The expected code length required to encode events drawn from true distribution P(x)P(x) using a code optimized for estimated distribution Q(x)Q(x).

To quantify the expected penalty incurred by assuming estimated distribution predicted distribution instead of true distribution true distribution, we compute the expected code length across all possible outcomes under PP. This expectation defines the cross-entropy . For a target distribution P=[1,0,0]P = [1, 0, 0] and model output Q=[q1,q2,q3]Q = [q_1, q_2, q_3], the sum over all classes collapses because non-target classes have P(x)=0P(x) = 0:

H(P,Q)=1logq10logq20logq3=logq1H(P, Q) = -1 \cdot \log q_1 - 0 \cdot \log q_2 - 0 \cdot \log q_3 = -\log q_1

When the model assigns full confidence to the correct class (q1=1q_1 = 1), the loss vanishes to log(1)=0-\log(1) = 0, indicating that no excess code space is wasted. However, when the model makes a confident wrong prediction like Q=[0.1,0.7,0.2]Q = [0.1, 0.7, 0.2], the target probability q1=0.1q_1 = 0.1 yields a cross-entropy loss of log(0.1)2.30-\log(0.1) \approx 2.30. If the model becomes even more confident in its mistake and drops q1q_1 to 0.010.01, the loss doubles to log(0.01)4.61-\log(0.01) \approx 4.61. In the extreme limit as q10q_1 \to 0, the loss grows without bound towards infinity:

limq10H(P,Q)=limq10(logq1)=\lim_{q_1 \to 0} H(P, Q) = \lim_{q_1 \to 0} (-\log q_1) = \infty

By penalizing probability deficits logarithmically rather than linearly, cross-entropy loss generates extremely steep gradients precisely when the model is confidently wrong. This property prevents the optimization process from stalling on severe misclassifications.

Evaluating H(P,Q)H(P, Q) penalizes missing target probability with infinite severity, but does minimizing cross-entropy directly minimize an explicit distance between probability distributions PP and QQ?

Forward KL divergence

Why is minimizing cross-entropy H(P,Q)H(P, Q) equivalent to minimizing DKL(PQ)D_{KL}(P \| Q) when target distribution PP is fixed?

When optimizing model parameters θ\theta to classify our cat image with ground-truth target P=[1,0,0]P = [1, 0, 0] against predicted probabilities Q=[q1,q2,q3]Q = [q_1, q_2, q_3], minimizing the cross-entropy loss H(P,Q)=1logq1H(P, Q) = -1 \log q_1 appears on the surface to depend on the intrinsic structure of PP. Because cross-entropy measures the total expected code length paid when events from PP are encoded using QQ, one might worry that loss updates could be confounded by variations in target uncertainty. If cross-entropy combines both target complexity and distribution mismatch into a single scalar value, could gradient descent inadvertently attempt to alter the underlying target distribution's baseline entropy rather than focusing purely on model alignment?

To test whether cross-entropy cleanly separates prediction error from target uncertainty, we decompose the total cross-entropy H(P,Q)H(P, Q) into two distinct terms: the baseline theoretical minimum code length given by target Shannon entropy H(P)H(P), and the extra bit penalty incurred by using model probabilities QQ instead of true probabilities PP. This excess penalty is called the forward KL divergence DKL(PQ)D_{KL}(P \| Q).

We write the forward KL divergence by taking the expectation over target distribution PP of the logarithmic difference between true probabilities P(x)P(x) and predicted probabilities Q(x)Q(x):

DKL(PQ)=i=13P(xi)logP(xi)Q(xi)D_{KL}(P \| Q) = \sum_{i=1}^3 P(x_i) \log \frac{P(x_i)}{Q(x_i)}
Forward KL divergence measures the expected log-likelihood ratio between target distribution PP and predicted distribution QQ.

Using standard logarithm rules to expand the log quotient logP(xi)Q(xi)=logP(xi)logQ(xi)\log \frac{P(x_i)}{Q(x_i)} = \log P(x_i) - \log Q(x_i), we split the summation into two separate sums:

DKL(PQ)=i=13P(xi)logP(xi)i=13P(xi)logQ(xi)D_{KL}(P \| Q) = \sum_{i=1}^3 P(x_i) \log P(x_i) - \sum_{i=1}^3 P(x_i) \log Q(x_i)
Expanding the log quotient separates the target log probabilities from the model log probabilities.

We recognize the first term i=13P(xi)logP(xi)-\sum_{i=1}^3 P(x_i) \log P(x_i) as the negative target entropy H(P)-H(P), and the second term i=13P(xi)logQ(xi)-\sum_{i=1}^3 P(x_i) \log Q(x_i) as the cross-entropy H(P,Q)H(P, Q). Substituting these definitions yields the fundamental decomposition formula:

H(P,Q)=H(P)+DKL(PQ)H(P, Q) = H(P) + D_{KL}(P \| Q)
Total cross-entropy equals target distribution entropy plus forward KL divergence.

This decomposition makes the distinction between target uncertainty and model miscalibration explicit. For our cat classification target P=[1,0,0]P = [1, 0, 0], target entropy is H(P)=1log(1)00=0H(P) = -1 \log(1) - 0 - 0 = 0. Even in settings with soft targets where H(P)>0H(P) > 0, the target distribution PP is fixed by the dataset and contains no trainable model parameters θ\theta. When taking the derivative of cross-entropy with respect to network weights θ\theta, the target entropy derivative θH(P)\nabla_\theta H(P) vanishes identically:

θH(P,Q)=θH(P)+θDKL(PQ)=θDKL(PQ)\nabla_\theta H(P, Q) = \nabla_\theta H(P) + \nabla_\theta D_{KL}(P \| Q) = \nabla_\theta D_{KL}(P \| Q)
The parameter gradient of cross-entropy equals the parameter gradient of forward KL divergence.

Because θH(P)=0\nabla_\theta H(P) = 0, updating network parameters θ\theta along the negative gradient of cross-entropy θH(P,Q)-\nabla_\theta H(P, Q) is mathematically identical to updating parameters along θDKL(PQ)-\nabla_\theta D_{KL}(P \| Q). The optimization algorithm cannot modify the dataset's intrinsic entropy; every parameter update works exclusively to minimize the statistical discrepancy between predicted probabilities QQ and target distribution PP.

Cross-entropy isolates distribution mismatch mathematically, but how does this log-based objective behave when optimized via gradient descent through continuous logit activations?

Softmax gradient cancellation

Why does combining softmax with cross-entropy produce a linear, non-saturating gradient error vector zL=QP\nabla_z L = Q - P?

In our cat classification task, the model converts raw, unnormalized logits z=[z1,z2,z3]z = [z_1, z_2, z_3] into predicted probabilities Q=[q1,q2,q3]Q = [q_1, q_2, q_3] using the softmax function. Because softmax normalizes every component by the sum of exponentials kezk\sum_k e^{z_k}, evaluating its partial derivatives introduces quotient terms and coupled cross-terms. The derivative of every predicted probability qjq_j with respect to every input logit ziz_i yields a complex Jacobian matrix containing terms like qi(1qi)q_i(1 - q_i) and qiqj-q_i q_j. Navigating this interconnected quotient structure during backpropagation threatens severe computational overhead and potential gradient vanishing.

L=kpklogqkL = -\sum_k p_k \log q_k
The cross-entropy loss LL measures negative log-likelihood between true target distribution PP and predicted softmax distribution QQ.

To compute the loss gradient with respect to logit ziz_i, we apply the multivariable chain rule across all output probabilities: Lzi=jLqjqjzi\frac{\partial L}{\partial z_i} = \sum_j \frac{\partial L}{\partial q_j} \frac{\partial q_j}{\partial z_i}. Differentiating loss LL gives Lqj=pjqj\frac{\partial L}{\partial q_j} = -\frac{p_j}{q_j}. For the softmax output, the Jacobian entry qjzi\frac{\partial q_j}{\partial z_i} equals qi(1qi)q_i(1 - q_i) when j=ij = i and qjqi-q_j q_i when jij \neq i. Substituting these components into the chain rule expansion gives:

Lzi=piqi(qi(1qi))+jipjqj(qjqi)\frac{\partial L}{\partial z_i} = -\frac{p_i}{q_i} \left( q_i(1 - q_i) \right) + \sum_{j \neq i} -\frac{p_j}{q_j} \left( -q_j q_i \right)

Notice the algebraic simplification: the qiq_i denominator in piqi-\frac{p_i}{q_i} cancels the qiq_i factor in qi(1qi)q_i(1 - q_i), while qjq_j in pjqj-\frac{p_j}{q_j} cancels qjq_j inside qjqi-q_j q_i. Simplifying the remaining terms yields pi(1qi)+jipjqi=pi+piqi+jipjqi=pi+qijpj-p_i(1 - q_i) + \sum_{j \neq i} p_j q_i = -p_i + p_i q_i + \sum_{j \neq i} p_j q_i = -p_i + q_i \sum_j p_j. Because PP is a valid probability distribution, target probabilities sum to 11 (jpj=1\sum_j p_j = 1). The expression collapses completely to Lzi=qipi\frac{\partial L}{\partial z_i} = q_i - p_i . In vector form, zL=QP\nabla_z L = Q - P.

Logit response and gradient error under softmax cross-entropy

As z1z_1 varies, predicted probability q1q_1 follows a smooth sigmoid curve while the logit gradient q1p1q_1 - p_1 remains bounded between 1-1 and 00 without collapsing to zero when z1z_1 is small.

Logit response and gradient error under softmax cross-entropy: live curves controlled by Fixed logit z 2-1.16-0.5800.581.16-4-2024
MagnitudeTarget logit z1z_1
Probability q1q_1Gradient error q1p1q_1 - p_1

This simplified two-logit model (z1z_1 varying, held z2z_2, target p1=1p_1 = 1) illustrates how q1p1q_1 - p_1 scales smoothly with logit input z1z_1.

This exact cancellation between the softmax exponential and cross-entropy logarithm leaves a purely linear residual error vector QPQ - P. When the model is confidently wrong (q10q_1 \approx 0 for target p1=1p_1 = 1), the gradient magnitude q1p11|q_1 - p_1| \approx 1 guarantees strong, constant parameter updates. But what happens if we pair softmax outputs with an alternative loss function like Mean Squared Error instead?

Cross-entropy versus quadratic loss

Why does Mean Squared Error saturate and freeze model learning when evaluating confidently misclassified probabilities?

Suppose our network evaluates a cat image (P=[1,0,0]P = [1, 0, 0]) and outputs a confidently misclassified prediction Q=[q1,q2,q3]=[0.001,0.998,0.001]Q = [q_1, q_2, q_3] = [0.001, 0.998, 0.001]. Measuring probability error with Mean Squared Error Mean Squared Error loss yields a loss penalty (q11)21(q_1 - 1)^2 \approx 1, near its maximum theoretical bound . Intuition suggests that such a severe error should trigger steep gradient updates to correct the model parameters model parameters. Instead, backpropagation stalls completely, leaving the network trapped in its incorrect state.

To understand why parameter updates freeze, trace how the loss gradient flows back through the network to the unnormalized logit z1z_1 logit. Under softmax activation, probability q1=ez1kezkq_1 = \frac{e^{z_1}}{\sum_k e^{z_k}} depends on all class logits. The partial derivative of q1q_1 with respect to logit z1z_1 is q1z1=q1(1q1)\frac{\partial q_1}{\partial z_1} = q_1(1 - q_1). By the chain rule, the gradient of any loss function LL with respect to logit z1z_1 is Lz1=Lq1q1z1\frac{\partial L}{\partial z_1} = \frac{\partial L}{\partial q_1} \frac{\partial q_1}{\partial z_1}.

For Mean Squared Error, taking the derivative with respect to predicted probability q1q_1 gives LMSEq1=q1p1=q11\frac{\partial L_{\text{MSE}}}{\partial q_1} = q_1 - p_1 = q_1 - 1. Substituting this into the chain rule yields the explicit logit derivative:

LMSEz1=(q11)q1(1q1)\frac{\partial L_{\text{MSE}}}{\partial z_1} = (q_1 - 1) q_1 (1 - q_1)
The logit gradient under quadratic loss contains the product of the probability residual and the derivative of the softmax function.

When the model is confidently wrong (q10q_1 \approx 0), the factor q1q_1 in the softmax derivative vanishes to zero, driving the entire product LMSEz10\frac{\partial L_{\text{MSE}}}{\partial z_1} \to 0. Although the loss derivative q111q_1 - 1 \approx -1 indicates a massive prediction error, it is scaled down by the vanishing softmax term q1(1q1)0.000999q_1(1 - q_1) \approx 0.000999. Consequently, the gradient becomes negligible, parameter updates cease, and learning freezes.

Cross-entropy loss avoids this saturation through exact derivative cancellation. The cross-entropy loss derivative with respect to probability q1q_1 is Lq1=1q1\frac{\partial L}{\partial q_1} = -\frac{1}{q_1}. Multiplying by the softmax derivative gives:

Lz1=(1q1)q1(1q1)=(1q1)=q11\frac{\partial L}{\partial z_1} = \left(-\frac{1}{q_1}\right) q_1 (1 - q_1) = -(1 - q_1) = q_1 - 1
The inverse probability factor 1q1-\frac{1}{q_1} in the cross-entropy derivative cancels the softmax derivative factor q1q_1, producing a linear error signal q1p1q_1 - p_1.

The factor q1q_1 in the denominator of the cross-entropy derivative perfectly cancels the vanishing term q1q_1 in the softmax derivative. Even when q1=0.001q_1 = 0.001, cross-entropy maintains a robust gradient of Lz1=0.0011=0.999\frac{\partial L}{\partial z_1} = 0.001 - 1 = -0.999, ensuring rapid parameter updates until the prediction matches the target.

Cross-entropy eliminates gradient saturation, but its drive to reach zero loss forces target logit z1z_1 \to \infty, causing model overconfidence.

Label smoothing

How does label smoothing alter target PP to prevent logit explosion and improve probability calibration?

With a hard one-hot target P=[1,0,0]P = [1, 0, 0] for classifying our cat image, cross-entropy loss L=logq1L = -\log q_1 reaches its theoretical minimum of zero only when the predicted probability q1=1q_1 = 1. Expressed in terms of unnormalized logits logit, predicted probability q1=ez1ez1+ez2+ez3q_1 = \frac{e^{z_1}}{e^{z_1} + e^{z_2} + e^{z_3}}. For q1q_1 to equal 11, the logit difference z1zjz_1 - z_j for non-target classes j{2,3}j \in \{2, 3\} must approach infinity. As gradient descent continuously updates model parameters model parameters, the optimization algorithm relentlessly increases weight magnitudes to drive target logit z1z_1 \to \infty relative to z2z_2 and z3z_3. This logit explosion causes extreme probability overconfidence: the network outputs probabilities arbitrarily close to 1.01.0 on training samples, destroying probability calibration and making hidden representations rigid and fragile to noise .

Pϵ=(1ϵ)P+ϵKP_\epsilon = (1 - \epsilon) P + \frac{\epsilon}{K}
The smoothed target probability distribution PϵP_\epsilon interpolates between true target distribution PP and a uniform distribution across KK classes using smoothing factor ϵ\epsilon.

Label smoothing resolves logit explosion by altering target distribution PP before computing cross-entropy loss cross-entropy. For K=3K = 3 total classes and smoothing factor ϵ=0.1\epsilon = 0.1, the original one-hot vector P=[1,0,0]P = [1, 0, 0] softens into target distribution Pϵ=[0.933,0.033,0.033]P_\epsilon = [0.933, 0.033, 0.033]. The cross-entropy loss H(Pϵ,Q)H(P_\epsilon, Q) reaches its absolute minimum when predicted probability vector Q=[q1,q2,q3]Q = [q_1, q_2, q_3] perfectly matches PϵP_\epsilon, setting q1=0.933q_1 = 0.933 and q2=q3=0.033q_2 = q_3 = 0.033.

To produce prediction q1=0.933q_1 = 0.933 under softmax normalization, target logit z1z_1 no longer needs to approach infinity. Instead, the optimal logit difference z1z2z_1 - z_2 is finite: ln(0.933/0.033)3.342\ln(0.933 / 0.033) \approx 3.342. Because the loss function penalizes predictions that overestimate target certainty beyond 0.9330.933, gradient descent stops expanding weight magnitudes once logit differences reach this finite threshold.

This completes our throughline from information theory to backpropagation dynamics. Measuring categorical mismatch using cross-entropy loss guarantees non-saturating linear gradients qipiq_i - p_i that preserve steep updates when predictions are wrong, avoiding the vanishing gradient failure of quadratic loss. Incorporating label smoothing regularizes optimal logit magnitudes, preventing infinite weight growth while preserving clear margin boundaries between classes.

Transfer set

Put the pieces together

These questions combine mechanisms from more than one section. Work from the causal chain before opening the answer.

  1. 01

    Suppose a 3-class classifier is trained using label smoothing parameter ϵ=0.1\epsilon = 0.1, so the target becomes Pϵ=[0.9,0.033,0.033]P_\epsilon = [0.9, 0.033, 0.033] instead of standard target P=[1,0,0]P = [1, 0, 0]. How does this altered target change the logit gradient zL\nabla_z L and the optimal logit difference z1z2z_1 - z_2 at the loss minimum?

    Show answer

    Under softmax cross-entropy, the logit gradient vector remains zL=QPϵ\nabla_z L = Q - P_\epsilon, meaning the residual error signal for class 1 becomes q10.9q_1 - 0.9 instead of q11q_1 - 1. The gradient vanishes to zero when Q=PϵQ = P_\epsilon (q1=0.9,q2=0.033q_1 = 0.9, q_2 = 0.033), corresponding to a finite optimal logit difference z1z2=ln(0.9/0.033)3.307z_1 - z_2 = \ln(0.9 / 0.033) \approx 3.307. Because minimizing H(Pϵ,Q)H(P_\epsilon, Q) is equivalent to minimizing DKL(PϵQ)D_{KL}(P_\epsilon \| Q) when PϵP_\epsilon is fixed, parameter updates bring predicted probabilities QQ toward PϵP_\epsilon without requiring target logit z1z_1 \to \infty.

  2. 02

    Consider evaluating a model prediction Q=[0.001,0.998,0.001]Q = [0.001, 0.998, 0.001] against target P=[1,0,0]P = [1, 0, 0] using Mean Squared Error versus cross-entropy. Why does cross-entropy maintain a non-zero gradient magnitude of q1p1=0.999|q_1 - p_1| = 0.999 while Mean Squared Error yields a vanishing logit gradient of approximately 0.000999-0.000999?

    Show answer

    The cross-entropy loss derivative with respect to predicted probability Lq1=1q1\frac{\partial L}{\partial q_1} = -\frac{1}{q_1} originates from the logarithmic coding penalty logq1-\log q_1, which grows infinitely as q10q_1 \to 0. When multiplied by the softmax Jacobian derivative q1z1=q1(1q1)\frac{\partial q_1}{\partial z_1} = q_1(1-q_1) via the chain rule, the inverse factor 1q1\frac{1}{q_1} cancels the vanishing q1q_1 term, leaving a linear residual error Lz1=q11=0.999\frac{\partial L}{\partial z_1} = q_1 - 1 = -0.999. Under Mean Squared Error, the loss derivative LMSEq1=q111\frac{\partial L_{\text{MSE}}}{\partial q_1} = q_1 - 1 \approx -1 lacks this inverse probability factor, leaving the vanishing q1(1q1)q_1(1-q_1) factor in the logit derivative (q11)q1(1q1)0.000999(q_1 - 1)q_1(1-q_1) \approx -0.000999 intact and stalling gradient flow.

  3. 03

    How does combining the forward KL divergence decomposition with softmax cross-entropy and label smoothing resolve the gradient saturation problem of Mean Squared Error while preventing logit explosion?

    Show answer

    Decomposing cross-entropy into H(P,Q)=H(P)+DKL(PQ)H(P, Q) = H(P) + D_{KL}(P \| Q) proves that optimizing cross-entropy directly minimizes distribution mismatch DKL(PQ)D_{KL}(P \| Q) because target entropy H(P)H(P) is constant. The negative log-likelihood coding penalty logq1-\log q_1 yields probability derivative 1q1-\frac{1}{q_1}, which cancels the vanishing q1q_1 term in the softmax derivative q1(1q1)q_1(1-q_1). This cancellation converts distribution mismatch into a linear, non-saturating logit error signal zL=QP\nabla_z L = Q - P, restoring steep gradient flow when q10q_1 \to 0 where Mean Squared Error saturates. Finally, replacing hard target PP with smoothed target Pϵ=(1ϵ)P+ϵKP_\epsilon = (1-\epsilon)P + \frac{\epsilon}{K} places the DKL(PϵQ)D_{KL}(P_\epsilon \| Q) minimum at finite probability predictions q1=1ϵ+ϵK<1q_1 = 1-\epsilon+\frac{\epsilon}{K} < 1, bounding the required optimal logit difference z1z2=ln(q1/q2)z_1 - z_2 = \ln(q_1 / q_2) to a finite threshold and preventing weight explosion.

References

  1. [1]
    Shannon (1948) A Mathematical Theory of Communication
    Model-knowledge reference; verify independently.
  2. [2]
    Kullback & Leibler (1951) On Information and Sufficiency
    Model-knowledge reference; verify independently.
  3. [3]
    Golik et al. (2013) Cross-Entropy vs Squared Error Training Samples
    Model-knowledge reference; verify independently.
  4. [4]
    Szegedy et al. (2016) Rethinking the Inception Architecture for Computer Vision
    Model-knowledge reference; verify independently.