We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/Mathematics/Optimal RoPE extension via Bayesian Optimization for training-free length generalization
PeriodicalsMathematics

Optimal RoPE extension via Bayesian Optimization for training-free length generalization

Checking your access to this record.

Abstract & Overview

Transformers are designed to process input of variable length without resource constraints. However, their performance significantly deteriorates when the input surpasses a threshold slightly larger than the pre-training context window. This limitation on the effective context window confines the application of Transformer-based large language models (LLMs) that have been the subject of great anticipation. Consequently, the generalization of pre-trained LLMs to handle varying input lengths becomes a pivotal and formidable challenge. Previous research has endeavored to address this challenge by modifying the Rotary Position Embedding (RoPE), the primary factor responsible for disparities in handling different input lengths. These efforts have provided valuable insights, while they often lack a deep understanding of the root causes of performance degradation and rely heavily on manual parameter tuning. In response to these issues, we conduct a comprehensive analysis and identify two primary causes behind the performance drop: global distribution mismatch and local resolution degradation. In light of these challenges, we introduce an Optimal RoPE (ORoPE) extension using Bayesian Optimization (BO), which alleviates the need for additional model training. Our experiments demonstrate the efficacy of our approach, outperforming baselines by up to 21.9%, 32.1%, and 41.2% at evaluation lengths of 8K, 16K, and 32K, respectively. We will release all code and data when this paper is published.

Cite this record

Xinrong Zhang, Shengding Hu, Weilin Zhao, Huadong Wang, Xu Han, Chaoqun He, et al. (2025). Optimal RoPE extension via Bayesian Optimization for training-free length generalization. AI Open, 6, 1–11. https://doi.org/10.1016/j.aiopen.2025.01.002

Copy in another style

Zhang, X., Hu, S., Zhao, W., Wang, H., Han, X., He, C., Zeng, G., Liu, Z., & Sun, M. (2025). Optimal RoPE extension via Bayesian Optimization for training-free length generalization. AI Open, 6, 1–11. https://doi.org/10.1016/j.aiopen.2025.01.002
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.