/ Модель

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

Контекст
262 144 токена
Размер весов
8,6 ГБ
Лицензия
Apache 2.0
Архитектура
prism_hadamard_qwen35 · dense
Базовая модель
Ternary-Bonsai-2-27B-mlx-2bit
Библиотека
mlx
Опубликована
29 сен 2026

Ternary-Bonsai-2-27B-Crystal

Генерация текстаТекст → текст12 профессий
666скачиваний за 30 дней2лайкавеса обновлены8 ноя 2026

Описание модели

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

Модель на основе Qwen3.8-27B для диалоговой генерации и дополнения текста с кристаллизованным вниманием, снижающим расход памяти при длинном контексте.

Ternary-Bonsai-2-27B-Crystal — модель для генерации текста и диалога, созданная tfwnotops на основе объединения Ternary Bonsai 2 27B от Prism ML и Qwen3.8-27B. Она использует гибридную архитектуру Qwen3.8-27B с 27 млрд параметров; веса совпадают с пакетом Prism ML, а изменён механизм внимания в 16 слоях с полным вниманием. Кристаллизованное внимание хранит точное окно последних 1 024 токенов, компактное рекуррентное состояние и индекс удалённого контекста. Режим --top0 ограничивает память внимания постоянными 469 МиБ независимо от длины контекста.

Модель предназначена для диалоговой генерации и дополнения текста, включая работу с длинными документами и повторное продолжение общих префиксов. Monorail сохраняет маршруты обработки запросов в графе .causal, чтобы повторно использовать вычисления для знакомых префиксов; поддерживается интерфейс вызова инструментов. Для запуска требуется специализированная среда crystal_runtime на MLX, с поддержкой Metal на Apple Silicon или CUDA 12.9 на Linux. Лицензия — Apache-2.0.

README описывает экономию памяти и ускорение повторных запросов, но не приводит здесь полного набора оценок качества и ограничений точности сжатого контекста. В описании указана Qwen3.8-27B как мультимодальная базовая модель, однако сама карточка Crystal заявляет задачу генерации текста; поддержку изображений и видео для этой сборки не следует предполагать.

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

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

Ограничения

Для запуска нужна специализированная среда crystal_runtime и совместимая аппаратная платформа; заявлены MLX на Apple Silicon или CUDA 12.9 на Linux. Сжатое представление дальнего контекста аппроксимирует внимание, а README не даёт полного набора оценок качества этой сборки.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

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

Открыть на Hugging Face

Ternary-Bonsai-2-27B-Crystal

Successor: Ternary-Bonsai-2-27B-ConstantKV — the same weights and crystallized heads with an exact store instead of the index: 1.18 GiB of attention state at every context length, +0.0084 nat per token on unseen books at 32k tokens, 40/40 pass keys, and 32k tokens on a 16 GB Mac mini.

Ternary Bonsai 2 27B with crystallized attention: the 16 full-attention layers of the Qwen3.8-27B hybrid keep a fixed state (an exact window of 1,024 tokens plus a fitted decay carrier) and a 4-bit index of the past, instead of a key-value cache in bf16. The weights are the unchanged Prism ML pack; they are carried on a .causal graph (the monorail) that binds every tensor, authenticates every file, and records the model's routes so that known prefixes are travelled instead of recomputed.

The first model of the constant-state line. Crystallized Attention is the precursor of the Holographic Causal Graph Machine: it replaced the growing cache of a 27B hybrid by a fixed state without training the model, and the same idea, carried through the whole network, became Qwen2.5-1.5B-Instruct-HCGM — a model compiled into a causal graph with a constant state of 14.4 MiB, 470 tokens/s on the Neural Engine of a Mac mini, and reusable answers as .mrail tracks.

Original against Crystal

Same weights, same tokenizer, same prompts; only the attention state of the 16 full-attention layers differs.

Ternary Bonsai 2 27B (original, native KV cache)Ternary-Bonsai-2-27B-Crystal (default)Crystal, constant memory (--top0)
weightsPrism ML packbyte-identicalbyte-identical
attention memory at 32k tokens3.2 GB2.0 GB469 MiB
attention memory at 64k tokens6.3 GB3.5 GB469 MiB
cost on unseen books, 32k tokens (nat/token)reference+0.0045+0.116
exact lines, project-level code completion (40 items, 32k)0.4730.474–
pass keys retrieved (10 depths × 4k–32k)40/4040/40–
decode at 4k / 32k / 64k tokens (ms/token)24.4 / 37.0 / 42.442.6 / 44.0 / 41.931.2 / 32.8 / 28.9
a request that repeats or extends an earlier onecomputed againtravels the recorded route, bit-identical: 5.5× faster for a growing file, 2.3–2.9× for a repeated requestsame

The ternary weights themselves cost 0.28 nat per token against bf16 Qwen3.8-27B; the attention adds 1–2 % of that with the index.

What is different

  • Attention without a bf16 cache. Per head: exact attention over the last 1,024 tokens, and beyond it a crystallized tail — five exponential modes with half-lives from a fixed catalogue (1 … 3,000 tokens) times a rank-8 query–key term, kept as a recurrent state. The 32 far tokens with the highest 4-bit score are read exactly from the index (int8 keys, int4 values, Hadamard-rotated), and the carrier's share of them is subtracted exactly.
  • Constant-memory mode. With --top0 only the window and the state remain: 469 MiB for all 16 layers at any length, the fastest decode from 32k tokens on (1.5× the native cache at 64k).
  • Monorail. Every request records its route through the model in the .causal graph (a route point every 1,024 tokens: recurrent states, crystal state, index rows). A request that shares a prefix with an earlier one travels the recorded route and computes only the rest — bit-identical to computing everything. In an editor-like workload (the same file completed six times while it grows) this is 5.5× faster. Confirmed continuations are recorded too and proposed as drafts that the model checks in one block: a repeated request runs 2.3–2.9× faster with 4–6 tokens per forward pass, and every emitted token is the argmax of the model's own logits. --routes-gb bounds the stored route points (least recently used first).
  • Authenticated pack. bundle.json lists every shard and every file with SHA-256; the weights are read through their graph coordinates. A modified byte anywhere is rejected at load time.

Quickstart

hf download tfwnotops/Ternary-Bonsai-2-27B-Crystal --local-dir crystal-bonsai
pip install -r crystal-bonsai/crystal_runtime/requirements.txt      # Metal on Apple Silicon, CUDA 12.9 on Linux
pip install --find-links crystal-bonsai/crystal_runtime crystal_runtime
python crystal-bonsai/crystal_runtime/quickstart_crystal.py --pack crystal-bonsai \
    --prompt "Write a Python function that returns the n-th Fibonacci number iteratively." \
    --routes ~/.crystal/routes --bank ~/.crystal/bank

--file code.py --complete completes a file; --top0 switches to the constant-memory mode; --native runs the same pack with the native cache for comparison. Generation is greedy.

Checked from this repository on an RTX 3090 host (PyTorch CUDA image, Python 3.11): monorail verified (2,519 bindings), model ready in 20 s. The first request compiles the CUDA kernels once; the same request again replays its route: 128 tokens in 5.3 s, 6.74 tokens per forward, identical text.

Files

File
model.safetensors, config.json, tokenizer*, runtime/, …Prism ML's Ternary Bonsai 2 27B MLX pack, byte-identical (checked against the publisher's files.json); its model card is README.bonsai.md
crystal.safetensors, crystal.jsonthe crystallized heads (16 layers × 24 heads) and runtime options
causal/, bundle.json, inventory.pinned.jsonthe monorail: .causal graph with 2,519 tensor bindings, manifest
crystal_runtime/compiled MLX runtime (crystallized attention, fused decode kernel, monorail) as wheels, and the quickstart
paper/Crystallized Attention
assets/crystal/the figures of this card, from the paper

Papers

  • Crystallized Attention (paper/Foss_2026_Crystallized_Attention.pdf) — fixed-state carriers and exact index correction for the full-attention heads of a 27B hybrid; the method of this model and its full evaluation.
  • The constant-state line continues in the three papers of Qwen2.5-1.5B-Instruct-HCGM: The Holographic Causal Graph Machine (the compiler and holographic Ward recall), No GPU, No KV Cache (the Neural Engine runtime) and Compute Once (answers as reusable .mrail tracks).

Citation

@misc{foss2026crystal,
  author = {Foss, David Tom},
  title  = {Crystallized Attention: Fixed-State Carriers and Exact Index Correction for the Full-Attention Heads of a 27B Hybrid Language Model},
  year   = {2026},
  doi    = {10.13140/RG.2.2.21299.18725}
}
@misc{foss2026hcgm,
  author = {Foss, David Tom},
  title  = {The Holographic Causal Graph Machine: Compiling a Pretrained Transformer into a Constant-State Model without Training},
  year   = {2026},
  doi    = {10.13140/RG.2.2.28206.68167}
}
@misc{foss2026ane,
  author = {Foss, David Tom},
  title  = {No GPU, No KV Cache: A Constant-State Language Model on the Neural Engine of a Mac mini},
  year   = {2026},
  doi    = {10.13140/RG.2.2.31562.12484}
}
@misc{foss2026computeonce,
  author = {Foss, David Tom},
  title  = {Compute Once: Constant-State Language Models Make Answers Reusable and Agents Cheap},
  year   = {2026},
  doi    = {10.13140/RG.2.2.18140.35202}
}

License

Weights: Prism ML, Ternary Bonsai 2 27B (Apache License 2.0), derived from Qwen3.8-27B (Apache License 2.0); crystal parameters and monorail graph: PolyForm Noncommercial License 1.0.0;. The compiled runtime in crystal_runtime/: research license (crystal_runtime/LICENSE; fPolyForm Noncommercial License 1.0.0;. The .causal format and the live graph come from Immer. Author: David Tom Foss (d.foss@ieee.org, ORCID 0009-0004-0289-7154).

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

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

GPU в ailist

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

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

MLX-модели работают только на Apple Silicon.

Ревизия весов
9a67117

0 моделей