Saved in:
Bibliographic Details
Main Authors: Han, Wei, Zhou, Pan, Poria, Soujanya, Yan, Shuicheng
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2410.19318
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909364792590336
author Han, Wei
Zhou, Pan
Poria, Soujanya
Yan, Shuicheng
author_facet Han, Wei
Zhou, Pan
Poria, Soujanya
Yan, Shuicheng
contents The limited context window of contemporary large language models (LLMs) remains a huge barrier to their broader application across various domains. While continual pre-training on long-context data is a straightforward and effective solution, it incurs substantial costs in terms of data acquisition and computational resources. To alleviate this issue, we propose SharedLLM, a novel approach grounded in the design philosophy of multi-grained context compression and query-aware information retrieval. SharedLLM is composed of two short-context LLMs such as LLaMA-2, termed upper model and lower model. The lower model functions as a compressor while the upper model acts as a decoder. The upper model receives compressed, multi-grained context information from the lower model and performs context-aware modeling on the running text. Information transfer between the compressor and decoder occurs only at the lowest layers to refrain from long forward paths in the lower model and redundant cross-attention modules in the upper model. Based on this architecture, we introduce a specialized tree-style data structure to efficiently encode, store and retrieve multi-grained contextual information for text chunks. This structure, combined with a search algorithm, enables rapid encoding and retrieval of relevant information from various levels of the tree based on the input query. This entire process, wherein the sender and receiver are derived from the same LLM layer, is referred to as self-injection.
format Preprint
id arxiv_https___arxiv_org_abs_2410_19318
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Two are better than one: Context window extension with multi-grained self-injection
Han, Wei
Zhou, Pan
Poria, Soujanya
Yan, Shuicheng
Computation and Language
Artificial Intelligence
Machine Learning
The limited context window of contemporary large language models (LLMs) remains a huge barrier to their broader application across various domains. While continual pre-training on long-context data is a straightforward and effective solution, it incurs substantial costs in terms of data acquisition and computational resources. To alleviate this issue, we propose SharedLLM, a novel approach grounded in the design philosophy of multi-grained context compression and query-aware information retrieval. SharedLLM is composed of two short-context LLMs such as LLaMA-2, termed upper model and lower model. The lower model functions as a compressor while the upper model acts as a decoder. The upper model receives compressed, multi-grained context information from the lower model and performs context-aware modeling on the running text. Information transfer between the compressor and decoder occurs only at the lowest layers to refrain from long forward paths in the lower model and redundant cross-attention modules in the upper model. Based on this architecture, we introduce a specialized tree-style data structure to efficiently encode, store and retrieve multi-grained contextual information for text chunks. This structure, combined with a search algorithm, enables rapid encoding and retrieval of relevant information from various levels of the tree based on the input query. This entire process, wherein the sender and receiver are derived from the same LLM layer, is referred to as self-injection.
title Two are better than one: Context window extension with multi-grained self-injection
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2410.19318