NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PaTH Attention: Position Encoding via Accumulating Householder Transformations

Songlin Yang, Yikang Shen, Kaiyue Wen, Shawn Tan, Mayank Mishra, Liliang Ren, Rameswar Panda, Yoon Kim

Abstract

PaTH (Position Encoding via Accumulating Householder Transformations) is a novel, data-dependent position encoding scheme designed to overcome the limitations of static Rotary Position Embeddings (RoPE). By treating position as a cumulative path of input-driven Householder transformations, PaTH enables Transformers to solve complex state-tracking and sequential reasoning tasks that are theoretically impossible for standard attention models. We demonstrate that PaTH achieves superior performance on synthetic reasoning tasks, language modeling benchmarks, and long-context extrapolation up to 64k tokens.

Introduction

Modern Large Language Models (LLMs) predominantly utilize Rotary Position Embedding (RoPE) to capture relative token distances. However, RoPE is fundamentally data-independent; the transformation applied to a token depends solely on its position, not its content. This static nature restricts the model's expressivity, particularly in state-tracking tasks where internal states must be updated dynamically (e.g., variable swapping in code). Theoretically, RoPE-based Transformers are limited to the $TC^0$ complexity class, preventing them from efficiently learning iterated permutations and other complex logic.

Methodology: Accumulating Householder Transformations

The proposed PaTH framework generalizes RoPE into a multiplicative, data-dependent framework. Instead of fixed rotation matrices, PaTH employs a product of Householder-like matrices: $H_t = I - \beta_t w_t w_t^\top$, where the vector $w_t$ and scalar $\beta_t$ are functions of the input token $x_t$. The attention logit between a query at index $i$ and a key at index $j$ is computed by applying a cumulative product of these matrices along the "path" from $j$ to $i$.

To maintain hardware efficiency, the authors utilize the UT transform to represent products of Householder matrices compactly. This is integrated into a FlashAttention-style blockwise algorithm, allowing for parallel training on modern GPUs with performance comparable to standard RoPE implementations.

Synthetic Reasoning and Complexity

PaTH effectively bridges the gap between the associative recall strengths of Softmax Attention and the state-tracking capabilities of Linear RNNs. The paper proves that a one-layer PaTH Transformer can solve $NC^1$-complete problems, representing a significant leap in logical computation capacity over standard absolute or rotary encodings.

PaTH demonstrates superior performance on MQRAR and A5 synthetic reasoning tasks compared to RoPE and other baselines.

As shown in the synthetic evaluations, PaTH maintains near-perfect accuracy on Multi-query Repeated Associative Recall (MQRAR) and requires significantly fewer layers to solve $A_5$ word problems as sequence length increases, whereas other methods scale linearly in depth.

Language Modeling and Long-Context Performance

The authors evaluated a 760M parameter PaTH model pretrained on 50B tokens of Fineweb-Edu. The model outperformed RoPE-based counterparts across zero-shot commonsense reasoning tasks (averaging 54.2 vs 52.7). Crucially, PaTH exhibits exceptional length extrapolation. While RoPE models typically fail when sequences exceed their training window, PaTH (specifically the PaTH-FoX variant) generalizes gracefully.

Length extrapolation performance on Narrative QA, showing PaTH's stability compared to RoPE's divergence beyond the training context.

On the Narrative QA benchmark, PaTH maintains stable perplexity up to 64k tokens, while RoPE's performance degrades rapidly after the 4k token mark. Furthermore, the authors demonstrated that pretrained RoPE models can be distilled into PaTH models, resulting in improved performance on math and coding tasks.

Conclusion

PaTH introduces a dynamic, input-driven approach to position encoding that significantly enhances the computational expressivity of Transformers. By enabling iterative refinement of the KV cache and solving higher-order complexity problems, PaTH sets a new standard for state-tracking and long-context reasoning. Future work will focus on improving numerical stability in lower precision and optimizing for larger head dimensions.

Summary updated

BibTeX
@inproceedings{yang2025path,
  author = {Songlin Yang and Yikang Shen and Kaiyue Wen and Shawn Tan and Mayank Mishra and Liliang Ren and Rameswar Panda and Yoon Kim},
  title = {{PaTH Attention: Position Encoding via Accumulating Householder Transformations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=ZBlHEeSvKd},
}
Figure