Cubit: Token Mixer with Kernel Ridge Regression

Chuanyang Zheng, Jiankai Sun, Yihang Gao, Yuehao Wang, Liangchen Tan, Mac Schwager, Anderson Schneider, Yuriy Nevmyvaka, Xiaodong Liu

TL;DR

Standard Transformer attention can be mathematically framed as Nadaraya–Watson kernel regression. This paper introduces Cubit, a novel token-mixing architecture that upgrades this mechanism to Kernel Ridge Regression (KRR), delivering a stronger mathematical foundation, explicit regularization, and superior performance that scales exceptionally well with long sequences.

What Problem Does This Paper Address?

Since 2017, the Transformer architecture has dominated deep learning, yet its core token-mixing mechanism—softmax attention—has remained fundamentally unchanged. From a statistical perspective, standard attention acts as a Nadaraya–Watson estimator, a classical non-parametric regression method that aggregates values based on query-key similarities.

However, this approach lacks explicit regularization to manage the bias-variance trade-off and can suffer from training instabilities and boundary effects, particularly as sequence lengths grow. The authors address this limitation by re-engineering the attention block using a more robust regression framework to improve stability and long-context modeling.

Methods

The authors introduce Cubit, which replaces Nadaraya–Watson regression with the closed-form solution of Kernel Ridge Regression (KRR).

  • KRR Attention Formulation: Instead of relying solely on query-dependent softmax weights, Cubit incorporates a global normalization matrix $\Sigma = (g(K K^\top) + \lambda I)^{-1}$. Here, $\lambda$ acts as an explicit ridge regularization parameter, providing better robustness to noise and faster convergence rates in the Reproducing Kernel Hilbert Space (RKHS).
  • Limited-Range Rescale (LRR): To prevent numerical instability during training, the authors introduce LRR. This mechanism uses a learnable, sigmoid-gated scaling vector to bound the value layer within a controlled range, guaranteeing the invertibility of the underlying kernel matrices.

Datasets

The architecture was pre-trained and evaluated using several prominent language modeling datasets:

  • Pre-training: Arxiv, Books3, and subsets of the large-scale FineWeb / FineWeb-Edu datasets.
  • Downstream Evaluation: Zero-shot performance was tested across seven standard benchmarks: ARC-C, HellaSwag, PIQA, SciQ, WinoGrade, SocialIQA, and RACE.

Key Insights and Ideas

  • Attention is Just Regression: The core conceptual breakthrough is treating token mixing strictly as a non-parametric regression problem. This opens the door to applying decades of statistical regression theory directly to deep learning architectures.
  • The Power of Explicit Regularization: By introducing the ridge parameter ($\lambda$), Cubit explicitly manages the bias-variance trade-off, making the model inherently more robust to noise than vanilla Transformers.
  • Long-Context Advantage: Standard attention often suffers at longer contexts due to a lack of structural constraints. In contrast, Cubit’s performance advantage over the Transformer actually widens as the training sequence length increases.

Key Results

  • Consistent Loss Reduction: Cubit consistently achieves lower validation perplexity than both the standard Transformer and DeltaFormer across Arxiv, Books3, and FineWeb datasets.
Validation loss on Arxiv and Books3 datasets showing Cubit outperforming baselines.
  • Sequence Length Scaling: As shown in Figure 3, the training loss gap between Cubit and the Transformer increases monotonically with sequence length, stabilizing at a substantial 0.05–0.06 margin for 8192 tokens.
Training loss gap widening as sequence length increases.
  • Downstream Superiority: In zero-shot downstream evaluations, a 350M parameter Cubit model trained on 50B tokens achieved an average score of 50.01, outperforming the Transformer (49.48) and DeltaFormer (49.63).

Limitations and Future Work

  • Computational Speed: The authors experimented with a Local Linear Regression (LLR) variant to mitigate boundary effects, but noted it is currently quite slow compared to the KRR implementation. Future work will focus on optimizing the speed of both KRR and LLR token mixers.
  • Alternative Regression Frameworks: The authors suggest exploring even more advanced statistical frameworks, such as Local Kernel Ridge Regression, to further boost performance.
  • Broader Impact Obscurity: While the authors note that Cubit is a more powerful model that could benefit society, they acknowledge it remains unclear if or how such an architecture might be abused.

Summary updated

BibTeX
@misc{zheng2026cubit,
  author = {Chuanyang Zheng and Jiankai Sun and Yihang Gao and Yuehao Wang and Liangchen Tan and Mac Schwager and Anderson Schneider and Yuriy Nevmyvaka and Xiaodong Liu},
  title = {{Cubit: Token Mixer with Kernel Ridge Regression}},
  year = {2026},
  eprint = {2605.06501},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.06501},
}
Figure