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.
Fine-tuned for enhanced reasoning with structured chain-of-thought data.
The state matrix S_t accumulates causal history along its diagonal. Each head maintains an independent d x d state that compresses ALL past tokens into a fixed footprint:
where alpha_t = sigmoid(decay_proj(x_t)) is a learned, content-dependent decay gate that controls how fast past information fades.
Explicit Causal Modeling
Unlike Transformers where causality is a constraint imposed by masking, Spartacus makes causality a first-class citizen:
The decay gate alpha_t explicitly controls per-head information retention at every timestep
The model learns when to forget rather than encoding where tokens are (no positional encoding needed)
No attention mask required -- causality is structural, not enforced
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
Log-space decay: Working in log-space log(alpha) avoids numerical underflow when alpha^T -> 0 for long sequences
Learnable h0: The initial state S_0 = h0 is a learnable parameter (zero-initialized), acting as a compressed "system prompt"
Model Details
Parameter
Value
Model
NoesisLab/Spartacus-1B-Instruct
Architecture
MonoidForCausalLM
Parameters
~1.34B (tied embeddings)
Hidden size
2048
Intermediate size (MLP)
8192
Layers
16
Attention heads
32
Head dimension
64
State matrix per head
64 x 64 = 4096 floats
Vocabulary
128,256 (Llama-3.2 tokenizer)
Precision
bfloat16
Benchmarks (0-shot)
Task
Metric
Value
Stderr
ARC-Challenge
acc_norm
0.3063
±0.0135
ARC-Easy
acc
0.5518
±0.0102
HellaSwag
acc_norm
0.4610
±0.0050
PIQA
acc_norm
0.6915
±0.0108
WinoGrande
acc
0.5225
±0.0140
Comparison with ~1B Baselines (acc_norm, 0-shot)
Task
Spartacus-1B-Instruct
TinyLlama-1.1B
Llama 3.2-1B
Mamba-1.4B
RWKV-6-1.6B
ARC-C
0.3063
0.3268
~0.359
0.284
~0.301
ARC-E
0.5518
0.5547
~0.752
0.512
~0.530
HellaSwag
0.4610
0.4670
~0.546
0.435
~0.450
PIQA
0.6915
0.7210
~0.740
0.655
~0.670
WinoGrande
0.5225
0.5040
~0.592
0.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.
Training
Stage 1: General SFT
Base weights: Transferred from Llama-3.2-1B-Instruct (embeddings, MLP, norms)
Optimizer: AdamW (weight decay 0.01, max grad norm 1.0)
The reasoning data uses structured "Thought + Solution" format to strengthen chain-of-thought capabilities while the general data prevents catastrophic forgetting.
Parallel Scan Implementation
The monoid_scan_cuda.py module provides a Triton JIT-compiled parallel prefix scan:
Forward: Sequential scan along T, parallelized across B x H x D on GPU via Triton kernels
Backward: Reverse-order adjoint scan computes gradients for both values and log-decay gates
Fallback: Pure PyTorch sequential scan for CPU/MPS
Auto-dispatch: CUDA -> Triton kernel, otherwise -> PyTorch fallback
MonoidForCausalLM.py # Model architecture (MonoidConfig, MonoidAttention, MonoidForCausalLM)
monoid_scan_cuda.py # Triton JIT parallel prefix scan + PyTorch fallback
model.safetensors # Model weights (bfloat16)
config.json # Model configuration
tokenizer.json # Llama-3.2 tokenizer
Citation
bibtex
1@software{spartacus2025,
2 title={Spartacus: Causal Monoid Language Model with O(1) Inference},
3 author={NoesisLab},
4 year={2025},
5 url={https://huggingface.co/NoesisLab/Spartacus-1B-Instruct},
6 description={Replaces softmax attention with monoid state compression for constant-time, constant-memory autoregressive generation}
7}