philippelaban commited on
Commit
edc6aa6
·
verified ·
1 Parent(s): d4bb9b2

Add UserLM-2.0 model card

Browse files
Files changed (1) hide show
  1. README.md +327 -0
README.md CHANGED
@@ -1,3 +1,330 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ datasets:
4
+ - allenai/WildChat-4.8M
5
+ language:
6
+ - en
7
+ base_model:
8
+ - meta-llama/Llama-3.1-8B-Instruct
9
+ pipeline_tag: text-generation
10
+ library_name: transformers
11
+ tags:
12
+ - userlm
13
+ - user-simulation
14
+ - simulation
15
+ - multi-turn
16
  ---
17
+
18
+ # UserLM-2.0
19
+
20
+ <p align="center">
21
+ <img src="./assets/userlm-2-teaser.png" alt="UserLM-2.0 generates natural conversations that faithfully enact task intents." width="100%">
22
+ </p>
23
+
24
+ UserLM-2.0 is an 8-billion-parameter user simulator for user-AI
25
+ conversations. Unlike typical language models trained to play the assistant,
26
+ UserLM-2.0 generates the **user** side of a conversation. It is conditioned on
27
+ a task intent that describes the user's high-level objective.
28
+
29
+ UserLM-2.0 can:
30
+
31
+ 1. Generate an initial user utterance from a task intent.
32
+ 2. Generate follow-up user utterances from the conversation so far.
33
+ 3. Emit `<|endconversation|>` when it determines that the user's objective has
34
+ been satisfied and the conversation should end.
35
+
36
+ The model is intended to support research on realistic user simulation and the
37
+ development and evaluation of more robust assistant models.
38
+
39
+ > **Paper:** The accompanying UserLM-2.0 paper is forthcoming. An arXiv link
40
+ > will be added when it becomes available.
41
+
42
+ ## Model details
43
+
44
+ - **Developed by:** Omer Gul (Microsoft Research intern, Spring 2026),
45
+ Philippe Laban (Microsoft Research), Tanya Goyal (Microsoft Research), and
46
+ Jennifer Neville (Microsoft Research)
47
+ - **Model type:** Generative causal language model, 8B parameters
48
+ - **Language:** English
49
+ - **License:** MIT
50
+ - **Backbone:** [`meta-llama/Llama-3.1-8B-Instruct`](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct)
51
+ - **Repository:** [`microsoft/UserLM-2.0`](https://huggingface.co/microsoft/UserLM-2.0)
52
+
53
+ ## How to use
54
+
55
+ UserLM-2.0 generates user turns. Put the task intent in the system message,
56
+ generate a user turn, append the assistant's reply, and call the model again.
57
+ The bundled chat template automatically opens the correct user-role generation
58
+ header.
59
+
60
+ The following example uses Hugging Face Transformers directly:
61
+
62
+ ```python
63
+ import torch
64
+ from transformers import AutoModelForCausalLM, AutoTokenizer
65
+
66
+ model_id = "microsoft/UserLM-2.0"
67
+
68
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
69
+ model = AutoModelForCausalLM.from_pretrained(
70
+ model_id,
71
+ dtype=torch.bfloat16,
72
+ device_map="auto",
73
+ ).eval()
74
+
75
+ task_intent = (
76
+ "You want help planning a quick vegetarian dinner for four people. "
77
+ "You have 45 minutes, one guest has a peanut allergy, and you need a "
78
+ "shopping list and cooking instructions. You prefer pasta, but only "
79
+ "mention that preference if the assistant asks. Your goal is not "
80
+ "satisfied until you receive a menu, shopping list, and cooking steps."
81
+ )
82
+ messages = [{"role": "system", "content": task_intent}]
83
+
84
+
85
+ def generate_user_turn(messages: list[dict[str, str]]) -> str:
86
+ inputs = tokenizer.apply_chat_template(
87
+ messages,
88
+ tokenize=True,
89
+ add_generation_prompt=True,
90
+ return_tensors="pt",
91
+ return_dict=True,
92
+ ).to(model.get_input_embeddings().weight.device)
93
+
94
+ with torch.inference_mode():
95
+ outputs = model.generate(
96
+ **inputs,
97
+ max_new_tokens=128,
98
+ do_sample=True,
99
+ temperature=1.0,
100
+ top_p=0.8,
101
+ eos_token_id=tokenizer.eos_token_id,
102
+ pad_token_id=tokenizer.pad_token_id,
103
+ )
104
+
105
+ generated_ids = outputs[0, inputs["input_ids"].shape[1]:]
106
+ return tokenizer.decode(generated_ids, skip_special_tokens=True).strip()
107
+
108
+
109
+ # First user turn
110
+ user_turn = generate_user_turn(messages)
111
+ messages.append({"role": "user", "content": user_turn})
112
+ print("User:", user_turn)
113
+
114
+ # Supply an assistant response, then generate the next user turn.
115
+ messages.append(
116
+ {
117
+ "role": "assistant",
118
+ "content": "I can help with that. Would you prefer pasta, tacos, or a rice bowl?",
119
+ }
120
+ )
121
+ user_turn = generate_user_turn(messages)
122
+
123
+ if "<|endconversation|>" not in user_turn:
124
+ messages.append({"role": "user", "content": user_turn})
125
+ print("User:", user_turn)
126
+ else:
127
+ print("The simulated user ended the conversation.")
128
+ ```
129
+
130
+ ### Example output
131
+
132
+ The following user turns were produced by UserLM-2.0 with
133
+ `temperature=1.0` and `top_p=0.8`. Assistant turns were supplied by the
134
+ simulation harness.
135
+
136
+ > **UserLM-2.0:** hi. i need help with a dinner. i have 45 minutes. i need to
137
+ > make a dinner for 4 people. 1 of the people has a peanut allergy. i need a
138
+ > menu, shopping list, and step by step cooking instructions. if you need any
139
+ > more information from me, let me know.
140
+ >
141
+ > **Assistant:** I can help with that. Would you prefer pasta, tacos, or a rice
142
+ > bowl?
143
+ >
144
+ > **UserLM-2.0:** pasta.
145
+ >
146
+ > **Assistant:** Let's make chickpea tomato pasta with a green salad. For four
147
+ > people, buy 12 oz pasta, two cans of chickpeas, one 28 oz can of crushed
148
+ > tomatoes, garlic, one onion, olive oil, Italian herbs, one lemon, mixed
149
+ > greens, one cucumber, and Parmesan or a vegetarian alternative. The menu is
150
+ > peanut-free, but check package labels for cross-contamination. Would you like
151
+ > the step-by-step cooking order?
152
+ >
153
+ > **UserLM-2.0:** yes please.
154
+ >
155
+ > **Assistant:** Boil the pasta while you prepare a chickpea tomato sauce. Toss
156
+ > the greens and cucumber with lemon and olive oil, combine the pasta and
157
+ > sauce, and serve with the salad and optional cheese. This should take about
158
+ > 35 minutes.
159
+ >
160
+ > **UserLM-2.0:** `<|endconversation|>`
161
+
162
+ Treat `<|endconversation|>` as a control signal: stop the rollout rather than
163
+ showing it as dialogue in an end-user interface. Generated text is stochastic,
164
+ so outputs will vary across runs.
165
+
166
+ ## Uses
167
+
168
+ ### Direct intended uses
169
+
170
+ UserLM-2.0 is released for researchers evaluating assistant language models.
171
+ It can simulate multi-turn conversations to help estimate how an assistant may
172
+ perform with real users. Our evaluation provides evidence that UserLM-2.0
173
+ produces more realistic and task-faithful user behavior than prior user
174
+ simulators and prompted assistant models.
175
+
176
+ ### Downstream uses
177
+
178
+ Potential research applications that were not implemented in the accompanying
179
+ work include:
180
+
181
+ 1. User modeling, such as predicting user responses to a set of questions.
182
+ 2. A foundation for fine-tuning judge models.
183
+ 3. Synthetic conversation generation in conjunction with an assistant model.
184
+
185
+ ### Out-of-scope uses
186
+
187
+ UserLM-2.0 is **not an assistant model**. It is unlikely to be useful to an end
188
+ user who needs direct help completing a task; an assistant language model is
189
+ more appropriate for that purpose.
190
+
191
+ We do not recommend deploying UserLM-2.0 in commercial or real-world
192
+ applications without additional testing, adaptation, and safeguards. This
193
+ checkpoint is released for research purposes.
194
+
195
+ ## Risks and limitations
196
+
197
+ The main objective of a user simulator is twofold:
198
+
199
+ 1. Faithfully enact the supplied task intent without critical omissions or
200
+ contradictions.
201
+ 2. Produce natural utterances that could plausibly have been written by a real
202
+ user.
203
+
204
+ Although UserLM-2.0 improves this joint objective relative to prior work, it
205
+ remains imperfect. Simulated conversations may omit or contradict parts of the
206
+ task intent, introduce unsupported facts or requirements, behave unnaturally,
207
+ or terminate at an inappropriate point.
208
+
209
+ Additional limitations include:
210
+
211
+ - The model was designed and evaluated in English. Performance in other
212
+ languages may vary and should be assessed by domain experts and native
213
+ speakers.
214
+ - The model inherits biases, errors, and omissions from its
215
+ Llama-3.1-8B-Instruct backbone.
216
+ - The model may inherit or amplify biases, errors, and omissions in its
217
+ training data, including AI-generated interpretations of conversations.
218
+ - The model may hallucinate constraints not present in the task intent.
219
+ Providing a specific intent can reduce, but not eliminate, this behavior.
220
+ - The model has not been systematically hardened against security
221
+ vulnerabilities such as indirect prompt injection. Systems using the model
222
+ should apply appropriate isolation, validation, and security controls.
223
+
224
+ ## Recommendations
225
+
226
+ UserLM-2.0 is a research release and may require adaptation for new tasks and
227
+ environments. The original UserLM-8B work describes four useful generation
228
+ guardrails:
229
+
230
+ 1. Filtering undesirable first tokens.
231
+ 2. Avoiding premature dialogue termination.
232
+ 3. Applying minimum and maximum utterance-length thresholds.
233
+ 4. Filtering verbatim repetitions.
234
+
235
+ We encourage users to adapt these guardrails to their use case and to evaluate
236
+ task fidelity, naturalness, termination behavior, and safety before relying on
237
+ generated simulations.
238
+
239
+ ## Training details
240
+
241
+ ### Training data
242
+
243
+ UserLM-2.0 was trained on a filtered version of
244
+ [`allenai/WildChat-4.8M`](https://huggingface.co/datasets/allenai/WildChat-4.8M).
245
+ The filtering and processing procedure is described in the forthcoming paper.
246
+ The processed training data and processing scripts are not included with this
247
+ model release.
248
+
249
+ ### Training procedure
250
+
251
+ UserLM-2.0 uses Llama-3.1-8B-Instruct as its backbone. A dedicated
252
+ `<|endconversation|>` token was added, and the chat template was modified so
253
+ generation begins under the user role rather than the assistant role.
254
+
255
+ Training consisted of:
256
+
257
+ 1. **Supervised fine-tuning (SFT):** full-parameter fine-tuning on individual
258
+ user turns conditioned on the preceding conversation, using a batch size of
259
+ 1,024, a learning rate of `2e-5`, and a maximum sequence length of 8,192
260
+ tokens.
261
+ 2. **Reinforcement learning:** post-training with GRPO to jointly optimize task
262
+ intent coverage, response quality, naturalness, and appropriate
263
+ conversation termination.
264
+
265
+ Additional hyperparameters and implementation details will be available in the
266
+ paper.
267
+
268
+ ## Evaluation
269
+
270
+ ### Testing data, factors, and metrics
271
+
272
+ UserLM-2.0 was compared with competitive fine-tuned user simulators and
273
+ prompted assistant models. Evaluation measured whether simulations faithfully
274
+ covered the supplied task intent and whether the resulting user behavior
275
+ appeared natural. Details of test-set construction and evaluation methodology
276
+ will be available in the paper.
277
+
278
+ ### Evaluation results summary
279
+
280
+ We evaluate UserLM-2.0 along three complementary dimensions:
281
+
282
+ 1. **Quality:** UserLM-2.0 generates coherent and contextually appropriate user
283
+ behavior, outperforming all evaluated fine-tuned user simulators by at least
284
+ 12%.
285
+ 2. **Coverage:** UserLM-2.0 reliably expresses subgoals specified by the user's
286
+ intent, exceeding evaluated fine-tuned baselines by at least 23% and
287
+ matching GPT-5.6-Luna, including on challenging multi-subgoal intents.
288
+ 3. **Naturalness:** Using a general-purpose human-text classifier and
289
+ dataset-specific discriminators, UserLM-2.0 produces highly natural user
290
+ interactions. It matches specialized fine-tuned simulators while
291
+ substantially outperforming smaller prompted assistant models.
292
+
293
+ Overall, UserLM-2.0 achieves Pareto-optimal performance across naturalness and
294
+ task-intent fidelity. Compared with prompted assistant models, it substantially
295
+ improves naturalness; compared with previous fine-tuned user simulators, it
296
+ substantially improves task-intent fidelity.
297
+
298
+ ## Environmental impact
299
+
300
+ Carbon emissions were estimated using the Machine Learning Impact calculator
301
+ presented by Lacoste et al. (2019).
302
+
303
+ - **Hardware:** NVIDIA B200
304
+ - **Compute:** 4 GPUs for 12 hours (48 GPU-hours)
305
+ - **Cloud provider:** Microsoft Azure
306
+ - **Compute region:** East US
307
+ - **Estimated carbon emissions:** 115 kg CO2e
308
+
309
+ ## Citation
310
+
311
+ A BibTeX entry will be added when the paper is publicly available. Please do
312
+ not cite an unpublished arXiv identifier.
313
+
314
+ ## Glossary
315
+
316
+ **UserLM** means **User Language Model**.
317
+
318
+ ## Model card contact
319
+
320
+ This research was conducted by members of Microsoft Research. We welcome
321
+ feedback and collaboration. To share suggestions, ask questions, or report
322
+ unexpected or offensive behavior, contact
323
+ [`plaban@microsoft.com`](mailto:plaban@microsoft.com).
324
+
325
+ If the team receives reports of undesired behavior or independently identifies
326
+ issues, this repository will be updated with appropriate mitigations.
327
+
328
+ ## Privacy
329
+
330
+ See the [Microsoft Privacy Statement](https://www.microsoft.com/en-us/privacy/privacystatement).