philippelaban commited on
Commit
4afd26c
·
verified ·
1 Parent(s): 1514de4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +100 -5
README.md CHANGED
@@ -22,34 +22,129 @@ The model takes a single input, which is the “task intent”, which defines th
22
 
23
  Developed by: Tarek Naous (intern at MSR Summer 2025), Philippe Laban (MSR), Wei Xu, Jennifer Neville (MSR)
24
 
25
- Paper: Will add once we’ve uploaded to arXiv
26
 
27
  # Uses
28
 
29
  ## Direct intended uses
30
 
31
- The UserLM-8b is released for use by researchers involved in the evaluation of assistant LLMs. In such scenarios, UserLM-8b can be used to simulate multi-turn conversations, with our analyses (see Section 3 of the paper) giving evidence that UserLM-8b provides more realistic simulation of user behavior than other methods (such as prompting an assistant model). UserLM-8b offers a user simulation environment that can better estimate the performance of an assistant LLM with real users. See Section 4 of the work for an initial implementation of such an evaluation.
32
 
33
  ## Downstream uses
34
 
35
- We envision several potential uses for UserLM-8b that we did not implement yet in our presented work, but describe in our Discussion section as potential research directions for UserLMs. These potential applications include: (1) user modeling (i.e., predicting user responses to a given set of questions), (2) foundation for judge models (i.e., LLM-as-a-judge finetuning), (3) synthetic data generation (in conjunction with an assistant LM).
36
 
37
  ## Out-of-scope uses
38
 
39
- We caution potential users of the model that UserLM-8b is not an assistant LM, unlike the majority of LLMs released on HuggingFace. As such, it is unlikely to be useful to end-users that require assistance with a task, for which an assistant LLM (such as microsoft/Phi-4) might be more appropriate.
 
 
40
 
41
  # Risks and limitations
42
 
43
- The paper accompanying this model release presents several evaluation of UserLM-8b and its potential limitations.
44
 
45
  First in Section 3, we describe the robustness experiments we conducted with UserLM-8b, which show that though the model can more robustly adhere to the user role and the provided task intent, the robustness numbers are not perfect (< 100%), meaning that the UserLM-8b can occasionally get detracted from its user role or its initial task intent.
46
 
47
  Second in Section 4, we describe the possibility for the UserLM-8b to hallucinate additional requirements that are not provided in the task intent. In such cases, we find that the UserLM can introduce new facts or constraints to the task. This can both be beneficial (diversifying simulation conditions) and detrimental (e.g., in cases where the hallucination is incompatible with the task intent). Hallucination mitigation is unfortunately an unsolved research problem, and all generative models (including UserLMs) generate hallucinated text on occasion. One mitigation option is to provide user intents that are as specified as possible, which limits the opportunities for the UserLM to hallucinate task information.
48
 
 
 
 
 
 
 
 
 
 
49
  # Recommendations
50
 
51
  The UserLM-8b is a research release, and it is likely to require some adaptation when adapted to new tasks and environments. In Appendix D.1 of the paper (Generation Configuration for UserLM-8b), we describe four generation guardrails (Filtering First Tokens, Avoiding Dialogue Termination, Maximal and Minimal Length Threshold, and Filter Verbatim Repetitions) we implemented to get the UserLM-8b to effectively simulate user utterances on the use-cases described in our paper. We encourage users of UserLM-8b to adopt and adapt these guardrails in their own use-cases.
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  # Privacy
54
 
55
  [Privacy & Cookies](https://www.microsoft.com/en-us/privacy/privacystatement)
 
22
 
23
  Developed by: Tarek Naous (intern at MSR Summer 2025), Philippe Laban (MSR), Wei Xu, Jennifer Neville (MSR)
24
 
25
+ Paper: Will add once the work is on arXiv
26
 
27
  # Uses
28
 
29
  ## Direct intended uses
30
 
31
+ The UserLM-8b is released for use by researchers involved in the evaluation of assistant LLMs. In such scenarios, UserLM-8b can be used to simulate multi-turn conversations, with our analyses (see Section 3 of the paper) giving evidence that UserLM-8b provides more realistic simulation of user behavior than other methods (such as prompting an assistant model). UserLM-8b offers a user simulation environment that can better estimate the performance of an assistant LLM with real users. See Section 4 of the paper for an initial implementation of such an evaluation.
32
 
33
  ## Downstream uses
34
 
35
+ We envision several potential uses for UserLM-8b that we did not implement yet in our presented work but describe in our Discussion section as potential research directions for UserLMs. These potential applications include: (1) user modeling (i.e., predicting user responses to a given set of questions), (2) foundation for judge models (i.e., LLM-as-a-judge finetuning), (3) synthetic data generation (in conjunction with an assistant LM).
36
 
37
  ## Out-of-scope uses
38
 
39
+ We caution potential users of the model that UserLM-8b is **not an assistant LM**, unlike the majority of LLMs released on HuggingFace. As such, it is unlikely to be useful to end-users that require assistance with a task, for which an assistant LLM (such as microsoft/Phi-4) might be more appropriate.
40
+
41
+ We do not recommend using UserLM in commercial or real-world applications without further testing and development. It is being released for research purposes.
42
 
43
  # Risks and limitations
44
 
45
+ The paper accompanying this model release presents several evaluations of UserLM-8b and its potential limitations.
46
 
47
  First in Section 3, we describe the robustness experiments we conducted with UserLM-8b, which show that though the model can more robustly adhere to the user role and the provided task intent, the robustness numbers are not perfect (< 100%), meaning that the UserLM-8b can occasionally get detracted from its user role or its initial task intent.
48
 
49
  Second in Section 4, we describe the possibility for the UserLM-8b to hallucinate additional requirements that are not provided in the task intent. In such cases, we find that the UserLM can introduce new facts or constraints to the task. This can both be beneficial (diversifying simulation conditions) and detrimental (e.g., in cases where the hallucination is incompatible with the task intent). Hallucination mitigation is unfortunately an unsolved research problem, and all generative models (including UserLMs) generate hallucinated text on occasion. One mitigation option is to provide user intents that are as specified as possible, which limits the opportunities for the UserLM to hallucinate task information.
50
 
51
+ UserLM was designed and tested using the English language. Performance in other languages may vary and should be assessed by someone who is both an expert in the expected outputs and a native speaker of that language. 
52
+
53
+ UserLM inherits any biases, errors, or omissions produced by its base model. Developers are advised to choose an appropriate base LLM/MLLM carefully, depending on the intended use case.
54
+
55
+ UserLM inherits any biases, errors, or omissions characteristic of its training data, which may be amplified by any AI-generated interpretations.
56
+
57
+ There has not been a systematic effort to ensure that systems using UserLM are protected from security vulnerabilities such as indirect prompt injection attacks. Any systems using it should take proactive measures to harden their systems as appropriate. 
58
+
59
+
60
  # Recommendations
61
 
62
  The UserLM-8b is a research release, and it is likely to require some adaptation when adapted to new tasks and environments. In Appendix D.1 of the paper (Generation Configuration for UserLM-8b), we describe four generation guardrails (Filtering First Tokens, Avoiding Dialogue Termination, Maximal and Minimal Length Threshold, and Filter Verbatim Repetitions) we implemented to get the UserLM-8b to effectively simulate user utterances on the use-cases described in our paper. We encourage users of UserLM-8b to adopt and adapt these guardrails in their own use-cases.
63
 
64
+
65
+ # How to get started with the model
66
+
67
+ Here’s a simple snippet to use the model:
68
+ ```python
69
+ from transformers import AutoTokenizer, AutoModelForCausalLM
70
+ import torch
71
+
72
+ # Load the model and tokenizer
73
+ model_path = "microsoft/userlm-8b/"
74
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
75
+ model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True).to("cuda")
76
+
77
+ # Create a conversation
78
+ messages = [{"role": "system", "content": "You are a user who wants to implement a special type of sequence. The sequence sums up the two previous numbers in the sequence and adds 1 to the result. The first two numbers in the sequence are 1 and 1."}]
79
+ inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
80
+
81
+ # Example 1: Generate response
82
+ outputs = model.generate(inputs, max_new_tokens=100, do_sample=True, temperature=1.0)
83
+ response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
84
+ print(response) # This can output: “Create a sequence that always starts at 1, 1, and then sums the two previous numbers in the sequence, adds 1 to the result.”
85
+
86
+ # Example 2: Generate response while ignoring the <|endconversation|> token
87
+
88
+ end_conv_token = "<|endconversation|>"
89
+ end_conv_token_id = tokenizer.encode(end_conv_token, add_special_tokens=False)
90
+ outputs = model.generate(
91
+ input_ids=inputs,
92
+ do_sample=True,
93
+ top_p=0.8,
94
+ temperature=1,
95
+ max_new_tokens=10,
96
+ eos_token_id=end_token_id,
97
+ pad_token_id=tokenizer.eos_token_id,
98
+ bad_words_ids=[[token_id] for token_id in end_conv_token_id]
99
+ )
100
+ response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
101
+ print(response)
102
+ ```
103
+
104
+ # Training details
105
+ ## Training data
106
+ We trained on a filtered version of [WildChat-1M](https://huggingface.co/datasets/allenai/WildChat-1M). The details on the filtering and processing are Appendix A and Section 2 of our paper. We do not release any data or processing scripts with our paper, as we believe these are sufficiently detailed in the paper that they can be reimplemented.
107
+
108
+ ## Training procedure
109
+
110
+ We performed full-parameter fine-tuning of Llama3-8b-Base. We used a maximum sequence length of 2048 tokens, a batch size of 1024 samples, and a learning rate of 2e-5. Training was performed on four NVIDIA RTX A6000 GPUs, taking 227 hours to train UserLM-8b. Further details are provided in Section 2.2 of our paper.
111
+
112
+ # Evaluation
113
+
114
+ ## Testing data
115
+ We evaluated on a held-out set of [WildChat-1M](https://huggingface.co/datasets/allenai/WildChat-1M), as well as [PRISM](https://huggingface.co/paige-ai/Prism). In our extrinsic evaluation, we evaluated using samples from the [Lost in Conversation](https://huggingface.co/datasets/microsoft/lost_in_conversation) sharded instructions.
116
+ The details for data selection are described in Section 2.2 of the paper.
117
+
118
+ ## Evaluation results summary
119
+
120
+ We evaluate UserLM-8b with three complementary experiments:
121
+ 1. Distributional Alignment (perplexity). We measure the ability of the UserLM-8b to predict (generate) user utterances for a set of test conversations from users that were not included in training. We observe lower perplexity (higher alignment) than prior work, including previously trained models (USP-8b) and prompted assistant models. See Section 2 of the paper for details.
122
+ 2. Instrinsic Evaluation of User Simulators. We define six metrics that correspond to desirable properties of user simulators (for example, ability to end conversation, or shard information across turns). We then compare UserLM-8b to a broad set of methods including trained models, and open-weights and API-based prompted assistant models. We find that UserLM-8b outperforms assistant-based methods on all six metrics. See Section 3 of the paper for details.
123
+ 3. Extrinsic Evaluation of User Simulators. We create a simulation setting for conversations involving the user wanting to either solve mathematics problems, or wanting to code a basic Python programming function. We simulate conversations with various user simulators, including UserLM-8b and prompted assistant models, and find that UserLM-8b leads to more diverse simulation on several levels (conversation pace, lexical choice, information choice), leading to a broader range of simulation, and leading to deteriorated performance from the assistant. See Section 4 of the paper for details.
124
+
125
+
126
+ # Environmental impact
127
+ Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
128
+ - Hardware type: A6000
129
+ - Hours used: 227*4
130
+ - Cloud provider: Azure
131
+ - Compute region: useast
132
+ - Carbon emitted: 115 kg CO2 (estimate)
133
+
134
+ # BibTeX
135
+
136
+ Coming soon
137
+
138
+ # Glossary
139
+
140
+ UserLM = User Language Model
141
+
142
+ # Model card contact
143
+
144
+ This research was conducted by members of Microsoft Research. We welcome feedback and collaboration from our audience. If you have suggestions, questions, or observe unexpected/offensive behavior in our technology, please contact us at: plaban@microsoft.com
145
+
146
+ If the team receives reports of undesired behavior or identifies issues independently, we will update this repository with appropriate mitigations.
147
+
148
  # Privacy
149
 
150
  [Privacy & Cookies](https://www.microsoft.com/en-us/privacy/privacystatement)