/ Модель

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

Контекст
131 072 токена
Параметры
838 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
MiniCPM5-1B
Библиотека
transformers
Опубликована
5 июл 2026

minicpm5-stock-analyst-v2-mtp

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

Экспериментальная голова многотокенного предсказания для MiniCPM5-1B предлагает следующие токены для speculative decoding и ускорения генерации.

89скачиваний за 30 дней3лайкавеса обновлены5 июл 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ewin-reg/minicpm5-stock-analyst-v2-mtp — производная модель на базе MiniCPM5-1B от OpenBMB с дополнительной головой многотокенного предсказания FastMTP-style. Замороженная основа дополнена обученной головой примерно на 33 млн параметров, которая рекурсивно предлагает от одного до трёх следующих токенов; для проверки предложений используется сама базовая модель. Вес основы при обучении головы не изменялся. В репозитории также находятся веса MiniCPM5-1B со слитым LoRA дообучением для прогнозирования направления движения акций.

Модель предназначена для ускорения генерации текста методом speculative decoding без отдельной черновой модели. Голова обучена самодистилляцией на математических, общих диалоговых и программных примерах с оптимизацией принятия токенов. В README приведены доли совпадения черновых токенов с предсказаниями основы на GSM8K, HumanEval и MT-Bench; наиболее высокий результат показан на математических примерах.

Это экспериментальная реализация для изучения и интеграции многотокенного предсказания. Приведённые доли принятия получены в режиме teacher-forced и не являются измерениями ускорения по времени; фактический эффект зависит от реализации проверки предложений и режима пакетной обработки. Диалоговая точность головы ограничена, а для прогнозирования акций сама MTP-голова не предназначена. Модель использует архитектуру LlamaForCausalLM, формат safetensors и библиотеку Transformers; контекст основы — до 131 072 токенов. Лицензия — Apache 2.0.

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

  • ускорение генерации текста через speculative decoding
  • обучение и оценка MTP-головы для компактной языковой модели
  • проверка принятия черновых токенов на математических задачах
  • эксперименты с самодистилляцией и оптимизацией acceptance rate
  • исследование ускорения генерации кода и диалогов

Ограничения

Показатели в README — доли принятия токенов при teacher-forced оценке, а не измеренное ускорение генерации; реальный эффект зависит от реализации и режима инференса. Диалоговые результаты слабее математических, а MTP-голова не предназначена для stock prediction.

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

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

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

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

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

Открыть на Hugging Face

Multi-Token Prediction (MTP) Head for a 1B LLM — FastMTP-style Speculative Decoding, Trained for ~$0 on Kaggle

A single 33M-parameter multi-token prediction head bolted onto a frozen MiniCPM5-1B, trained with self-distillation (FastMTP recipe) + a direct acceptance-rate loss (LK losses) — with honestly reported, per-benchmark acceptance rates instead of a single cherry-picked number. If you searched for multi-token prediction, MTP head, speculative decoding for small LLMs, or how to speed up LLM inference without a separate draft model — this is a complete, reproducible worked example, including the failure modes.

TL;DR

  • What: one extra Llama decoder layer (+ input projection, 33M params ≈ 2% of the backbone) that recursively drafts k=1..3 future tokens from the frozen base model's own hidden states, embeddings, and LM head. No separate draft model. Backbone weights untouched.
  • Recipe: FastMTP (single shared MTP head, self-distillation on the model's own outputs) + LK losses (hybrid KL/Total-Variation objective that directly optimizes acceptance rate instead of plain cross-entropy).
  • Cost: trained entirely on free Kaggle T4x2 GPUs, ~8,400 self-distilled sequences total.
  • Result (held-out, teacher-forced argmax acceptance vs. the backbone's own predictions):
benchmarkk=1k=2k=3
GSM8K (math)60.9%48.0%42.1%
HumanEval (code)40.2%28.3%24.0%
MT-Bench (chat)38.1%29.0%25.0%
  • Not: a claim of production speedup. These are draft-acceptance rates, not wall-clock numbers; integration into an inference engine (vLLM/SGLang-style verify step) is up to you.

Why this exists

Vanilla reuse of a single MTP module collapses at depth — the FastMTP paper measured ~70% acceptance at k=1 dropping to ~10% at k=2 and ~0% at k=3 when a stock MTP head is recursed naively. This repo demonstrates the two published fixes that actually move that number, combined and reproduced at 1B scale on free hardware:

  1. Self-distillation — the head trains on the model's own greedy completions (MT-Bench / GSM8K / HumanEval prompt mixes), so it learns the distribution it will actually be drafting for.
  2. Direct acceptance-rate optimization — the LK hybrid loss λ·KL + (1−λ)·TV with an adaptive λ = exp(−η·α) schedule, which their ablation showed beats plain KL by ~5.6% acceptance length when fine-tuning a native MTP module.

What's in the repo

filewhat it is
model.safetensors + configsthe backbone: MiniCPM5-1B with the stock-analyst v2 LoRA merged in. Frozen during MTP training.
mtp_head.ptthe trained 33M-param MTP head (input_proj + 1 LlamaDecoderLayer + norms).
tokenizer filesstandard MiniCPM tokenizer.

The head projects through the backbone's own LM head matrix (no new output weights).

How to load

import torch, torch.nn as nn
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.models.llama.modeling_llama import LlamaDecoderLayer, LlamaRMSNorm
from huggingface_hub import hf_hub_download

REPO = "ewinregirgojr/minicpm5-stock-analyst-v2-mtp"
backbone = AutoModelForCausalLM.from_pretrained(REPO, torch_dtype=torch.bfloat16).eval()
tokenizer = AutoTokenizer.from_pretrained(REPO)
config = backbone.config

class MTPHead(nn.Module):
    def __init__(self, config):
        super().__init__()
        self.input_proj = nn.Linear(2 * config.hidden_size, config.hidden_size, bias=False)
        self.pre_norm = LlamaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
        self.decoder_layer = LlamaDecoderLayer(config, layer_idx=config.num_hidden_layers)
        self.out_norm = LlamaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
    def forward(self, prev_hidden, token_embed, position_ids, position_embeddings):
        x = self.pre_norm(self.input_proj(torch.cat([prev_hidden, token_embed], dim=-1)))
        out = self.decoder_layer(x.unsqueeze(1), position_ids=position_ids.unsqueeze(1),
                                 position_embeddings=position_embeddings)
        if isinstance(out, tuple):
            out = out[0]
        return self.out_norm(out.squeeze(1))

head = MTPHead(config).to(torch.bfloat16)
head.load_state_dict(torch.load(hf_hub_download(REPO, "mtp_head.pt"), map_location="cpu"), strict=True)
head.eval()
# drafting: feed h_i (backbone hidden at position i) + embedding of token i+1 -> logits for token i+2,
# then recurse with the head's own output hidden state. Verify drafts with the backbone as usual.

FAQ

Is there a multi-token prediction head I can train myself without a big cluster?

Yes — that's this repo's point. One epoch + a continuation round on ~8.4k self-distilled sequences, free Kaggle T4x2, a few hours total. The full recipe (FastMTP-style shared head + LK loss) is described above and in the linked papers.

Why is GSM8K so much higher than MT-Bench and HumanEval?

Data mix. The self-distillation rounds were math/general-instruction heavy; code got only ~120 prompts. Acceptance tracks training-data volume per domain almost linearly at this scale — that's the main practical lesson from this run. If you continue training with a code-heavy mix, expect HumanEval to move the same way GSM8K did (it roughly doubled from a 7k-sequence round).

Is this the same as DeepSeek's MTP or Qwen's MTP-native models?

Same idea (a small head drafts future tokens, the base model verifies), different provenance: those models pretrain the MTP module jointly; this one is retrofitted onto a finished model post-hoc, which is the situation you're in if your model didn't ship with an MTP head.

What's the catch?

Three honest ones. (1) These are teacher-forced acceptance rates, an upper-bound proxy — real speculative-decoding speedup depends on your verify-step implementation and batch regime. (2) Chat (MT-Bench) is the hardest domain for a 33M head and is still under 30% at k=2 here. (3) The backbone includes a stock-prediction LoRA (see lineage below); for a general-purpose backbone you may want to re-run the recipe on plain MiniCPM5-1B.

Where did the backbone come from?

It's the MiniCPM5-1B Stock Analyst v2 (a LoRA fine-tune for BUY/SELL stock-direction prediction with honestly-reported ~53% held-out accuracy at the feature set's measured ceiling), merged to plain weights. On the stock task itself the model answers in one token, so MTP does nothing there — the head is trained and evaluated on general text.

Reproduce / extend

  • Levers, in order of measured impact: more self-distillation data (dominant — one 7k round roughly doubled every benchmark), domain mix (train on what you want accepted), epochs, then loss hyperparameters (η, γ).
  • Eval protocol: held-out prompts (seeded slices disjoint from training), backbone generates completions greedily, head predicts each next token teacher-forced, acceptance = argmax match with the backbone's own logits.

Version history

versiondataGSM8K k=2note
round 11.4k seqs (incl. stock)26.4%stock EOS-patterns polluted training
round 2 (this)+7k general seqs, stock removed48.0%every benchmark ~doubled

License: Apache 2.0 (matches base model and LoRA lineage). Last updated: 2026-07.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей