/ Модель

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

Лицензия
MIT
Архитектура
instruction-tuned (SFT) · dense
Опубликована
16 мар 2026

nanogpt-slm-tinystories-instruct

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

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

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

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

nishantup/nanogpt-slm-tinystories-instruct — небольшая плотная языковая модель на 124 млн параметров, созданная Dr. Nishant Upadhyay с нуля на PyTorch и дообученная следовать инструкциям. Сначала модель обучалась на наборе TinyStories, затем прошла SFT на 300 тысячах инструкций из нескольких источников. Лицензия — MIT.

Модель предназначена для генерации текста по инструкциям на английском языке. Она отвечает на вопросы, кратко пересказывает текст, пишет рассказы и другие творческие тексты, классифицирует содержание, составляет списки и объясняет понятия простыми словами. Для взаимодействия используется формат Task/Question/Answer.

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

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

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

Ограничения

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

nanoGPT SLM TinyStories Instruct -- 124.0M Parameters

An instruction-tuned Small Language Model trained entirely from scratch:

  1. Pretrained on TinyStories (2.1M children's stories, 70K iterations)
  2. Instruction fine-tuned (SFT) on a 300K multi-source instruction dataset

What This Model Does

This model follows instructions across diverse tasks: answering questions, summarizing text, creative writing, classification, translation, and more. Give it a task and it responds:

Task: Explain what photosynthesis is in simple terms.

Answer:
Photosynthesis is the process by which plants convert sunlight, water, and
carbon dioxide into glucose and oxygen. It occurs in the chloroplasts of
plant cells and is essential for life on Earth...

Capabilities:

  • Answers factual questions
  • Summarizes text
  • Writes creative content (poems, stories, descriptions)
  • Classifies text (sentiment, category)
  • Generates lists and structured content
  • Explains concepts in simple terms

Limitations:

  • 512-token context window limits response length
  • Trained on children's stories base -- may default to simple language
  • Not as capable as larger instruction-tuned models
  • English only

Training Pipeline

StageDatasetSizeDetails
PretrainingTinyStories2.1M stories70K iters, batch 32x512, lr=6e-4, cosine to 1e-5
Instruction SFT300K Instructions300K examples3 epochs, batch 32, lr=1e-4, AdamW

Instruction Dataset Sources

SourceCountType
Alpaca52KStanford instruction-following
Dolly15KDatabricks human-authored
UltraChat80KMulti-turn conversations
OpenAssistant33KHuman-generated QA
FLAN120KGoogle's diverse NLP tasks

Quick Start

Option 1: Run directly

pip install torch tiktoken huggingface_hub
python nanogpt_slm_tinystories_instruct_inference.py

Option 2: Import and use ask() in your own code

from nanogpt_slm_tinystories_instruct_inference import ask

# Simple question
print(ask("What is the capital of France?"))

# With input context
print(ask(
    instruction="Summarize the following text.",
    input_text="Machine learning enables systems to learn from data..."
))

# Control generation
print(ask("Write a poem about the ocean.", temperature=1.0, top_k=100))

Option 3: Load weights manually

from huggingface_hub import hf_hub_download
import torch

model_path = hf_hub_download(
    repo_id="nishantup/nanogpt-slm-tinystories-instruct",
    filename="nanogpt_slm_tinystories_instruct.pth"
)

from nanogpt_slm_tinystories_instruct_inference import GPT, GPTConfig
config = GPTConfig()
model = GPT(config)
model.load_state_dict(torch.load(model_path, map_location="cpu"))
model.eval()

Prompt Format

The model uses the unified Task/Question/Answer format:

Task: {instruction}

Question:
{input}          <- only if input is non-empty

Answer:
{response}

Model Architecture

AttributeValue
ArchitecturenanoGPT (GPT-2 small: 12 layers, 12 heads, 768 dim)
Parameters124.0M (unique, with weight tying)
Context length512 tokens
Tokenizertiktoken GPT-2 BPE (50,257 tokens)
EOS token<|endoftext|> (50256) -- clean response stopping

ask() API Reference

ask(instruction, input_text="", max_tokens=256, temperature=0.7, top_k=40)
ParameterDefaultDescription
instruction(required)The task instruction
input_text""Optional additional context
max_tokens256Maximum tokens to generate
temperature0.70.0 = greedy, 0.7 = balanced, 1.5 = creative
top_k40Top-k filtering (None = no filtering)

Files

FileDescription
nanogpt_slm_tinystories_instruct.pthInstruction fine-tuned weights
nanogpt_slm_tinystories_instruct_inference.pyStandalone inference script
config.jsonModel + training configuration

Related Models (Vizuara SLM Family)

VariantTypeRepo
Pretrained (TinyStories)Basenishantup/nanogpt-pretrained-slm-tinystories-124m
This modelInstruction SFTnishantup/nanogpt-slm-tinystories-instruct
Spam classifierClassificationnishantup/nanogpt-slm-tinystories-classifier

Citation

Eldan, R., & Li, Y. (2023). TinyStories: How Small Can Language Models Be
and Still Speak Coherent English? arXiv preprint arXiv:2305.07759.

Author

Dr. Nishant Upadhyay

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

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

GPU в ailist

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

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

Архитектура instruction-tuned (SFT) неизвестна transformers в образе рантайма.

Ревизия весов
e159039

0 моделей