/ Модель

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

Контекст
524 288 токенов
Параметры
2,2 млрд
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
MiniCPM5-2B-Base
Библиотека
peft
Опубликована
1 окт 2026

minicpm5-ul4b-story

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

Дообученная MiniCPM5-2B-Base для генерации длинных англоязычных рассказов и их продолжения.

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

Бенчмарки

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

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

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

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

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

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

baiango/minicpm5-ul4b-story — модель для генерации длинной англоязычной прозы, созданная автором репозитория на базе openbmb/MiniCPM5-2B-Base. Это дообученная плотная авторегрессионная модель семейства Llama примерно с 2,2 млрд параметров; в обучении использовалась последовательность из четырёх LoRA-этапов: SFT, DAgger, GRPO и unlikelihood. Репозиторий содержит объединённый LoRA-адаптер и GGUF-квантование Q4_K_S; указанная в README лицензия — Apache-2.0.

Модель предназначена для написания коротких рассказов и их продолжения на английском языке, в том числе по трёхчастному шаблону, рассчитанному примерно на 1700 слов. Авторы сообщают, что выбранная версия выдаёт связные многоабзацные истории; заявленный контекст модели составляет 524288 токенов. Она не предназначена для диалогов с ассистентом, фактологических ответов и генерации на других языках.

К ограничениям относятся слабое соблюдение точки зрения и лица повествования, возможные метакомментарии с последующей переписанной версией продолжения и зависимость качества от параметров сэмплирования. В README сообщается о повторениях у промежуточных версий и утечке маркеров рассуждений или символов CJK при отдельных настройках; результаты вне рекомендованного формата и параметров проверены ограниченно.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

chain_ul4b — story-tuned MiniCPM5-2B-Base (LoRA ladder + GGUF)

openbmb/MiniCPM5-2B-Base (Apache-2.0) fine-tuned for long-form English fiction writing via a 4-stage LoRA ladder (SFT → DAgger → GRPO → unlikelihood), merged to full weights locally and shipped here as one combined rank-64 LoRA + a Q4_K_S GGUF. Selected as the best writer by qualitative read-off: the intermediate stage merges degenerate into hard repetition loops; this one writes coherent multi-paragraph stories.

Lineage

Each stage is trained on the cumulative merge of all previous stages, not on the raw base — only sft3 ever saw openbmb/MiniCPM5-2B-Base directly:

openbmb/MiniCPM5-2B-Base (LlamaForCausalLM, ~2.2B)
  └─ + sft3     (r16 α160, ckpt_0001637)  trained on the base      → merge_1
  └─ + dagger2  (r16 α160, ckpt_0000568)  trained on merge_1       → merge_2
  └─ + grpo3d   (r16 α160, ckpt_final)    trained on merge_2       → merge_3
  └─ + ul4      (r16 α16,  ckpt_0000300)  trained on merge_3       = merged_ul4b

Provenance: the training base was verified by an activation-hash canary gate (layer fingerprints), not by config metadata. The full merged weights are not hosted — reproduce them with openbmb/MiniCPM5-2B-Base + chain_ul4b_lora.

Which base to attach each adapter to

adapterattaches to
chain_ul4b_lora (all 4 stages folded, r64)openbmb/MiniCPM5-2B-Base (raw) — equals merged_ul4b
stage_adapters/sft3raw -Base (→ merge_1)
stage_adapters/dagger2merge_1 (= -Base + sft3), not the raw base
stage_adapters/grpo3merge_2 (= -Base + sft3 + dagger2)
stage_adapters/ul4merge_3 (= -Base + sft3 + dagger2 + grpo3)

Attaching a later stage adapter to the wrong parent gives a different (much weaker) model; the per-stage adapters exist to reproduce/ablate the ladder, not to be mixed and matched freely.

Prompt format (read this before generating)

SFT data: 1,637 three-turn stories. Each story is generated over 3 turns (≈500–650 words per turn, ≈1,700 words assembled), turns separated by a blank line, each turn ending with EOS. Instructions come in 7 phrasing variants spanning 34 genres × first/second/third person × past/present tense, with a pair of flavor tags drawn from a pool of ~1,600. Verbatim examples from the training data:

Write a Young Adult story, in first person, past tense, that leans on Cyberpunk Noir and Equestrian for atmosphere.
Write a short story in the Fantasy genre, in third person, present tense. Draw on the flavors of Moorish Fantasy and Wildfire Wildness.

The exact turn-1 prompt used in training and evaluation appends this fixed instruction to the story instruction:

 Write the opening third of a longer story (the complete story will run about 1800 words). This part: 500-650 words. End at a natural paragraph break mid-story - do NOT conclude.

so the full prompt is <instruction> + the text above + a blank line. Turn 2 and turn 3 append (after the blank line following the previous piece):

Continue the story with its middle third: 550-650 words, then stop at a paragraph break. Rules reminder, zero exceptions: never begin a paragraph with the word 'The' - open on a name, a place, a time, or an action (e.g. 'Rain had pooled...', 'Marta ', 'At six...'); no smell or taste words; no glow, hum, flicker, or whisper in any form; never 'as if', 'as though', or 'seemed to'; never the phrase 'the same'; no similes with 'like'; rooms and objects have no feelings or intentions. Never reuse a phrase, image, or detail from earlier in the story - every paragraph brings fresh specifics. Vary sentence length hard: every paragraph needs at least one very short sentence (1-5 words) and at least one long sentence (25+ words).
Write the story's final third (about N words) and bring it to a close.

where the final turn's N = max(300, min(750, 1700 - words_so_far)), and the same rules-reminder text above is appended after it. The runnable scripts below bake all of this in — you never need to assemble it by hand. A bare instruction without the appended text also produces a coherent shorter opening (verified in LM Studio), but the full frame is what the model was trained and evaluated on.

Intended use / not intended

  • Long-form short-story generation and 3-turn continuation in English, with prompts in the format above. Prompting far outside it is untested.
  • Not intended for: chat/assistant use, factual QA, non-English text, or strict POV enforcement (it drifts out of the requested person, see below).

Training procedure

Training scripts, stage drivers, and full run history: baiango/minicpm5-story-ladder.

Each stage is a LoRA (attention-only: q, k, v, o) trained on the merge of all previous stages and then merged in — identical recipe to the training-time chain merge.

stageadaptercheckpointmethoddata
sft3stage_adapters/sft3ckpt_0001637SFT (r16, α160)baiango/minicpm5-sft3-3turn — 1637 train + 40 valid 3-turn stories
dagger2stage_adapters/dagger2ckpt_0000568DAgger-style SFT on gate-labeled self-draws (glitch turns → fixed targets)model self-draws, labeled by automated quality gates
grpo3stage_adapters/grpo3ckpt_final (≡ ckpt_0050)GRPO with a dense shaped reward (gate pass + per-turn length closeness)model self-draws
ul4stage_adapters/ul4ckpt_0000300unlikelihood on glitch tokens (repetition/echo classes)model self-draws
  • Later-stage data (self-draws) was generated by the model itself, offline, and labeled by automated gates; the gates label the DAgger SFT targets and provide the GRPO group rewards — they are not part of the loss for sft3.
  • Sampling doctrine: all training and evaluation used plain sampling (temp 1.0, min_p 0.1, repetition penalty 1.0, no n-gram tricks). Anti-repetition behavior lives in the weights; sampler tuning was deliberately avoided.

Files

  • chain_ul4b_lora/ — the whole ladder as ONE combined LoRA (rank 64, alpha 64, per-stage scales folded into A). Verification is at the WEIGHT level: a sequential-bf16 re-merge of the recorded lineage reproduces the merged checkpoint exactly (fingerprint max error 0.0), and fp32 file-math confirms the concat equals the sum of scaled stage deltas (≤1.4e-5). Greedy decode identity is NOT a valid check here — bf16 branch-add vs. folded-merge rounding flips near-tie argmaxes chaotically; behavioral equivalence was bounded with teacher-forced logit stats at rounding scale instead. Attach to openbmb/MiniCPM5-2B-Base.
  • chain_ul4b_UD-Q4_K_S.gguf — 1.5 GB, Q4_K_S quantized with a self-generated importance matrix. Sanity-checked in LM Studio: clean prose, no degradation vs. f16 (see Evaluation).
  • stage_adapters/ — the four per-stage peft adapters (r16 each) to reproduce or ablate the ladder stage by stage (see the attach table above).

Download

pip install -U "huggingface_hub[cli]"
huggingface-cli download baiango/minicpm5-ul4b-story --local-dir .

Usage (llama.cpp)

git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build && cmake --build build -j

PROMPT='Write a Young Adult story, in first person, past tense, that leans on Cyberpunk Noir and Equestrian for atmosphere. Write the opening third of a longer story (the complete story will run about 1800 words). This part: 500-650 words. End at a natural paragraph break mid-story - do NOT conclude.'

./build/bin/llama-cli -m /path/to/chain_ul4b_UD-Q4_K_S.gguf \
    -st -c 4096 -n 1200 \
    --temp 1.0 --min-p 0.1 --top-p 1.0 --repeat-penalty 1.0 \
    -p "$PROMPT"

(-st = single-turn on current builds; older llama.cpp used --no-cnv.)

The model first emits a [Start thinking] … [End thinking] planning block, then the story text, then stops at EOS on its own. To keep only the story, strip everything through the last [End thinking]. To continue with turns 2 and 3, append your generated text plus the turn-2/turn-3 messages from the Prompt format section after a blank line and re-run with -f prompt.txt — or use the llama-server route / the transformers script below, which do the bookkeeping for you.

OpenAI-style completion server (prompt is the same turn-1 prompt):

./build/bin/llama-server -m /path/to/chain_ul4b_UD-Q4_K_S.gguf -c 4096 --port 8012

curl http://127.0.0.1:8012/v1/completions -H 'Content-Type: application/json' -d @- <<'JSON'
{
  "prompt": "Write a Young Adult story, in first person, past tense, that leans on Cyberpunk Noir and Equestrian for atmosphere. Write the opening third of a longer story (the complete story will run about 1800 words). This part: 500-650 words. End at a natural paragraph break mid-story - do NOT conclude.\n",
  "max_tokens": 1200,
  "temperature": 1.0,
  "top_p": 1.0,
  "min_p": 0.1,
  "frequency_penalty": 0.0,
  "presence_penalty": 0.0
}
JSON

Usage (transformers + LoRA) — full 3-turn story generator

Copy-paste runnable: downloads the adapter, attaches it to the matching base, and runs all three turns with the exact training-frame prompts and sampling.

import torch
from huggingface_hub import snapshot_download
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

REPO = "baiango/minicpm5-ul4b-story"
BASE = "openbmb/MiniCPM5-2B-Base"          # must match; LoRA trained against -Base

# ---- exact training-frame strings (baiango/minicpm5-sft3-3turn format) ----
ASK1 = (" Write the opening third of a longer story (the complete story will run "
        "about 1800 words). This part: 500-650 words. End at a natural paragraph "
        "break mid-story - do NOT conclude.")
REMIND = (" Rules reminder, zero exceptions: never begin a paragraph with the word 'The' - "
          "open on a name, a place, a time, or an action (e.g. 'Rain had pooled...', 'Marta ', "
          "'At six...'); no smell or taste words; no glow, hum, flicker, or whisper in any form; "
          "never 'as if', 'as though', or 'seemed to'; never the phrase 'the same'; no similes "
          "with 'like'; rooms and objects have no feelings or intentions. Never reuse a "
          "phrase, image, or detail from earlier in the story - every paragraph brings "
          "fresh specifics.")
REMIND += (" Vary sentence length hard: every paragraph needs at least one very short "
           "sentence (1-5 words) and at least one long sentence (25+ words).")
CMSG2 = ("Continue the story with its middle third: 550-650 words, then stop at a "
         "paragraph break." + REMIND)

def cmsg3(words_so_far):
    n_left = max(300, min(750, 1700 - words_so_far))
    return (f"Write the story's final third (about {n_left} words) and bring it "
            "to a close." + REMIND)

INSTRUCTION = ("Write a Young Adult story, in first person, past tense, that leans "
               "on Cyberpunk Noir and Equestrian for atmosphere.")  # swap freely

# ---- load ----
local = snapshot_download(REPO)
tok = AutoTokenizer.from_pretrained(BASE, trust_remote_code=True)
base = AutoModelForCausalLM.from_pretrained(
    BASE, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base, f"{local}/chain_ul4b_lora").eval()

# ---- generate ----
# Turn 1 segment keeps the default BOS; every later segment is appended with
# add_special_tokens=False, exactly like training. Generated pieces (including
# their EOS) stay in context as the next turn's prefix.
ctx = tok(INSTRUCTION + ASK1 + "\n\n", return_tensors="pt").input_ids.to(model.device)

def generate_piece(max_new_tokens=1200):
    global ctx
    n = ctx.shape[1]
    out = model.generate(input_ids=ctx, attention_mask=torch.ones_like(ctx),
                         max_new_tokens=max_new_tokens, do_sample=True,
                         temperature=1.0, top_p=1.0, top_k=0, min_p=0.1,
                         repetition_penalty=1.0, pad_token_id=tok.eos_token_id)
    piece = tok.decode(out[0, n:], skip_special_tokens=False)
    ctx = out
    return piece.replace(tok.decode([tok.eos_token_id]), "")

piece1 = generate_piece()
ctx = torch.cat([ctx, tok("\n\n" + CMSG2, add_special_tokens=False,
                          return_tensors="pt").input_ids.to(ctx.device)], dim=1)
piece2 = generate_piece()
ctx = torch.cat([ctx, tok("\n\n" + cmsg3(len(piece1.split()) + len(piece2.split())),
                          add_special_tokens=False,
                          return_tensors="pt").input_ids.to(ctx.device)], dim=1)
piece3 = generate_piece()

story = "\n\n".join(p.strip() for p in (piece1, piece2, piece3))
if "[End thinking]" in story:          # drop the planning block if one leaked in
    story = story.split("[End thinking]", 1)[1].lstrip()
story = story.replace("[Start thinking]", "").replace("</think>", "").strip()
print(story)

These sampling settings are the ones the model was trained and evaluated with — treat them as part of the model.

Running in LM Studio (chat mode)

The GGUF ships without an embedded chat template — the model was trained on bare instruction → story text, so standard chat templates (including the official minicpm5 preset with its thinking scaffold) knock it off-distribution: it emits Chinese meta-text or reasoning filler instead of a story. (The HF repo ships this same pass-through template as chat_template.jinja, so the HF Playground and chat APIs already get the right format — only the GGUF needs the manual setup below.) Configure once per model:

  1. Model load settings (advanced) → Chat Template — paste exactly this pass-through template and enable "Remember settings":
    {% for message in messages %}{{ message['content'] }}{% endfor %}{{ "\n\n" }}
    
    It renders the prompt as plain text and adds the blank-line separator the model expects before a story starts (without it, the first line begins with stray punctuation).
  2. Reasoning → Enable Thinking: OFF; leave the System Prompt empty.
  3. Sampling — keep it plain: Temperature 1.0, Min P 0.1, Top P 1.0, Repeat Penalty 1.0 (off).

Raw completion also works with no template (POST /v1/completions, instruction as plain text). POV drift and other limitations are listed above.

Evaluation & selection

  • Stage selection: qualitative read-off of 2 prompts × 3-turn framed generations per candidate (all intermediate merges looped; this merge did not).
  • Chain-LoRA equivalence: weight-level — exact lineage fingerprint plus fp32 concat file-math, with teacher-forced logit stats bounded at bf16 rounding scale (decode parity is chaotic and was abandoned as a check), so the distributed LoRA is the model.
  • GGUF verification (LM Studio, 2026-10-01): with the pass-through template and plain sampling, clean 500+-token stories terminating in EOS with no repetition or pattern collapse.

Known behaviors / limitations

  • On longer framed continuations the model may emit a meta-commentary review ending in </think>, then a rewritten (usually better) continuation; the scripts above strip it.
  • Trained/evaluated only with plain sampling: temp 1.0, min_p 0.1, repetition penalty 1.0. Repetition-loop behavior at other settings is untested.
  • GGUF bake-off (LM Studio): temp 1.0 + min_p 0.1 plain — zero defects; temp 1.2 leaks thinking markers into prose; temp 0.7 / top_p 0.9 causes CJK character bleed.
  • Instruction-following on POV/person constraints is weak: third-person instructions can come out first-person (present in the full-precision model too — a training-data limitation, not a quantization artifact); it otherwise drifts between persons.
  • English fiction only; the SFT data is LLM-distilled and inherits its biases.
  • Turn-3 segments sometimes fall short of the per-turn word targets.

Citation

@misc{baiango_minicpm5_ul4b_story,
  author = {baiango},
  title = {chain_ul4b: a 4-stage LoRA ladder for story writing on MiniCPM5-2B-Base},
  year = {2026},
  url = {https://huggingface.co/baiango/minicpm5-ul4b-story}
}

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

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

GPU в ailist

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

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

Репозиторий содержит только адаптер (LoRA/PEFT) без базовой модели.

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

0 моделей