Back to Transformers

Helium

docs/source/en/model_doc/helium.md

5.8.05.2 KB
Original Source
<!--Copyright 2024 Kyutai and The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be rendered properly in your Markdown viewer. -->

This model was released on 2025-01-13 and added to Hugging Face Transformers on 2025-01-13.

Helium

<div class="flex flex-wrap space-x-1"> </div>

Overview

Helium was proposed in Announcing Helium-1 Preview by the Kyutai Team.

Helium-1 preview is a lightweight language model with 2B parameters, targeting edge and mobile devices. It supports the following languages: English, French, German, Italian, Portuguese, Spanish.

  • Developed by: Kyutai
  • Model type: Large Language Model
  • Language(s) (NLP): English, French, German, Italian, Portuguese, Spanish
  • License: CC-BY 4.0

Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

Testing Data

<!-- This should link to a Dataset Card if possible. -->

The model was evaluated on MMLU, TriviaQA, NaturalQuestions, ARC Easy & Challenge, Open Book QA, Common Sense QA, Physical Interaction QA, Social Interaction QA, HellaSwag, WinoGrande, Multilingual Knowledge QA, FLORES 200.

Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

We report accuracy on MMLU, ARC, OBQA, CSQA, PIQA, SIQA, HellaSwag, WinoGrande. We report exact match on TriviaQA, NQ and MKQA. We report BLEU on FLORES.

English Results

BenchmarkHelium-1 PreviewHF SmolLM2 (1.7B)Gemma-2 (2.6B)Llama-3.2 (3B)Qwen2.5 (1.5B)
MMLU51.250.453.156.661.0
NQ17.315.117.722.013.1
TQA47.945.449.953.635.9
ARC E80.981.881.184.689.7
ARC C62.764.766.069.077.2
OBQA63.861.464.668.473.8
CSQA65.659.064.465.472.4
PIQA77.477.779.878.976.0
SIQA64.457.561.963.868.7
HS69.773.274.776.967.5
WG66.565.671.272.064.8
Average60.759.362.264.763.6

Multilingual Results

LanguageBenchmarkHelium-1 PreviewHF SmolLM2 (1.7B)Gemma-2 (2.6B)Llama-3.2 (3B)Qwen2.5 (1.5B)
GermanMMLU45.635.345.047.549.5
ARC C56.738.454.758.360.2
HS53.533.953.453.742.8
MKQA16.17.118.920.210.4
SpanishMMLU46.538.946.249.652.8
ARC C58.343.258.860.068.1
HS58.640.860.561.151.4
MKQA16.07.918.520.610.6

Technical Specifications

Model Architecture and Objective

HyperparameterValue
Layers24
Heads20
Model dimension2560
MLP dimension7040
Context size4096
Theta RoPE100,000

Tips:

Usage tips

Helium can be found on the Huggingface Hub

In the following, we demonstrate how to use helium-1-preview for the inference.

python
from transformers import AutoModelForCausalLM, AutoTokenizer


model = AutoModelForCausalLM.from_pretrained("kyutai/helium-1-preview-2b", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("kyutai/helium-1-preview-2b")

prompt = "Give me a short introduction to large language model."

model_inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, do_sample=True)

generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

HeliumConfig

[[autodoc]] HeliumConfig

HeliumModel

[[autodoc]] HeliumModel - forward

HeliumForCausalLM

[[autodoc]] HeliumForCausalLM - forward

HeliumForSequenceClassification

[[autodoc]] HeliumForSequenceClassification - forward

HeliumForTokenClassification

[[autodoc]] HeliumForTokenClassification - forward