/ Модель

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

Контекст
131 072 токена
Параметры
1,6 млрд
Лицензия
Apache 2.0
Архитектура
granite_kvshare · dense
Базовая модель
granite-4.0-1b
Библиотека
transformers
Опубликована
20 сен 2026

granite-4.0-1b-kvshare-experiment

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

Экспериментальная версия Granite 4.0 1B от OVRLab проверяет совместное использование KV-кэша между соседними слоями ценой резкого ухудшения качества генерации.

294скачиваний за 30 дней0лайковвеса обновлены20 сен 2026

Бенчмарки

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

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

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

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

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

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

OVRLab выпустила экспериментальную производную IBM Granite 4.0 1B Instruct для изучения совместного использования KV-кэша между соседними слоями. Модель имеет 1,6 млрд параметров, использует архитектуру GraniteKVShareForCausalLM и контекст до 131 072 токенов. Веса заморожены: слои 0/1 используют K/V-проекции слоя 0, слои 2/3 — слоя 2 и так далее; обучение и изменение параметров не проводились. Модель принимает текст и генерирует текст на английском языке.

Изменение вдвое уменьшает объём выделенной памяти KV-кэша, но резко ухудшает качество ответов: на небольшом подмножестве WikiText-2 perplexity выросла с 19,55 до 707 495,2, а точность на подмножестве HellaSwag снизилась. Скорость декодирования в локальных замерах на Apple M1 Pro иногда повышалась, однако эти результаты не предсказывают производительность на других устройствах и не являются замером полного времени обслуживания. Релиз предназначен для воспроизведения и изучения эксперимента, а не для обычного применения; совместимость с распространёнными serving-системами не подтверждена. Лицензия — Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Granite 4.0 1B — frozen-weight KV-sharing experiment

The frozen-weight modification severely damages language-model quality. This release is a negative research result, not an improved or production-ready Granite model.

Pairing adjacent layers halves allocated KV-cache storage. On the local WikiText-2 subset, perplexity changes from 19.55 to 707,495.20 (lower is better). HellaSwag subset accuracy with per-token normalization changes from 62.50% to 31.25%.

What this release changes

OVRLab's independent experimental derivative of the standard all-attention IBM Granite 4.0 1B instruct model (approximately 1.63B parameters). This is OVRLab's next model experiment after the Granite 3.1 concision experiment, and a separate model with a different base and intervention.

Adjacent layers share keys and values: zero-based layers 0/1 use layer 0's K/V, 2/3 use layer 2's K/V, and so on. Each layer keeps its own queries, output projection, and feed-forward network. All 40 layers still execute; 20 own KV caches. Consumer K/V projections are bypassed, but their original parameters remain in the checkpoint. The tokenizer, generation configuration, and BF16 checkpoint are unchanged. This is an architecture/inference-code modification with zero training, not a fine-tune, weight edit, or quantization. Checkpoint size is unchanged.

The design is related to Cross-Layer Attention. That paper studies trained architectures; it does not establish that this frozen Granite conversion should preserve quality. This experiment was motivated by reading DeepSeek's KV-cache compression work. It does not implement the full DeepSeek CSA2/CED design and does not claim architectural novelty or IBM endorsement.

Measured results

Context tokensNative KV MiBPaired KV MiBNative prefill sPaired prefill sNative decode tok/sPaired decode tok/sDecode change
51240.020.00.9140.88418.5819.64+5.7%
2,048160.080.04.0624.0439.359.67+3.4%
4,096320.0160.09.7519.5343.755.85+55.8%
DiagnosticNativePaired
WikiText-2 subset perplexity ↓19.55707,495.20
HellaSwag subset accuracy, token normalized ↑62.50%31.25%
HellaSwag subset accuracy, raw ↑40.62%25.00%

Tested on Apple M1 Pro, 10 CPU cores, 14 GPU cores, 32 GiB unified memory; macOS-26.3.1-arm64-arm-64bit. Python 3.12.13, PyTorch 2.8.0, Transformers 4.57.1; MPS, BF16, SDPA, batch size 1. The same physical weights are used for both conditions. These are local measurements, not a prediction of CUDA or server performance.

Performance uses 3 measured repeats after one full warm-up per condition/context. Condition order alternates by repeat. The table reports medians; all samples are included in the JSON. Decoding uses 32 identical teacher-forced tokens, with no early stopping. Device work is synchronized at timing boundaries. Prefill excludes loading, tokenization, sampling, and network overhead. It is not end-to-end serving latency.

KV memory counts unique allocated key/value tensor storage, not total or peak memory. The stored weight file remains unchanged in size. The 50% cache reduction does not imply 50% total memory savings or 2× speed. At 32,768 tokens the formula predicts 2.5 GiB → 1.25 GiB of BF16 KV tensors at batch size 1; this is an extrapolation, not a tested 32K result.

WikiText-2 uses the first 16 non-overlapping windows of 512 tokens from the raw test split, scoring 8,176 next-token predictions, without special tokens and with context reset per window. HellaSwag uses 32 validation examples, sampled with seed 42, zero-shot raw and token-normalized continuation likelihood. Context and endings are tokenized separately; no harness-specific preprocessing is applied. These custom subset diagnostics are not standard full-benchmark scores. The HellaSwag sample is small and unsuitable for fine-grained ranking. Five fixed greedy examples illustrate chat behavior without constituting an instruction-following benchmark.

No training, fine-tuning, calibration, or quantization was performed. No original training corpus is required for this experiment. Evaluation text comes only from the pinned public datasets. No parameters were updated. Untested: long contexts beyond the lengths above, multilingual performance, safety behavior, and production serving frameworks.

Load the experimental model

The custom code is pinned to Transformers 4.57.1. Install the tested environment before loading; arbitrary newer versions are not supported by this release. Use trust_remote_code=True to load the included Python implementation.

pip install torch==2.8.0 transformers==4.57.1 accelerate==1.10.1 huggingface-hub==0.36.0 safetensors==0.6.2
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "OVRLab/granite-4.0-1b-kvshare-experiment"
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
    repo, trust_remote_code=True, dtype=torch.bfloat16,
    attn_implementation="sdpa",
).eval().to(device)

prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": "What is 17 + 28?"}],
    tokenize=False, add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
with torch.inference_mode():
    output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))

The model may produce poor or incoherent answers, as shown by the evaluations. For normal use, load the original IBM model. Compatibility with Ollama, llama.cpp, vLLM, and hosted inference providers has not been established. This release is intended for reproducing and studying the experiment.

Reproduce and inspect

Base revision: 6a7381ba1f54d684ff508d991aeb7dc580157103. The release checkpoint is byte-identical to that revision's checkpoint; SHA-256 verification is included. Differences are in the custom configuration and model forward code. Dataset revisions and example indices are recorded in the raw results.

Attribution and license

Base weights and tokenizer: Granite Team, IBM. Custom experiment: OVRLab. Code reuses Hugging Face Transformers' Apache-2.0 implementation. See LICENSE, NOTICE, and the original model card.

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
GraniteKVShareForCausalLM
Ревизия весов
80d6f60

0 моделей