Three Delay Classes, One Nudge

BackpropagationMedium+20 XP+20

Three Delay Classes, One Nudge

A food-delivery app predicts how late each order will be. Its model sorts the order into one of three delay classes, then reports the expected delay: each class's delay weighted by its probability.

classdelay
on time0 min
a bit late10 min
very late40 min

The final layer emits three logits, softmax turns them into probabilities, and the expected delay is computed from those:

pk=ezkez1+ez2+ez3,y^=0 p1+10 p2+40 p3p_k = \frac{e^{z_k}}{e^{z_1} + e^{z_2} + e^{z_3}}, \qquad \hat{y} = 0\,p_1 + 10\,p_2 + 40\,p_3pk​=ez1​+ez2​+ez3​ezk​​,y^​=0p1​+10p2​+40p3​

For one order the logits are

(z1, z2, z3)=(1.2, 0.8, 0.5)(z_1,\ z_2,\ z_3) = (1.2,\ 0.8,\ 0.5)(z1​, z2​, z3​)=(1.2, 0.8, 0.5)

The backward pass needs the gradient of y^\hat{y}y^​ with respect to every logit. Find one of them: the rate of change of the expected delay with respect to the "a bit late" logit,

∂y^∂z2\frac{\partial \hat{y}}{\partial z_2}∂z2​∂y^​​

at these logits, in minutes per unit of logit.

Give your answer rounded to 3 decimal places, including its sign. Carry at least four decimals through the probabilities.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.