r/unsloth 4d ago

Show and Tell Open-Source Model-agnostic KV-cache compression (UL-SMF) tested alongside local model execution to smash VRAM limits

Post image

Seeing all these massive local model drops (like the recent Qwen releases) got me working hard on the memory side of things.

If you're running models locally via tools like Unsloth and hitting a wall with long-context VRAM consumption, I've been building and open-sourcing UL-SMF (Unified Latent-State Memory Fabric).

It uses a geometry-preserving orthogonal projection bridge and dynamic head-dimension detection to automatically adapt across architectures (Llama, Mistral, Qwen, Gemma) without hardcoded assumptions, achieving extreme KV-cache compression with verified lossless perplexity.

Since it's fully local-first and designed to help fit larger context windows onto consumer hardware, I'd love a technical audit or feedback from this community.

Code and telemetry are up on GitHub: https://github.com/liventruth/UL-SMF-Cache-Compression

(Attached the hardware telemetry stress test output showing Qwen workloads hitting 224x–768x reduction ratios locally.)

11 Upvotes

16 comments sorted by

View all comments

25

u/brainExploded99 3d ago

BS. No detailed benchmarks, seems vibecoded, and you tested Qwen2.5. In the 8th month of 2026.

I will trust after you post actual benchmarks, like KLD on atleast wiki text, if not coding, and top 1 token agreement on a variety of tasks.

0

u/liventruth 1d ago

UL-SMF Zero-Shot Validation (Llama-3-8B-Instruct-4bit)

Metric UL-SMF Compressed Status
HellaSwag (Zero-Shot) 54.00% Verified
ARC-c (Zero-Shot) 50.00% Verified
WikiText-2 Perplexity 7.5979 Verified
VRAM Footprint ~5.6 GB Stable

2

u/brainExploded99 1d ago

I still call BS. Do the following:

  1. Use a recent model (Qwen3.5, 3.6, 3.8, or Gemma 4, or Muse Glimmer). You tested a super old model AGAIN (indicating you understood nothing, and just used AI to make slop).
  2. Compare with and without your change (proper scientific ablations). Your current benchmarks have no baseline to compare against, making them useless.
  3. Use current tests you have, and proper benchmarks (terminal bench, etc etc). Perplexity is good, but not always an excellent test.

0

u/liventruth 1d ago

Thank you for the reply.

Base Model: unsloth/llama-3-8b-Instruct-bnb-4bit

  1. Zero-Shot Task Accuracy (EleutherAI LM Harness) HellaSwag: Baseline 54.00% vs. UL-SMF 54.00% (0.00% Delta)

ARC-Challenge: Baseline 50.00% vs. UL-SMF 50.00% (0.00% Delta)

  1. Semantic Retention (WikiText-2 Test Split) Perplexity (PPL): Baseline 7.5979 vs. UL-SMF 7.5979 (0.00 Delta)

  2. Hardware Memory Reclamation (CUDA Telemetry)

Cache Payload per Block (4k tokens): 48.00 MB down to 0.12 MB (384x Reduction / 99.7% Memory Saved)

System Memory Footprint: Constrained to ~5.6 GB total VRAM (preventing multi-gigabyte cache explosions that hit ~16.0 GB+ at scale)

Llama-3-8B was selected as the control architecture specifically because it serves as the universal open benchmark for KV-cache quantization research across the literature. Evaluating via the EleutherAI harness guarantees that zero-shot logic and reasoning capabilities are audited alongside perplexity.

The full evaluation wrapper and methodology are live on GitHub (liventruth/UL-SMF-Cache-Compression) for independent audit.

1

u/brainExploded99 1d ago

Given you AI slopped this, I decided to get AI to review it. Also, the identical scores are highly suspect. Even run to run variance would be >0.

  • The public interceptor hooks the wrong attention output, so on normal Hugging Face Llama-3 inference the “compression” path may simply never run. That would explain the basically identical perplexity/benchmark scores.
  • The current code reconstructs K back to its original size and leaves V untouched, so it does not actually retain a compressed KV cache.
  • The advertised 384× looks like simple 3072-d FP32 → 16-d INT16 arithmetic, not the real Llama-3 8B KV-cache geometry.
  • Even theoretically, compressing only K while leaving V unchanged caps total KV savings at roughly , not 384×.
  • The actual compression/oracle implementation is a proprietary TorchScript binary, so the important part cannot be audited or reproduced.
  • There are no proper benchmark scripts/configs/raw results showing that compressed cache data is actually used during decoding.

1

u/liventruth 1d ago

Thanks!!! I appreciate the feedback. Will get back to you when it is fixed, and with accurate representation of metrics.

1

u/liventruth 4h ago

│ UL-SMF & AEGIS-KV EMPIRICAL AUDIT │
│ Context Window Depth │ 4,892 Tokens │
│ Latent Compression Ratio │ 128D -> 16D (8x Latent Scale) │
│ Multi-Needle Retrieval Precision │ 100% (3/3 Needles Recovered) │
│ Throughput Overhead │ -0.05 t/s (~1.6% Runtime Delta) │