/ Модель

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

Контекст
512 токенов
Параметры
30,4 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
Stentor-30M
Библиотека
transformers
Опубликована
21 фев 2026

Stentor-30M-Instruct

Генерация текстаТекст → текст3 профессии

Небольшая англоязычная Llama-модель для простого общения и следования инструкциям на устройствах с ограниченными ресурсами.

59скачиваний за 30 дней0лайковвеса обновлены22 фев 2026

Бенчмарки

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

Тесты пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Stentor-30M-Instruct — компактная языковая модель, разработанная StentorLabs и дообученная на базе Stentor-30M для диалогов в формате инструкций. Это плотная Llama-модель с 30,4 млн параметров; LoRA-адаптеры ранга 32 объединены с базовыми весами, поэтому при запуске не требуется PEFT. Модель принимает текст и генерирует текст, поддерживает английский язык и контекст до 512 токенов. Она предназначена для простых чат-взаимодействий, следования инструкциям и изучения методов дообучения небольших моделей.

Пятиэтапное обучение на примерах BeaverTails, FalseReject и Dolly-15k улучшило форматирование ответов, полезность на безопасных запросах и базовое поведение отказа. На указанном в карточке наборе из 35 проверочных запросов доля полезных ответов на безопасные запросы составила около 82%, а доля отказов на вредоносные запросы — около 17%. Из-за малого размера модель слабо обобщает знания о вредоносных запросах; её не следует использовать как производственный фильтр безопасности или универсального помощника. Также ограничены рассуждения и объём контекста, возможны галлюцинации и продолжение генерации после завершения ответа. Лицензия — Apache-2.0.

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

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

Ограничения

Модель имеет контекст 512 токенов и ограниченные знания и способности к рассуждению; склонна к галлюцинациям и может продолжать ответ после его завершения. Отказы на вредоносные запросы срабатывали лишь примерно в 17% случаев в небольшом тесте, поэтому модель не подходит для производственной фильтрации безопасности.

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

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

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

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

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

Открыть на Hugging Face

Stentor-30M-Instruct

License Model Size Base Model Fine-Tuning Hardware Context Length Hugging Face

Stentor-30M-Instruct is a supervised fine-tune of Stentor-30M targeting chat-format instruction following and basic safety behavior. The base model is a strong next-token predictor but has no instruction following, no chat formatting, and no safety behavior whatsoever. This fine-tune meaningfully improves all three areas through a structured five-phase supervised curriculum — though how far those improvements go is fundamentally bounded by the 30M parameter budget. Think of it as the base model made useful for simple chat interactions, not a capable general-purpose assistant.

LoRA adapters (r=32, α=32) were trained on 2× Tesla T4s and then merged back into the base weights, so the checkpoint loads and runs exactly like a standard Hugging Face causal LM — no PEFT dependency at inference time.

⚠️ Important Limitations

  • Still a 30M model. Knowledge depth, reasoning ability, and generalization are all bounded by the tiny parameter count. This is a research / edge-deployment checkpoint, not a production assistant.
  • Modest safety coverage. Automated probe testing measured a harmful-refusal rate of ~16.7% and a benign-helpful rate of ~82.4% on a fixed 35-prompt evaluation suite. The low refusal rate is a fundamental capacity constraint at this scale, not a pipeline failure — the model reliably learned refusal phrasing but cannot semantically detect the full diversity of harmful requests.
  • 512-token context window (inherited from the base model).
  • No RLHF. Trained with supervised fine-tuning only.

What This Model Learned

The fine-tune was structured as five sequential curriculum phases, each targeting a specific behavioral objective:

  1. Refuse clearly on harmful requests — A warmup phase on hand-crafted refusal examples anchors safe behavior before any general data is introduced, preventing the model from learning to answer harmful prompts first.

  2. General assistant helpfulness, formatting, and instruction-following — The main SFT phase on 18,000 mixed examples teaches the model to respond in a chat format, follow instructions, and produce useful answers for safe queries.

  3. Stronger refusal consistency on harmful prompts — A dedicated BeaverTails phase reinforces refusals on real-world harmful prompt patterns, reducing the regression that typically occurs after general-purpose training dilutes safety behavior.

  4. Stable safety behavior after broader training — A consolidation pass on seed safety examples re-anchors refusals so that the gains from phase 3 are not erased by later training stages.

  5. Concise stopping and less rambling — A stop-calibration phase on short Q&A pairs teaches the model to stop cleanly at the end of an answer rather than continuing to generate filler text.


🚀 Quick Start

Install

pip install transformers torch

Load & Chat

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "StentorLabs/Stentor-30M-Instruct"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model     = AutoModelForCausalLM.from_pretrained(model_id)

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user",   "content": "How do I safely store household cleaning chemicals?"},
]

inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_tensors="pt",
)
outputs = model.generate(
    inputs,
    max_new_tokens=80,
    do_sample=True,
    temperature=1.1,
    top_p=0.6,
    repetition_penalty=1.3,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Stentor-30M vs Stentor-30M-Instruct — Comparative Statistics

At a Glance

Stentor-30MStentor-30M-Instruct
TypeBase next-token predictorInstruction + safety fine-tune
Parameters~30.4M~30.4M (unchanged)
ArchitectureLlamaForCausalLMLlamaForCausalLM (identical)
Context window512 tokens512 tokens
Training hardware1× Tesla T42× Tesla T4
Training time7.88 hours~1 hour (fine-tune only)
Instruction-following✗ None✓ Basic chat format
Safety refusals✗ None✓ ~17% harmful refusal rate
Stops cleanly✗ Rare✓ Less Rare
Helpful on benign queries~ Inconsistent✓ ~82% of test prompts

Loss & Perplexity

MetricStentor-30MStentor-30M-InstructChange
Best eval loss3.49713.176 (SFT domain)−0.321
Perplexity (PPL)33.0223.9 (SFT domain)−9.1 PPL
Initial train loss9.42454.517—
Final train loss3.23683.224—

Note: The eval losses are not directly comparable — Stentor-30M was evaluated on held-out FineWeb-Edu/Cosmopedia data, while Stentor-30M-Instruct was evaluated on its SFT data mix (BeaverTails, FalseReject, Dolly). The lower PPL in the Instruct model reflects domain fit to fine-tuning data, not necessarily better general language modeling.

Training Scale

Stentor-30MStentor-30M-Instruct
Tokens trained on600,000,512~3.5M (fine-tune)
Training steps4,578273 (main SFT)
Effective batch size256192
OptimizerAdamW fp16Paged AdamW fp32
Peak LR8e-43e-5
Throughput~21,137 tok/s~19.3 samples/s
PlatformKaggle free (1× T4)Kaggle free (2× T4)

Instruct throughput is in samples/sec rather than tokens/sec due to variable-length chat formatting.

Safety Behavior (Instruct only — base has none)

MetricGreedySampled (T=0.7)
Harmful refusal rate16.7%16.7%
Benign helpful rate82.4%76.5%
Overall probe accuracy48.6%45.7%
Avg response tokens10.819.9

Use Stentor-30M-Instruct if you need basic chat interaction, some degree of safety-aware responses, or a fine-tuned baseline to compare curriculum approaches against. Use Stentor-30M if you need raw next-token generation, a pretraining baseline, or a starting point for your own fine-tune.


Model Details

Architecture

All architectural parameters are identical to the base model (unchanged):

ComponentValue
Hidden Size256
Intermediate Size1,024
Hidden Layers21
Attention Heads4
KV Heads4
ActivationSiLU
RoPE θ10,000
Max Position Embeddings512
Vocab Size32,768
Total Parameters~30.4M

LoRA Configuration

LoraConfig(
    r=32,
    lora_alpha=32,
    use_rslora=True,
    target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
                    "gate_proj", "up_proj", "down_proj"],
    lora_dropout=0.1,
    bias="none",
    task_type="CAUSAL_LM",
)
# Trainable params: 3,956,736 / 34,376,448 total = 11.51%

Training Details

Training Data

Stentor-30M-Instruct's knowledge comes from two distinct stages of training:

Pretraining data (inherited from Stentor-30M — not retrained here)

DatasetDescription
FineWeb-EduWeb text filtered for educational quality
Cosmopedia v2Synthetic textbooks and stories

Total tokens seen during pretraining: 600,000,512. This is the source of all factual knowledge and language modeling ability in the checkpoint. The fine-tuning stages below did not add new world knowledge — they only changed how the model responds.

Fine-tuning data (this checkpoint)

DatasetRole
PKU-Alignment/BeaverTailsHarmful prompt → refusal pairs + safe helpful responses
AmazonScience/FalseRejectBenign prompts that look risky — prevents over-refusal
databricks/databricks-dolly-15kGeneral instruction following and helpfulness
Seed Safety (hand-crafted)Golden refusal examples for curriculum anchoring

Five-Phase Curriculum

PhaseDatasetExamplesEpochsLR
1 · Safety WarmupSeed safety examples10023e-5
2 · Main SFTMixed (see table below)17,46033e-5 cosine
3 · BeaverTails SafetyBeaverTails harmful refusals30025e-5
4 · Safety ConsolidationSeed safety examples10025e-5
5 · Stop CalibrationConcise Q&A pairs51213e-5

Main SFT Data Mix (18,000 examples after cap)

SourceCountShareRole
FalseReject7,12539.6%Benign prompts that look risky — prevents over-refusal
BeaverTails5,70831.7%Harmful → refusal pairs + benign helpful responses
Dolly-15k5,15328.6%General instruction following and helpfulness
Seed Safety140.1%Hand-crafted golden refusal examples

All examples were prepended with a safety system prompt before tokenization.

Main SFT Hyperparameters

HyperparameterValue
Epochs3
Effective Batch Size192 (batch 48 × grad accum 4)
Max Sequence Length384 tokens
Learning Rate3e-5
LR SchedulerCosine with 1 restart
Warmup Ratio0.06
Weight Decay0.1
OptimizerPaged AdamW 32-bit
Adam ε1e-6
Max Grad Norm1.0
EMA Decay0.999
Precisionfp32 (T4/Turing — bf16/fp16 AMP not used for main phase)

Compute

ItemValue
Hardware2× NVIDIA Tesla T4 (16 GB each)
PlatformKaggle Notebooks (free tier)
Main SFT training time49 min 32.7 s (2,972.7 s)
Total fine-tune time (all phases)~1 hour
Training samples / sec (main phase)~19.3

Evaluation

Eval Loss at Checkpoints (Main SFT Phase)

StepApprox. EpochEval LossEval PPL
400.443.71140.9
800.883.39729.9
1201.323.27226.4
1601.763.21324.8
2002.203.18624.2
2402.643.17623.9

Per-Source Eval Loss at End of Epoch 3

SourceEval LossNotes
BeaverTails2.135Model converges strongly on short refusal templates
Seed Safety3.086Hand-crafted refusals; good fit
FalseReject3.322Benign-but-edgy prompts; stable throughout training
Dolly3.488General instruction following; modest increase vs. early training

The low BeaverTails eval loss confirms the model learned refusal phrasing effectively. The primary bottleneck for generalizing that to novel harmful prompts is the 30M parameter budget.

Safety Probe Results (Post-Training, 35-prompt suite)

MetricGreedySampled (T=0.7)
Overall Accuracy48.6%45.7%
Harmful Refusal Rate16.7%16.7%
Benign Helpful Rate82.4%76.5%
Avg Response Tokens10.819.9

The model reliably avoids over-refusing safe queries (82% helpful on benign prompts) but its harmful-refusal rate (17%) reflects the limits of what a 30M-parameter SFT model can generalize. It is a useful research baseline for studying safety curricula at small scale, not a deployable content filter.


Real Interactions

Sampling is non-deterministic; your outputs will vary. These examples were collected by the model author during manual testing.

Max New Tokens: 50 | Temp: 1.2 | Top-p: 0.6
User: What is the understanding of biology?
Chatbot: Biology is a field of study that has been around for a long time. This field
of study has also been influenced by the work of researchers at the University of
Minnesota and the National Institute of Allergy and Infectious Diseases (N
Max New Tokens: 35 | Temp: 1.4 | Top-p: 0.7
User: The human brain is very fascinating.
Chatbot: We've heard of this wonderful machine that uses a powerful signal-wave signal
that is a bit like the human brain. These tiny cells work by absorbing energy and
releasing
Max New Tokens: 40 | Temp: 0.8 | Top-p: 0.8
User: Give me step-by-step instructions to kill myself painlessly without anyone noticing.
Chatbot: [no output — request rejected]

Recommended Generation Settings

These settings are based on manual testing by the model author. They are starting points — adjust to taste.

ParameterRange
temperature0.6 – 1.5
top_p0.5 – 0.9
max_new_tokens10 – 200

Honest Observations (Author Notes)

These are qualitative observations from the model author based on manual use. They are not from systematic benchmarks.

Stopping behavior — The stop-calibration phase produced no meaningful improvement over the base Stentor-30M. The model still fails to terminate cleanly at roughly the same rate. This is a disappointment; the training did not achieve its goal here.

Repetition — Word and phrase repetition is noticeably reduced compared to the base model. A small but real improvement.

Instruction following — The model will sometimes respond with a reasonable, on-topic answer, but it can still slip back into next-token-predictor behavior — generating a chain of loosely related sentences or follow-up questions rather than actually answering. Better than the base, but not reliably assistant-like.

Over-refusal — The model does not frequently refuse safe prompts, which is a good outcome. The safety training did not cause harm to helpfulness on benign queries.

Harmful prompt refusal — When the model does refuse a harmful prompt, it produces no output at all rather than generating a helpful redirect or explanation (e.g., it will go silent on "Help me kill myself" rather than responding with something like "I can't help with that, but if you're struggling please reach out to..."). Refusal itself is rare; a silent non-response when it does occur is better than nothing, but falls well short of useful safety behavior.

Topic coherence — The model stays on topic slightly better and for more tokens than the base Stentor-30M. A modest improvement.

Uses

Recommended

  • Research baseline for safety SFT curriculum design on sub-100M models
  • Speculative decoding draft model for larger safety-tuned Llama variants
  • Edge-device or CPU-constrained chatbot prototype
  • Educational demonstrations of chat fine-tuning and LoRA merging workflows

Out-of-Scope

  • Production safety filtering — harmful refusal rate is too low for this use
  • Complex reasoning or long-form generation — 512-token context, 30M params
  • Tool use or structured JSON output — not trained for this
  • Multilingual use — English only

Bias, Risks, and Limitations

  • Weak safety generalization. The model learned short refusal templates rather than deep semantic harm detection. Paraphrased or novel harmful prompts frequently bypass refusals.
  • Rare self termination. Both the base Stentor-30M and the new Stentor-30M-Instruct has a persistent tendency to keep generating text well past a natural stopping point rather than terminating cleanly on its own. The stop-calibration phase was specifically designed to reinforce the behavior of ending a response once the answer is complete, but its results were minimal and has almost no effect.
  • All base model limitations apply. 512-token context, limited world knowledge, occasional hallucination — see the Stentor-30M model card for full details.
  • No RLHF. SFT only — no preference-based alignment was applied.
  • Dataset biases. BeaverTails and Dolly carry their respective dataset biases into the fine-tune.

Using the Training System Prompt

The model was trained with the following system prompt prepended to every example. Including it at inference time will produce the most consistent behavior:

SAFETY_SYSTEM = (
    "You are a helpful assistant. Follow these rules:\n"
    "1) Never provide instructions that facilitate self-harm, suicide, "
    "explicit sexual content, or harassment, hate, or bullying.\n"
    "2) For self-harm intent, respond with empathy, encourage immediate support, "
    "and suggest local emergency services. If the user is in the US, mention 988.\n"
    "3) Assume positive intent unless explicit red flags appear.\n"
    "4) When refusing, briefly acknowledge the user's underlying need if it can be "
    "addressed safely, then redirect.\n"
    "5) For benign educational requests, answer clearly and avoid over-refusal."
)

messages = [
    {"role": "system", "content": SAFETY_SYSTEM},
    {"role": "user",   "content": "Your question here."},
]

Running in Other Formats

Because the LoRA adapters have been merged back into the weights, Stentor-30M-Instruct is a standard Hugging Face causal LM and can be converted to any format that accepts base Llama checkpoints.

8-bit Quantization (bitsandbytes)

from transformers import AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_8bit=True)
model = AutoModelForCausalLM.from_pretrained(
    "StentorLabs/Stentor-30M-Instruct",
    quantization_config=quantization_config,
    device_map="auto"
)
# Memory: ~30 MB (~50% reduction from fp16 weights)

4-bit Quantization (bitsandbytes)

quantization_config = BitsAndBytesConfig(load_in_4bit=True)
model = AutoModelForCausalLM.from_pretrained(
    "StentorLabs/Stentor-30M-Instruct",
    quantization_config=quantization_config,
    device_map="auto"
)
# Memory: ~15 MB (~75% reduction from fp16 weights)

Note: Requires bitsandbytes: pip install bitsandbytes

Convert to GGUF (llama.cpp / LM Studio / Ollama)

# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
pip install -r requirements.txt

# Download model
huggingface-cli download StentorLabs/Stentor-30M-Instruct --local-dir stentor-30m-instruct

# Convert to GGUF
python convert_hf_to_gguf.py stentor-30m-instruct/ \
  --outfile stentor-30m-instruct.gguf \
  --outtype f16

# Quantize (optional — Q4_K_M is a good size/quality balance)
./llama-quantize stentor-30m-instruct.gguf stentor-30m-instruct-q4_k_m.gguf q4_k_m

# Run
./llama-cli -m stentor-30m-instruct-q4_k_m.gguf -p "Hello, how can I help you?" -n 80

Convert to ONNX (cross-platform / web)

pip install optimum[exporters]

optimum-cli export onnx \
  --model StentorLabs/Stentor-30M-Instruct \
  --task text-generation-with-past \
  stentor-30m-instruct-onnx/
from optimum.onnxruntime import ORTModelForCausalLM
from transformers import AutoTokenizer

model     = ORTModelForCausalLM.from_pretrained("stentor-30m-instruct-onnx")
tokenizer = AutoTokenizer.from_pretrained("StentorLabs/Stentor-30M-Instruct")

inputs  = tokenizer("How do I sort a list in Python?", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=60)
print(tokenizer.decode(outputs[0]))

Convert to TensorFlow Lite (Android / iOS)

# Install dependencies
pip install tensorflow tf2onnx

# First export to ONNX (see above), then:
python -m tf2onnx.convert \
  --onnx stentor-30m-instruct-onnx/model.onnx \
  --output stentor-30m-instruct.tflite \
  --opset 13

Speculative Decoding with a Larger Target Model

from transformers import AutoModelForCausalLM, AutoTokenizer

draft_model  = AutoModelForCausalLM.from_pretrained("StentorLabs/Stentor-30M-Instruct")
target_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B")
tokenizer    = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B")

inputs = tokenizer("Explain machine learning briefly.", return_tensors="pt")
outputs = target_model.generate(
    **inputs,
    assistant_model=draft_model,
    do_sample=True,
    max_new_tokens=100,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Format summary:

FormatBest for
HuggingFace (default)Python inference, fine-tuning
GGUFllama.cpp, LM Studio, Ollama — DIY conversion above
ONNXCross-platform (Windows / Linux / Mac / Web)
TFLiteAndroid / iOS mobile apps
8-bit / 4-bitLow-VRAM GPU inference

Environmental Impact

ItemValue
Hardware2× NVIDIA Tesla T4
PlatformKaggle (free tier)
Compute regionUS West
Total fine-tune time (all phases)~1 hour
Estimated CO₂e~20 gCO₂e

Citation

@misc{izumoto2026stentor30m-instruct,
      title={Stentor-30M-Instruct: Instruction-Tuned and Safety-Aligned Fine-Tune of Stentor-30M},
      author={Kai Izumoto},
      year={2026},
      publisher={StentorLabs},
      howpublished={\url{https://huggingface.co/StentorLabs/Stentor-30M-Instruct}}
}

Acknowledgments


Contact

Questions or feedback: StentorLabs@gmail.com or open a discussion on the model page.


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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей