Loading…
Loading…
Author: Kelvin Mateus | Bit++ Technologies
Architecture: BitCacheGPT2LMHeadModel (Spectral KV-Cache Decimation Engine)
BitCache is an ultra-fast, $O(N)$ spectral KV-cache compression middleware for Large Language Models. It decimates redundant attention states in Key and Value projection matrices during auto-regressive generation, cutting KV-cache memory footprint by up to 65% while preserving strict factual recall and language fluency.
Unlike sliding-window methods (such as StreamingLLM) that suffer from catastrophic context loss in the middle (Lost in the Middle), BitCache leverages:
In controlled benchmarks across 5 prompt depths (10%, 30%, 50%, 70%, and 90% of total sequence length):
| Method | Context Retained | P1 (10%) | P2 (30%) | P3 (50%) | P4 (70%) | P5 (90%) | Factual Accuracy | VRAM Savings |
|---|---|---|---|---|---|---|---|---|
| Baseline (Dense Cache) | 100% | PASS | PASS | FAIL | FAIL | PASS | 60.0% (3/5) | 0% (Reference) |
| StreamingLLM (Sliding Window) | ~20% | FAIL | FAIL | FAIL | FAIL | FAIL | 0.0% (0/5) | Amnesia / Collapse |
| BitCache (Cheeger-Catalan) | 35% | PASS | PASS | FAIL | FAIL | PASS | 60.0% (3/5) | 65.0% Reduced |
Finding: BitCache achieves 100% parity with the full uncompressed baseline, maintaining identical answer recall while freeing 65% of physical memory.
You can load and run this model directly using standard Hugging Face pipelines with trust_remote_code=True:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "KelvinAxhcar/bitcache-distilgpt2"
# 1. Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True)
# 2. Run generation - KV-cache is automatically compressed in VRAM
prompt = "In enterprise cloud telemetry architectures, the database master password is PHOENIX-771. Question: What is the database password?\nAnswer: The database password is"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=15, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
For commercial deployments, high-throughput multi-GPU serving (vLLM / TGI integration), or enterprise PoC trials, contact:
kaxhcar@gmail.com