Encoder–Decoder / Learn the representation
Which gradient should a token trust?
Optimize the task objective while respecting the discrete constraint.
The Encoder receives two signals: an end-task gradient passed through the STE, and a commitment gradient pulling tokens toward their assigned codes. Their balance is critical as both distributions evolve.
But the end-task gradient is evaluated at the code, not at the token. When the pair is far apart, a useful direction for the code can be misleading for the token—even pushing it away from its assigned code, against the commitment signal.
The mismatch can then reinforce itself: unreliable gradients pull the distributions further apart, making subsequent estimates worse. This feedback can ultimately cause extremely low codebook utilization or even NaN values; the Scale Divergence described above is one example.
Make gradient trust distance-aware. Attenuate the STE-passed end-task gradient for relatively distant token–code assignments.
Dynamic STE