Journal of the Operations Research Society of China ›› 2026, Vol. 14 ›› Issue (3): 1088-1114.doi: 10.1007/s40305-026-00672-w

Previous Articles     Next Articles

Alternating Bayesian Mixed Integer Optimization for Context Window Extension in Large Language Models Without Tuning Model Parameters

Jia Liu1,3, Zhi-You Wu2,3, Huan Gao3, Peng Hu2,4, Ran Gu2,3   

  1. 1 National Center for Applied Mathematics in Chongqing, Chongqing Normal University, Chongqing 401331, China;
    2 School of Mathematical Sciences, Chongqing Normal University, Chongqing 401331, China;
    3 Chongqing Key Lab of Cognitive Intelligence and Intelligent Finance, Chongqing Normal University, Chongqing 401331, China;
    4 School of Science, Xichang University, Xichang 615000, Sichuan, China
  • Received:2025-04-29 Revised:2025-12-02 Accepted:2026-02-26 Online:2026-09-30 Published:2026-10-15
  • Supported by:
    This work was supported by the Natural Science Foundation of Chongqing Municipality (No. CSTB2023NSCQ-LZX0056) and the Chongqing Graduate Student Research Innovation Project (No. YKC24001).

Abstract: Extending the context window of large language models (LLMs) is crucial for effectively processing long texts, yet existing models typically struggle due to their restricted input lengths. Existing methods for extending context windows mainly include training-based and training-free approaches. However, training-based methods require significant computational resources, while training-free methods typically achieve limited performance. In this paper, we propose a new method to effectively extend the context window of LLMs. This method consists of three key components: First, we conduct an experimental analysis of Rotary Position Embedding (RoPE), a primary positional encoding method used in LLMs, to identify the critical characteristics that influence the context window size and performance of LLMs. Second, based on the analysis results, we formulate a mixed integer black-box optimization model and utilize its optimal solution to determine the best adjustment strategy for RoPE. Third, we develop an alternating Bayesian mixed integer optimization algorithm to solve the model. Extensive experiments show that our method successfully extends the context window of LLMs and outperforms most existing training-based and training-free methods across various tasks.

Key words: LLM context window extension, Mixed integer black-box optimization model, Alternating Bayesian mixed integer optimization algorithm, Rotary positional embedding

CLC Number: