LLM Maybe LongLM: 튜닝 없이 LLM 컨텍스트 윈도우를 자체 확장
LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuning
January 2, 2024
저자: Hongye Jin, Xiaotian Han, Jingfeng Yang, Zhimeng Jiang, Zirui Liu, Chia-Yuan Chang, Huiyuan Chen, Xia Hu
cs.AI
초록
본 연구는 미세 조정 없이도 대규모 언어 모델(LLM)이 장문 맥락을 처리할 수 있는 내재적 능력을 이끌어냅니다. 학습 과정에서 제한된 길이의 훈련 시퀀스는 추론 시 장문 입력 시퀀스에 대한 LLM의 적용을 제한할 수 있습니다. 본 연구에서는 기존 LLM 자체가 장문 맥락을 처리할 수 있는 내재적 능력을 가지고 있다고 주장합니다. 이를 바탕으로, 우리는 LLM의 컨텍스트 윈도우를 스스로 확장하여 이러한 내재적 능력을 최대한 활용할 것을 제안합니다. LLM의 장문 맥락 처리 잠재력을 자극하기 위해 Self-Extend를 제안합니다. 기본 아이디어는 그룹 수준과 이웃 수준의 이중 수준 주의 정보를 구성하는 것입니다. 두 수준은 원본 모델의 자기 주의 메커니즘에 의해 계산되며, 이는 제안된 방법이 어떠한 학습도 필요로 하지 않음을 의미합니다. 단 4줄의 코드 수정만으로, 제안된 방법은 기존 LLM의 컨텍스트 윈도우를 미세 조정 없이도 손쉽게 확장할 수 있습니다. 포괄적인 실험을 수행한 결과, 제안된 방법이 기존 LLM의 컨텍스트 윈도우 길이를 효과적으로 확장할 수 있음을 보여줍니다.
English
This work elicits LLMs' inherent ability to handle long contexts without
fine-tuning. The limited length of the training sequence during training may
limit the application of Large Language Models (LLMs) on long input sequences
for inference. In this work, we argue that existing LLMs themselves have
inherent capabilities for handling long contexts. Based on this argument, we
suggest extending LLMs' context window by themselves to fully utilize the
inherent ability.We propose Self-Extend to stimulate LLMs' long context
handling potential. The basic idea is to construct bi-level attention
information: the group level and the neighbor level. The two levels are
computed by the original model's self-attention, which means the proposed does
not require any training. With only four lines of code modification, the
proposed method can effortlessly extend existing LLMs' context window without
any fine-tuning. We conduct comprehensive experiments and the results show that
the proposed method can effectively extend existing LLMs' context window's
length.