Recap. Part 1 framed the problem (trajectory reward is too coarse for multi-step agents) and SDAR's fix (a privileged teacher gives dense token-level guidance, filtered through a gate). Part 2 put the four-model system on AWS and counted the GPU cost. This part is the payoff: the actual gate, in PyTorch.

Honest label up front: what follows is a reference implementation - faithful to the paper's mechanism, written to be read and reasoned about. It is not a benchmarked run. I have no convergence curves to sell you; I have the machinery. (Part 4 designs the verification that money would buy.)

The claim: it's basically one sigmoid

Strip away the framework scaffolding and SDAR's entire contribution is a weighting coefficient on a distillation loss. Three moves:

Measure how much the teacher likes a token versus the student - the gap.