ChatPaper.aiChatPaper

긴 레시피: 대규모 언어 모델에서 효율적인 긴 문맥 일반화를 위한 레시피

LongRecipe: Recipe for Efficient Long Context Generalization in Large Languge Models

August 31, 2024
저자: Zhiyuan Hu, Yuliang Liu, Jinman Zhao, Suyuchen Wang, Yan Wang, Wei Shen, Qing Gu, Anh Tuan Luu, See-Kiong Ng, Zhiwei Jiang, Bryan Hooi
cs.AI

초록

대형 언어 모델(Large language models, LLMs)은 사전 훈련 중 효과적인 컨텍스트 창 크기가 제한되어 긴 문맥 작업을 처리하는 데 상당한 어려움을 겪습니다. 이는 LLMs가 확장된 시퀀스에 대해 일반화하는 능력을 제한하기 때문입니다. 한편, LLMs에서 컨텍스트 창을 확장하는 것은 사후 사전 훈련을 통해 매우 많은 리소스를 필요로 합니다. 이에 대응하기 위해 우리는 **LongRecipe**를 소개합니다. 이는 LLMs의 컨텍스트 창을 확장하기 위한 효율적인 훈련 전략으로, 중요한 토큰 분석, 위치 인덱스 변환 및 훈련 최적화 전략을 포함합니다. LongRecipe는 훈련 효율을 유지하면서 긴 시퀀스 입력을 시뮬레이션하며, 훈련 효율을 유지하고 모델의 장거리 종속성 이해를 크게 향상시킵니다. 세 가지 유형의 LLMs에 대한 실험 결과, LongRecipe는 대상 컨텍스트 창 크기의 30%만 필요로 하면서도 긴 시퀀스를 활용할 수 있으며, 전체 시퀀스 훈련 대비 계산 훈련 리소스를 85% 이상 줄입니다. 더불어, LongRecipe는 일반 작업에서 원래 LLM의 능력을 유지합니다. 궁극적으로, *우리는 오픈 소스 LLMs의 효과적인 컨텍스트 창을 8k에서 128k로 확장하여, 80G 메모리를 갖춘 단일 GPU를 사용하여 단 하루의 전용 훈련으로 GPT-4와 유사한 성능을 달성할 수 있습니다.* 저희의 코드는 [링크](https://github.com/zhiyuanhubj/LongRecipe)에서 공개되어 있습니다.
English
Large language models (LLMs) face significant challenges in handling long-context tasks because of their limited effective context window size during pretraining, which restricts their ability to generalize over extended sequences. Meanwhile, extending the context window in LLMs through post-pretraining is highly resource-intensive. To address this, we introduce **LongRecipe**, an efficient training strategy for extending the context window of LLMs, including impactful token analysis, position index transformation, and training optimization strategies. It simulates long-sequence inputs while maintaining training efficiency and significantly improves the model's understanding of long-range dependencies. Experiments on three types of LLMs show that LongRecipe can utilize long sequences while requiring only 30% of the target context window size, and reduces computational training resource over 85% compared to full sequence training. Furthermore, LongRecipe also preserves the original LLM's capabilities in general tasks. Ultimately, *we can extend the effective context window of open-source LLMs from 8k to 128k, achieving performance close to GPT-4 with just one day of dedicated training using a single GPU with 80G memory.* Our code is released at the [link](https://github.com/zhiyuanhubj/LongRecipe).

Summary

AI-Generated Summary

PDF422November 16, 2024