ahmedehabb/Memory-R2-answer-agent
099
1---2license: apache-2.03base_model: Qwen/Qwen2.5-7B-Instruct4pipeline_tag: text-generation5tags:6 - memory7 - long-horizon8 - reinforcement-learning9 - agent10---11 12# Memory-R2 7B — Answer Agent13 14The trained **answer agent** (`sft_cont_step55`) from [Memory-R2: Fair Credit Assignment for Long-Horizon Memory-Augmented LLM Agents](https://arxiv.org/abs/2605.21768) (arXiv:2605.21768).15 16It is a Qwen2.5-7B-Instruct model trained with an SFT warm-start followed by an RL continuation (answer-F1 reward). Given a question and a memory store, it generates the final answer.17 18**This model only answers questions — it does not manage memory.** It is meant to be paired with the [Memory-R2 memory manager](https://huggingface.co/ahmedehabb/Memory-R2), which reads the running conversation and maintains the memory store this model answers from. It is *optional and swappable*: the memory manager was evaluated against several different answer agents in the paper (untrained Qwen-7B, GPT-OSS-120B, this one) — any instruction-tuned LLM can play this role, and using a different one has no effect on how memory is maintained.19 20## Headline results (`tab:main`)21 22| Memory manager | Answer agent | F1 | BLEU-1 | LLM-judge (gpt-4o-mini) |23| --- | --- | ---: | ---: | ---: |24| [ahmedehabb/Memory-R2](https://huggingface.co/ahmedehabb/Memory-R2) | this model | **51.46** | **44.84** | 69.03 |25| [ahmedehabb/Memory-R2](https://huggingface.co/ahmedehabb/Memory-R2) | GPT-OSS-120B (untrained, external) | 49.29 | 43.64 | **86.08** |26 27## Usage28 29```python30from transformers import AutoModelForCausalLM, AutoTokenizer31 32answer_agent = AutoModelForCausalLM.from_pretrained("ahmedehabb/Memory-R2-answer-agent", torch_dtype="auto", device_map="auto")33tokenizer = AutoTokenizer.from_pretrained("ahmedehabb/Memory-R2-answer-agent")34```35 36Full 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).37 38## Training39 40- Base model: `Qwen/Qwen2.5-7B-Instruct`41- SFT warm-start followed by an RL continuation (answer-F1 reward) against the memory manager's rollouts42- Judge for reward/logging during training: GPT-OSS-120B43 44## Citation45 46```bibtex47@misc{yan2026memoryr2faircreditassignment,48 title={Memory-R2: Fair Credit Assignment for Long-Horizon Memory-Augmented LLM Agents},49 author={Sikuan Yan and Ahmed Bahloul and Ercong Nie and Susanna Schwarzmann and Riccardo Trivisonno and Volker Tresp and Yunpu Ma},50 year={2026},51 eprint={2605.21768},52 archivePrefix={arXiv},53 primaryClass={cs.LG},54 url={https://arxiv.org/abs/2605.21768},55}56```57 