/ Модель

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

Лицензия
Apache 2.0
Базовая модель
Spark-X2.6-4B
Библиотека
gguf
Опубликована
26 окт 2026

Spark-X2.6-4B-CED

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

Экспериментальная адаптация Spark-X2.6-4B для генерации текста с ускоренным предварительным проходом по длинным контекстам.

279скачиваний за 30 дней8лайковвеса обновлены29 окт 2026

Бенчмарки

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

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

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

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

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

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

Spark-X2.6-4B-CED — экспериментальная версия модели XHToken/Spark-X2.6-4B, опубликованная автором репозитория darioooooo0o. Она адаптирует 36-слойную языковую модель к схеме causal encoder-decoder: в рекомендуемой версии v2 слои 0–23 обрабатывают весь вход, а слои 24–35 формируют продолжение; шесть матриц проекции K/V получены закрытой ridge-регрессией, остальные веса исходные. Модель предназначена для генерации текста и диалога с ускоренным предварительным проходом по длинным контекстам. Автор сообщает о результатах на тестах извлечения из длинного контекста, близких к исходной модели, при ускорении prefill примерно в 1,26–1,43 раза на указанных длинах и оборудовании.

Репозиторий содержит GGUF-варианты Q4_K_M и Q8_0, а также веса проекций в safetensors; метаданные указывают библиотеку GGUF и лицензию Apache-2.0. Для запуска GGUF требуется форк llama.cpp с соответствующей поддержкой, а для PyTorch — демонстрационный код и исходная модель. Это экспериментальный артефакт, не готовый к использованию как обычная модель: стандартные llama.cpp и vLLM его не загружают. В README также описана обученная v1, но рекомендуемой названа v2, для которой обучение не проводилось.

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

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

Ограничения

Рекомендуемая v2 не обучалась и описана как экспериментальный артефакт. Для GGUF нужен специальный форк llama.cpp; стандартные llama.cpp и vLLM модель не поддерживают.

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

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

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

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

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

Открыть на Hugging Face

Spark-X2.6-4B with a Causal Encoder-Decoder (CED) split: experimental retrofit

Update 2026-10-29: v2, split moved from layer 18 to layer 24 (recommended)

v1 lost a lot of long-context retrieval. The reason turned out to be the split point: the decoder's global layers (23, 27) need information that the layer-18 state simply doesn't contain yet (a closed-form fit from H_18 to the original layer-23/27 values leaves 37-48% error, and no projector training fixed it; from H_24 it's 6%). v2 moves the split to layer 24: layers 0-23 = encoder (all original weights, including global layer 23), layers 24-35 = decoder, whose 3 global layers (27, 31, 35) read K/V projected from RMSNorm(H_24).

v2 is not trained at all. The 6 projection matrices are a closed-form ridge-regression fit of the original model's K/V from H_24 (about 0.5M tokens of PG19 / code / chat / synthetic retrieval); there is no LoRA and every other weight is the original.

v1 (split 18, trained)v2 (split 24, no training)original
long-context generation, 138 items, official scorers: RULER (multi-key needles + variable tracking)69%88%90%
NoLiMa (36 items)8%31%33%
BABILong qa1-3 (54 items)52%43%50%
all 13847%55%59%
KL(original ‖ CED), last 512 of 8K, replay 1024 (PG19 / code / chat, 85 held-out seqs)0.066 / 0.095 / 0.1050.040 / 0.083 / 0.0520
top-1 agreement with the original0.885 / 0.922 / 0.8890.896 / 0.937 / 0.9131
needles with 4 near-duplicate distractors, 20 trials at 4K / 8K / 16K19 / 18 / 2020 / 20 / 2020 / 20 / 20
GSM8K, 100 questions, greedy878589
prefill speedup vs original, PyTorch reference path, replay 1024, 4K / 8K / 16K1.52 / 1.67 / 1.72x1.35 / 1.42 / 1.46x1x

The trade: more of the model runs over the whole prompt (24 of 36 layers instead of 18), so prefill saves about a third instead of about half; in exchange retrieval comes most of the way back to the original. Decode speed is the same as the original either way. Long-context items are thinking-off, greedy, up to 32K tokens; RULER variable tracking is included with the answer prefix pre-filled as in the official setup. llama.cpp prefill on an Intel Arc Pro B70 (Vulkan, Q4_K_M, llama-server two-phase prefill with replay 1024, ub 512, warm; prompt of repeated token ids, timing only), tokens/s at 4K / 8K / 16K / 32K: original 2867 / 2503 / 1942 / 1332, v1 4234 / 4147 / 3535 / 2595 (1.48 / 1.66 / 1.82 / 1.95x), v2 3616 / 3358 / 2710 / 1907 (1.26 / 1.34 / 1.40 / 1.43x). The PyTorch speedups in the table use the same reference implementation for all variants (the GGUF parity is: mean KL 3.5e-4 to 2.3e-3 vs the PyTorch path, within about 2x of the plain-GGUF-vs-PyTorch noise floor on the same sequences).

v2 files: spark-ced24-Q8_0.gguf, spark-ced24-Q4_K_M.gguf (GGUF key spark2_5.ced.split = 24, same llama.cpp patch as v1, same bartowski imatrix), ced_weights_split24.safetensors (the 6 projections, bf16, 31 MB; demo.py reads the split from the file). The v1 files below are unchanged.


v1 (2026-10-26): split at layer 18, trained

Experimental research artifact, not a drop-in model. Runs in PyTorch (demo.py) and in a llama.cpp fork (GGUFs below); stock llama.cpp and vLLM cannot load it.

This takes the finished XHToken/Spark-X2.6-4B (36 layers, sliding-window layers with a global-attention layer every 4th layer) and converts it to the CED layout of DeepSeek-V4.1-Flash (arXiv 2609.19969, sec. 2.2 and 3.2.2) without pre-training anything from scratch:

  • layers 0-17 = causal encoder (layers 0-13 are the original weights, 14-17 carry a small LoRA), layers 18-35 = decoder;
  • the global-attention K/V of the 5 decoder global layers (19, 23, 27, 31, 35) are projected from the encoder's last hidden state with layer-dependent weights instead of from each layer's own hidden state: C_l = RMSNorm(H_18) W_l (the paper writes C_l = H_{L/2} W_l; the gain-free RMSNorm on the input is my addition so the projections can be initialised from the layers' own weights);
  • decoder sliding-window K/V stay layer-wise and are rebuilt by bounded replay of the last prompt tokens.

Prefill runs the encoder (18 layers) over the whole prompt and the decoder (18 layers) over only the last replay tokens: close to half the prefill compute. Decode compute and the KV-cache size are unchanged (exact CED keeps one cache per layer; KV compression is CSA2's job, not CED's).

What was trained

Only a small number of weights, by distillation against the original model (KL on its own logits + normalised per-layer hidden-state MSE; no labels, no teacher other than Spark itself), about 50M training tokens in total on one local B70 (~6 h):

  1. closed-form ridge init of the 10 new K/V projections (5 layers x K,V, 26M parameters) from H_18 onto the original layers' K/V;
  2. training of those projections;
    • LoRA (rank 16) on all 18 decoder layers;
    • LoRA (rank 16) on encoder layers 14-17 (data: PG19 books, GitHub code, WildChat);
    • 300 more steps with the original model's own sampled answers to GSM8K-train questions and general prompts mixed in (each conversation as its own sequence, full replay).

Encoder layers 0-13 are bit-identical to the original. The LoRA can be folded into the weights (Spark.merge_lora), after which decode runs at the original's speed.

Quality: distillation fidelity

85 held-out 8192-token sequences (44 PG19, 24 code, 17 chat) never used for training or for choosing a checkpoint. KL(original || CED) on the last 512 positions, lower is better:

variantPG19 (replay 1024)codechatPG19 (replay 512)codechat
naive init (the layers' own K/V weights on H_18)0.9221.6130.9670.9601.7161.060
closed-form ridge init0.2140.4920.3010.2690.5610.387
+ trained K/V projections (26M)0.0870.1440.1340.1240.1770.187
+ LoRA on the 18 decoder layers0.0760.1210.1180.1050.1480.159
final: + LoRA on encoder layers 14-17, + on-policy math/chat data0.0660.0950.1050.0930.1220.141
floor: original K/V in the decoder, replay only0.0000.0000.0000.0460.0560.077
  • Replay of 1024 tokens (2x the 512 window) is lossless (KL 0.000 on top of the K/V approximation); the paper-style replay of exactly one window (512) costs 0.05-0.08 KL by itself. Use replay=1024.
  • Cross-entropy on the last 1024 tokens, original -> CED (PG19 / code / chat): 2.676 -> 2.705 / 0.961 -> 0.993 / 2.089 -> 2.017. Top-1 agreement with the original: 0.885 / 0.922 / 0.889.

Next to ordinary quantization

KL to the unquantized model for the usual GGUF quants (bartowski imatrix quants vs his bf16 GGUF, llama.cpp --kl-divergence on CPU, 4K-token chunks, same text domains) next to CED. Not the same positions as the CED numbers (CED: last 512 of 8K sequences), so read it as a rough placement:

PG19codechatmean
Q8_0 (GGUF, 4.38 GB)0.0030.0010.0010.002
Q6_K (GGUF, 3.61 GB)0.0080.0020.0030.004
Q5_K_M (GGUF, 3.16 GB)0.0240.0100.0090.014
Q4_K_M (GGUF, 2.62 GB)0.0700.0270.0350.044
IQ4_XS (GGUF, 2.34 GB)0.1120.0390.0490.067
CED (this repo)0.0660.0950.1050.089
IQ3_M (GGUF, 2.23 GB)0.2480.0960.1040.149
Q3_K_M (GGUF, 1.99 GB)0.3020.1170.1560.192
Q2_K (GGUF, 1.61 GB)0.9120.4200.6170.650
IQ2_M (GGUF, 1.57 GB)0.8710.4820.5970.650

CED costs about as much as an IQ4_XS-to-IQ3_M quant. It saves prefill compute, not memory, and the two should stack (errors add up).

Task check: GSM8K, 100 questions

Greedy, chat template, no thinking, the same PyTorch code path for both: original 89/100, CED 87/100 (6 questions only the original solved, 4 only CED). A 2-question gap on 100 is within noise.

Speed (same reference implementation for both, bf16, LoRA merged, steady-state median, Intel Arc Pro B70)

Prefill:

prompt tokensoriginalCED, replay 512CED, replay 1024
4,0960.59 s0.35 s (1.67x)0.39 s (1.52x)
8,1921.27 s0.73 s (1.75x)0.76 s (1.67x)
16,3843.20 s1.73 s (1.85x)1.86 s (1.72x)

The reference implementation is plain PyTorch with chunked attention, so absolute tokens/s are not comparable with optimised engines; the ratio is what carries over. The asymptote is ~2x. Decode at 8K context: original 52.4 ms/token, CED 52.9 ms/token (LoRA merged). CED is a prefill optimisation, not a decode one.

Retrieval ("needle in a haystack" with 4 near-duplicate distractors, 20 trials per length, greedy)

prompt tokensoriginalCED (replay 512)CED (replay 1024)
4,09620/2019/2019/20
8,19220/2018/2018/20
16,38420/2020/2020/20

llama.cpp (GGUF)

spark-ced-Q8_0.gguf (4.4 GB) and spark-ced-Q4_K_M.gguf (2.6 GB) have the LoRA merged in and carry the 10 K/V projections as extra tensors (blk.N.ced_k, ced_v; GGUF key spark2_5.ced.split). They need llama.cpp with the CED patch (llama.cpp-ced.patch in this repo, against upstream commit a0e6dc738; git apply it and build as usual, e.g. -DGGML_CUDA=ON or -DGGML_VULKAN=ON); stock llama.cpp refuses to load them (tensor-count error). The patch adds the CED graph, the converter and a llama_set_ced API and does nothing for models without CED tensors. llama-server -np 1 does the two-phase prefill by itself (replay 1024, LLAMA_CED_REPLAY=0 turns it off); other slot counts fall back to normal prefill. The quants use bartowski's imatrix, not one of my own.

Logits match the PyTorch CED within the bf16 noise floor (mean KL 3e-4 to 8e-4, CPU and Vulkan); with the decoder sliding-window mask deliberately removed the same test shows KL 0.34, so it does catch a broken graph. KL to the original bf16 GGUF (mean over PG19 / code / chat, llama.cpp --kl-divergence): CED bf16 0.067, CED Q8_0 0.068, CED Q4_K_M 0.114 (plain Q4_K_M: 0.044).

Prefill, tokens/s, Q4_K_M, warm, ub 512, -ngl 99, stock = XHToken's official Q4_K_M:

prompt tokensRTX 4090 stockRTX 4090 CEDArc Pro B70 (Vulkan) stockB70 CED
4,09618.1k24.3k1.34x3.0k4.4k1.46x
8,1922.6k4.2k1.66x
16,3842.0k3.5k1.80x
32,76814.4k23.4k1.62x1.3k2.6k1.93x
131,0728.7k14.7k1.68x
262,1445.7k8.3k1.45x

Decode (4090, tok/s at 4K / 32K / 128K context): stock 219 / 175 / 93, CED 226 / 177 / 94. The 4090 numbers are from a rented host with an i9-14900K; an earlier run on a slow server CPU was CPU-bound (GPU 48-64% busy) and showed almost no gain, so prefill speedups on a weak host will be smaller. The B70 numbers were measured on a build that also has my own Intel Xe2 Vulkan kernel changes (not in the patch here); the stock column is the same build without CED, so the ratio is CED's.

Usage

python demo.py /path/to/Spark-X2.6-4B ced_weights.safetensors --replay 1024 --compare

spark_ced.py is a self-contained PyTorch re-implementation of Spark (checked against the reference code and an fp32 CPU run) with the CED path. ced_weights.safetensors holds the 10 K/V projections and the LoRA deltas (bf16, 89 MB); the base weights come from the original repo. In code: proj, lora = load_ced_weights(...), S.merge_lora(lora), then S.ced_prefill(ids, proj, caches, tail=1024) and S.ced_step(...) with lora=None.

Caveats

  • Not an official or endorsed variant of Spark or DeepSeek; the architecture is from the DeepSeek-V4.1-Flash paper.
  • The paper trains CED from scratch with a jointly trained encoder; this retrofit adapts a finished model with LoRA and distillation, so it is lossy (see tables). Greedy outputs diverge from the original after a few dozen tokens; a multi-step arithmetic prompt can come out wrong where the original is right.
  • Evaluation is distillation fidelity (KL/CE), 100 GSM8K questions and a synthetic retrieval test, not task benchmarks. The PyTorch speed table above comes from a reference implementation, not an inference engine; the llama.cpp numbers are above.
  • GGUF speed numbers use a prompt of repeated token ids (timing only; quality is measured separately); the server path has been checked for identical greedy output on CPU only.
  • CED GGUF Q4_K_M is noticeably lossier than plain Q4_K_M (KL 0.114 vs 0.044); Q8_0 adds nothing on top of CED.

Credits

Made by @imdariotoo. I post my local-model releases on X, so follow there for the next ones.

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

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

GPU в ailist

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

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

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
2b48da1

0 моделей