lycheememory
Dynamic Long Context Reasoning over Compressed Memory via End-to-End Reinforcement Learning
Chen, Zhuoen, Li, Dongfang, Zhang, Meishan, Hu, Baotian, Zhang, Min
We introduce LycheeMemory, a cognitively inspired framework that enables efficient long-context inference via chunk-wise compression and selective memory recall, rather than processing all raw tokens. LycheeMemory segments the input into chunks and encodes each into compressed KV-cache-style representations using a Compressor. AGatethen dynamically selects relevant memory blocks, which a Reasoneriteratively processes with an evolving working memory to solve downstream tasks. The Compressorand Reasonerare jointly optimized via end-to-end reinforcement learning, while the Gate is trained separately as a classifier. Experimental results demonstrate that LycheeMemory achieves competitive accuracy (up to 82% in ablation variants) on multi-hop reasoning benchmarks (e.g., RULER-HQA), successfully extrapolates context length from 7K to 1.75M, and provides a favorable accuracy-efficiency trade-off against strong long-context baselines. Notably, compared to MemAgent, LycheeMemory achieves an average 2 reduction in peak GPU memory usage and a 6 speedup during inference.