# UL-SMF – Open-source linear-complexity KV-cache compression

> Source: <https://github.com/liventruth/UL-SMF-Cache-Compression>
> Published: 2026-08-17 15:56:14+00:00

The **Unified Latent-State Memory Fabric (UL-SMF)** is a hardware-software co-designed memory compression fabric that solves the memory bottleneck in long-context Transformer inference. By combining **Finite Scalar Quantization (FSQ)** with dynamic 16-dimensional latent mapping, UL-SMF compresses Key-Value (KV) cache tensors by up to **384x** while maintaining **>94% semantic retention**.

**UL-SMF is dual-licensed:**

**Open Source (AGPLv3):** Free for non-commercial research, academic use, and open-source projects.*Note: The AGPLv3 license requires any network-accessible service using this software to open-source its entire backend application code.***Commercial Enterprise License:** Required for proprietary commercial deployments, closed-source SaaS platforms, and enterprise data center infrastructure. Commercial licenses grant full rights without AGPLv3 copyleft restrictions, plus integration support.

📩 **For Enterprise Licensing Inquiries:** `inquiries@lawrencearchitectures.com`

| Metric | Raw FP32 Cache | UL-SMF 16D Latent | Improvement |
|---|---|---|---|
VRAM Footprint (4096 tokens) |
48.00 MB | 0.12 MB | 384x Reduction |
VRAM Saved / Block |
— | 47.88 MB |
99.7% Memory Saved |
Semantic Retention |
100% | 94.15% - 95.84% |
Cosine Similarity |
Pipeline Latency |
— | ~14.1 ms - 19.6 ms |
CUDA Event Verified |

UL-SMF dynamically maps **any** model hidden dimension (Mistral, Llama, Qwen, etc.) on-the-fly using orthogonal projection:

``` python
import torch
from ul_smf import UniversalLatentBridge

# 1. Load your compiled Aegis-KV oracle core binary
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
oracle_core = torch.jit.load("aegis_kv_oracle_core.pt", map_location=device)
oracle_core.eval()

# 2. Wrap it with the Universal Dynamic Bridge (auto-adapts to any model size)
ul_smf_bridge = UniversalLatentBridge(core_module=oracle_core, core_dim=3072).to(device)

# 3. Seamlessly compress any model hidden dimension (e.g., 4096 for Llama/Qwen)
kv_cache_tensor = torch.randn(1, 32, 4096, device=device)
reconstructed_cache, compressed_latents = ul_smf_bridge(kv_cache_tensor)

print(f"Compressed down to latent space: {compressed_latents.shape}")
```


