Update README.md

#1
by reach-vb HF staff - opened
Files changed (1) hide show
  1. README.md +143 -142
README.md CHANGED
@@ -1,143 +1,144 @@
1
- ---
2
- license: other
3
- license_name: nvidia-open-model-license
4
- license_link: >-
5
- https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
6
- ---
7
-
8
- # Mistral-NeMo-Minitron-8B-Base
9
-
10
- ## Model Overview
11
-
12
- Mistral-NeMo-Minitron-8B-Base is a base text-to-text model that can be adopted for a variety of natural language generation tasks. It is a large language model (LLM) obtained by pruning and distilling the Mistral-NeMo 12B; specifically, we prune the embedding dimension and MLP intermediate dimension in the model. Following pruning, we perform continued training with distillation using 380 billion tokens to arrive at the final model; we use the continuous pre-training data corpus used in Nemotron-4 15B for this purpose.
13
-
14
- **Model Developer:** NVIDIA
15
-
16
- **Model Dates:** Mistral-NeMo-Minitron-8B-Base was trained between July 24, 2024 and August 10, 2024.
17
-
18
- ## License
19
-
20
- This model is released under the [NVIDIA Open Model License Agreement](https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf).
21
-
22
- ## Model Architecture
23
-
24
- Mistral-NeMo-Minitron-8B-Base uses a model embedding size of 4096, 32 attention heads, MLP intermediate dimension of 11520, with 40 layers in total. Additionally, it uses Grouped-Query Attention (GQA) and Rotary Position Embeddings (RoPE).
25
-
26
- **Architecture Type:** Transformer Decoder (Auto-Regressive Language Model)
27
-
28
- **Network Architecture:** Mistral-NeMo
29
-
30
- **Input Type(s):** Text
31
-
32
- **Input Format(s):** String
33
-
34
- **Input Parameters:** One Dimensional (1D)
35
-
36
- **Other Properties Related to Input:** Works well within 8k characters or less.
37
-
38
- **Output Type(s):** Text
39
-
40
- **Output Format:** String
41
-
42
- **Output Parameters:** 1D
43
-
44
- **Other Properties Related to Output:** None
45
-
46
- ## Usage
47
- Support for this model will be added in the upcoming `transformers` release. In the meantime, please install the library from source:
48
- ```
49
- pip install git+https://github.com/huggingface/transformers
50
- ```
51
- We can now run inference on this model:
52
-
53
- ```python
54
- import torch
55
- from transformers import AutoTokenizer, LlamaForCausalLM
56
-
57
- # Load the tokenizer and model
58
- model_path = "nvidia/Mistral-NeMo-Minitron-8B-Base"
59
- tokenizer = AutoTokenizer.from_pretrained(model_path)
60
-
61
- device = 'cuda'
62
- dtype = torch.bfloat16
63
- model = LlamaForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)
64
-
65
- # Prepare the input text
66
- prompt = 'Complete the paragraph: our solar system is'
67
- inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)
68
-
69
- # Generate the output
70
- outputs = model.generate(inputs, max_length=20)
71
-
72
- # Decode and print the output
73
- output_text = tokenizer.decode(outputs[0])
74
- print(output_text)
75
- ```
76
-
77
- ## Software Integration
78
- **Runtime Engine(s):**
79
- * NeMo 24.05
80
-
81
- **Supported Hardware Microarchitecture Compatibility:** <br>
82
- * NVIDIA Ampere
83
- * NVIDIA Blackwell
84
- * NVIDIA Hopper
85
- * NVIDIA Lovelace
86
-
87
-
88
- **Operating System(s):** <br>
89
- * Linux
90
-
91
- ## Dataset & Training
92
-
93
- **Data Collection Method by Dataset:** Automated
94
-
95
- **Labeling Method by Dataset:** Not Applicable
96
-
97
- **Properties:**
98
- The training corpus for Mistral-NeMo-Minitron-8B-Base consists of English and multilingual text, as well as code. Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials. The corpus spans domains including legal, math, science, finance, and more. In our continued training set, we introduce a small portion of question-answering, and alignment style data to improve model performance.
99
-
100
- **Data Freshness:**
101
- Training was done in 2024, the pretraining data has a cutoff of June 2023.
102
-
103
- ## Evaluation Results
104
-
105
- _5-shot performance._ Language Understanding evaluated using [Massive Multitask Language Understanding](https://arxiv.org/abs/2009.03300):
106
-
107
- | Average |
108
- | :---- |
109
- | 69.5 |
110
-
111
- _Zero-shot performance._ Evaluated using select datasets from the [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) with additions:
112
-
113
- | HellaSwag | Winogrande | GSM8K| ARC-Challenge | XLSum |
114
- | :---- | :---- | :---- | :---- | :---- |
115
- | 83.0 | 80.4 | 58.5 | 64.4 | 32.0
116
-
117
- _Code generation performance._ Evaluated using [MBPP](https://github.com/google-research/google-research/tree/master/mbpp):
118
- | Score |
119
- | :---- |
120
- | 43.77 |
121
-
122
- ## Inference
123
-
124
- **Engine:** TensorRT-LLM
125
-
126
- **Test Hardware:** NVIDIA A100
127
-
128
- **DType:** BFloat16
129
-
130
- ## Limitations
131
-
132
- The model was trained on data that contains toxic language, unsafe content, and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
133
-
134
- ## Ethical Considerations
135
-
136
- NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
137
-
138
- Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
139
-
140
-
141
- ## References
142
- * [Minitron: Compact Language Models via Pruning and Knowledge Distillation](https://arxiv.org/abs/2407.14679)
 
143
  * [LLM Pruning and Distillation in Practice: The Minitron Approach](https://research.nvidia.com/publication/_llm-pruning-and-distillation-practice-minitron-approach)
 
1
+ ---
2
+ license: other
3
+ license_name: nvidia-open-model-license
4
+ license_link: >-
5
+ https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
6
+ library_name: transformers
7
+ ---
8
+
9
+ # Mistral-NeMo-Minitron-8B-Base
10
+
11
+ ## Model Overview
12
+
13
+ Mistral-NeMo-Minitron-8B-Base is a base text-to-text model that can be adopted for a variety of natural language generation tasks. It is a large language model (LLM) obtained by pruning and distilling the Mistral-NeMo 12B; specifically, we prune the embedding dimension and MLP intermediate dimension in the model. Following pruning, we perform continued training with distillation using 380 billion tokens to arrive at the final model; we use the continuous pre-training data corpus used in Nemotron-4 15B for this purpose.
14
+
15
+ **Model Developer:** NVIDIA
16
+
17
+ **Model Dates:** Mistral-NeMo-Minitron-8B-Base was trained between July 24, 2024 and August 10, 2024.
18
+
19
+ ## License
20
+
21
+ This model is released under the [NVIDIA Open Model License Agreement](https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf).
22
+
23
+ ## Model Architecture
24
+
25
+ Mistral-NeMo-Minitron-8B-Base uses a model embedding size of 4096, 32 attention heads, MLP intermediate dimension of 11520, with 40 layers in total. Additionally, it uses Grouped-Query Attention (GQA) and Rotary Position Embeddings (RoPE).
26
+
27
+ **Architecture Type:** Transformer Decoder (Auto-Regressive Language Model)
28
+
29
+ **Network Architecture:** Mistral-NeMo
30
+
31
+ **Input Type(s):** Text
32
+
33
+ **Input Format(s):** String
34
+
35
+ **Input Parameters:** One Dimensional (1D)
36
+
37
+ **Other Properties Related to Input:** Works well within 8k characters or less.
38
+
39
+ **Output Type(s):** Text
40
+
41
+ **Output Format:** String
42
+
43
+ **Output Parameters:** 1D
44
+
45
+ **Other Properties Related to Output:** None
46
+
47
+ ## Usage
48
+ Support for this model will be added in the upcoming `transformers` release. In the meantime, please install the library from source:
49
+ ```
50
+ pip install git+https://github.com/huggingface/transformers
51
+ ```
52
+ We can now run inference on this model:
53
+
54
+ ```python
55
+ import torch
56
+ from transformers import AutoTokenizer, LlamaForCausalLM
57
+
58
+ # Load the tokenizer and model
59
+ model_path = "nvidia/Mistral-NeMo-Minitron-8B-Base"
60
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
61
+
62
+ device = 'cuda'
63
+ dtype = torch.bfloat16
64
+ model = LlamaForCausalLM.from_pretrained(model_path, torch_dtype=dtype, device_map=device)
65
+
66
+ # Prepare the input text
67
+ prompt = 'Complete the paragraph: our solar system is'
68
+ inputs = tokenizer.encode(prompt, return_tensors='pt').to(model.device)
69
+
70
+ # Generate the output
71
+ outputs = model.generate(inputs, max_length=20)
72
+
73
+ # Decode and print the output
74
+ output_text = tokenizer.decode(outputs[0])
75
+ print(output_text)
76
+ ```
77
+
78
+ ## Software Integration
79
+ **Runtime Engine(s):**
80
+ * NeMo 24.05
81
+
82
+ **Supported Hardware Microarchitecture Compatibility:** <br>
83
+ * NVIDIA Ampere
84
+ * NVIDIA Blackwell
85
+ * NVIDIA Hopper
86
+ * NVIDIA Lovelace
87
+
88
+
89
+ **Operating System(s):** <br>
90
+ * Linux
91
+
92
+ ## Dataset & Training
93
+
94
+ **Data Collection Method by Dataset:** Automated
95
+
96
+ **Labeling Method by Dataset:** Not Applicable
97
+
98
+ **Properties:**
99
+ The training corpus for Mistral-NeMo-Minitron-8B-Base consists of English and multilingual text, as well as code. Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials. The corpus spans domains including legal, math, science, finance, and more. In our continued training set, we introduce a small portion of question-answering, and alignment style data to improve model performance.
100
+
101
+ **Data Freshness:**
102
+ Training was done in 2024, the pretraining data has a cutoff of June 2023.
103
+
104
+ ## Evaluation Results
105
+
106
+ _5-shot performance._ Language Understanding evaluated using [Massive Multitask Language Understanding](https://arxiv.org/abs/2009.03300):
107
+
108
+ | Average |
109
+ | :---- |
110
+ | 69.5 |
111
+
112
+ _Zero-shot performance._ Evaluated using select datasets from the [LM Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) with additions:
113
+
114
+ | HellaSwag | Winogrande | GSM8K| ARC-Challenge | XLSum |
115
+ | :---- | :---- | :---- | :---- | :---- |
116
+ | 83.0 | 80.4 | 58.5 | 64.4 | 32.0
117
+
118
+ _Code generation performance._ Evaluated using [MBPP](https://github.com/google-research/google-research/tree/master/mbpp):
119
+ | Score |
120
+ | :---- |
121
+ | 43.77 |
122
+
123
+ ## Inference
124
+
125
+ **Engine:** TensorRT-LLM
126
+
127
+ **Test Hardware:** NVIDIA A100
128
+
129
+ **DType:** BFloat16
130
+
131
+ ## Limitations
132
+
133
+ The model was trained on data that contains toxic language, unsafe content, and societal biases originally crawled from the internet. Therefore, the model may amplify those biases and return toxic responses especially when prompted with toxic prompts. The model may generate answers that may be inaccurate, omit key information, or include irrelevant or redundant text producing socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
134
+
135
+ ## Ethical Considerations
136
+
137
+ NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
138
+
139
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
140
+
141
+
142
+ ## References
143
+ * [Minitron: Compact Language Models via Pruning and Knowledge Distillation](https://arxiv.org/abs/2407.14679)
144
  * [LLM Pruning and Distillation in Practice: The Minitron Approach](https://research.nvidia.com/publication/_llm-pruning-and-distillation-practice-minitron-approach)