/ Модель

Характеристики

Лицензия
Своя лицензия
Базовая модель
gpt-sw3-20b
Опубликована
28 апр 2023

gpt-sw3-20b-instruct

Генерация текстаТекст → текст

GPT-SW3 20B Instruct — дообученная AI Sweden многоязычная языковая модель для диалогов, генерации текста и выполнения инструкций.

7скачиваний за 30 дней12лайковвеса обновлены24 июн 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

GPT-SW3 20B Instruct — диалоговая авторегрессионная языковая модель AI Sweden, разработанная совместно с RISE и WASP WARA for Media and Language. Это дообученная на инструкционных данных версия GPT-SW3 20B; базовая модель построена на архитектуре decoder-only Transformer и обучалась предсказывать следующий токен. Модель предназначена для генерации текста и выполнения инструкций в формате диалога или обычного текста.

Модель ориентирована прежде всего на шведский, норвежский, датский, исландский и английский языки; исходное семейство также обучалось на коде. Её можно применять для диалоговых помощников, написания и продолжения текста, а также для текстовых задач, сформулированных как инструкции. Репозиторий содержит веса PyTorch в формате safetensors. Лицензия — модифицированная RAIL, обозначенная в метаданных как other.

К ограничениям относятся галлюцинации, предвзятость, стереотипы, повторяющиеся или нерелевантные ответы и возможная генерация оскорбительного, дискриминационного, жестокого либо сексуального содержания. Качество ответов может зависеть от языка и формулировки запроса.

Сценарии применения

  • создание диалогового помощника на скандинавских языках
  • генерация и продолжение текстов на шведском, норвежском, датском, исландском и английском
  • ответы на инструкции в формате чата
  • черновое составление и переформулирование текста
  • выполнение текстовых задач через генерацию

Ограничения

Модель может галлюцинировать, повторяться, выдавать нерелевантные ответы и отражать предвзятость или стереотипы; возможна генерация оскорбительного, дискриминационного, жестокого или сексуального содержания. README также упоминает обучение на коде, но не перечисляет поддерживаемые языки программирования.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Model description

AI Sweden
Base models
GPT-Sw3 126M | GPT-Sw3 356M | GPT-Sw3 1.3B
GPT-Sw3 6.7B | GPT-Sw3 6.7B v2 | GPT-Sw3 20B
GPT-Sw3 40B
Instruct models
GPT-Sw3 126M Instruct | GPT-Sw3 356M Instruct | GPT-Sw3 1.3B Instruct
GPT-Sw3 6.7B v2 Instruct | GPT-Sw3 20B Instruct
Quantized models
GPT-Sw3 6.7B v2 Instruct 4-bit gptq | GPT-Sw3 20B Instruct 4-bit gptq

GPT-SW3 is a collection of large decoder-only pretrained transformer language models that were developed by AI Sweden in collaboration with RISE and the WASP WARA for Media and Language. GPT-SW3 has been trained on a dataset containing 320B tokens in Swedish, Norwegian, Danish, Icelandic, English, and programming code. The model was pretrained using a causal language modeling (CLM) objective utilizing the NeMo Megatron GPT implementation.

The instruct models were finetrained on instruction data using both chat and raw text formats.

Intended use

GPT-SW3 is an autoregressive large language model that is capable of generating coherent text in 5 different languages, and 4 programming languages. GPT-SW3 can also be instructed to perform text tasks that it has not been explicitly trained for, by casting them as text generation tasks.

Limitations

Like other large language models for which the diversity (or lack thereof) of training data induces downstream impact on the quality of our model, GPT-SW3 has limitations in terms of for example bias and safety. GPT-SW3 can also have quality issues in terms of generation diversity and hallucination. By releasing with the modified RAIL license, we also hope to increase communication, transparency, and the study of large language models. The model may: overrepresent some viewpoints and underrepresent others, contain stereotypes, generate hateful, abusive, violent, discriminatory or prejudicial language. The model may make errors, including producing incorrect information as if it were factual, it may generate irrelevant or repetitive outputs, and content that may not be appropriate for all settings, including sexual content.

How to use

To be able to access the model from Python, since this is a private repository, you have to log in with your access token. This can be done with huggingface-cli login, see HuggingFace Quick Start Guide for more information.

The following code snippet loads our tokenizer & model, and uses the GPU if available.

import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM

# Initialize Variables
model_name = "AI-Sweden-Models/gpt-sw3-20b-instruct"
device = "cuda:0" if torch.cuda.is_available() else "cpu"
prompt = "Träd är fina för att"

# Initialize Tokenizer & Model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
model.eval()
model.to(device)

Generating text using the generate method is done as follows:

input_ids = tokenizer(prompt, return_tensors="pt")["input_ids"].to(device)

generated_token_ids = model.generate(
    inputs=input_ids,
    max_new_tokens=100,
    do_sample=True,
    temperature=0.6,
    top_p=1,
)[0]

generated_text = tokenizer.decode(generated_token_ids)    

The chat format used during data-preprocessing takes the form:

<|endoftext|><s>
User:
Jag tycker träd är fina
<s>
Bot:
Kul att du tycker det!
<s>
...

The procedure to generate text is the same as before:

prompt = """
<|endoftext|><s>
User:
Varför är träd fina?
<s>
Bot:
""".strip()

input_ids = tokenizer(prompt, return_tensors="pt")["input_ids"].to(device)

generated_token_ids = model.generate(
    inputs=input_ids,
    max_new_tokens=100,
    do_sample=True,
    temperature=0.6,
    top_p=1,
)[0]

generated_text = tokenizer.decode(generated_token_ids)    

Generating text using the generate method is done as follows:

input_ids = tokenizer(prompt, return_tensors="pt")["input_ids"].to(device)

generated_token_ids = model.generate(
    inputs=input_ids,
    max_new_tokens=100,
    do_sample=True,
    temperature=0.6,
    top_p=1,
)[0]

A convenient alternative to the generate method is the HuggingFace pipeline, which handles most of the work for you:

generator = pipeline('text-generation', tokenizer=tokenizer, model=model, device=device)
generated = generator(prompt, max_new_tokens=100, do_sample=True, temperature=0.6, top_p=1)[0]["generated_text"]

Maintenance

  • Who is supporting/hosting/maintaining the dataset? AI Sweden at Lindholmen Science Park AB.
  • How can the owner/curator/manager of the dataset be contacted (e.g., email address)? nlu@ai.se
  • Is there an erratum? If so, please provide a link or other access point. N/A.
  • Will the dataset be updated (e.g., to correct labeling errors, add new instances, delete instances)? If so, please describe how often, by whom, and how updates will be communicated to users (e.g., mailing list, GitHub)? Currently, there are no plans for updating the dataset.
  • If the dataset relates to people, are there applicable limits on the retention of the data associated with the instances (e.g., were individuals in question told that their data would be retained for a fixed period of time and then deleted)? If so, please describe these limits and explain how they will be enforced. Read the privacy policy for the NLU initiative at AI Sweden here.
  • Will older versions of the dataset continue to be supported/hosted/maintained? If so, please describe how. If not, please describe how its obsolescence will be communicated to users. N/A.
  • If others want to extend/augment/build on/contribute to the dataset, is there a mechanism for them to do so? If so, please provide a description. Will these contributions be validated/ verified? If so, please describe how. If not, why not? Is there a process for communicating/ distributing these contributions to other users? If so, please provide a description. Not at this time.
  • Any other comments? No.

Open LLM Leaderboard Evaluation Results

Detailed results can be found here

MetricValue
Avg.38.19
ARC (25-shot)43.17
HellaSwag (10-shot)71.09
MMLU (5-shot)31.32
TruthfulQA (0-shot)41.02
Winogrande (5-shot)66.77
GSM8K (5-shot)8.79
DROP (3-shot)5.15

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
9dff842

0 моделей