TokenFormer: Unify the Multi-Field and Sequential Recommendation Worlds

Yifeng Zhou, Yuehong Hu, Zhixiang Feng, Junwei Pan, Kaihui Wu, Hanyong Li, Shangyu Zhang, Shudong Huang, Zhangbin Zhu, Chengguo Yin, Haijie Gu, Jie JiangarXiv 2026

TL;DR

TokenFormer unifies multi-field feature interactions and sequential user behavior modeling into a single, homogeneous Transformer backbone. By introducing a layered attention scheme and non-linear gating, it prevents "sequential collapse" caused by low-information static fields, delivering significant accuracy and throughput gains in production.

What Problem Does This Paper Address?

Modern recommender systems deal with two distinct types of data: static multi-field categorical features (e.g., user demographics, device type) and sequential behavior logs (e.g., a user's recent click history). Historically, these have been handled by separate architectures—Collaborative Filtering/CTR models for static fields and sequential models (like SASRec or HSTU) for behavior histories—and fused late in the pipeline.

While recent trends attempt to unify these into a single Transformer backbone by flattening everything into a token stream, the authors discover a hidden trap: Sequential Collapse Propagation (SCP). Static features often have low information density and occupy a low-dimensional subspace. When forced to interact with sequential features through standard linear attention, this low-rank "noise" propagates, causing the high-dimensional sequential representations to dimensionally collapse and lose their predictive power.

Figure 1: The central tradeoff in unified recommendation modeling. Left: representation discriminability measured by mutual information (MI). Right: dimensional robustness measured by the singular value spectrum and effective rank. Compared with a sequence-only Transformer (green), naive unification of sequential and non-sequential features with a vanilla Transformer (blue) improves discriminability, but also induces much steeper spectral decay and lower effec- tive rank in sequential representations, revealing sequential collapse propagation. The proposed BFTS and NLIR mitigate this collapse, restore dimensional robustness, and further improve discriminability.

Methods

TokenFormer addresses SCP through a homogeneous decoder-only architecture featuring two main innovations:

  1. Bottom-Full-Top-Sliding (BFTS) Attention: Instead of uniform attention across all layers, TokenFormer uses full causal attention in the lower layers to thoroughly mix static fields and sequence tokens. In deeper layers, it switches to a shrinking-window Sliding Window Attention (SWA) and completely discards the static tokens. This ensures global context is captured early, while deeper layers focus purely on local temporal dynamics.
  2. Non-Linear Interaction Representation (NLIR): To prevent rank collapse, TokenFormer introduces a multiplicative gating mechanism on the attention output. By applying a one-sided non-linear transformation ($\sigma(G^{(l)}) \odot A^{(l)}$), it injects high-order non-linearity that acts as a mathematical safeguard, preserving the rank richness and expressiveness of the feature space.

Additionally, it uses a unified Rotary Positional Embedding (RoPE) scheme to handle relative chronological ordering across the entire token stream without needing explicit type embeddings.

Figure 2: Overview of TokenFormer. TokenFormer represents multi-field features F , sequential behavior tokens T, and target features V as a unified token stream, which is processed by stacked Unified Interaction Blocks (UIBs). Each UIB combines the proposed Bottom-Full-Top-Sliding (BFTS) attention design, which applies full causal attention in shallow layers and shrinking SWA in deeper layers, with the Non-Linear Interaction Representation (NLIR) for multiplicative feature interaction.

Datasets

The authors evaluated TokenFormer on both academic and massive industrial scales:

  • KuaiRand-27K: A public sequential recommendation benchmark containing approximately 27k unique user interaction trajectories.
  • Tencent Ads Platform: Massive, production-grade datasets containing billions of interaction logs characterized by extreme feature sparsity and dynamic user intent.

Key Insights and Ideas

  • The Unification Tradeoff: Naively throwing static and sequential features into a vanilla Transformer improves representation discriminability (measured by mutual information) but severely degrades dimensional robustness (effective rank). TokenFormer achieves the best of both worlds.
  • Gating as a Rank Preserver: Multiplicative gating (NLIR) isn't just a feature filter; it actively prevents representation collapse by promoting feature decorrelation and preserving subspace dimensionality.
  • Static Features are Early-Stage Priors: Static features provide valuable context initially, but repeatedly attending to them in deep layers introduces structural noise. Discarding them in upper layers allows the model to focus entirely on temporal dynamics.

Key Results

  • Offline Performance: On the KuaiRand-27K dataset, TokenFormer-T (Tiny) outperformed the vanilla Transformer baseline by 5.00‰ in AUC and beat the strong HSTU-Ultra baseline by 2.05‰. Larger variants scaled even higher, with TokenFormer-L achieving an +8.15‰ AUC improvement.
  • Online Production Impact: Deployed in production on Tencent's WeChat Channels advertising system, TokenFormer achieved a 4.03% uplift in GMV (Gross Merchandise Value) and a +0.22% relative AUC improvement over a highly optimized production baseline.
  • Serving Efficiency: By utilizing a decoupled serving strategy (compressing user-side tokens) combined with BFTS, TokenFormer boosted inference throughput from 126 QPS to 695 QPS—a 5.5× speedup, making it highly practical for large-scale industrial deployment.

Limitations and Future Work

The authors note that TokenFormer's performance plateaus on smaller academic datasets beyond a certain model size due to data cardinality bottlenecks (i.e., limited sample volume to regularize high-capacity models). Its full potential as a heavy-duty backbone adhering to neural scaling laws is best unlocked in data-abundant, large-scale industrial regimes. Future work could explore better regularization techniques to make these unified architectures more data-efficient on smaller benchmarks.

Summary updated

BibTeX
@misc{zhou2026tokenformer,
  author = {Yifeng Zhou and Yuehong Hu and Zhixiang Feng and Junwei Pan and Kaihui Wu and Hanyong Li and Shangyu Zhang and Shudong Huang and Zhangbin Zhu and Chengguo Yin and Haijie Gu and Jie Jiang},
  title = {{TokenFormer: Unify the Multi-Field and Sequential Recommendation Worlds}},
  year = {2026},
  eprint = {2604.13737},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.13737},
}
Figure