/ Модель

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

Контекст
1 024 токена
Параметры
20,4 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
26 сен 2026

GPT-U-20M

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

Компактная англоязычная Llama-модель на 20 млн параметров для экспериментов с генерацией текста и кода.

977скачиваний за 30 дней1лайквеса обновлены26 сен 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

GPT-U-20M — компактная языковая модель автора DedeProGames, построенная на архитектуре Llama и обученная с нуля. Это плотный декодерный трансформер LlamaForCausalLM с 8 слоями, RoPE, SwiGLU и RMSNorm; в модели 20,4 млн параметров. Она принимает текст и предсказывает продолжение последовательности, используя контекст до 1 024 токенов.

Модель обучалась один проход на 2,6 млрд токенов англоязычных веб-текстов, образовательных материалов и кода. Она подходит для экспериментов и обучения принципам предобучения языковых моделей, а также для изучения генерации коротких продолжений текста и кода. Авторы приводят результаты проверки на отложенных данных и несколько оценок на zero-shot задачах, но отмечают, что эти показатели не следует считать свидетельством высокого качества.

При размере 20 млн параметров у модели ограниченные знания и слабые способности к рассуждению; ответы могут быть беглыми, но неверными, а сгенерированный код — нефункциональным. Модель обучена только на английском языке, не проходила инструкционную и безопасностную настройку, а короткое контекстное окно ограничивает работу с длинными документами. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

image

A 20.5M-parameter Llama-architecture language model pretrained from scratch on 2.6B tokens of web text, educational text and code.

Architecture

Typedecoder-only transformer, LlamaForCausalLM: RoPE, SwiGLU, RMSNorm, pre-norm, no biases
Parameters20,453,760 (6,291,456 tied embedding + 8 × 1,770,240 per block + 384 final norm)
Layers8
Hidden size384
Attention6 heads × 64 dims, full multi-head (no GQA), SDPA
MLPSwiGLU, intermediate size 1,024
Vocabulary16,384 (byte-level BPE, trained on the same mix)
Context length1,024 tokens
RoPE θ10,000
Input/output embeddingstied

The 16,384-token vocabulary keeps the embedding at 31% of the parameters (a 50k vocabulary would need 19.3M parameters at width 384) and lets tokens be stored as uint16.

Tokenizer. Byte-level BPE with a cl100k-style split that keeps whitespace runs whole (Python indentation), one token per digit, and <|endoftext|> (id 0) as BOS/EOS/padding. Round-trip decode(encode(x)) == x holds on 1,000 held-out samples (tabs, CRLF, emoji, CJK, RTL, control characters).

Held-out domainTokens / wordBytes / token
DCLM1.484.07
FineWeb-Edu1.454.24
Code (27% Python)5.342.01
Python only3.783.21

Training data

One epoch over 2.6B tokens, no repetition:

DatasetTarget shareRealized shareTokens seen (≈)
mlfoundations/dclm-baseline-1.045%45.04%1.17B
HuggingFaceFW/fineweb-edu (sample-10BT)35%35.03%0.91B
HuggingFaceCode/stack-v3-train20%19.93%0.52B
  • Each source is streamed from the Hub and tokenized up to its token budget; the documents are then interleaved per document in a seeded random order, i.e. with fixed proportions for the whole run (no domain curriculum), so the realized shares match the targets exactly. (Holding the four streams open at once was avoided: it needed 7–8 GB of RAM and destabilized the training machine.)
  • The Stack v3 is grouped by repository; repositories were split into individual files, vendored files dropped, and Python held at 26.6% of the code tokens (it is ~4% of Stack v3 naturally).
  • Documents are separated by <|endoftext|> and packed into contiguous 1,025-token blocks (1,024 inputs + 1 shifted target), no padding. Batches are sampled from a seeded permutation of all blocks.
  • Validation holdouts (2M tokens per domain) come from source files that never fed training or the tokenizer.

Training

HyperparameterValue
Tokens per step131,072 (2 GPUs × 32 sequences × 1,024 tokens × 2 accumulation steps)
Steps19,840
OptimizerAdamW, β = (0.9, 0.95), ε = 1e-8
Peak learning rate1.8e-3
ScheduleWSD: 500 warmup steps → constant to step 15,872 → linear decay to 1.8e-4 at step 19,840
Weight decay0.1 on 2D matrices only (none on norms and embeddings)
Gradient clipping1.0
z-loss1e-4
Dropout0
InitializationN(0, 0.02); o_proj and down_proj scaled by 1/√(2·8)
Precisionbf16 autocast, fp32 master weights

Trained on 2× RTX 3060 12GB (no NVLink) under WSL2 with PyTorch DDP and torch.compile (mode: compile): 4.6 h of active training time, 167,893 tokens/s on average (MFU ≈ 52% of the GPUs' measured bf16 matmul throughput), max GPU temperature 76°C, 3 automatic resume(s) from checkpoints after the machine was shut down, 0 loss-spike rollback(s).

Results

Validation loss on the 2M-token holdouts (1,600 fixed 1,024-token windows per domain) and bits per byte, bpb = loss_nats × tokens / (bytes × ln 2), which is comparable across tokenizers:

DomainVal loss (nats/token)Bits per byte
DCLM-baseline3.50441.2377
FineWeb-Edu3.25861.1070
The Stack v3 (code)1.80751.3031
Aggregate2.85681.1967

The aggregate is the equal-weight mean of the three holdouts (same number of tokens each). Code tokens are far easier to predict than prose with this tokenizer, which pulls the aggregate down; the prose domains (3.26–3.50 nats/token) are the fairer comparison point for web-text models, and bits per byte is the fairer one across tokenizers.

Zero-shot benchmarks (lm-evaluation-harness). <|endoftext|> is prepended as BOS. hellaswag and winogrande sit at chance, as expected at 20M parameters; arc_easy and piqa land clearly above it, which reflects surface lexical knowledge more than reasoning. They are reported for transparency, not as a quality signal.

TaskMetricGPT-U-20MChance
arc_easyacc40.0325
arc_easyacc_norm37.4225
piqaacc58.6050
piqaacc_norm58.5450
hellaswagacc26.6425
hellaswagacc_norm27.8525
lambada_openaiacc21.790
lambada_openaiperplexity138.45—
winograndeacc51.7850

Sample generations (temperature 0.8, top-p 0.95) are in out/samples.md.

Loss curve

Training and validation loss

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("DedeProGames/GPT-U-20M")
model = AutoModelForCausalLM.from_pretrained("DedeProGames/GPT-U-20M")

inputs = tokenizer("The history of the Roman Empire", return_tensors="pt")  # prepends <|endoftext|> as BOS
output = model.generate(**inputs, max_new_tokens=100, do_sample=True, temperature=0.8, top_p=0.95)
print(tokenizer.decode(output[0], skip_special_tokens=True))

Checkpoints

  • main: final weights (step 19,840, end of the decay phase).
  • stable-15872: weights at step 15,872, the end of the constant-learning-rate phase, meant for continued pretraining (e.g. extending to 4–5B tokens before decaying again). Load with revision="stable-15872".

Limitations

  • It is tiny. 20M parameters is a research and teaching scale; the model has shallow world knowledge and weak reasoning.
  • Heavily over-trained for its size by design: 127 tokens per parameter, about 6× the Chinchilla-optimal ratio (~20).
  • Not for production use. It hallucinates freely and produces fluent but often false statements.
  • Generated code is not functional. It imitates the surface form of code; do not run it.
  • English only (web and educational text); no instruction tuning, no safety tuning. Web data can carry biases and offensive content.
  • Context is limited to 1,024 tokens.

Data provenance and licenses

SourceLicenseNotes
DCLM-baseline 1.0CC-BY-4.0Common Crawl web text filtered by DataComp-LM; see the dataset card.
FineWeb-Edu (sample-10BT)ODC-By 1.0Common Crawl pages filtered for educational value; use is also subject to Common Crawl's terms of use.
The Stack v3 (train)ODC-ByGitHub code as of August 2025; files are permissively licensed or carry no detected license (non-permissive files excluded upstream), PII-redacted, with an opt-out process. Individual files keep their original licenses.

The model weights are released under Apache-2.0. Tokenized data is not redistributed.

Reproducibility

Everything used to build this model is in the repository: scripts/ (tokenizer training, data preparation, training, evaluation, publishing), configs/model.json, logs/train.jsonl (every 10 steps: loss, lr, grad norm, throughput, MFU, GPU temperatures, memory), logs/tokenizer_report.json and out/data_index.json (token counts per shard and domain, holdout bytes). Raw evaluation outputs: out/eval.json and out/lm_eval_results.json.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей