Downloads · 30 days
0
staccs/lecore-hrr-gpt2
lecore-hrr-gpt2 is a text generation model from staccs. Use it when you need the model to write or continue text. The card lists the license as mit.
WORK IN PROGRESS: not a working model yet. Passkey recall currently fails; constant 3.3MB memory state verified on small proof.
Downloads · 30 days
0
Access
Public
Updated Oct 15, 2026
Repo size
11.7 GB
Likes
0
Public
Click a slice to open those files.
.pt4.6 GB · 100%
From the Hugging Face model README
WORK IN PROGRESS: not a working model yet. Passkey recall currently fails; constant 3.3MB memory state verified on small proof.
47603357 and is not this repo.This repo is the GPT-2 HRR attention code + small checkpoints. Product overlay for Flash is staccs/lecore-deepseek-v4-flash-hrr.
Dashboard: https://ai.stacc.bio
Replaced O(C²) pairwise tensor with O(T·F) stable loop:
torch.fft.rfft on CUDATL;DR — Normal transformers store every token's keys+values forever (KV cache). At 128K context, GPT-2 Large needs 22.5 GB. HRR attention stores a 139 KB holographic state — same size at any context length. 169,467× reduction. Quality gap on the proof-of-concept: 0.7%. Scaling to 709M params confirmed.
| softmax attention | gated HRR attention | |
|---|---|---|
| Test BPC (lower is better) | 2.532 | 2.551 (+0.7%) |
| Context state at length 65K | 256.2 MB | 3.2 KB |
| Decode latency at 65K | 138 ms/tok | 9.8 ms/tok |
| State reduction | — | 82,322× |
Both models: identical architecture, same corpus, same seed, same tokenizer. The ONLY difference is the attention operator.
| Model | Params | Corpus | Train Loss | Tune BPC | vs Proof | Status |
|---|---|---|---|---|---|---|
| GPT-2 Small HRR | 85M | TinyShakespeare | 0.09 | 5.21 ⚠️ | overfit | ✅ done |
| GPT-2 Small HRR | 85M | WikiText-2 | 1.23 | 1.79 ✅ | beats | ✅ done |
| GPT-2 Medium HRR | 303M | TinyShakespeare | 1.17 | 2.17 ✅ | beats | ✅ done |
| GPT-2 Large HRR | 709M | TinyShakespeare | 1.38 | 2.54 ✅ | matches | ✅ done |
Key findings:
Finding: Medium (303M) at 2.17 BPC and Large (709M) at 2.54 BPC both equal or beat the original proof (2.55). HRR attention scales to GPT-2 sizes without quality collapse. The Small model overfit because 85M params on 1MB of text = memorization. WikiText-2: BPC 1.79 ✅.
| Model | HRR State | KV @ 8K | KV @ 128K | KV @ 1M | Reduction |
|---|---|---|---|---|---|
| GPT-2 Small (85M) | 28 KB | 288 MB | 4.5 GB | 36 GB | 1.3M× |
| GPT-2 Medium (303M) | 74 KB | 768 MB | 12 GB | 96 GB | 1.3M× |
| GPT-2 Large (709M) | 139 KB | 1.4 GB | 22.5 GB | 180 GB | 1.3M× |
| GPT-2 XL (1.5B) | 232 KB | 2.3 GB | 37.5 GB | 300 GB | 1.3M× |
HRR state is O(1) — constant at any context length. KV cache is O(T).
Despite high BPC (overfit), the model learned Shakespeare:
ROMEO:
Thou hast done me; then will I make good to Rome,
And you will be considered.
MISTRESS OVERDONE:
What's to do here, Thomas tapster? let's withdraw.
POMPEY:
Here comes Signior Claudio, led by the provost to prison;
and there's Madam Juliet.
CLAUDIO:
Fellow, why dost thou show me thus to the world?
Bear me to prison, where I am committed.
torch.fft.rfft on CUDA (matmul DFT fallback for MPS)The 85M model overfit because TinyShakespeare is 1 MB. On WikiText-2 (2M tokens, real English), the same model should score comparably to Medium/Large. Runner script included in repo.
The HRR operator is a drop-in replacement for any attention module. The math doesn't care about MLP architecture, activation function, or positional encoding. A Qwen-7B with HRR attention would need 299 KB of context state vs 56 GB KV cache at 1M tokens (187,000× reduction).
| Model | KV @ 128K | HRR State | Reduction |
|---|---|---|---|
| Llama-3.1-8B (GQA, 8 kv heads) | 16 GB | 390 KB | 42,983× |
| Qwen2.5-7B (GQA, 4 kv heads) | 7 GB | 299 KB | 23,990× |
The current Python for-loop is 12.4ms per scan. A proper Triton parallel scan
(Blelloch-style) should run in 2-4ms. Spec: gated_scan_spec.md in repo.
232 KB of state at 1M tokens means a single A100 80GB could serve thousands of concurrent long-context sessions. Compare: softmax needs 300 GB just for ONE session's KV cache.