paper-with-me

홈 › Papers

LLoCO: Learning Long Contexts Offline

2024-04-11 · Sijun Tan, Xiuyu Li, Shishir Patil, Ziyang Wu, Tianjun Zhang, Kurt Keutzer, Joseph E. Gonzalez, Raluca Ada Popa

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.

📄 PDF Abstract BibTeX arXiv:2404.07979

Code (1)

jeffreysijuntan/lloco 공식 구현 pytorch

Tasks

4kIn-Context LearningQuestion Answering

Similar Papers 제목 키워드 기반

PolicyLong: Towards On-Policy Context Extension

2026-04-09 · Junlong Jia, Ziyang Chen, Xing Wu, Chaochen Gao 외 arxiv

Extending LLM context windows is hindered by scarce high-quality long-context data. Recent methods synthesize data with genuine long-range dependencies via information-theoretic verification, selecting contexts that redu…

Bypassing the Monster: A Faster and Simpler Optimal Algorithm for Contextual Bandits under Realizability

2020-03-28 · David Simchi-Levi, Yunzong Xu

We consider the general (stochastic) contextual bandit problem under the realizability assumption, i.e., the expected reward, as a function of contexts and actions, belongs to a general function class $\mathcal{F}$. We d…

Multi-Armed Banditsregression

Infer Implicit Contexts in Real-time Online-to-Offline Recommendation

2019-07-08 · Xichen Ding, Jie Tang, Tracy Liu, Cheng Xu 외

Understanding users' context is essential for successful recommendations, especially for Online-to-Offline (O2O) recommendation, such as Yelp, Groupon, and Koubei. Different from traditional recommendation where individu…

Implicit Context-aware Learning and Discovery for Streaming Data Analytics

2019-10-18 · Kin Gwn Lore, Kishore K. Reddy

The performance of machine learning model can be further improved if contextual cues are provided as input along with base features that are directly related to an inference task. In offline learning, one can inspect his…

Clustering

All-Mem: Agentic Lifelong Memory via Dynamic Topology Evolution

2026-03-20 · Can Lv, Heng Chang, Shengyu Tao, Mingju Chen 외 arxiv

Lifelong interactive agents are expected to assist users over months or years, which requires continually writing long term memories while retrieving the right evidence for each new query under fixed context and latency …