ClockRoPE Enhances Transformer Models for Temporal Routines

Yiwen Chen, Joshua Ainslie, Krzysztof Choromanski, Xiang Gao, Su-Lin Wu, Yiping Yuan, Qian Sun· July 30, 2026 View original

Summary

ClockRoPE introduces Random Fourier Rotations to Rotary Position Embedding (RoPE), enabling transformer-based models to better capture temporal periodicity in sequential data. This innovation improves attention modulation for complex distance-correlation patterns, demonstrating significant gains in online recommendation systems.

Rotary Position Embedding (RoPE) is widely used in transformer models but its log-linear frequency schedule is primarily designed for long-term attention decay, limiting its effectiveness for complex temporal patterns like periodicity. This research introduces ClockRoPE, which leverages Random Fourier Rotations to enhance temporal routine modeling. ClockRoPE's theoretical foundation shows that any normalized continuous positive-definite attention modulation function can be approximated by random rotations derived from its own Fourier transform. By applying this to sequential recommendation, where rotation frequencies are based on periodic attention modulation functions, ClockRoPE significantly improves the model's ability to understand and utilize temporal routines. Online A/B tests confirm consistent improvements in valued engagement metrics, leading to its successful deployment in a large-scale generative retrieval system.

Why it matters

For professionals building recommendation systems, search engines, or any AI dealing with sequential data with strong temporal patterns, ClockRoPE offers a significant upgrade to transformer architectures, leading to more accurate predictions and improved user engagement.

How to implement this in your domain

  1. 1Evaluate the current position embedding strategy in transformer-based sequential models for its ability to capture temporal periodicity.
  2. 2Investigate integrating ClockRoPE or similar Random Fourier Rotation techniques into existing transformer architectures for sequential recommendation or time-series forecasting.
  3. 3Conduct A/B tests to measure the impact of ClockRoPE on key engagement metrics in production systems.
  4. 4Explore the theoretical underpinnings of Random Fourier Rotations to understand how they can be adapted for other complex distance-correlation patterns.

Who benefits

E-commerceMedia & EntertainmentSocial MediaAdvertisingFinTech

Key takeaways

  • Standard RoPE's log-linear frequency schedule limits its effectiveness for complex temporal periodicity.
  • ClockRoPE uses Random Fourier Rotations to better model temporal routines in sequential data.
  • It allows attention modulation functions to be approximated by rotations derived from their Fourier transform.
  • Deployed in production, ClockRoPE significantly improves engagement metrics in sequential recommendation systems.

Original post by Yiwen Chen, Joshua Ainslie, Krzysztof Choromanski, Xiang Gao, Su-Lin Wu, Yiping Yuan, Qian Sun

"arXiv:2607.26369v1 Announce Type: new Abstract: Rotary Position Embedding (RoPE) has been widely adopted in transformer-based large language models. However, its log-linear frequency schedule, originally designed to produce long-term attention decay, limits its adoption in domain…"

View on X

Originally posted by Yiwen Chen, Joshua Ainslie, Krzysztof Choromanski, Xiang Gao, Su-Lin Wu, Yiping Yuan, Qian Sun on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses