kjs243 commited on
Commit
fc13081
1 Parent(s): 9afaa56

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -19
README.md CHANGED
@@ -6,13 +6,14 @@ pipeline_tag: text-generation
6
  library_name: transformers
7
  ---
8
 
9
- # Granite Uncertainty 3.0 8b
10
 
 
11
 
12
 
13
  ## Model Summary
14
 
15
- **Granite Uncertainty 3.0 8b** is a LoRA adapter for [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct),
16
  adding the capability to provide calibrated certainty scores when answering questions when prompted, in addition to retaining the full abilities of the [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct) model.
17
 
18
  - **Developer:** IBM Research
@@ -33,6 +34,9 @@ adding the capability to provide calibrated certainty scores when answering ques
33
  <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
34
 
35
  ### Intended use
 
 
 
36
  **Granite Uncertainty 3.0 8b** is lightly tuned so that its behavior closely mimics that of [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct),
37
  with the added ability to generate certainty scores for answers to questions when prompted.
38
 
@@ -43,15 +47,15 @@ This percentage is *calibrated* in the following sense: given a set of answers a
43
 
44
  **Usage steps** Answering a question and obtaining a certainty score proceeds as follows.
45
 
46
- 1. Prompt the model with a system prompt followed by the user prompt. The model is calibrated with the system prompt below.
47
- 2. Use the model to generate a response as normal (via the `assistant` role), or insert a response from [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct).
48
- 3. Prompt the model to generate a certainty score by generating in the `certainty` role (by appending `<|start_of_role|>certainty<|end_of_role|>` and generating).
49
- 4. The model will respond with a certainty percentage, quantized with steps of 10% (i.e. 5%, 15%, 25%,...95%).
50
 
51
  When not given the certainty generation prompt `<|start_of_role|>certainty<|end_of_role|>`, the model's behavior should mimic that of the base model [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct).
52
 
53
  **System prompt** The model was calibrated with the following system prompt: `You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.`
54
- It is recommended to prepend this string to any other desired system prompts.
55
 
56
 
57
 
@@ -123,6 +127,15 @@ print("Certainty: " + str(5 + uq_score * 10) + "%")
123
  ```
124
 
125
 
 
 
 
 
 
 
 
 
 
126
 
127
 
128
 
@@ -157,18 +170,6 @@ The following datasets were used for calibration and/or finetuning.
157
 
158
 
159
 
160
-
161
- ## Evaluation
162
-
163
- The model was evaluated on the [MMLU](https://huggingface.co/datasets/cais/mmlu) datasets (not used in training). Shown are the [Expected Calibration Error (ECE)](https://towardsdatascience.com/expected-calibration-error-ece-a-step-by-step-visual-explanation-with-python-code-c3e9aa12937d) for each task, for the base model (Granite-3.0-8b-instruct) and Granite-Uncertainty-3.0-8b.
164
- The average ECE across tasks for our method is 0.064 (out of 1) and is consistently low across tasks (maximum task ECE 0.10), compared to the base model average ECE of 0.20 and maximum task ECE of 0.60. Note that our ECE of 0.064 is smaller than the gap between the quantized certainty outputs (10% quantization steps). Additionally, the zero-shot performance on the MMLU tasks does not degrade, averaging at 89%.
165
- <!-- This section describes the evaluation protocols and provides the results. -->
166
-
167
-
168
-
169
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6602ffd971410cf02bf42c06/2MwP7DRZlNBtWSKWFvXOI.png)
170
-
171
-
172
  ## Model Card Authors
173
 
174
  Kristjan Greenewald
 
6
  library_name: transformers
7
  ---
8
 
9
+ # Granite 3.0 8B Instruct - Uncertainty LoRA
10
 
11
+ << @Connor Leech Some creative, fun copy should go here describing how this is being shared as an IBM Research experiment that we want to put out in the world and get some early feedback. Try it out and let us know how it goes (but don't be upset if it breaks / isn't in our products just yet)!>>
12
 
13
 
14
  ## Model Summary
15
 
16
+ **Granite 3.0 8b Instruct - Uncertainty** is a LoRA adapter for [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct),
17
  adding the capability to provide calibrated certainty scores when answering questions when prompted, in addition to retaining the full abilities of the [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct) model.
18
 
19
  - **Developer:** IBM Research
 
34
  <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
35
 
36
  ### Intended use
37
+
38
+ <<@Connor to rewrite this statement as needed>> This is an experimental LoRA testing new functionality being developeed for IBM's Granite LLM family. We are welcoming the community to test it out and give us feedback, but we are NOT recommending this model be used for real deployments at this time. Stay tuned for more updates on the Granite roadmap.
39
+
40
  **Granite Uncertainty 3.0 8b** is lightly tuned so that its behavior closely mimics that of [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct),
41
  with the added ability to generate certainty scores for answers to questions when prompted.
42
 
 
47
 
48
  **Usage steps** Answering a question and obtaining a certainty score proceeds as follows.
49
 
50
+ 1. Prompt the model with a system prompt (required) followed by the user prompt. The model is calibrated to work best with the system prompt provided below.
51
+ 2. Use the model to generate a response as normal (via the `assistant` role).
52
+ 3. Prompt the model to generate a certainty score by generating in the `certainty` role (use "certainty" as the role in the chat template, or simply append `<|start_of_role|>certainty<|end_of_role|>` and continue generating), see examples below.
53
+ 4. The model will respond with a certainty percentage, quantized with steps of 10% (i.e. 05%, 15%, 25%,...95%). Note, any additional text after the score and % can be ignored. You can curb additional generation by setting "max token length" = 3 when using this role.
54
 
55
  When not given the certainty generation prompt `<|start_of_role|>certainty<|end_of_role|>`, the model's behavior should mimic that of the base model [ibm-granite/granite-3.0-8b-instruct](https://huggingface.co/ibm-granite/granite-3.0-8b-instruct).
56
 
57
  **System prompt** The model was calibrated with the following system prompt: `You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.`
58
+ You can further augment this system prompts for a given use case or task, but it is recommended your system prompt always starts with this string.
59
 
60
 
61
 
 
127
  ```
128
 
129
 
130
+ ## Evaluation
131
+
132
+ The model was evaluated on the [MMLU](https://huggingface.co/datasets/cais/mmlu) datasets (not used in training). Shown are the [Expected Calibration Error (ECE)](https://towardsdatascience.com/expected-calibration-error-ece-a-step-by-step-visual-explanation-with-python-code-c3e9aa12937d) for each task, for the base model (Granite-3.0-8b-instruct) and Granite-Uncertainty-3.0-8b.
133
+ The average ECE across tasks for our method is 0.064 (out of 1) and is consistently low across tasks (maximum task ECE 0.10), compared to the base model average ECE of 0.20 and maximum task ECE of 0.60. Note that our ECE of 0.064 is smaller than the gap between the quantized certainty outputs (10% quantization steps). Additionally, the zero-shot performance on the MMLU tasks does not degrade, averaging at 89%.
134
+ <!-- This section describes the evaluation protocols and provides the results. -->
135
+
136
+
137
+
138
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6602ffd971410cf02bf42c06/2MwP7DRZlNBtWSKWFvXOI.png)
139
 
140
 
141
 
 
170
 
171
 
172
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  ## Model Card Authors
174
 
175
  Kristjan Greenewald