/ Модель

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

Контекст
8 192 токена
Параметры
924 млн
Размер весов
6,1 ГБ
Лицензия
Apache 2.0
Архитектура
k2_horizon · MoE
Базовая модель
K2-Horizon-0.9B
Библиотека
transformers
Опубликована
9 ноя 2026

K2-Horizon-4x0.9B-MoE-heretic

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

Диалоговая MoE-модель на основе K2-Horizon-0.9B для генерации текста с сокращённым количеством отказов.

736скачиваний за 30 дней1лайквеса обновлены24 ноя 2026

Бенчмарки

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

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

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

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

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

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

Lucasgitguy-co/K2-Horizon-4x0.9B-MoE-heretic — диалоговая языковая модель на архитектуре K2-Horizon Sparse MoE, созданная Lucasgitguy на основе контрольных точек IFM/K2-Horizon-0.9B и обработанная методом Heretic для сокращения отказов. В каждом слое четыре эксперта, маршрутизатор выбирает одного из них; общее число параметров — 924,5 млн, контекст — до 8192 токенов. Модель принимает текст и генерирует текст; в метаданных указаны английский и китайский языки.

Модель предназначена для диалога и генерации текста, в том числе для задач, связанных с кодом, математикой, следованием инструкциям и естественными науками. Она использует MLP-компоненты специалистов из контрольных точек базовой модели, однако маршрутизатор не обучался, а различия между экспертами малы. По результатам автора, качество на тесте ARC-Easy близко к базовой модели, а отказы на указанном тесте вредоносных запросов почти устранены.

Для запуска требуются Transformers 5.x и trust_remote_code=True; в README также заявлена совместимость с llama.cpp 0.9.0+ через GGUF-квантизации. Проверка проводилась только на Apple M4 с MPS и bf16; MLX, Ollama и LM Studio не тестировались. Модель лицензирована по Apache-2.0. Поскольку отказы в значительной степени удалены, ответы могут включать опасный контент.

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

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

Ограничения

Эксперты почти идентичны базовой модели, поэтому MoE ведёт себя близко к ней при примерно втрое большем размере файлов; маршрутизатор и эксперты отдельно не обучались. Отказы в значительной степени удалены, а тестирование проводилось только на Apple M4.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

K2-Horizon-4x0.9B-MoE-heretic

A 4-expert Mixture-of-Experts built from IFM's own K2-Horizon-0.9B checkpoints and uncensored with Heretic.

Usage · Results · How it was built · Limits · Credits

BaseIFM/K2-Horizon-0.9B (Apache-2.0)
Architecturenative k2_horizon MoE (the model's own K2HorizonSparseMoeBlock)
Experts4 per layer, top-1 routing, softmax router
Parameters3.06B total, 1.08B active per token
Context128K (YaRN, same as the base)
Precisionbf16, 6.1 GB (GGUF quants)
UncensoringHeretic 2.0.0.dev0, Arbitrary-Rank Ablation
Fine-tunedK2-Horizon-4x0.9B-MoE-Cyber: cybersecurity version (normal, MLX, GGUF, browser)

Usage

Needs transformers 5.x and trust_remote_code=True (the architecture code ships with the repo).

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "Lucasgitguy-co/K2-Horizon-4x0.9B-MoE-heretic"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", trust_remote_code=True, device_map="auto")

msgs = [{"role": "user", "content": "Explain how a transformer works in two sentences."}]
text = tok.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False, reasoning_effort="high")
ids = tok(text, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=4096, do_sample=True, temperature=0.6, top_p=0.95)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))

It is a reasoning model like the base: answers come after a <ifm|think> … </ifm|think> block. reasoning_effort accepts high, medium, low.

Results

ModelRefusals (harmful_behaviors test, 100)ARC-Easy acc / acc_norm (200, ±0.035)
IFM/K2-Horizon-0.9B100/1000.560 / 0.575
Dense 0.9B after Heretic (trial 47)4/100 (Heretic's own count: 0/100, KL 0.058)–
This MoE3/1000.570 / 0.560

Refusals: thinking skipped (</ifm|think> prefilled), 100 new tokens, greedy, Heretic's refusal keyword list. KL is Heretic's first-token KL divergence against the original on harmless prompts.

Routing share of held-out prompts per domain (top-1 picks, all layers):

Promptsmainrl_code2rl_ifrl_stem
general chat0.480.170.250.10
code + math0.220.740.030.01
instruction following0.210.130.630.04
science0.350.220.090.35

The router was initialised from per-domain hidden-state means, so this table shows the routing works as set up, not that the experts are specialists (see Limits).

How it was built

  1. Experts. K2-Horizon-0.9B ships its RL specialist checkpoints as repo tags. Expert e of every layer is the MLP of one tag: main (MOPD final, general), rl_code2 (code and math), rl_if (instruction following), rl_stem (science). Attention, embeddings, norms and lm_head come from main.
  2. Uncensoring. Heretic ran on dense main (100 trials). Trial 47 changed 14 tensors: self_attn.o_proj and mlp.down_proj of layers 13–19. The o_proj edits were copied over as is; the same down_proj edit (W_heretic − W_main) was added to every expert's down_proj in those layers.
  3. Router. Per layer, gate row e = the normalised difference between the mean MLP input on domain-e prompts and the mean over all domains (computed on main; 32 prompts per domain from harmless_alpaca, MBPP + GSM8K, IFEval, SciQ), scaled to unit logit spread. No router training.
  4. Checks. A test build with every expert set to main's MLP matched dense main's next-token argmax on 50/50 positions (max logit gap 0.72, bf16 noise).
# 1. sources (RL tags kept as MLP-only files to save disk)
hf download IFM/K2-Horizon-0.9B --revision main --local-dir src/main
for t in rl_code2 rl_if rl_stem; do
  hf download IFM/K2-Horizon-0.9B --revision $t --local-dir src/tmp_$t \
    --include "model*.safetensors" --include "model.safetensors.index.json"
  python build/extract_mlp.py src/tmp_$t src/$t.mlp.safetensors && rm -rf src/tmp_$t
done

# 2. Heretic on dense main (config: build/config.toml), then save the chosen trial
heretic                      # 100 trials
python build/pareto.py checkpoints/src--main.jsonl
build/finish.sh 0            # saves trial, builds the MoE, runs checks

# 3. the MoE build on its own
python build/build_moe.py --src src --experts main rl_code2 rl_if rl_stem --top-k 1 \
  --router hidden --heretic out/main-heretic --out out/K2-Horizon-4x0.9B-MoE-heretic

All scripts are in build/.

Limits

  • Near-identical experts. The RL tags differ from main by only about 0.05% of their weights (relative norm; rl_if vs rl_stem about 0.07%). The MoE therefore behaves almost exactly like the base model, at 3× the size on disk. Real gains would need router or expert training, which was not done.
  • Runtimes. Transformers (this repo) and llama.cpp 0.9.0+ via the GGUF quants. MLX, Ollama and LM Studio were not tested.
  • Uncensored. Refusals are largely removed. You are responsible for how you use the outputs.
  • Tested on an Apple M4 (MPS, bf16) only.

Credits

  • IFM for K2-Horizon-0.9B, its code and its released RL checkpoints (Apache-2.0).
  • Heretic by Philipp Emanuel Weidmann for the abliteration.
  • MoE background: the Hugging Face Mixture of Experts explained post.

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

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

0 моделей