/ Модель

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

Контекст
8 192 токена
Параметры
362 млн
Лицензия
CC BY-NC 4.0
Архитектура
llama · dense
Базовая модель
SmolLM2-360M-Instruct
Библиотека
transformers
Опубликована
25 окт 2026

smollm2_360m-alpaca-it

Генерация текстаТекст → текст3 профессии
77скачиваний за 30 дней0лайковвеса обновлены26 окт 2026

Описание модели

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

Англоязычная модель SmolLM2 на 361,8 млн параметров, дообученная на Alpaca для генерации ответов на инструкции и экспериментов по дистилляции.

Модель yoshitomo-matsubara/smollm2_360m-alpaca-it — англоязычная инструктивная модель, созданная Yoshitomo Matsubara на основе HuggingFaceTB/SmolLM2-360M-Instruct. Это плотная Llama-архитектура с 361,8 млн параметров, дообученная всеми параметрами на наборе Stanford Alpaca методом instruction tuning. Она предназначена для генерации ответов на инструкции и диалогов в стиле Alpaca, а также служит адаптированным учителем для экспериментов по дистилляции знаний в torchdistill. Контекст модели составляет 8192 токена; при обучении использовались последовательности длиной не более 512 токенов.

Контрольная perplexity на отложенной выборке Alpaca составила 4,4708, однако оценка относится только к данным того же распределения; downstream-бенчмарки не проводились. Ответы Alpaca основаны на генерациях text-davinci-003 и могут наследовать фактические ошибки, смещения и шаблонный стиль. Дополнительного обучения безопасности не проводилось. Лицензия CC-BY-NC-4.0 запрещает коммерческое использование; автор указывает исследовательские сценарии, в частности эксперименты с дистилляцией.

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

  • генерация ответов на англоязычные инструкции в стиле Alpaca
  • создание диалогового прототипа на компактной языковой модели
  • использование модели-учителя в экспериментах по дистилляции знаний
  • сравнение perplexity на выборках с инструкциями Alpaca

Ограничения

Модель обучена только на англоязычных инструкциях Alpaca; её ответы могут содержать ошибки и смещения, а дополнительного обучения безопасности не проводилось. Оценка ограничена perplexity на данных того же распределения, downstream-бенчмарки не выполнялись; коммерческое использование запрещено лицензией CC-BY-NC-4.0.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

smollm2_360m-alpaca-it

HuggingFaceTB/SmolLM2-360M-Instruct fully fine-tuned on Stanford Alpaca with torchdistill.

It is the task-adapted teacher for the knowledge distillation (KD) configs configs/sample/alpaca/on_policy_kd/smollm2_135m_from_smollm2_360m.yaml and configs/sample/alpaca/off_policy_kd/smollm2_135m_from_smollm2_360m.yaml, which load it from the Hub. The off-the-shelf instruct checkpoint never saw Alpaca's reference style, so its KL term would pull the student toward a distribution the task loss pulls it away from; fine-tuning the teacher on the same data first removes that conflict.

Model details

Base modelHuggingFaceTB/SmolLM2-360M-Instruct (360M parameters, Llama architecture)
Fine-tuningFull-parameter instruction tuning, cross-entropy on response tokens only
Training datatatsu-lab/alpaca, 90% of the train split (46,801 examples)
LanguageEnglish
Context used in training512 tokens (prompt up to 256)
Weightsmodel.safetensors, float32
LicenseCC BY-NC 4.0 (see License)

Usage

The model was trained with the system prompt "You are a helpful assistant.". The bundled chat template falls back to SmolLM's default system prompt when none is given, so pass the training one explicitly:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = 'yoshitomo-matsubara/smollm2_360m-alpaca-it'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype='bfloat16', device_map='auto')

messages = [
    {'role': 'system', 'content': 'You are a helpful assistant.'},
    {'role': 'user', 'content': 'Give three tips for staying healthy.'},
]
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors='pt', return_dict=True
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True))

The tokenizer pads on the right (the default). That is fine for a single prompt, but for batched generation set left padding, so that every prompt ends at the last position and generation continues from the prompt rather than from pad tokens:

tokenizer.padding_side = 'left'
batch = [
    [{'role': 'system', 'content': 'You are a helpful assistant.'}, {'role': 'user', 'content': instruction}]
    for instruction in ['Give three tips for staying healthy.', 'What is the capital of France?']
]
inputs = tokenizer.apply_chat_template(
    batch, add_generation_prompt=True, padding=True, return_tensors='pt', return_dict=True
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.batch_decode(outputs[:, inputs['input_ids'].shape[1]:], skip_special_tokens=True))

Training itself used left padding too (torchdistill's instruction pipeline sets it for batched on-policy rollouts), but the side does not matter there: padded positions are excluded by the attention mask and from the loss.

Training data and split

tatsu-lab/alpaca ships only a train split (52,002 examples), so it was split 90/5/5 into train, validation and test at run time with torchdistill's split_dataset (lengths: [90, 5, 5], generator_seed: 42). The equivalent in plain PyTorch:

import torch
from datasets import load_dataset
from torch.utils.data import random_split

dataset = load_dataset('tatsu-lab/alpaca', split='train', revision='dce01c9b08f87459cf36a430d809084718273017')
subsets = random_split(dataset, [46801, 2600, 2601], generator=torch.Generator().manual_seed(42))
train, validation, test = (dataset.select(subset.indices) for subset in subsets)
# train: 46,801 examples, validation: 2,600 examples, test: 2,601 examples

The training run did not pin revision; the commit above is the one it resolved to. The same seed reproduces the same split only for the same dataset revision (and a PyTorch version that keeps the randperm stream unchanged). The SmolLM2 Alpaca models (the 135M baseline, the 360M and 1.7B teachers and the distilled 135M students) all use this split.

Each example is formatted with SmolLM2's chat template: the system prompt above, the instruction field as the user turn (prompt_key: 'instruction') and the output field as the assistant turn (response_key: 'output'). Prompt tokens are masked out of the loss.

Training procedure

HyperparameterValue
Epochs3 (checkpoint kept from epoch 2, see Evaluation)
OptimizerAdamW, lr 2e-5, weight decay 0.0
ScheduleLinear decay with 100 warmup steps
Batch size8 per device x 1 device(s) x gradient accumulation 4 = 32
Gradient clippingmax norm 1.0
Precisionfp32 master weights, bf16 autocast
Hardware1x 24 GB GPU, bf16 mixed precision
Time per epoch~13 min
Seed42

The full torchdistill config, CLI arguments, training log and per-step metrics are in logs/: config.yaml, args.json, train.log, metrics.json and trackio/summary.csv. To reproduce the run with torchdistill, use the command in the header of logs/config.yaml.

Evaluation

Perplexity over the response tokens. The 2,600-example validation split was measured after each epoch and used to pick the checkpoint:

EpochValidation perplexity
14.4633
2 (released)4.4483
34.5167

The checkpoint with the lowest validation perplexity (epoch 2) is the one released here. Evaluated once on the 2,601-example test split, its perplexity is 4.4708.

The test split is disjoint from both the training data and the checkpoint selection, so this is a held-out score; it is still in-distribution (Alpaca-style instructions and text-davinci-003 references). No downstream benchmarks (e.g. AlpacaEval, MT-Bench) have been run.

Limitations

  • Alpaca's responses were generated by OpenAI's text-davinci-003 and inherit its factual errors, biases and short, generic style. The model may produce incorrect, harmful or biased text.
  • No safety tuning was performed beyond what the base SmolLM2-Instruct model already has.
  • English only; trained on sequences of at most 512 tokens.
  • Validation perplexity rose in epoch 3, so three epochs over-train at this learning rate.
  • Intended for research, in particular as a reference point for knowledge-distillation experiments. Not intended for production or commercial use.

License

The weights are released under CC BY-NC 4.0 (LICENSE), because the training data, tatsu-lab/alpaca, is licensed under CC BY-NC 4.0 and its outputs were generated with OpenAI's text-davinci-003, whose terms restrict use for developing competing models.

This model is a modification of HuggingFaceTB/SmolLM2-360M-Instruct by Hugging Face, which is licensed under the Apache License 2.0; a copy is included in LICENSE.SmolLM2. The modification is full-parameter fine-tuning on the data described above.

Citation

If you use this model, please cite torchdistill, as well as SmolLM2 and Alpaca:

@inproceedings{matsubara2021torchdistill,
  title={torchdistill: A Modular, Configuration-Driven Framework for Knowledge Distillation},
  author={Matsubara, Yoshitomo},
  booktitle={International Workshop on Reproducible Research in Pattern Recognition},
  pages={24--44},
  year={2021},
  organization={Springer}
}

@inproceedings{matsubara2023torchdistill,
  title={{torchdistill Meets Hugging Face Libraries for Reproducible, Coding-Free Deep Learning Studies: A Case Study on NLP}},
  author={Matsubara, Yoshitomo},
  booktitle={Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023)},
  publisher={Empirical Methods in Natural Language Processing},
  pages={153--164},
  year={2023}
}

@misc{allal2025smollm2,
  title={SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model},
  author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Mart\'in Bl\'azquez and Guilherme Penedo and Lewis Tunstall and Andr\'es Marafioti and Hynek Kydl\'i\v{c}ek and Agust\'in Piqueres Lajar\'in and Vaibhav Srivastav and Joshua Lochner and Caleb Fahlgren and Xuan-Son Nguyen and Cl\'ementine Fourrier and Ben Burtenshaw and Hugo Larcher and Haojun Zhao and Cyril Zakka and Mathieu Morlon and Colin Raffel and Leandro von Werra and Thomas Wolf},
  year={2025},
  eprint={2502.02737},
  archivePrefix={arXiv},
  primaryClass={cs.CL}
}

@misc{alpaca,
  author={Rohan Taori and Ishaan Gulrajani and Tianyi Zhang and Yann Dubois and Xuechen Li and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto},
  title={Stanford Alpaca: An Instruction-following LLaMA model},
  year={2023},
  publisher={GitHub},
  journal={GitHub repository},
  howpublished={\url{https://github.com/tatsu-lab/stanford_alpaca}}
}

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
eeae9f8

0 моделей