/ Модель

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

Контекст
1 024 токена
Лицензия
odc-by
Архитектура
llm_mojo_gpt2 · dense
Опубликована
2 ноя 2026

gpt2-124m-fineweb-muon-rotary-qknorm-mojo

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

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

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

Экспериментальный GPT‑2-класс чекпойнт на 124 млн параметров для воспроизведения обучения на FineWeb и генерации текста через llm.mojo.

Это экспериментальный чекпойнт GPT‑2 класса на 124 млн параметров, обученный с нуля разработчиком ulmentflam на выборке FineWeb classic объёмом 10 млрд токенов. Модель использует 12 слоёв, 12 голов и 768 каналов, а также rotary position embeddings и QK-нормализацию; это архитектурный вариант GPT‑2, который несовместим с обычной реализацией GPT‑2. Контекст составляет 1024 токена, веса сохранены в формате safetensors с точностью bf16.

Чекпойнт предназначен прежде всего для воспроизводимости обучения и изучения рецепта Muon в llm.mojo. Он поддерживает генерацию текста, но автор характеризует его как артефакт обучения, а не как эффективную языковую модель для повседневных задач. Обучение проводилось на английском корпусе FineWeb; приведённая оценка — validation loss 3,2704 на FineWeb val, при этом HellaSwag не оценивался.

Для корректной загрузки и генерации требуется llm.mojo с поддержкой rotary и QK-нормализации, а также NVIDIA GPU; стандартные загрузчики Transformers намеренно не распознают эту архитектуру и могут вычислять неверную модель. Лицензия репозитория — ODC-BY.

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

  • воспроизведение обучения языковой модели на FineWeb
  • изучение влияния Muon на обучение GPT‑2-класса моделей
  • проверка реализации rotary embeddings и QK-нормализации
  • эксперименты с генерацией английского текста через llm.mojo

Ограничения

Модель описана как артефакт обучения, а не как способная языковая модель; её качество проверено только на FineWeb validation, без оценки HellaSwag и подтверждения на нескольких полноценных запусках. Для корректной работы необходим llm.mojo с включёнными rotary и QK-нормализацией; стандартная загрузка GPT‑2 вычисляет неверную модель.

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

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

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

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

Источники: 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

GPT-2 124M (bf16), Muon + rotary + QK-norm, trained with llm.mojo

A GPT-2 124M-class model (12 layers, 12 heads, 768 channels) trained from scratch on the FineWeb classic 10B-token sample with llm.mojo, using the recipe from its modded-nanogpt adoption campaign. It is a training-run artifact and reproducibility reference, not a capable language model.

This is not a stock GPT-2. It uses rotary position embeddings and QK-norm, so a stock GPT-2 loader computes a different model from these weights. The weights are provided in two formats, and both require the llm.mojo code to run correctly:

  • model.safetensors with config.json (model_type: llm_mojo_gpt2), the weights in Hugging Face tensor names;
  • model_5700.bin, llm.mojo's raw checkpoint, plus state_5700_0.bin (optimizer and trainer state, for resuming).

Results

Validation is FineWeb val, 320 batches (10,485,760 tokens).

tokensval loss
First eval at or below 3.28 (step 5600)2.94B3.2795
This checkpoint (step 5700)2.99B3.2704
AdamW, gpt2-124m-fineweb-mojo model.safetensors (7 GPUs, 458,752 tokens/step)10.25B3.2784
AdamW, same repo, llm_mojo_raw_checkpoint/model_19552.bin (524,288 tokens/step)10.25B3.2900

The 3.2704 above is the training run's logged value (3.2703533, pre-fusion kernels). Re-measured on the current fused rotary/QK-norm kernels over the same full 320-batch val, both formats (model_5700.bin and model.safetensors) score 3.2703578; the difference from the logged value is floating-point rounding between the two kernel generations.

This recipe passes the better AdamW checkpoint's 3.2784 between steps 5600 and 5700 (by 2.99B tokens, about 3.4x fewer than that run's total), and the other's 3.2900 at step 5500 (2.88B tokens, 3.2892). The AdamW runs' own crossing points on this val set were not measured.

Limits of this result:

  • One seed. A three-seed confirmation exists only at 600 steps and 131k tokens/step.
  • The figure belongs to this recipe and horizon together. The same recipe with a 3800-step horizon ended at 3.3249 after 1.99B tokens. Other horizons were not tried.
  • This run resumed from step 2000 of that 3800-step run, where the two schedules are identical. Its discarded steps 2001-3800 are not counted in the tokens above.
  • HellaSwag was not evaluated on this checkpoint.

Files

filecontentssha256 prefix
model.safetensorsbf16, 147 tensors, HF GPT-2 names with Conv1D transposes; wte cut to 50257 rows; no transformer.wpe.weight (it is all zero and unused under rotary); tied lm_head not stored540566164813ec7c
config.jsonmodel_type: llm_mojo_gpt2, llm_mojo_arch_flags: 5, rotary, qk_norm, attn_scale, dropout 0.0 (llm.mojo has no dropout), the exact rotation in rotary_note
generation_config.json, tokenizer.json, tokenizer_config.jsonthe GPT-2 tokenizer files, as in the other llm.mojo repos
model_5700.binbf16 model weights, llm.mojo model file version 5, architecture flags = 5 (rotary + QK-norm); wpe is present but all zero394d3a6ae33f24e8
state_5700_0.binoptimizer and trainer state, for resuming only; flags = 5e07337124a7218ef

The .bin files were corrected

The first upload of model_5700.bin (sha256 prefix 9ab731c3073e9ef2) and state_5700_0.bin (067a41fd93a0e966) recorded only the rotary flag (flags = 1) because the QK-norm bit did not exist when they were written. The files here differ from those by that one flag byte in the header (byte 81 in the model file and byte 177 in the state file, value 1 changed to 5) and nothing else. This repo's history was squashed on 2026-11-02 to remove those earlier versions, so if you downloaded a file with one of those prefixes, replace it.

Why it matters: a rotary-only build (-D LLMM_ROTARY=1 without -D LLMM_QK_NORM=1) loads a flags = 1 file without complaint and computes the wrong model (loss about 8.55 on the check batch instead of 3.29). With the corrected files such a build refuses to load them, and so does a build with neither flag. If you downloaded the first versions, re-download, or write a corrected copy with scripts/set_checkpoint_arch_flags.py in llm.mojo.

Loading

Use llm.mojo. AutoConfig, AutoModelForCausalLM and pipeline refuse this checkpoint by design (they raise "does not recognize this architecture" for llm_mojo_gpt2), instead of loading it as GPT-2. An explicit GPT2LMHeadModel.from_pretrained(dir) still loads it, with a model-type warning and a load report that transformer.wpe.weight is MISSING (a randomly initialised position table), and it computes the wrong model: a stock GPT-2 has neither rotary nor QK-norm.

Generate

Requires pixi and an NVIDIA GPU; these commands were run on one NVIDIA GB10 only.

Needs gpt2_tokenizer.bin in the directory you run from (make gpt2_tokenizer.bin fetches it). Download the files from this repo into a directory (below, hf/).

git clone https://github.com/ulmentflam/llm.mojo && cd llm.mojo
make gpt2_tokenizer.bin
make build-infer-bf16 INFER_BIN_BF16=build/infer_gpt2_bf16_recipe MOJO_DEFINES="-D LLMM_ROTARY=1 -D LLMM_QK_NORM=1"

# raw checkpoint
pixi run -e cuda ./build/infer_gpt2_bf16_recipe hf/model_5700.bin 48 1337

# safetensors (reads hf/config.json next to it)
pixi run -e cuda ./build/infer_gpt2_bf16_recipe hf/model.safetensors 48 1337

Both commands print the same text for the same seed. Both flags are required: the loader checks llm_mojo_arch_flags (safetensors) or the header flags (.bin) and refuses a build that lacks either one. infer_gpt2 --hf ulmentflam/gpt2-124m-fineweb-muon-rotary-qknorm-mojo 24 1337 fetches this repo directly; tested on the same build.

To score a batch of FineWeb val: ./build/infer_gpt2_bf16_recipe --loss hf/model_5700.bin <val shard> 4 1024 (both formats print loss= 3.2883191 on the first 4 x 1024 tokens of fineweb_val_000000.bin).

These commands were tested with the fused rotary/QK-norm kernels on llm.mojo main plus the export changes. The model was trained with the earlier unfused kernels at commit 21a2e4c, and the two differ only by floating-point rounding. The safetensors file passes scripts/check_hf_export.py (every tensor bit-identical to the .bin, an independent PyTorch forward at 3.2880 on the same batch).

Training recipe

GPT-2 124M, bf16, 524,288 tokens per step (-b 32 -t 1024 -d 524288), one NVIDIA GB10:

-D LLMM_ROTARY=1 -D LLMM_QK_NORM=1
-opt muon -l 4.8e-3 -c 0.1 -gc 1.0 -x 5700 -v 100 -m 320 -qk_clip 0
-k wsd -u 0 -cooldown 0.4 -decay_shape linear -q 0.1
-mu_start 0.85 -mu 0.95 -mu_warmup 300

Full report, figures and logs: docs/ai/modded_nanogpt_adoption_results_2026-10-30.md.

License

Weights are released under ODC-BY, matching the other llm.mojo FineWeb checkpoints. The llm.mojo code is MIT.

Written with AI assistance (Claude Code, Opus 5.5 agent), directed by Evan Owen.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей