File size: 2,654 Bytes
26faaff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
license: apache-2.0
base_model: Qwen/Qwen2.5-7B-Instruct
pipeline_tag: text-generation
tags:
  - memory
  - long-horizon
  - reinforcement-learning
  - agent
---

# Memory-R2 7B — Answer Agent

The 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).

It 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.

**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.

## Headline results (`tab:main`)

| Memory manager | Answer agent | F1 | BLEU-1 | LLM-judge (gpt-4o-mini) |
| --- | --- | ---: | ---: | ---: |
| [ahmedehabb/Memory-R2](https://huggingface.co/ahmedehabb/Memory-R2) | this model | **51.46** | **44.84** | 69.03 |
| [ahmedehabb/Memory-R2](https://huggingface.co/ahmedehabb/Memory-R2) | GPT-OSS-120B (untrained, external) | 49.29 | 43.64 | **86.08** |

## Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

answer_agent = AutoModelForCausalLM.from_pretrained("ahmedehabb/Memory-R2-answer-agent", torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("ahmedehabb/Memory-R2-answer-agent")
```

Full 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).

## Training

- Base model: `Qwen/Qwen2.5-7B-Instruct`
- SFT warm-start followed by an RL continuation (answer-F1 reward) against the memory manager's rollouts
- Judge for reward/logging during training: GPT-OSS-120B

## Citation

```bibtex
@misc{yan2026memoryr2faircreditassignment,
      title={Memory-R2: Fair Credit Assignment for Long-Horizon Memory-Augmented LLM Agents},
      author={Sikuan Yan and Ahmed Bahloul and Ercong Nie and Susanna Schwarzmann and Riccardo Trivisonno and Volker Tresp and Yunpu Ma},
      year={2026},
      eprint={2605.21768},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2605.21768},
}
```