Cache2LoRA: Understanding and Improving Context Internalization
Yi Fang, Gaurav Srivastava, Zhenyu Bi, Sirui Ding, Xuan Wang
Abstract
Context-to-LoRA methods encode documents as low-rank parameter updates, allowing language models to answer without retaining the source text in their decoding context. How reliably do these updates preserve facts and support their use under different instructions? Controlled diagnosis of existing context-to-LoRA methods separates fact discrimination, target retention, and response adaptation. Competing sources influence answers, while target-only construction and memory-state optimization improve recovery at fixed update size. Recovering facts also does not ensure that answers follow response instructions. We introduce Cache2LoRA, which uses each query to aggregate evidence from a reusable frozen document cache before generating LoRA updates. Trainable encoding operates only on the query and memory-token suffix, and multi-style supervision teaches both evidence preservation and answer expression. Across 17 tasks, Cache2LoRA improves on existing context-to-LoRA methods and achieves macro F1 of 0.663, approaching full-context in-context learning at 0.671. For 32K documents and 256-token outputs at batch size 16, its decoding throughput is 5.9 that of full-context ICL. At matched memory size, generated LoRA preserves answer accuracy more reliably than the learned-KV variant under long, diverse intervening text and combines more effectively with retained document KV, yielding higher hybrid F1 and EM.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL, cs.IR
Related papers
Beyond Linear Decodability: Understanding and Improving Instruction Following in World Action Models
Shared title terminologycs.AIBokai Ji, Jiapeng Chen, Yi Zhang et al.
LongForge: Measuring and Improving Long-Context Instruction Data via Evidence-Assertion Reasoning Graphs
Shared title terminologycs.AIZiyang Chen, Junlong Jia, Xing Wu et al.
R^2Orch: Recursive Self-Improvement for Agent Orchestration via Self-Play within a Skill-Internalization Loop
Shared title terminologycs.AIMingda Zhang, Yun Huang, Qiang Huang et al.
Fin-RSI: A Unified Library of Financial Skills, Checks, and Self-Improvement for LLM Agents
Shared title terminologycs.AIWanghao Ye, Shwai He, Sihan Chen et al.
Emotion-Aware and Context-Grounded Dialogue Agents for Personalized Video Game Interactions
Shared title terminologycs.AIMichael Adjeisah, Jin Zhang, Pierluigi Vito Amadori et al.
MVAgent: Per-Video Agents under Global Coordination for Multi-Video Understanding
Shared title terminologycs.AIKewei Wei, XueXiang Wen, Bocheng Hu et al.