ELVIA.Evidence Atlas
NeurIPS 2025ELVIA assessment Minor

Learning to Focus: Causal Attention Distillation via Gradient‐Guided Token Pruning

Yiju Guo, Wenkai Yang, Zexu Sun, Ning Ding, Zhiyuan Liu, Yankai Lin

ELVIA analysis

Independent review pending

The first reported finding concerns “The gradient detector indexes an unretained non-leaf gradient”. Under the inspected loader configuration, the released detector cannot obtain its gradients through this access. Historical use of frozen parameters, another internal kernel or precomputed outputs remains unresolved; benchmark scores are not refuted.

Problem 1. The gradient detector indexes an unretained non-leaf gradient

Minor
Evidence and reasoning

Problem statement

The detector needs teacher/student loss derivatives with respect to token embeddings. Each released kernel constructs embedding outputs, calls requires_grad_(True), backpropagates, then indexes inputs_embeds.grad. The inspected loader leaves embedding weights trainable.

Proof

If the embedding matrix WW is trainable, E=Embedding⁡(W,I)E=\operatorname{Embedding}(W,I) is a non-leaf operation result. Enabling requires_grad does not detach it or retain its intermediate gradient. Backward can populate WW while leaving E.grad=None,E.\mathrm{grad}=\mathrm{None}, which the subsequent indexing cannot use. No detach, retain_grad or explicit returned input-gradient operation appears in the four kernels.

For a concrete derivative oracle, L(E)=∑j,dajEjdL(E)=\sum_{j,d}a_jE_{jd} with three-dimensional tokens and a=(1,2,4)a=(1,2,4) has gradient norms (3,23,43),(\sqrt3,2\sqrt3,4\sqrt3), hence normalized sensitivities (0,1/3,1).(0,1/3,1). The failure is retention of that existing derivative, independently of whether the downstream differentiable loss is linear or language-model cross-entropy. Freezing embedding weights before constructing an explicit input leaf is a valid countercontrol.

□\square

Possible revision

The supplied local correction detaches embedding values, enables their input gradient and explicitly requests the loss derivative with respect to that input. This preserves the requested downstream partial derivative. Retaining the intermediate gradient is another option; full detection and benchmark recovery remain unverified.

The existing correction is retained as a bounded proposal; author adoption is not established.

Problem 2. The response mask selects shifted target positions incorrectly

Minor
Evidence and reasoning

Problem statement

The release copies token IDs into labels, ignores prompt labels with −100,-100, and applies the unshifted label mask to raw causal-LM output logits in the separate distillation reduction.

Proof

Raw logit row ii predicts token i+1.i+1.

Therefore response prediction rows require mi=1{ℓi+1≠−100}m_i=\mathbf1\{\ell_{i+1}\ne-100\} for 0≤i<L−1.0\leq i<L-1. Passing labels to the causal model shifts its internal supervised loss, not the returned raw logits. The source instead uses 1{ℓi>−100}.\mathbf1\{\ell_i>-100\}.

Take four positions: two prompt tokens, one response token and EOS, with labels (−100,−100,0,1).(-100,-100,0,1). At row 1,1, use teacher probabilities (0.8,0.2)(0.8,0.2) and student probabilities (0.2,0.8);(0.2,0.8); set both distributions to (0.5,0.5)(0.5,0.5) at the other rows. The source selects rows 2,32,3 and gives zero KL. The intended response prediction rows 1,21,2 give L=12[0.8log⁡4+0.2log⁡(1/4)]=0.3log⁡4≈0.4158883083.L=\tfrac12[0.8\log4+0.2\log(1/4)]=0.3\log4\approx0.4158883083. Thus it omits the first-response prediction and includes the row after the final supervised token.

□\square

Possible revision

With aligned tokenization, prefixes and vocabulary, compare teacher/student logits at rows 0,…,L−20,\ldots,L-2 using labels at rows 1,…,L−1.1,\ldots,L-1. State an empty-target convention. This repairs the one-position relation, but not arbitrary cross-tokenizer or differently pruned sequence alignment.

The existing correction is retained as a bounded proposal; author adoption is not established.

Supporting record & provenance

Work status

Current version

Version 1

Minhao Liu · Initial report · Version 1

Independent review pending

Original claim and review scope

The training pipeline comprises two key stages: (11) Confounding Token Detection: gradient-based comparisons between an advanced teacher model and the student model are used to identify confounding tokens in the training samples and constructs counterfactual samples by pruning these tokens; and (22)Causal Attention Distillation: prune identified confounders respectively during training to align the student’s attention with the teacher’s and capture casual relationships.

NeurIPS 2025 official proceedings PDF; current endpoint freshly retrieved and relevant current author revisions compared; PDF p. 4

Actual review scope

The recorded inspection concerns these source locations: Proceedings Section 2.2.1, Eq.(2), PDF p.4; current author src/Confounding_token_detection/run_gradients_{llama,qwen}_{instruct,response}_level.py, compute_token_gradients; Proceedings Section 2.2.2, PDF p.5; current author src/Causal_attention_distillation/LeaF_instruct_level/distill_instruct_level.py, lines 201,225–229,423–460; LeaF_response_level analogous reduction.

Submit an author revisionContribute a review