For latency-constrained candidate ranking, we propose a similarity-identity decoupling framework that separates target-history compatibility from target-only information. We study two orders for computing pooled similarity, similarity-then-pool and pool-then-similarity, and identify linearity of the similarity operator in its history argument, for each fixed target, as sufficient for their equivalence, justifying the cheaper pool-then-similarity form. We instantiate the framework as multi-head efficient lightweight operator for decoupling identity and similarity (MELODI), whose similarity branch combines target-conditioned multi-head history pooling with a single residual-free cross layer that is linear in its pooled-history input and whose identity branch is problem-dependent. On public benchmark datasets, MELODI matches or surpasses the evaluated target-aware and target-agnostic baselines. On two large-scale industrial datasets, its area under the precision-recall curve (AUPRC), normalised discounted cumulative gain (NDCG), and recall values are equal to or higher than those of the evaluated target-aware baselines. Processor measurements show lower latency than the evaluated candidate-conditioned baselines at large candidate counts, further reduced by request-local history reuse.
Figures & tables
Symbol
Description
Symbol
Description
Framework
C={tc}c=1C
Candidate set of size C
X=[xi]i=1S∈RS×Dx
History matrix of length S
xi∈RDx,t∈RDt
History item and generic target; the candidate index on t is dropped
Dx,Dt
Framework history and target widths
α=[αi]i=1S∈ΔS−1
Non-negative attention distribution over the S history items
u(X,t)∈RDx
Target-aware pooled history
ϕ:RDx×RDt→RM
Similarity operator; linear in its history argument where SP/PS equivalence is invoked (Def. 3.2 )
M
Similarity-operator output width
ψSP,ψPS∈RM
Pooled similarity under similarity-then-pool and pool-then-similarity orderings
A(t)∈RM×Dx
Matrix in ϕA(x,t)=A(t)x
Table 1. Mathematical notation used in the framework and architecture.
Figure 1. MELODI’s two-signal design. Top row: the similarity signal branch applies a shared embedding projection and layer normalization (LN) ( Ba et al., 2016 ) (Stage 1), multi-head dot-product cross-attention producing {uh} (Stage 2), and a per-head gated cross layer without a residual connection producing c (Stage 3). Bottom row: the identity signal branch (dashed) applies a problem-dependent target-only transformation. Block diagram of MELODI's two-signal design. The upper similarity signal branch runs left to right: the user history and the target item both enter a shared embedding and layer-normalization stage, then multi-head dot-product cross-attention pools the history into per-head vectors, then a per-head gated cross layer without a residual connection combines those with the target to produce the similarity signal c. The lower, dashed identity signal branch applies a target-only transformation. Both signal outputs enter a final MLP that emits the score.
Figure 2. Detailed data flow of the similarity branch. Stage 1 produces X~ and t~ at width D . Stage 2 projects them to H heads of width d and computes the pooled histories uh . Stage 3 projects the target to vt∈RDu , where Du=Hd , and applies per-head gated experts to produce ηh and ch . The teal wavy arrows mark the cacheable history-only keys and values (Rem. 4.1 ). Vertical data-flow diagram of the similarity branch in three stages. Stage 1: the history matrix and the target vector both pass through a shared projection and layer normalization. Stage 2: the history produces keys and values while the target produces the query. Scaled dot-product cross-attention then yields a pooled history vector per head. The key and value boxes are marked reused, indicating they depend on the history only and are computed once per request. Stage 3: per-head softmax-gated low-rank experts map the target to a vector that is multiplied element-wise with the pooled history, and the per-head results are concatenated into the similarity signal c.
Steam
ML-25M
Model
HIT@10
NDCG@10
MRR
HIT@10
NDCG@10
MRR
SASRec (target-agnostic)
.7677 ± .0032
.4997 ± .0029
.4279 ± .0029
.9327 ± .0017
.7234 ± .0038
.6595 ± .0043
TA-Transformer (1 layer, 1 head)
.7741 ± .0043
.5128 ± .0062
.4425 ± .0065
.9283 ± .0016
.7158 ± .0031
.6512 ± .0035
DIN
.7817 ± .0029
.5253 ± .0045
.4561 ± .0049
.9399 ± .0021
.7347 ± .0063
.6719 ± .0074
DIN + DCN-v2
.7851 ± .0029
.5300 ± .0021
.4609 ± .0017
.9436 ± .0003
.7467 ± .0022
.6862 ± .0029
MELODI (4 experts, 1 layer)
.7940 ± .0019
.5409 ± .0016
.4720 ± .0016
.9503 ± .0006
.7605 ± .0016
.7017 ± .0019
Table 2. Public-dataset results (HIT@10, NDCG@10, MRR): mean ± sample standard deviation over three training seeds. MELODI is the prespecified single-layer, 4 -expert configuration of Sec. 4 , identical on both datasets and not selected per dataset. Tab. 3 reports all combinations of {4,8} experts and {1,2} layers from one training run each. SASRec uses the normalised target.
Dataset
Model
HIT@1
HIT@5
HIT@10
NDCG@5
NDCG@10
MRR
Steam
SASRec (history-only LN)
0.2168
0.5554
0.7198
0.3917
0.4451
0.3736
SASRec
0.2738
0.6198
0.7704
0.4540
0.5029
0.4311
TA-Transformer (1 layer, 1 head)
0.2809
0.6235
0.7695
0.4599
0.5073
0.4370
DIN
0.3082
0.6465
0.7848
0.4855
0.5304
0.4616
DIN + DCN-v2
0.3060
0.6439
0.7823
0.4834
0.5284
0.4598
MELODI (4 experts, 1 layer)
0.3196
0.6563
0.7923
0.4963
0.5405
0.4720
Table 3. Full public-dataset results from one training run per model. Bold marks best per dataset and metric. “SASRec (history-only LN)” omits the shared LN on the target, while the main SASRec row applies it. Supp. Sec. G gives batching details.
Model
Sampled
Hard
Full
Steam
SASRec
.4311
.0636
.0351
TA-Transformer (1L, 1H)
.4370
.0623
.0340
DIN
.4616
.0748
.0457
DIN + DCN-v2
.4598
.0731
.0434
CAN
.4611
.0785
.0388
Table 4. Single-run MRR under sampled ( 99 uniform negatives), hard ( 999 negatives from a fixed MiniLM retriever), and full-catalogue ranking (the test item versus every other item outside the user’s sequence).
Steam
ML-25M
Model
NDCG@10
Δ
Flat.
Reuse
Benefit
NDCG@10
Δ
Flat.
Reuse
Benefit
TA-Transformer (1 layer, 1 head)
0.5073
0.0000
14.76
15.09
1.03×
0.7189
0.0000
14.52
13.74
1.05×
DIN
0.5304
+0.0231
16.57
9.89
1.67×
0.7383
+0.0194
18.70
9.87
1.89×
DIN + DCN-v2
0.5284
+0.0211
17.74
10.58
1.80×
0.7457
+0.0268
16.64
10.19
1.66×
MELODI (4 experts, 1 layer)
0.5405
+0.0332
27.86
1.97
14.21×
0.7619
+0.0430
29.30
2.00
14.68×
Table 5. Public quality–latency comparison. Top: NDCG@10, candidate-flattened latency (Flat., ms), request-local-reuse latency (Reuse, ms), and median paired reuse benefit at C=1,000 . NDCG@10 is from one training run, and Δ is its difference from TA-Transformer. Bottom: request-local-reuse latency at smaller C . Latencies are medians of five replicate minima. Benefit is the median within-replicate Flat./Reuse ratio, not the quotient of the displayed medians. TA-Trans. is TA-Transformer and DIN+DCN is DIN + DCN-v2.
Figure 3. Public quality gain versus latency relative to TA-Transformer at C=1,000 . Quality is the single-run NDCG@10 difference from TA-Transformer. Baseline points use request-local-reuse latency over TA-Transformer’s. MELODI’s dashed arrow shows request-local reuse lowering its latency, and upper-left points have higher NDCG@10 at lower latency. Grey regions are dominated by reused MELODI, and black rings mark the nondominated plotted operating points. Target-agnostic SASRec (NDCG@10 0.5029 on Steam and 0.7236 on ML-25M) is omitted to focus on candidate-conditioned models. Two quality-versus-latency panels for Steam and ML-25M. Request-local-reuse MELODI lies above and to the left of TA-Transformer, DIN, and DIN plus DCN-v2. A dashed arrow from candidate-flattened to request-local-reuse MELODI shows the same-process reduction.
Overall
Segment-1
Segment-2
Model
AUROC
AUPRC
N@20
R@20
AUROC
AUPRC
N@20
R@20
AUROC
AUPRC
N@20
R@20
Tabular baseline
–
–
–
–
–
–
–
–
–
–
–
–
TA-Transformer
+2.5
+22.2
+8.8
+5.8
+2.3
+28.6
+11.1
+3.8
+3.1
+11.1
+6.9
+7.1
DIN
+2.8
+16.7
+8.8
+6.0
+2.6
+22.4
+11.8
+4.6
+3.4
+7.4
+6.4
+6.7
MELODI
+2.9
+25.0
+11.3
+7.1
+2.5
+32.7
+15.4
+5.5
+3.6
+11.1
+7.9
+8.1
Table 6. Industrial-A: % change from the tabular baseline, overall and by segment (N@20: NDCG@20, R@20: Recall@20).
Overall
Identifier available
Identifier unavailable
Model
AUROC
AUPRC
N@20
R@20
AUROC
AUPRC
N@20
R@20
AUROC
AUPRC
N@20
R@20
Tabular baseline
–
–
–
–
–
–
–
–
–
–
–
–
TA-Transformer
+2.0
+6.5
+2.3
+2.3
+2.3
− 3.3
+3.5
+4.9
+1.6
+12.5
+2.3
+0.9
DIN
+2.5
+6.5
+2.7
+3.1
+3.1
+3.3
+5.6
+7.4
+1.9
+10.2
+1.6
0.0
MELODI
+2.0
+7.8
+3.2
+4.2
+2.8
+3.3
+5.6
+8.4
+1.0
+10.2
+2.3
+1.3
Table 7. Industrial-B: % change from the tabular baseline, overall and by identifier availability, as in Tab. 6 .
#
Configuration
Steam
ML-25M
1
Anchor: 1 layer, no residual, cross-only scorer
.4720
.7033
2
− target self-cross
.4702
.6882
3a
+ target residual
.4722
.7023
3b
+ pooled-history residual
.4716
.7023
4a
+ second layer; identity also deepened
.4771
.7086
4b
+ second layer; identity fixed
.4794
.7019
Table 8. Component ablations (MRR, 4 experts). Rows 3 and 4 include the coupled and isolated interventions. Supp. Sec. D gives deltas and details.
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Flat.
Reuse
Benefit
DIN
421.38 M
176.17 M
2.39×
DIN + DCN-v2
429.04 M
183.84 M
2.33×
MELODI (1 layer, 4 experts)
618.50 M
43.83 M
14.11×
MELODI (2 layers, 4 experts)
635.56 M
60.88 M
10.44×
MELODI (1 layer, 8 experts)
635.42 M
60.74 M
10.46×
Appendix
Table 9. Total FLOPs for scoring C=100 candidates in the shared public setting ( S=50 , D=64 ). “Flat.” re-encodes the shared history for every candidate, while “Reuse” encodes it once within the request. The benefit is Flat./Reuse.
Aspect
DCN-v2 self-cross
Our user–target cross
Inputs
One feature vector x , self-crossed.
Pooled history u∈RDu and target t~∈RD , with a target projection vt∈RDu .
Core operation
xℓ+1=x0⊙(Wℓxℓ+bℓ)+xℓ
c=u⊙η(t~) (no residual), with η computed from vt and gates on t~ .
Residual connection
Included, carries the previous layer state xℓ forward.
Dropped. The output contains only similarity, and the identity branch handles target-only content.
Head structure
Single-stream, no attention heads.
Each head operates on d -dimensional slices of u and vt ; concatenation gives Du=Hd .
Expert structure
Mixture of experts is global: Mℓ(xℓ)=∑kgℓ,k(xℓ)Uℓ,kVℓ,k , dense across all dimensions.
The same d -dimensional experts are reused across heads, producing H independent blocks Mh(t~) . Relative to a width- D DCN-v2 layer, the expert-term ratio is d/D .
Gating
Single gate vector gℓ(xℓ)∈RK shared across all dimensions.
Per-head gate vector gh(t)∈RK , so each head mixes the K experts independently instead of sharing one mixture across all dimensions.
Appendix
Table 10. Structural comparison of our user–target cross layer (in MELODI’s similarity branch) against a standard DCN-v2 self-cross.
Steam
ML-25M
Configuration
Both
Pinned
Both
Pinned
1 similarity layer
+0.0088
+0.0035
+0.0048
−0.0032
2 similarity layers
+0.0030
−0.0088
+0.0042
+0.0031
Appendix
Table 11. Effect of doubling expert count. Δ is MRR with 8 experts minus MRR with 4 experts. All variants are residual-free, use cross-only scoring, and include the target self-cross. “Pinned” holds the identity signal branch at one layer and 4 experts, while “Both” changes both signal branches.
Component
Effect (Steam / ML-25M)
Recommendation
Remove target self-cross from identity branch
−0.0018 / −0.0151
Retain the tested identity branch because removal gives lower reported MRR
Pooled-history residual
−0.0004 / −0.0010
Omit to keep a pure interaction signal
Second similarity layer
+0.0074 / −0.0014
Use one layer to retain the stated SP/PS guarantee
Uncrossed pooled history and projected target in MLP
+0.0038 / +0.0005
Retain the fixed cross-only scorer
Projected target without uncrossed pooled history
−0.0077 / −0.0099
If the scorer receives uncrossed inputs, pair the target with pooled history
Expert count
Changes sign across settings
Use 4 experts as the fixed default
Appendix
Table 12. Fixed defaults and their observed MRR effects. Each effect compares single training runs.
Steam
ML-25M
Model
Params
HIT@10
NDCG@10
MRR
HIT@10
NDCG@10
MRR
Latency
TA-Transformer (1L, 1H)
61.6k
.7695
.5073
.4370
.9302
.7189
.6546
15.0 / 17.1
TA-Transformer (2L, 2H)
95.0k
.7960
.5421
.4727
.9407
.7399
.6783
29.3 / 29.0
TA-Transformer (2L, 2H, 4D )
128.1k
.8080
.5562
.4867
.9461
.7519
.6921
32.4 / 31.3
MELODI
132.9k
.7923
.5405
.4720
.9510
.7619
.7033
2.0 / 2.0
Appendix
Table 13. Larger TA-Transformers: single-run metrics with 99 sampled negatives and request-local latency at C=1,000 (ms; Steam / ML-25M). Latency is from one benchmark run.
Figure 4. Industrial quality gain versus latency relative to the tabular baseline on a commodity processor instance with 32 virtual cores. Quality is the relative NDCG@20 gain (%) over the tabular baseline. The logarithmic horizontal axis is model latency divided by tabular-baseline latency, so the upper left is better. In both datasets, MELODI is faster and has higher reported NDCG@20 than TA-Transformer and DIN. Blue dashed arrows show the measured candidate-flattened-to-request-local-reuse reduction, grey regions are dominated by reused MELODI, and black rings mark nondominated measured operating points. Two scatter plots, one per industrial dataset, of relative NDCG@20 gain (percent) on the vertical axis against latency overhead on a logarithmic horizontal axis, both measured relative to the tabular baseline. In each panel, MELODI sits above and to the left of both TA-Transformer and DIN. A dashed arrow points left from candidate-flattened to request-local-reuse MELODI. Black rings identify the tabular baseline and reused MELODI as the nondominated measured points.
Model
Latency ( × )
NDCG@20 gain (%)
Tabular baseline
1.0
–
TA-Transformer
201.8
+8.8
DIN
80.9
+8.8
MELODI (candidate-flattened)
40.0
+11.3
MELODI (history reused)
15.6
+11.3
Appendix
Table 14. Industrial-A latency on a commodity processor instance with 32 virtual cores. Latency is divided by tabular-baseline latency, and NDCG@20 gain is the percentage change relative to the tabular baseline.
Model
Latency ( × )
NDCG@20 gain (%)
Tabular baseline
1.0
–
TA-Transformer
142.1
+2.3
DIN
55.1
+2.7
MELODI (candidate-flattened)
18.7
+3.2
MELODI (history reused)
4.9
+3.2
Appendix
Table 15. Industrial-B latency on a commodity processor instance with 32 virtual cores, reported as in Tab. 14 .
Dataset / Model
Flat.
Reuse
Lower bound
Industrial-A: MELODI
40.0×
15.6×
15.7×
Industrial-B: MELODI
18.7×
4.9×
4.6×
Appendix
Table 16. Online-latency lower bound with aggressive pre-computation on a commodity processor instance with 32 virtual cores ( 1 user ×50 history ×1,000 candidates). Latencies are divided by the tabular-baseline latency of each dataset.
Model
Parameters
Configurations
SASRec
127,936
2
TA-Transformer (1 layer, 1 head)
61,569
1
TA-Transformer (2 layers, 2 heads)
95,041
1
TA-Transformer (2 layers, 2 heads, 4D )
128,065
1
DIN
52,802
1
DIN + DCN-v2
90,314
1
Appendix
Table 17. Trainable parameters, excluding the frozen item-embedding table, and configurations trained per public dataset. Counts are identical on Steam and ML-25M.
Steam
ML-25M
Users
281,354
162,541
Items
11,961
32,720
Item-table size
11,963
32,722
Training examples
2,706,396
3,226,917
Training prefixes per user
All
20 most recent
Embedding source
all-MiniLM-L6-v2 (384-d)
all-MiniLM-L6-v2 (384-d)
Appendix
Table 18. Dataset statistics and evaluation protocols.
This paper presents DeepMTL2R, an open-source deep learning framework for Multi-task Learning to Rank (MTL2R), where multiple relevance criteria must be optimized simultaneously. DeepMTL2R integrates heterogeneous relevance signals into a unified, context-aware model by leveraging the self-attention mechanism of transformer architectures, enabling effective learning across diverse and potentially conflicting objectives. The framework includes 21 state-of-the-art multi-task learning algorithms and supports multi-objective optimization to identify Pareto-optimal ranking models. By capturing complex dependencies and long-range interactions among items and labels, DeepMTL2R provides a scalable and expressive solution for modern ranking systems and facilitates controlled comparisons across MTL strategies. We demonstrate its effectiveness on a publicly available dataset, report competitive performance, and visualize the resulting trade-offs among objectives. DeepMTL2R is available at https://github.com/amazon-science/DeepMTL2R.
Decoding-free reranking methods that read relevance signals directly from LLM attention weights offer significant latency advantages over autoregressive approaches, yet suffer from attention score homogenization: middle-context documents receive near-identical scores, destroying the fine-grained distinctions required for ranking. We propose HeadRank, a framework that lifts preference optimization from discrete token space into the continuous attention domain through entropy-regularized head selection, hard adjacent-level preference pairs, and a distribution regularizer that jointly sharpen discriminability in the homogenized middle zone. Depth truncation at the deepest selected layer further reduces inference to O(1) forward passes. Across 14 benchmarks on three Qwen3 scales (0.6B--4B) using only 211 training queries, HeadRank achieves the highest average NDCG@10 at every scale, outperforming both generative and decoding-free baselines on the majority of benchmarks with 100% formatting success. At 4B, 57.4% of relevant middle-zone documents reach the top quartile versus 14.2% for irrelevant ones -- a 43-percentage-point selectivity gap that demonstrates the effectiveness of attention-space preference alignment for listwise reranking.
Juyuan Wang, Chenxing Wang, Yuchen Fang +8
Weixin Group, Tencent, China · 2South China University of Technology, Guangzhou, China
Modern industrial recommender systems use a deep ranking model to score N candidates against the same user and context features. Standard implementations broadcast context features early in the forward pass, redundantly computing context-only operations N times per request. We present a rank-aware decomposition applicable to the dominant interaction mechanisms in modern recommender architectures-Factorization Machine (FM) pairwise products, Deep Cross Network (DCNv2) cross layers, self-attention, and fully connected (FC) projection layers-built on a single algebraic principle: any linear or bilinear operation over a rank-partitioned input admits an exact block decomposition that moves context-only computation from once-per-candidate to once-per-request, identity-equivalent to the original model. Closed-form analysis and controlled ablation verify that savings scale quadratically with the number of context features. Applied to a production DLRM-style ranker without any architectural change, the decomposition increases per-pod throughput by 87.5% (a 47% reduction in peak pod count) at identical model predictions. The identity-equivalent decomposition applies only at the first layer of cross networks and self-attention, since each layer mixes ranks in its output. To extend savings across depth, we further introduce rDCN, an architectural variant of DCNv2 that maintains rank discipline across depth and matches DCNv2 accuracy within training noise at 67% fewer total FLOPs, and sketch an analogous architectural variant for self-attention.