/ Модель

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

Контекст
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

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

Сборка Qwen3.8-27B с механизмом crystallized attention для генерации текста и диалогов при сниженных затратах памяти на длинном контексте.

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

Бенчмарки

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

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

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

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

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

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

Ternary-Bonsai-2-27B-Crystal — производная модель на основе весов Prism ML для Qwen3.8-27B, представленная как сборка с изменённым механизмом внимания. Она предназначена для генерации текста и диалогов, включая продолжение кода и работу с длинным контекстом. Модель использует архитектуру Qwen3.8-27B с 27 млрд параметров; README описывает режим с фиксированным состоянием внимания: точное окно последних 1 024 токенов, сжатое состояние дальнего контекста и индекс для выборочного точного чтения прошлых токенов. Длина контекста в использованных данных не указана.

По заявлению авторов, такая схема сокращает память внимания при длинном контексте; режим `--top0` удерживает её постоянной независимо от длины последовательности. Пакет рассчитан на запуск через MLX runtime, с поддержкой Apple Silicon и CUDA. README также описывает сохранение маршрутов вычислений для повторно используемых префиксов и подтверждённых продолжений. Модель распространяется по лицензии Apache-2.0. Эти особенности описаны авторами модели; независимая проверка заявленных характеристик здесь не проводилась.

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

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

Ограничения

README не сообщает поддерживаемые естественные языки и приводит сравнительные результаты лишь для отдельных сценариев; заявленные характеристики памяти и ускорения зависят от режима запуска и оборудования.

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

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

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

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

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

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: Apache License 2.0 (LICENSE, NOTICE). The compiled runtime in crystal_runtime/: research license (crystal_runtime/LICENSE; free for non-commercial research and evaluation, commercial use by license). 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.

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

0 моделей