FocusLLM: Масштабирование контекста LLM с помощью параллельного декодирования
FocusLLM: Scaling LLM's Context by Parallel Decoding
August 21, 2024
Авторы: Zhenyu Li, Yike Zhang, Tengyu Pan, Yutao Sun, Zhichao Duan, Junjie Fang, Rong Han, Zixuan Wang, Jianyong Wang
cs.AI
Аннотация
Для многих последующих приложений важно, чтобы LLM мог использовать полезную информацию из длинного контекста. Однако достижение больших длин контекста с помощью обычной архитектуры трансформера требует значительных ресурсов для обучения и вывода. В данной статье мы представляем FocusLLM, фреймворк, разработанный для расширения длины контекста любого LLM только с декодером, позволяющий модели сосредотачиваться на актуальной информации из очень длинных последовательностей. FocusLLM обрабатывает длинные текстовые входы, разделяя их на части на основе исходной длины контекста модели для уменьшения проблемы рассеянного внимания. Затем он добавляет локальный контекст к каждой части в качестве подсказки для извлечения важной информации из каждой части на основе нового параллельного механизма декодирования и, в конечном итоге, интегрирует извлеченную информацию в локальный контекст. FocusLLM выделяется своей высокой эффективностью обучения и универсальностью: обученный с длиной входа 8K с гораздо меньшими затратами на обучение, чем предыдущие методы, FocusLLM проявляет превосходную производительность на последующих задачах с длинным контекстом и сохраняет сильные способности моделирования языка при обработке обширных длинных текстов, даже до 400K токенов. Наш код доступен по адресу https://github.com/leezythu/FocusLLM.
English
Empowering LLMs with the ability to utilize useful information from a long
context is crucial for many downstream applications. However, achieving long
context lengths with the conventional transformer architecture requires
substantial training and inference resources. In this paper, we present
FocusLLM, a framework designed to extend the context length of any decoder-only
LLM, enabling the model to focus on relevant information from very long
sequences. FocusLLM processes long text inputs by dividing them into chunks
based on the model's original context length to alleviate the issue of
attention distraction. Then, it appends the local context to each chunk as a
prompt to extract essential information from each chunk based on a novel
parallel decoding mechanism, and ultimately integrates the extracted
information into the local context. FocusLLM stands out for great training
efficiency and versatility: trained with an 8K input length with much less
training cost than previous methods, FocusLLM exhibits superior performance
across downstream long-context tasks and maintains strong language modeling
ability when handling extensive long texts, even up to 400K tokens. Our code is
available at https://github.com/leezythu/FocusLLM.Summary
AI-Generated Summary