BytedTsinghua-SIA/MemAgent
An RL-trained memory agent framework that enables LLMs to extrapolate to 3.5M token contexts from 32K training.

MemAgent is a long-context processing framework that optimizes LLM performance through end-to-end reinforcement learning without modifying model architecture. It demonstrates near-lossless extrapolation from 8K context trained on 32K text to 3.5M token QA tasks, achieving 95%+ accuracy on 512K RULER benchmarks. The repository includes RL-MemAgent-14B and RL-MemAgent-7B model weights along with a training framework for RL-based agent workflow optimization.