UIO-LLMs: Unbiased Incremental Optimization for Long-Context LLMs

Wenhao Li, Mingbao Lin, Yunshan Zhong, Shuicheng Yan, Rongrong Ji
6/26/2024
cs.CL

No official code found. Best implementation: wenhaoli-xmu/UIO-LLMs (7 stars, last commit 2025-08-05).

Abstract

Managing long texts is challenging for large language models (LLMs) due to limited context window sizes. This study introduces UIO-LLMs, an unbiased incremental optimization approach for memory-enhanced transformers under long-context settings. We initially conceptualize the process as a streamlined encoder-decoder framework where the weights-shared encoder and decoder respectively encapsulate a context segment into memories and leverage these memories to predict outputs of the subsequent segment. Subsequently, by treating our memory-enhanced transformers as fully-connected recurrent neural networks (RNNs), we refine the training process using the Truncated Backpropagation Through Time (TBPTT) algorithm, which incorporates innovative incremental optimization techniques. These techniques not only diminish time complexity but also address the bias in gradient computation through an unbiased optimization process. UIO-LLMs successfully handle long context, such as extending the context window of Llama2-7b-chat from 4K to 100K tokens with minimal 2% additional parameters, while keeping the inference cost nearly linear as context length increases.

View on arXivView PDF

Code Implementations(1)

Official implementation of UIO-LLMs

70PythonJun 26, 20241 years ago

Similar Papers

Cite this paper

@article{li2024uiollms,
  title  = {UIO-LLMs: Unbiased Incremental Optimization for Long-Context LLMs},
  author = {Wenhao Li and Mingbao Lin and Yunshan Zhong and Shuicheng Yan and Rongrong Ji},
  year   = {2024},
  eprint = {2406.18173},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.18173v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.18173.svg)](https://codeofpaper.com/paper/2406.18173)

Discussion