File size: 2,211 Bytes
a625111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558cc78
 
 
 
a625111
558cc78
a625111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e709ec
a625111
 
 
 
 
 
 
 
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
58
59
60
61
62
63
64
65
66
---
language:
- en
license: apache-2.0
library_name: transformers
base_model: Qwen/Qwen3-4B-Thinking-2507
pipeline_tag: text-generation
tags:
- agent
- productivity
- long-horizon
- rubric-based-rl
- qwen3
---

# Agent-R²-4B

**Agent-R²-4B** is a 4B-parameter language model agent trained for realistic productivity work: long-horizon professional workflows that involve heterogeneous files (documents, spreadsheets, slides, PDFs) and require producing a usable deliverable, not just an answer string.

It is the model introduced in *Agent-R²: Scaling Agents for Realistic Productivity Work via Real-Source Data Synthesis*.

## Results

| Benchmark | Qwen3-4B-Thinking-2507 (base) | Agent-R²-4B | Qwen3-235B-A22B-Thinking-2507 |
|---|---|---|---|
| GDPval  | 32.4 | **51.0** | 48.0 |
| OfficeQA | 2.2 | **14.8** | 13.8 |

Scores are as reported in the paper. All benchmarks evaluate end-to-end task completion on realistic occupational tasks.

## Model Details

- **Base model:** Qwen3-4B-Thinking-2507
- **Parameters:** 4B
- **Training stages:** SFT → rubric-based RL

## How to Use

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "teng-pan/Agent-R2-4B"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype="bfloat16",
    device_map="auto",
)

messages = [
    {"role": "system", "content": "You are a careful productivity agent. Ground every claim in the provided files and verify your deliverable before finishing."},
    {"role": "user", "content": "Using the files in ./workspace, produce quarterly_summary.xlsx ..."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```

For best results, expose the file tools used during training and give the model an explicit, verifiable deliverable specification. The model benefits from being told what the final artifact must contain and how it will be checked.

## Links

- Code: https://github.com/ZJU-REAL/Agent-R2