CLAILGApr 11, 2024

LLoCO: Learning Long Contexts Offline

arXiv:2404.07979v237 citationsh-index: 47Has CodeEMNLP
AI Analysis

This addresses the problem of high computational and memory costs for long-context tasks in AI, offering a promising solution for efficient long document question answering, though it is incremental as it builds on existing compression and finetuning techniques.

The paper tackles the challenge of processing long contexts in large language models by proposing LLoCO, which compresses contexts offline and uses parameter-efficient finetuning, extending a 4k token model to handle 128k tokens with up to 7.62x speed-up and 30x fewer tokens during inference.

Processing long contexts remains a challenge for large language models (LLMs) due to the quadratic computational and memory overhead of the self-attention mechanism and the substantial KV cache sizes during generation. We propose LLoCO, a novel approach to address this problem by learning contexts offline through context compression and in-domain parameter-efficient finetuning with LoRA. Our method enables an LLM to create a concise representation of the original context and efficiently retrieve relevant information to answer questions accurately. Our approach extends the effective context window of a 4k token LLaMA2-7B model to handle up to 128k tokens. We evaluate our approach on several long-context question-answering datasets, demonstrating that LLoCO significantly outperforms in-context learning while using $30\times$ fewer tokens during inference. LLoCO achieves up to $7.62\times$ speed-up during inference and $11.52\times$ higher throughput during finetuning, substantially reduces the cost of long document question answering. This makes it a promising solution for efficient long context processing. Our code is publicly available on https://github.com/jeffreysijuntan/lloco.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes