Update README.md
Browse files
README.md
CHANGED
|
@@ -17,11 +17,11 @@ tags:
|
|
| 17 |
- evaluation
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# 💨🚢 SteamSHP
|
| 21 |
|
| 22 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 23 |
|
| 24 |
-
SteamSHP is a preference model trained to predict human preferences, given some context and two possible responses.
|
| 25 |
It can be used for NLG evaluation or to train a smaller reward model for RLHF.
|
| 26 |
|
| 27 |
It is a FLAN-T5-xl model (3B parameters) finetuned on:
|
|
@@ -38,8 +38,8 @@ Here's how to use the model:
|
|
| 38 |
>> from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 39 |
>> device = 'cuda'
|
| 40 |
|
| 41 |
-
>> tokenizer = T5Tokenizer.from_pretrained('stanfordnlp/SteamSHP-
|
| 42 |
-
>> model = T5ForConditionalGeneration.from_pretrained('stanfordnlp/SteamSHP-
|
| 43 |
|
| 44 |
>> input_text = "POST: Instacart gave me 50 pounds of limes instead of 5 pounds... what the hell do I do with 50 pounds of limes? I've already donated a bunch and gave a bunch away. I'm planning on making a bunch of lime-themed cocktails, but... jeez. Ceviche? \n\n RESPONSE A: Lime juice, and zest, then freeze in small quantities.\n\n RESPONSE B: Lime marmalade lol\n\n Which response is better? RESPONSE"
|
| 45 |
>> x = tokenizer([input_text], return_tensors='pt').input_ids.to(device)
|
|
@@ -60,7 +60,7 @@ RESPONSE B: { second possible continuation }
|
|
| 60 |
Which response is better? RESPONSE
|
| 61 |
```
|
| 62 |
|
| 63 |
-
The output generated by SteamSHP will either be `A` or `B`.
|
| 64 |
|
| 65 |
If the input exceeds the 512 token limit, you can use [pybsd](https://github.com/nipunsadvilkar/pySBD) to break the input up into sentences and only include what fits into 512 tokens.
|
| 66 |
When trying to cram an example into 512 tokens, we recommend truncating the context as much as possible and leaving the responses as untouched as possible.
|
|
@@ -68,7 +68,7 @@ When trying to cram an example into 512 tokens, we recommend truncating the cont
|
|
| 68 |
|
| 69 |
## Training and Evaluation
|
| 70 |
|
| 71 |
-
SteamSHP was only finetuned on 125K of the 392K training examples that were available, since we found that:
|
| 72 |
1. When the total input length exceeded the limit (512 tokens), the loss would not converge.
|
| 73 |
When possible, we crammed an example to fit under 500 tokens by truncating the context as much as possible, though some examples would still not fit despite this.
|
| 74 |
We used 500 as the limit instead of 512 to allow for slight modifications to the structure of the input without any examples exceeding the actual 512 limit.
|
|
@@ -77,7 +77,7 @@ SteamSHP was only finetuned on 125K of the 392K training examples that were avai
|
|
| 77 |
We did no such subsampling for the HH-RLHF training data.
|
| 78 |
|
| 79 |
We evaluated the model on the SHP and HH-RLHF test data using accuracy, but only on the data that could be truncated to fit within 500 tokens (a total of 18621 out of 20753 available test examples).
|
| 80 |
-
SteamSHP gets an average 72.8% accuracy across all domains:
|
| 81 |
|
| 82 |
| Domain | Accuracy |
|
| 83 |
| ------ | -------- |
|
|
@@ -106,7 +106,7 @@ SteamSHP gets an average 72.8% accuracy across all domains:
|
|
| 106 |
|
| 107 |
### Biases and Limitations
|
| 108 |
|
| 109 |
-
Biases in the datasets used to train SteamSHP may be propagated downstream to the model predictions.
|
| 110 |
Although SHP filtered out posts with NSFW (over 18) content, chose subreddits that were well-moderated and had policies against harassment and bigotry, some of the data may contain discriminatory or harmful language.
|
| 111 |
Reddit users on the subreddits covered by SHP are also not representative of the broader population. They are disproportionately from developed, Western, and English-speaking countries.
|
| 112 |
|
|
|
|
| 17 |
- evaluation
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# 💨🚢 SteamSHP-XL
|
| 21 |
|
| 22 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 23 |
|
| 24 |
+
SteamSHP-XL is a preference model trained to predict human preferences, given some context and two possible responses.
|
| 25 |
It can be used for NLG evaluation or to train a smaller reward model for RLHF.
|
| 26 |
|
| 27 |
It is a FLAN-T5-xl model (3B parameters) finetuned on:
|
|
|
|
| 38 |
>> from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 39 |
>> device = 'cuda'
|
| 40 |
|
| 41 |
+
>> tokenizer = T5Tokenizer.from_pretrained('stanfordnlp/SteamSHP-flan-t5-xl')
|
| 42 |
+
>> model = T5ForConditionalGeneration.from_pretrained('stanfordnlp/SteamSHP-flan-t5-xl').to(device)
|
| 43 |
|
| 44 |
>> input_text = "POST: Instacart gave me 50 pounds of limes instead of 5 pounds... what the hell do I do with 50 pounds of limes? I've already donated a bunch and gave a bunch away. I'm planning on making a bunch of lime-themed cocktails, but... jeez. Ceviche? \n\n RESPONSE A: Lime juice, and zest, then freeze in small quantities.\n\n RESPONSE B: Lime marmalade lol\n\n Which response is better? RESPONSE"
|
| 45 |
>> x = tokenizer([input_text], return_tensors='pt').input_ids.to(device)
|
|
|
|
| 60 |
Which response is better? RESPONSE
|
| 61 |
```
|
| 62 |
|
| 63 |
+
The output generated by SteamSHP-XL will either be `A` or `B`.
|
| 64 |
|
| 65 |
If the input exceeds the 512 token limit, you can use [pybsd](https://github.com/nipunsadvilkar/pySBD) to break the input up into sentences and only include what fits into 512 tokens.
|
| 66 |
When trying to cram an example into 512 tokens, we recommend truncating the context as much as possible and leaving the responses as untouched as possible.
|
|
|
|
| 68 |
|
| 69 |
## Training and Evaluation
|
| 70 |
|
| 71 |
+
SteamSHP-XL was only finetuned on 125K of the 392K training examples that were available, since we found that:
|
| 72 |
1. When the total input length exceeded the limit (512 tokens), the loss would not converge.
|
| 73 |
When possible, we crammed an example to fit under 500 tokens by truncating the context as much as possible, though some examples would still not fit despite this.
|
| 74 |
We used 500 as the limit instead of 512 to allow for slight modifications to the structure of the input without any examples exceeding the actual 512 limit.
|
|
|
|
| 77 |
We did no such subsampling for the HH-RLHF training data.
|
| 78 |
|
| 79 |
We evaluated the model on the SHP and HH-RLHF test data using accuracy, but only on the data that could be truncated to fit within 500 tokens (a total of 18621 out of 20753 available test examples).
|
| 80 |
+
SteamSHP-XL gets an average 72.8% accuracy across all domains:
|
| 81 |
|
| 82 |
| Domain | Accuracy |
|
| 83 |
| ------ | -------- |
|
|
|
|
| 106 |
|
| 107 |
### Biases and Limitations
|
| 108 |
|
| 109 |
+
Biases in the datasets used to train SteamSHP-XL may be propagated downstream to the model predictions.
|
| 110 |
Although SHP filtered out posts with NSFW (over 18) content, chose subreddits that were well-moderated and had policies against harassment and bigotry, some of the data may contain discriminatory or harmful language.
|
| 111 |
Reddit users on the subreddits covered by SHP are also not representative of the broader population. They are disproportionately from developed, Western, and English-speaking countries.
|
| 112 |
|