ELVIA.Evidence Atlas
← Back to analysis

AI context

ELVIA analysis of: Scalable In-context Ranking with Generative Models — Problem 3: SDPA ranking logits omit attention scaling

Original paper: Gupta, Nilesh; You, Chong; Bhojanapalli, Srinadh; Kumar, Sanjiv; Dhillon, Inderjit; Yu, Felix. Scalable In-context Ranking with Generative Models. Advances in Neural Information Processing Systems, vol. 38, 2025, pp. 36590–36613. https://doi.org/10.52202/085713-1228
Source version: NeurIPS 2025 official proceedings PDF (current publisher bytes, checked 2026-10-21)
Source location: Section 4.2, PDF p. 7; current blockrank_std_attention.py, SDPA return-score construction lines 640–645

Question: What does the recorded analysis establish about “SDPA ranking logits omit attention scaling”?
Bounded finding:
The current SDPA ranking-score path still differs from the specified scaled attention and can reverse document rankings. This particular omission does not apply to the separately scaled eager path; no original JAX benchmark effect is established.

Recorded check:
The hidden-output SDPA call receives the correct scaling, but its separately returned ranking logits are \(QK^\top\) plus mask, omitting \(1/\sqrt{d_k}\). Set \(d_k=4\), query \(q=(1,0,0,0)\), and key first coordinates \[(-20,-20,4,-4,3,3,-20,-20),\] with other coordinates zero; the middle two pairs are documents A and B. Correct scaled document exponential sums satisfy \(e^2+e^{-2}<2e^{1.5}\), ranking B first. Unscaled returned sums satisfy \(e^4+e^{-4}>2e^3\), ranking A first. A common positive scaling of individual logits does not preserve a ranking obtained after exponentiation and token aggregation. The hidden-output operation remains correctly scaled; the discrepancy is specifically in the returned score path.

Case-wide limitations:
- No author program, attention kernel, model or old verifier was executed. The public PyTorch release is later than the original JAX/TPU experiments. Missing historical predictions prevent estimating metric or ranking effects on the paper’s tables. Normalization is a documented version difference whose intent and empirical merits remain unestablished.
Source problem ID: p3
Source report index: 3

Original source excerpts (verbatim):
Motivated by these observations, we introduce BlockRank (Blockwise In-context Ranking), a novel method that adapts the attention operation in an LLM by (a) architecturally enforcing the observed inter-document block sparsity, reducing attention complexity from quadratic to linear without loss in performance, and (b) optimizing query-document block relevance for true relevant documents during fine-tuning using an auxiliary contrastive training objective, improving retrieval in attention.
Source: NeurIPS 2025 official proceedings PDF (current publisher bytes, checked 2026-10-21)
Locator: Abstract, PDF p. 1
Source PDF SHA-256: 26032701ea72dcfc4881ea8a6810ea2b2a6ee7e9dc6ae2ba8fde463753d0afb3

Review status: Independent review pending
Case: neurips2025-0030-scalable-in-context-ranking-with-generative-models
Revision: 1
Record created: 2026-10-21T07:13:27.568206+00:00
Permalink: https://elvia-atlas.org/atlas/cases/neurips2025-0030-scalable-in-context-ranking-with-generative-models.html#problem-3
Versioned public record: https://elvia-atlas.org/atlas/evidence/neurips2025-0030-scalable-in-context-ranking-with-generative-models/records/neurips2025-0030-scalable-in-context-ranking-with-generative-models.r1.json
Canonical record SHA-256: 31b221883a76174b8d6c1d343d3a6df5cda2dff79a9cf1dfddb1e285acbe0df1
The page follows the latest revision; the versioned record identifies this snapshot.

Analysis citation:
Minhao Liu. ELVIA analysis of: Scalable In-context Ranking with Generative Models — Problem 3: SDPA ranking logits omit attention scaling. ELVIA, 2026. https://elvia-atlas.org/atlas/cases/neurips2025-0030-scalable-in-context-ranking-with-generative-models.html#problem-3
Case neurips2025-0030-scalable-in-context-ranking-with-generative-models; revision 1; Independent review pending. Assessment is limited to the inspected claims. Versioned record: https://elvia-atlas.org/atlas/evidence/neurips2025-0030-scalable-in-context-ranking-with-generative-models/records/neurips2025-0030-scalable-in-context-ranking-with-generative-models.r1.json

Source claim (paraphrase):
The SDPA and eager attention backends should return equivalent ranking logits for the same query/key tensors.

Full finding analysis:
The hidden-output SDPA call receives the correct scaling, but its separately returned ranking logits are \(QK^\top\) plus mask, omitting \(1/\sqrt{d_k}\). Set \(d_k=4\), query \(q=(1,0,0,0)\), and key first coordinates \[(-20,-20,4,-4,3,3,-20,-20),\] with other coordinates zero; the middle two pairs are documents A and B. Correct scaled document exponential sums satisfy \(e^2+e^{-2}<2e^{1.5}\), ranking B first. Unscaled returned sums satisfy \(e^4+e^{-4}>2e^3\), ranking A first. A common positive scaling of individual logits does not preserve a ranking obtained after exponentiation and token aggregation. The hidden-output operation remains correctly scaled; the discrepancy is specifically in the returned score path.

Finding and scope:
The current SDPA ranking-score path still differs from the specified scaled attention and can reverse document rankings. This particular omission does not apply to the separately scaled eager path; no original JAX benchmark effect is established.

Proposed correction:
Apply \(1/\sqrt{d_k}\) to returned logits under the same convention, then check backend parity.
Current SDPA code retains the missing scale in the independent returned-logit construction. The existing local correction scales that product before adding its mask; it changes no already-correct hidden-output computation and has no demonstrated benchmark result.

Displayed problem statement:
The SDPA and eager attention backends should return equivalent ranking logits for the same query/key tensors.

Source PDF SHA-256: 26032701ea72dcfc4881ea8a6810ea2b2a6ee7e9dc6ae2ba8fde463753d0afb3
Repair verification: pending
Author adoption: not_requested