Fused Latent-Cache Attention and Memory-Coalesced Binary Factorized CUDA Kernels
Fuse multi-stage binary factorized projections with latent attention caching into unified GPU kernels to eliminate memory-bandwidth bottlenecks and realize end-to-end decoding speedups.
Time
Compute level
Resources
What the paper used
Prerequisites
Scope
The Gap
In Section 5 and Appendix H.2/H.3 (Tables 13-14), the authors evaluate a proof-of-concept 1-bit GEMV CUDA kernel at batch size 1 that accelerates only nn.Linear layers, leaving attention and LayerNorm in FP16. Due to multiple sequential memory-bound steps in Eq. (5) and unoptimized memory access, a 11.6x kernel speedup on a single 70B MLP layer shrinks to only 2.46x end-to-end decoding throughput on Llama2-7B (0.1 BPW), while 1.0 BPW LittleBit is actually slower than OneBit at the kernel level (0.0938 ms vs. 0.0713 ms). Furthermore, the latent KV-cache compression reported in Table 4 (up to 21.3x) is only a theoretical estimate and is not implemented in an end-to-end attention kernel.
“The factorized approach involves multiple memory-bound operations, and the custom kernel has not yet reached the optimization level of industry-standard libraries.”
Limitation
Unfused multi-stage factorized kernels suffer from memory-bandwidth overhead, underperform 1-bit baselines at higher ranks, lack batch-size > 1 GEMM support, and leave the projected KV-cache memory savings unimplemented in real inference.
Proposed Solution
Design a fused CUDA/Triton kernel architecture that (1) executes the Primary and Residual paths concurrently in shared memory/registers, fusing input scaling (g), V_sign XOR-GEMV, latent scaling (l), U_sign XOR-GEMV, and output scaling (h) without writing intermediate rank-r activations to global HBM; (2) supports batched prefill and multi-request decoding (batch size > 1) via bit-packed tensor/warp-level popcount/XOR instructions; and (3) implements latent-space KV caching directly inside a custom FlashDecoding-style attention kernel that stores only rank-r K/V states in HBM and reconstructs keys/values on-the-fly in SRAM.
Why This Matters
Fusing the factorized linear paths and realizing latent KV caching in SRAM could close the gap between theoretical 7x FLOP reductions and end-to-end throughput, enabling long-context and multi-batch inference on consumer GPUs.
How to Get Started
How to test it: Test whether fusing Primary/Residual projections and latent-space KV caching reduces end-to-end Llama2-7B decoding latency and peak VRAM at 4k-16k context lengths compared to LittleBit's unfused nn.Linear kernel (203.20 tok/s at 128 tokens) and FP16 FlashAttention-2; stop if global memory traffic or register spilling prevents surpassing the unfused kernel by at least 25%.
- Benchmark LittleBit's released custom CUDA kernel on a single A100 GPU using Nsight Compute to measure HBM bandwidth utilization, stall reasons, and register pressure across batch sizes 1 to 16.
- Prototype a fused Primary+Residual Triton/CUDA kernel that keeps the intermediate rank-r vector in shared memory/registers across the V_sign and U_sign stages.
- Implement a latent-space KV cache layout and custom attention decoding kernel that caches rank-r K/V vectors and projects them on-the-fly in SRAM.
- Measure end-to-end tokens/sec and peak KV-cache VRAM on Llama2-7B across context lengths from 512 to 8192 tokens against Table 14 and FP16 baselines.
Suggested by AI. Adapt it to your setup.
Has This Been Done?
Existing literature such as Minima-KV and QuantMLA discuss KV caching and quantization, but do not implement fused CUDA/Triton kernels combining concurrent Primary-and-Residual binary factor execution with latent-space KV caching.
- Minima-KV: Retention-Preserving KV Cache Compression with Mixed-Format Paged Attention · 2026 · 0 citations
- QuantMLA: Function-Aligned Dual-Path Quantization for Low-Bit MLA KV Caching · 2026 · 1 citations
- FluxBin: Flexible LUT-based Ultra-low-bit LLM Inference by Algorithm-Kernel Synergy · 2026 · 0 citations
We searched OpenAlex and arXiv for “fused CUDA kernel binary matrix factorization latent KV cache attention” and “Fused Latent-Cache Attention and Memory-Coalesced Binary Factorized CUDA Kernels” and an AI compared the idea with the top 10 results. A small search can miss relevant work.
Source Paper
LittleBit: Ultra Low-Bit Quantization via Latent FactorizationBanseok Lee, Dongkyu Kim, Youngcheon You +1 more · 2025
This paper introduces LittleBit, a framework for compressing large language models (LLMs) into the extreme sub-1-bit regime down to 0.1 bits per weight (BPW), reducing Llama2-13B to under 0.9 GB. It combines low-rank latent matrix factorization with factor binarization, multi-scale compensation across row, column, and latent dimensions, Dual-SVID initialization, and parallel Residual Compensation trained via quantization-aware training (QAT) with knowledge distillation.
Related Ideas
- Graph-Compatible Dynamic Sparse Attention for End-to-End Prefix CaptureTideway: Phase-Aware Tiered Memory Management for MoE Inference on Consumer Devices🟡Fairly easy
- Hardware-Aware Kernels for Zero-Overhead InferenceBitNet b1.58 2B4T Technical Report⛔Very hard
- Dual-Axis KV Sharing: Integrating Joint-KV with Cross-Layer and Prefix-Shared AttentionMulti-Branch Transformer🟠Medium
- CUDA/Triton Implementation of Element-wise LUTsBitnet.cpp: Efficient Edge Inference for Ternary LLMs🔴Hard
- Foveated Spatial KV Compression and Sparse Attention for Interactive 720p Video GenerationFastFrames: Video Generation at Interactive Latency🔴Hard