Update README.md
Browse files# Summary
Instruction tuning (fine-tuning on high-quality responses to instructions) has emerged as an important step in developing performant large language models (LLMs) for generative AI tasks. While industry-backed LLMs such as ChatGPT, Bard, Claude, and even the open-source Llama 2 have relied on massive, expensive proprietary datasets unavailable to the public, the open source community has banded together to create similar datasets such as OpenAssistant and Dolly that are available to everyone. However, high variance in the quality and distribution of responses collected by volunteers has limited the quality of resulting open source models.
We have developed a lightweight model that achieves two purposes:
(1) classifies instructions across datasets into a standard schema that can be used to measure and track instruction diversity in training sets
(2) scores responses to instructions on a scale of 0-1
The model was trained with weak supervision using samples from:
* [The dataset used for Dolly 2.0](https://huggingface.co/datasets/databricks/databricks-dolly-15k)
* [Open-assistant](https://huggingface.co/datasets/OpenAssistant/oasst1)
* [Helpful-instructions](https://huggingface.co/datasets/HuggingFaceH4/helpful-instructions)
Instruction classes were based on a standard schema used in developing large language models:
* <strong>Open-qa</strong>: question-answering without context, e.g., “When was Google founded?”
* <strong>Closed-qa</strong>: question-answer from a provided context, e.g., “Look at the following paragraph and tell me how many mentions of fruit there are.”
* <strong>Brainstorming</strong>: e.g., “Give me some ideas for planning a beach trip.”
* <strong>Generation</strong>: e.g., “Write me an essay comparing baroque with minimalist music”.
* <strong>Summarization</strong>: e.g., “Summarize the main points from this news article”
* <strong>Other</strong>: e.g., anything that did not fit the previous five categories.
The model was evaluated with A/B testing against ChatGPT-generated responses (turbo 3.5) in double-blind experiments asking human evaluators whether they preferred the dataset response or ChatGPT's. Using these judgments we confirmed the model response quality score predicted whether evaluators preferred the response over ChatGPTs:
<p align="center">
<img src="https://cdn-uploads.huggingface.co/production/uploads/644985b8eb7db8f70fb72fab/L94un3u_ZfvAXYjh4dH0O.png" width="500" height="200">
</p>
# Usage
The model accepts as an input either a single dictionary or list of dictionaries. Each dictionary requires an ```instruction``` field at a bare minimum, with optional ```dataset``` and ```response``` fields. If only ```instruction``` is provided then an instruction class and class confidence score are returned. If a ```response``` is also provided then the model also returns a response quality score between 0 and 1.
If ```dataset ``` is provided and is one of ```open assistant```, ```dolly``` or ```helpful instructions``` then those values may nudge model predictions based on correlations learned between those data sources and instruction/response features. Future work will be focused on bringing in more datasets and improving the use of data source in the model.
## Example
Input:
```{'instruction': 'How can I stay energized throughout the day?', 'response': 'Drink lots of coffee!', 'dataset': 'open-assistant'}```
Model output:
```{'instruction class': 'brainstorming', 'instruction class confidence': 0.9683452, 'response quality': 0.08076164}```
@@ -4,4 +4,7 @@ widget:
|
|
4 |
- instruction: How can I stay energized throughout the day?
|
5 |
response: Drink lots of coffee!
|
6 |
dataset: open-assistant
|
|
|
|
|
|
|
7 |
---
|
|
|
4 |
- instruction: How can I stay energized throughout the day?
|
5 |
response: Drink lots of coffee!
|
6 |
dataset: open-assistant
|
7 |
+
language:
|
8 |
+
- en
|
9 |
+
pipeline_tag: text-classification
|
10 |
---
|