|
| 1 | +<!--Copyright 2024 Kyutai and The HuggingFace Team. All rights reserved. |
| 2 | +
|
| 3 | +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 4 | +the License. You may obtain a copy of the License at |
| 5 | +
|
| 6 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +
|
| 8 | +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 9 | +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 10 | +specific language governing permissions and limitations under the License. |
| 11 | +
|
| 12 | +⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be |
| 13 | +rendered properly in your Markdown viewer. |
| 14 | +
|
| 15 | +--> |
| 16 | + |
| 17 | +# Helium |
| 18 | + |
| 19 | + |
| 20 | +## Overview |
| 21 | + |
| 22 | +Helium was proposed in [Announcing Helium-1 Preview](https://kyutai.org/2025/01/13/helium.html) by the Kyutai Team. |
| 23 | + |
| 24 | + |
| 25 | +Helium-1 preview is a lightweight language model with 2B parameters, targeting edge and mobile devices. |
| 26 | +It supports the following languages: English, French, German, Italian, Portuguese, Spanish. |
| 27 | + |
| 28 | +- **Developed by:** Kyutai |
| 29 | +- **Model type:** Large Language Model |
| 30 | +- **Language(s) (NLP):** English, French, German, Italian, Portuguese, Spanish |
| 31 | +- **License:** CC-BY 4.0 |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +## Evaluation |
| 37 | + |
| 38 | +<!-- This section describes the evaluation protocols and provides the results. --> |
| 39 | + |
| 40 | +#### Testing Data |
| 41 | + |
| 42 | +<!-- This should link to a Dataset Card if possible. --> |
| 43 | + |
| 44 | +The model was evaluated on MMLU, TriviaQA, NaturalQuestions, ARC Easy & Challenge, Open Book QA, Common Sense QA, |
| 45 | +Physical Interaction QA, Social Interaction QA, HellaSwag, WinoGrande, Multilingual Knowledge QA, FLORES 200. |
| 46 | + |
| 47 | +#### Metrics |
| 48 | + |
| 49 | +<!-- These are the evaluation metrics being used, ideally with a description of why. --> |
| 50 | + |
| 51 | +We report accuracy on MMLU, ARC, OBQA, CSQA, PIQA, SIQA, HellaSwag, WinoGrande. |
| 52 | +We report exact match on TriviaQA, NQ and MKQA. |
| 53 | +We report BLEU on FLORES. |
| 54 | + |
| 55 | +### English Results |
| 56 | + |
| 57 | +| Benchmark | Helium-1 Preview | HF SmolLM2 (1.7B) | Gemma-2 (2.6B) | Llama-3.2 (3B) | Qwen2.5 (1.5B) | |
| 58 | +|--------------|--------|--------|--------|--------|--------| |
| 59 | +| | | | | | | |
| 60 | +| MMLU | 51.2 | 50.4 | 53.1 | 56.6 | 61.0 | |
| 61 | +| NQ | 17.3 | 15.1 | 17.7 | 22.0 | 13.1 | |
| 62 | +| TQA | 47.9 | 45.4 | 49.9 | 53.6 | 35.9 | |
| 63 | +| ARC E | 80.9 | 81.8 | 81.1 | 84.6 | 89.7 | |
| 64 | +| ARC C | 62.7 | 64.7 | 66.0 | 69.0 | 77.2 | |
| 65 | +| OBQA | 63.8 | 61.4 | 64.6 | 68.4 | 73.8 | |
| 66 | +| CSQA | 65.6 | 59.0 | 64.4 | 65.4 | 72.4 | |
| 67 | +| PIQA | 77.4 | 77.7 | 79.8 | 78.9 | 76.0 | |
| 68 | +| SIQA | 64.4 | 57.5 | 61.9 | 63.8 | 68.7 | |
| 69 | +| HS | 69.7 | 73.2 | 74.7 | 76.9 | 67.5 | |
| 70 | +| WG | 66.5 | 65.6 | 71.2 | 72.0 | 64.8 | |
| 71 | +| | | | | | | |
| 72 | +| Average | 60.7 | 59.3 | 62.2 | 64.7 | 63.6 | |
| 73 | + |
| 74 | +#### Multilingual Results |
| 75 | + |
| 76 | +| Language | Benchmark | Helium-1 Preview | HF SmolLM2 (1.7B) | Gemma-2 (2.6B) | Llama-3.2 (3B) | Qwen2.5 (1.5B) | |
| 77 | +|-----|--------------|--------|--------|--------|--------|--------| |
| 78 | +| | | | | | | | |
| 79 | +|German| MMLU | 45.6 | 35.3 | 45.0 | 47.5 | 49.5 | |
| 80 | +|| ARC C | 56.7 | 38.4 | 54.7 | 58.3 | 60.2 | |
| 81 | +|| HS | 53.5 | 33.9 | 53.4 | 53.7 | 42.8 | |
| 82 | +|| MKQA | 16.1 | 7.1 | 18.9 | 20.2 | 10.4 | |
| 83 | +| | | | | | | | |
| 84 | +|Spanish| MMLU | 46.5 | 38.9 | 46.2 | 49.6 | 52.8 | |
| 85 | +|| ARC C | 58.3 | 43.2 | 58.8 | 60.0 | 68.1 | |
| 86 | +|| HS | 58.6 | 40.8 | 60.5 | 61.1 | 51.4 | |
| 87 | +|| MKQA | 16.0 | 7.9 | 18.5 | 20.6 | 10.6 | |
| 88 | + |
| 89 | + |
| 90 | +## Technical Specifications |
| 91 | + |
| 92 | +### Model Architecture and Objective |
| 93 | + |
| 94 | +| Hyperparameter | Value | |
| 95 | +|--------------|--------| |
| 96 | +| Layers | 24 | |
| 97 | +| Heads | 20 | |
| 98 | +| Model dimension | 2560 | |
| 99 | +| MLP dimension | 7040 | |
| 100 | +| Context size | 4096 | |
| 101 | +| Theta RoPE | 100,000 | |
| 102 | + |
| 103 | +Tips: |
| 104 | + |
| 105 | +- This model was contributed by [Laurent Mazare](https://huggingface.co/lmz) |
| 106 | + |
| 107 | + |
| 108 | +## Usage tips |
| 109 | + |
| 110 | +`Helium` can be found on the [Huggingface Hub](https://huggingface.co/collections/kyutai/helium-1-preview) |
| 111 | + |
| 112 | +In the following, we demonstrate how to use `helium-1-preview` for the inference. |
| 113 | + |
| 114 | +```python |
| 115 | +>>> from transformers import AutoModelForCausalLM, AutoTokenizer |
| 116 | +>>> device = "cuda" # the device to load the model onto |
| 117 | + |
| 118 | +>>> model = AutoModelForCausalLM.from_pretrained("helium-1-preview", device_map="auto") |
| 119 | +>>> tokenizer = AutoTokenizer.from_pretrained("helium-1-preview") |
| 120 | + |
| 121 | +>>> prompt = "Give me a short introduction to large language model." |
| 122 | + |
| 123 | +>>> messages = [{"role": "user", "content": prompt}] |
| 124 | + |
| 125 | +>>> text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) |
| 126 | + |
| 127 | +>>> model_inputs = tokenizer([text], return_tensors="pt").to(device) |
| 128 | + |
| 129 | +>>> generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, do_sample=True) |
| 130 | + |
| 131 | +>>> generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)] |
| 132 | + |
| 133 | +>>> response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] |
| 134 | +``` |
| 135 | + |
| 136 | +## HeliumConfig |
| 137 | + |
| 138 | +[[autodoc]] HeliumConfig |
| 139 | + |
| 140 | +## HeliumModel |
| 141 | + |
| 142 | +[[autodoc]] HeliumModel |
| 143 | + - forward |
| 144 | + |
| 145 | +## HeliumForCausalLM |
| 146 | + |
| 147 | +[[autodoc]] HeliumForCausalLM |
| 148 | + - forward |
| 149 | + |
| 150 | +## HeliumForSequenceClassification |
| 151 | + |
| 152 | +[[autodoc]] HeliumForSequenceClassification |
| 153 | + - forward |
| 154 | + |
| 155 | +## HeliumForTokenClassification |
| 156 | + |
| 157 | +[[autodoc]] HeliumForTokenClassification |
| 158 | + - forward |
0 commit comments