/ Модель

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

Лицензия
Apache 2.0
Архитектура
m2r · dense
Библиотека
pytorch
Опубликована
22 сен 2026

amx-reasoning-moe-4day-v2

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

Компактная базовая языковая модель, обученная на одном CPU-ядре и предназначенная для экспериментов и дальнейшего дообучения.

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

Бенчмарки

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

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

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

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

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

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

gdiamos разработал базовую авторегрессионную языковую модель для предсказания следующего токена. Она обучена с нуля на одном CPU-ядре Intel Emerald Rapids с использованием bf16 через AMX; обучение охватило около 1,75 млрд токенов. В модели 6 слоёв, размер скрытого представления d_model равен 256, а число активных параметров на токен — около 3,32 млн при 30,03 млн параметров в хранилище. Архитектура сочетает скользящее оконное и линейное внимание, а также блочно маршрутизируемые эксперты.

Модель предназначена прежде всего как отправная точка для дальнейшего дообучения и экспериментов с компактными языковыми моделями и эффективным обучением на CPU. Это базовая модель без инструкционного дообучения; README указывает, что при свободной генерации она впадает в повторения примерно через пять токенов, поэтому для обычной генерации текста она непригодна. Для загрузки нужны исходный код архитектуры из репозитория и указанные автором зависимости; стандартный AutoModelForCausalLM её не поддерживает. Лицензия — Apache-2.0.

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

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

Ограничения

При свободной генерации модель впадает в повторения примерно через пять токенов; инструкционного, согласующего и защитного дообучения нет. Стандартный AutoModelForCausalLM её не загружает, требуется исходная реализация архитектуры из репозитория.

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

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

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

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

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

Открыть на Hugging Face

gdiamos/amx-reasoning-moe-4day-v2

A causal language model trained end to end on one CPU core --- a single Intel Emerald Rapids core, bf16 through AMX, OMP_NUM_THREADS=1. 3,315,744 active parameters per token, 30,029,417 stored.

The point of the project is not that a small model runs on a CPU. It is that the architecture is derived from a single-core roofline, that training is confined to the same core, and that at this scale the interesting behaviours show up much earlier in the token budget than we expected.

What it does

This is a base model: it predicts the next token and has had no instruction tuning. It is well calibrated under teacher forcing and it cannot generate --- free-running, it enters a repetition basin within about five tokens. That is expected of this checkpoint and is what the instruction-tuned sibling exists to fix. Use it as a starting point for fine-tuning, not as a generator.

Running it

AutoModelForCausalLM.from_pretrained will not work: the architecture is not one transformers knows --- chunked sliding-window attention interleaved with log-decay linear attention, and a tied readout and block-routed experts. The model's own source ships here under m2r/, unmodified from the repository that trained it.

hf download gdiamos/amx-reasoning-moe-4day-v2 --local-dir amx-reasoning-moe-4day-v2
cd amx-reasoning-moe-4day-v2 && pip install -r requirements.txt && python example.py
import sys, torch
from safetensors.torch import load_file
from tokenizers import Tokenizer
sys.path.insert(0, ".")                 # the folder you downloaded

from m2r.config import load
from m2r.model.torch_model import Model, swa_mask

cfg = load("training_config.yaml")
model = Model(cfg.model).to(torch.bfloat16)
model.load_state_dict(load_file("model.safetensors"))
model.eval()
tok = Tokenizer.from_file("tokenizer.json")
mask = swa_mask(cfg.model, dtype=torch.bfloat16)

# Pad to a whole number of blocks and read the last REAL position. Right-padding
# is safe -- attention is causal and the MLP is position-wise.
PAD_TO = max(cfg.model.window, cfg.model.route_block or 1, 256)
ids = [1] + tok.encode("The capital of France is").ids    # 1 is BOS
for _ in range(60):
    n = len(ids)
    x = torch.tensor([ids + [0] * ((-n) % PAD_TO)])
    with torch.no_grad():
        h = model.body(x, mask)[:, n - 1]
    logits = (h @ model.emb.t().to(h.dtype)).float()[0] / 0.8
    v, i = logits.topk(40)
    ids.append(int(i[torch.multinomial(v.softmax(-1), 1)]))
print(tok.decode(ids[1:]))

Sample rather than take the argmax: greedy decoding loops within a few tokens. BOS (id 1) matters --- the model was trained with attention confined to document boundaries keyed on that token, so a prompt without it is unlike anything it saw in training.

What is in this repo

file
model.safetensorsthe weights, bf16
generation.jsondecode settings, and the vocabulary mask described below
config.jsonevery architecture field, machine readable
training_config.yamlthe run's config, and what example.py loads
tokenizer.jsona tokenizers BPE; Tokenizer.from_file loads it alone
m2r/the model source, imported by example.py
example.pyload and generate, correctly
paper.pdfthe write-up, when shipped with this export
LICENSEApache 2.0

Architecture

d_model256
layers6
layer typeslin, swa, swa, lin, swa, lin
mixerssliding-window attention (window 256), log-decay linear attention (d_state 32)
MLP width640
vocabulary16384
readouttied to the embedding
parameters30,029,417 stored, 3,315,744 active per token
experts64, top-4, d_ff_e 160, route_block 256
MoE layers[0, 3, 5]

Attention is confined to document boundaries: a training window packs many documents, and without isolation sliding-window attention reaches into its neighbours while linear attention carries state across the whole window.

The shape is deliberate. One AMX core sustains roughly 2,231 GF/s of bf16 matrix multiply at these dimensions but pays a 1.4--1.5 microsecond floor per GEMM dispatch, so every design choice here is about issuing few large matrix multiplies rather than many small ones.

Training data

The run consumed 1,749,999,616 tokens --- 12.8% of the 13,651,264,478-token corpus prepared for it, taken in schedule order. The table below is the PREPARED corpus, not the consumed slice; per-source shares are of the corpus.

sourcetokensshare
reasoning_anneal.code_reasoning3,031,714,47822.2%
foundation.github_code2,926,000,00021.4%
foundation.web2,217,600,00016.2%
foundation.code_reasoning1,062,600,0007.8%
foundation.math924,000,0006.8%
reasoning_anneal.github_code582,000,0004.3%
instruction.tulu_sft290,000,0002.1%
instruction.web290,000,0002.1%
reasoning_anneal.web257,050,0001.9%
reasoning_anneal.tulu_sft218,250,0001.6%
instruction.code_reasoning217,500,0001.6%
instruction.github_code217,500,0001.6%
foundation.tulu_sft215,600,0001.6%
instruction.qa174,000,0001.3%
instruction.math168,200,0001.2%
reasoning_anneal.math145,500,0001.1%
foundation.qa77,000,0000.6%
foundation.task_induct77,000,0000.6%
foundation.task_shift77,000,0000.6%
foundation.task_add77,000,0000.6%
reasoning_anneal.qa72,750,0000.5%
reasoning_anneal.task_induct48,500,0000.4%
reasoning_anneal.task_shift48,500,0000.4%
reasoning_anneal.task_add48,500,0000.4%
instruction.ultrachat24,650,0000.2%
instruction.instruct_sft24,650,0000.2%
reasoning_anneal.ultrachat24,250,0000.2%
reasoning_anneal.instruct_sft24,250,0000.2%
foundation.ultrachat23,100,0000.2%
foundation.instruct_sft23,100,0000.2%
instruction.task_induct14,500,0000.1%
instruction.task_shift14,500,0000.1%
instruction.task_add14,500,0000.1%
total prepared13,651,264,478
consumed by this run1,749,999,61612.8%

Every natural-language and code source above is a curated artefact built with the help of large models --- quality classification, rephrasing, model-assisted extraction, and in the case of the reasoning corpus, traces that are themselves generated output. Training a model this small on them is a form of distillation, with no teacher present at training time. This is worth stating plainly, because it means results at this scale depend on corpora that did not exist when models of this size were last studied seriously.

Validation loss

The run's own numbers on its fixed held-out set, as logged. These are a sampled loss --- a (1 + n_negatives)-way discrimination, not a full-vocabulary one --- except val_flat, which is full-vocabulary.

{
  "val_foundation": {
    "last_3": [
      3.109375,
      3.09375,
      3.109375
    ],
    "mean": 3.1041666666666665
  },
  "val_reasoning_anneal": {
    "last_3": [
      2.296875,
      2.296875,
      2.296875
    ],
    "mean": 2.296875
  },
  "val_flat": {
    "last_3": [
      5.036965370178223,
      5.066086769104004,
      5.095897674560547
    ],
    "mean": 5.066316604614258
  },
  "val_loss": {
    "last_3": [
      2.84375,
      2.796875,
      2.765625
    ],
    "mean": 2.8020833333333335
  },
  "steps": 427245,
  "tokens": 1749999616
}

Limitations

A research artifact, and the honest summary is that the failures are specific rather than diffuse.

It degenerates into repetition. Free-running, it enters an absorbing state within about five tokens, in every domain. No decode-time patch fixes this --- truncation sampling has nothing to reshape in a distribution that concentrated. Instruction tuning does fix it, which is what the instruct sibling of this repo is.

It has had no alignment, safety, or preference training of any kind, and will reproduce the biases and errors of its training corpus.

License and provenance

Apache 2.0, for the weights and for the source in m2r/; full text in LICENSE.

The training data is a mixture of public code, web, math and instruction corpora, with per-source token counts above. Those corpora carry their own terms, which the Apache licence on this model does not alter and does not extend to them.

Produced by tools/export_hf.py from run moe-best-4day-v2-20260919T044803 at step 427246.

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

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

GPU в ailist

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

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

Архитектура m2r неизвестна transformers в образе рантайма.

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

0 моделей