/ Модель

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

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

amx-moe-4day-w2048

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

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

131скачиваний за 30 дней0лайковвеса обновлены1 окт 2026

Бенчмарки

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

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

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

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

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

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

gdiamos/amx-moe-4day-w2048 — базовая авторегрессионная языковая модель, разработанная автором репозитория и обученная с нуля на одном CPU-ядре Intel Emerald Rapids. Модель предсказывает следующий токен и предназначена прежде всего как основа для дальнейшего дообучения, а также для изучения обучения компактных моделей при ограниченных вычислительных ресурсах.

Архитектура M2R сочетает оконное скользящее внимание и линейное внимание с логарифмическим затуханием; в блоках также используются маршрутизируемые эксперты. В модели 6 слоёв, ширина представления 256, 30 029 429 параметров хранятся в весах, а на токен активно используются около 3,3 млн параметров. Контекстное окно — 2048 токенов. Обучение проведено на 1,75 млрд токенов смешанного корпуса с текстом, кодом и синтетическими материалами.

Модель не проходила инструкционное дообучение и при свободной генерации быстро зацикливается на повторениях, поэтому не подходит для обычного диалога или самостоятельной генерации текста. Для загрузки требуется исходный код архитектуры из репозитория: стандартный AutoModelForCausalLM в Transformers её не поддерживает. Веса доступны в формате safetensors, лицензия Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

gdiamos/amx-moe-4day-w2048

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,429 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-moe-4day-w2048 --local-dir amx-moe-4day-w2048
cd amx-moe-4day-w2048 && 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 2048), log-decay linear attention (d_state 32)
MLP width640
vocabulary16384
readouttied to the embedding
parameters30,029,429 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.0625,
      3.015625,
      3.03125
    ],
    "mean": 3.0364583333333335
  },
  "val_reasoning_anneal": {
    "last_3": [
      2.28125,
      2.28125,
      2.28125
    ],
    "mean": 2.28125
  },
  "val_flat": {
    "last_3": [
      4.885426998138428,
      4.837184429168701,
      4.90023946762085
    ],
    "mean": 4.874283631642659
  },
  "val_loss": {
    "last_3": [
      2.90625,
      2.890625,
      2.859375
    ],
    "mean": 2.8854166666666665
  },
  "steps": 427245,
  "tokens": 1749999616
}

Which run this is, and how its experts actually behave

This is the control arm of a router-normalisation A/B at window 2048: E=64 experts, top-4 (two of them shared), 1.75 B tokens, 427,246 steps. Its twin differs only by M2R_MOE_ROUTER_NORM. It is not the project's best model on any benchmark; it is a clean, completed baseline.

The three MoE layers behave completely differently from each other, which is worth knowing before fine-tuning from it. Measured on these weights with a real batch from the training mixture:

blockper-channel RMSNorm gainbranch output / branch inputshare of the residual
00.01735.50.3%
30.036324,5175.6%
50.0567110,10019.3%

For reference the dense blocks' RMSNorm gains are 0.0726 (block 1), 0.7861 (block 2) and 1.3187 (block 4), so all three MoE layers sit well below them.

Read the three columns together, because the gain alone is misleading. Every MoE layer damped its input gain hard, but the expert banks grew enough to more than compensate in blocks 3 and 5 -- so block 0's branch is effectively inert while block 5's carries a fifth of the residual stream. The enormous middle column is the signature of that trade: a tiny input scaled up by very large weights.

Two consequences, stated plainly:

  • Depth matters more than the MoE/dense distinction here. A fine-tune that assumes the expert banks are uniformly useful, or uniformly dead, will be wrong about two of the three layers either way.
  • This is not a clean demonstration that block-routed MoE works. The gain collapse is real, it is what this project calls expert collapse, and block 0 is what it looks like when it goes all the way.

The run discarded 367 gradients in 427,245 steps (0.086%) as non-finite and finished. Sibling runs on nearby configurations did worse, so the stability here should not be assumed to transfer.

Validation loss, its own

Full-vocabulary held-out loss, 42 draws over the run:

stepval_flat
10,0005.8506
80,0004.6006
150,0004.5947
220,0004.4394
290,0003.2218
360,0004.1605
420,0004.9002

Mean of the last six draws 4.5648; best single draw 3.2218. The spread between adjacent draws is large -- 3.22 to 4.90 within 130 k steps -- so single draws should not be compared across models.

The machine-generated block below reports 4.8743 for val_flat, which is the mean of the last THREE draws rather than six. Both are correct and the difference is entirely draw noise, which is the point: at this variance a three-draw window is not a stable estimate. Use the six-draw figure, and do not compare either against another model's single draw.

Limitations

A research artifact, and the honest summary is that the failures are specific rather than diffuse. The one above is architectural: the three MoE layers damped their input gains hard and only two of the three compensated, so block 0's experts are close to inert while block 5's carry a fifth of the residual.

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 torch-20260925T081457-4day-w2048-ctrl at step 427246.

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

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

GPU в ailist

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

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

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

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

0 моделей