ahmedehabb/Memory-R2
0251
1---2license: apache-2.03base_model: Qwen/Qwen2.5-7B-Instruct4pipeline_tag: text-generation5tags:6 - memory7 - long-horizon8 - reinforcement-learning9 - grpo10 - agent11---12 13# Memory-R2 7B — Memory Manager14 15The trained **memory-management policy** from [Memory-R2: Fair Credit Assignment for Long-Horizon Memory-Augmented LLM Agents](https://arxiv.org/abs/2605.21768) (arXiv:2605.21768). This is the paper's main contribution and deployed "champion" (`32sess_champion_v2`, LoGo-GRPO curriculum, global step 5).16 17It is a Qwen2.5-7B-Instruct model fine-tuned with **LoGo-GRPO** (turn-level + token-level credit assignment) via a curriculum of 8 → 16 → 32-session rollouts on the LoCoMo long-horizon dialogue dataset. Given a running conversation, it decides what to INSERT / UPDATE / DELETE in an external memory store.18 19**This model only manages memory — it does not answer questions.** A separate answer agent reads the memory store this model produces and generates answers; it can be any instruction-tuned LLM. Our own SFT+RL-trained answer agent is released separately at **[ahmedehabb/Memory-R2-answer-agent](https://huggingface.co/ahmedehabb/Memory-R2-answer-agent)**.20 21## Headline results (`tab:main`)22 23This memory manager is held constant; only the paired answer agent changes:24 25| Answer agent | F1 | BLEU-1 | LLM-judge (gpt-4o-mini) |26| --- | ---: | ---: | ---: |27| [ahmedehabb/Memory-R2-answer-agent](https://huggingface.co/ahmedehabb/Memory-R2-answer-agent) (ours, SFT+RL) | **51.46** | **44.84** | 69.03 |28| GPT-OSS-120B (untrained, external) | 49.29 | 43.64 | **86.08** |29 30See the paper's `tab:different-answer-agent` for more pairings (untrained Qwen-7B, etc.) — the memory manager is not tied to any one answer agent.31 32## Usage33 34```python35from transformers import AutoModelForCausalLM, AutoTokenizer36 37memory_manager = AutoModelForCausalLM.from_pretrained("ahmedehabb/Memory-R2", torch_dtype="auto", device_map="auto")38tokenizer = AutoTokenizer.from_pretrained("ahmedehabb/Memory-R2")39```40 41Full inference code and the memory-store protocol are in the [project repository](https://github.com/ahmedehabb/Memory-R2) (see the paper for the official release).42 43## Training44 45- Base model: `Qwen/Qwen2.5-7B-Instruct`46- Algorithm: LoGo-GRPO (turn-level + token-level advantage), curriculum-trained 8-session → 16-session → 32-session47- Reward: per-session cumulative F1 against gold QA + a memory-compression penalty (λ=0.3)48- Judge for reward/logging during training: GPT-OSS-120B49 50## Citation51 52```bibtex53@misc{yan2026memoryr2faircreditassignment,54 title={Memory-R2: Fair Credit Assignment for Long-Horizon Memory-Augmented LLM Agents},55 author={Sikuan Yan and Ahmed Bahloul and Ercong Nie and Susanna Schwarzmann and Riccardo Trivisonno and Volker Tresp and Yunpu Ma},56 year={2026},57 eprint={2605.21768},58 archivePrefix={arXiv},59 primaryClass={cs.LG},60 url={https://arxiv.org/abs/2605.21768},61}62```63 