/ Модель

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

Контекст
131 072 токена
Параметры
1,3 млрд
Лицензия
Apache 2.0
Архитектура
monoid · dense
Библиотека
transformers
Опубликована
17 фев 2026

Spartacus-1B-Instruct

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

Компактная англоязычная разговорная языковая модель NoesisLab для генерации текста с фиксированным состоянием и эффективной последовательной обработкой длинных контекстов.

115скачиваний за 30 дней25лайковвеса обновлены25 фев 2026

Бенчмарки

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

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

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

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

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

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

Spartacus-1B-Instruct — разговорная причинная языковая модель NoesisLab на архитектуре MonoidForCausalLM с примерно 1,3 млрд параметров. Вместо softmax-внимания она сжимает историю токенов в состояние фиксированного размера и использует векторное затухание, чтобы сохранять признаки с разными временными масштабами. Модель рассчитана на генерацию текста и диалоговые сценарии; в метаданных указан английский язык. Заявленная длина контекста — 131 072 токена.

При последовательной генерации каждый новый токен обновляет состояние за O(1) времени и памяти относительно длины последовательности; обучение и обработка префикса выполняются параллельным сканированием за O(T). В README приведены результаты нескольких тестов с нулевым числом примеров, где модель показывает конкурентные результаты среди моделей сопоставимого размера, но уступает некоторым базовым моделям. Модель опубликована в формате safetensors под лицензией Apache-2.0.

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

  • генерация ответов в англоязычном чат-боте
  • продолжение и написание англоязычного текста
  • диалоговое прототипирование с локальной языковой моделью
  • генерация текста с длинной историей диалога
  • эксперименты с альтернативами softmax-вниманию

Ограничения

В приведённых тестах с нулевым числом примеров результаты ниже Llama 3.2-1B и сопоставимы или несколько ниже других моделей около 1B параметров. Заявления о неограниченной длине контекста и постоянной стоимости относятся к архитектурным свойствам; качество на очень длинных последовательностях отдельно не показано.

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

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

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

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

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

Открыть на Hugging Face

Spartacus-1B-Instruct — Causal Monoid Language Model

A 1.3B parameter language model that replaces softmax attention with causal monoid state compression, achieving O(1) time per token and O(1) memory at inference — regardless of sequence length.

SFT Training Curves

LossAccuracy
SFT LossSFT Accuracy

Core Mechanism

Core Mechanism: The Monoid Recurrence

Key Properties

PropertyTransformer (Llama)Spartacus (Monoid)
Inference time per tokenO(T) — scans full KV-cacheO(1) — single state update
Inference memory per layerO(T) — stores all past K,VO(1) — fixed d×d state matrix
Sequence length extrapolationDegrades beyond training lengthUnlimited — state size is constant
CausalityImposed via attention maskBuilt into the recurrence
Training complexityO(T²)O(T) via parallel prefix scan

The Monoid Recurrence

Standard attention computes:

o_t = Σ_{i≤t} softmax(q_t · k_i) v_i    — requires O(T) KV-cache

Monoid attention compresses the entire causal history into a fixed-size state matrix S_t per head:

S_t = diag(α_t) · S_{t-1} + k_t ⊗ v_t     — vector decay monoid recurrence
o_t = q_t · S_t                              — state readout

This is a monoid because the binary operator (α, S) ⊕ (β, X) = (α·β, diag(β)·S + X) is associative, enabling O(T) parallel prefix scan for training and O(1) sequential update for inference.

Vector Decay — Per-Dimension Memory Lifetimes

Unlike scalar decay (one α per head), Spartacus uses vector decay: each dimension of the d-vector has its own independent decay rate α_t[i] ∈ (0, 1):

S_t[i,j] = α_t[i] · S_{t-1}[i,j] + k_t[i] · v_t[j]

This allows different feature dimensions to specialize:

  • Fast-decaying dimensions (α ≈ 0) — local syntax, punctuation, function words
  • Slow-decaying dimensions (α ≈ 1) — entity memory, topic tracking, long-range facts

The decay gate uses Sigmoid activation:

α_t = σ(W·x_t + b)
PropertyValue
Rangeα ∈ (0, 1) — bounded, no explosion
Perfect memoryW·x → +∞ ⟹ σ → 1 (lossless retention)
Full forgettingW·x → -∞ ⟹ σ → 0 (complete reset)
Stabilityα < 1 by construction — no divergence regardless of input magnitude
Bias initb = 3.0 ⟹ σ(3) ≈ 0.95, model starts in "mostly remember" mode

Attention Mask — Padding-Aware Recurrence

The monoid recurrence correctly handles attention_mask for padded batches (e.g., left-padding during generate()). For PAD positions (mask=0):

α = α * mask + (1 - mask)  →  α = 1  (preserve state unchanged)
k = k * mask, v = v * mask →  kv = 0 (no information injected)

Net effect: S_t = 1·S_{t-1} + 0 = S_{t-1} — PAD acts as the monoid identity element, completely invisible to the recurrence. This ensures identical outputs whether inputs are padded or not.

Design Choices

  • SiLU-activated keys: k = SiLU(k_proj(x)) ensures non-negative keys, making the state matrix S positive semi-definite (PSD). This prevents "feature erasure" where one token's contribution cancels another's
  • QK-Norm: RMSNorm on both q and k before readout, stabilizing the scale of q·S when the state matrix accumulates many outer products
  • Output Norm: RMSNorm on the readout o after q·S, further stabilizing scale before gating
  • Output Gate: gate = SiLU(gate_proj(x)), modulates the multi-head readout before o_proj (similar to GLA/RetNet). Lets the model suppress or amplify specific head outputs conditioned on the current input
  • Sigmoid decay gate: Ensures α ∈ (0, 1) by construction — allows near-perfect memory (α→1) while preventing state explosion (α>1). Bias initialized to 3.0 so σ(3)≈0.95, starting in high-retention mode
  • Learnable h0: The initial state S₀ = h0 is a learnable parameter (zero-initialized), acting as a compressed "system prompt"
  • Log-space decay in scan: The parallel prefix scan works in log-space log(α) to avoid numerical underflow when computing cumulative products over long sequences

Three Forward Paths

PathConditionComplexityDescription
Traininguse_cache=FalseO(T) parallel scanVectorized outer products → parallel prefix scan → vectorized readout
Inference prefilluse_cache=True, T>1O(T) parallel scanSame as training + extracts final state S_T for cache
Inference decodeuse_cache=True, T=1O(1) monoid_opSingle monoid_op to fold new token into state → one matmul readout

Model Details

ParameterValue
ModelNoesisLab/Spartacus-1B-Instruct
ArchitectureMonoidForCausalLM
Parameters~1.34B (tied embeddings)
Hidden size2048
Intermediate size (MLP)8192
Layers16
Attention heads32
Head dimension64
Decay gateVector decay (Sigmoid), d=64 per head
State matrix per head64 × 64 = 4,096 floats
Vocabulary128,256 (Llama-3.2 tokenizer)
Precisionbfloat16

Benchmarks (0-shot)

TaskMetricValueStderr
ARC-Challengeacc_norm0.3063±0.0135
ARC-Easyacc0.5518±0.0102
HellaSwagacc_norm0.4610±0.0050
PIQAacc_norm0.6915±0.0108
WinoGrandeacc0.5225±0.0140

Comparison with ~1B Baselines (acc_norm, 0-shot)

TaskSpartacus-1BTinyLlama-1.1BLlama 3.2-1BMamba-1.4BRWKV-6-1.6B
ARC-C0.30630.3268~0.3590.284~0.301
ARC-E0.55180.5547~0.7520.512~0.530
HellaSwag0.46100.4670~0.5460.435~0.450
PIQA0.69150.7210~0.7400.655~0.670
WinoGrande0.52250.5040~0.5920.510~0.515

Spartacus achieves competitive performance with sub-quadratic models (Mamba, RWKV) while maintaining O(1) inference time and memory per token. Scores marked with ~ are approximate community-reported values.

Parallel Scan Implementation

The monoid_scan_cuda.py module provides a Triton JIT-compiled parallel prefix scan for the vector-decay monoid:

  • Grid: (B*H*D_k, ceil(D_v/BLOCK_DV)) — one program per state matrix row
  • Forward: Sequential scan along T per row, parallelized across all (batch, head, d_k) dimensions
  • Backward: Reverse-order adjoint scan with per-row D_v reduction (minimal atomic_add)
  • Fallback: Pure PyTorch sequential scan for CPU/MPS
  • Auto-dispatch: CUDA → Triton kernel, otherwise → PyTorch fallback

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "NoesisLab/Spartacus-1B-Instruct",
    trust_remote_code=True,
    torch_dtype="bfloat16",
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("NoesisLab/Spartacus-1B-Instruct")

messages = [{"role": "user", "content": "Hello!"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

File Structure

MonoidForCausalLM.py       # Model architecture (MonoidConfig, MonoidAttention, MonoidForCausalLM)
monoid_scan_cuda.py        # Triton JIT parallel prefix scan (vector decay) + PyTorch fallback
model.safetensors          # Model weights (bfloat16)
config.json                # Model configuration
tokenizer.json             # Llama-3.2 tokenizer
ARCH.png                   # Core mechanism diagram (monoid recurrence + parallel scan)
ACC_SPAR.png               # SFT accuracy curve
LOSS_SPAR.png              # SFT loss curve

Citation

@software{spartacus2025,
  title={Spartacus: Causal Monoid Language Model with O(1) Inference},
  author={NoesisLab},
  year={2025},
  url={https://huggingface.co/NoesisLab/Spartacus-1B-Instruct},
  description={Replaces softmax attention with vector-decay monoid state compression for constant-time, constant-memory autoregressive generation}
}

License

Apache 2.0

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

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

GPU в ailist

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

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

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

Класс архитектуры
MonoidForCausalLM
Ревизия весов
9d0ba4a

0 моделей