• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Wednesday, June 11, 2025
Techcratic
  • TC
  • AI
    Artificial Intelligence

    Bridging the Gap: New Datasets Push Recommender Research Toward Real-World Scale

    Artificial Intelligence

    7 Python Errors That Are Actually Features

    Artificial Intelligence

    10 Awesome OCR Models for 2025

    Artificial Intelligence

    5 Error Handling Patterns in Python (Beyond Try-Except)

    Artificial Intelligence

    Top 5 Alternative Data Career Paths and How to Learn Them for Free

    Artificial Intelligence

    Implementing Machine Learning Pipelines with Apache Spark

    Artificial Intelligence

    Learn Power BI for Free This Week

    Artificial Intelligence

    Build GraphRAG applications using Amazon Bedrock Knowledge Bases

    Artificial Intelligence

    How to Use Deep Research Like a Pro

  • Crypto
    Strategy Begins Nasdaq Trading of New Stock With $980M Bitcoin-Fueled Momentum

    Strategy Begins Nasdaq Trading of New Stock With $980M Bitcoin-Fueled Momentum

    Crypto Prices Set To Move Higher After US Progress on Trade

    Crypto Prices Set To Move Higher After US Progress on Trade

    Crypto ETF Surge: Bitcoin and Ether Funds Attract Over $550 Million as Inflows Continue

    Crypto ETF Surge: Bitcoin and Ether Funds Attract Over $550 Million as Inflows Continue

    From ETFs to Strategic Bitcoin Reserve: Inside Trump’s crypto playbook

    From ETFs to Strategic Bitcoin Reserve: Inside Trump’s crypto playbook

    Crypto Lost $1.64 Billion to Hackers in Q1 2025

    Why Is Crypto Up Today? – June 11, 2025

    UK FCA Creates New Deputy Chief Executive Role to Oversee Regulation of Stablecoin and Crypto Firms

    UK FCA Creates New Deputy Chief Executive Role to Oversee Regulation of Stablecoin and Crypto Firms

    Bitcoin Bull Cycle is Over: CryptoQuant CEO

    GameStop Bought 4,710 Bitcoin in 5 Weeks

    Moscow Exchange Launches Landmark Bitcoin Index

    Moscow Exchange Launches Landmark Bitcoin Index

    ETH Short Liquidations May Send Ether Price to $3K

    ETH Short Liquidations May Send Ether Price to $3K

  • Cybersecurity
    Cybersecurity

    5 Lessons from River Island

    Cybersecurity

    INTERPOL Dismantles 20,000+ Malicious IPs Linked to 69 Malware Variants in Operation Secure

    Cybersecurity

    SinoTrack GPS Devices Vulnerable to Remote Vehicle Control via Default Passwords

    Cybersecurity

    Researchers Uncover 20+ Configuration Risks, Including Five CVEs, in Salesforce Industry Cloud

    Cybersecurity

    Adobe Releases Patch Fixing 254 Vulnerabilities, Closing High-Severity Security Gaps

    Cybersecurity

    Researcher Found Flaw to Discover Phone Numbers Linked to Any Google Account

    Cybersecurity

    CISA Adds Erlang SSH and Roundcube Flaws to Known Exploited Vulnerabilities Catalog

    Cybersecurity

    Malicious Browser Extensions Infect 722 Users Across Latin America Since Early 2025

    Cybersecurity

    Empower Users and Protect Against GenAI Data Loss

  • Deals
    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

    WALI Dual Monitor Mount, Adjustable Gas Spring Monitor Desk Stand for 2 Monitors, Heavy…

    WALI Dual Monitor Mount, Adjustable Gas Spring Monitor Desk Stand for 2 Monitors, Heavy…

    Lekvey Ergonomic Mouse, Vertical Wireless Mouse – Rechargeable 2.4GHz Optical Vertical…

    Lekvey Ergonomic Mouse, Vertical Wireless Mouse – Rechargeable 2.4GHz Optical Vertical…

    GTPLAYER Gaming Chair, Computer Office Chair with Pocket Spring Cushion, Linkage…

    GTPLAYER Gaming Chair, Computer Office Chair with Pocket Spring Cushion, Linkage…

    South Park: The Stick of Truth – Xbox 360 (Renewed)

    South Park: The Stick of Truth – Xbox 360 (Renewed)

    Dangerous Game: The Legacy Murders [DVD]

    Dangerous Game: The Legacy Murders [DVD]

    TOSY Flying Disc – 16 Million Colors RGB or 36 LEDs, Extremely Bright, Smart Modes,…

    TOSY Flying Disc – 16 Million Colors RGB or 36 LEDs, Extremely Bright, Smart Modes,…

    Transcend TS256GMTE220S 256GB M.2 PCIe Gen3x4 80mm Internal Solid State Drive

    Transcend TS256GMTE220S 256GB M.2 PCIe Gen3x4 80mm Internal Solid State Drive

    Cable Matters 10Gbps Short USB C to Micro USB 3.0 Cable – 1ft, USB-C Hard Drive Cable,…

    Cable Matters 10Gbps Short USB C to Micro USB 3.0 Cable – 1ft, USB-C Hard Drive Cable,…

  • Gaming
    Pokemon Violet Walkthrough Part 6: Paldea is Our Cloyster!

    Pokemon Violet Walkthrough Part 6: Paldea is Our Cloyster!

    How To Get KINGAMBIT in Pokemon Scarlet and Violet!

    How To Get KINGAMBIT in Pokemon Scarlet and Violet!

    Aniimo: Breaking Down This Beautiful Creature Collector – Sign Up for a Closed Beta!

    Aniimo: Breaking Down This Beautiful Creature Collector – Sign Up for a Closed Beta!

    Zelda Ocarina of Time HD 100% Walkthrough – Part 15 – Zora's Domain | King Zora

    Zelda Ocarina of Time HD 100% Walkthrough – Part 15 – Zora's Domain | King Zora

    My Let's Play Zelda Ocarina of Time Walkthrough 25 HD

    My Let's Play Zelda Ocarina of Time Walkthrough 25 HD

    The Legend of Zelda: Ocarina of Time Walkthrough! – #11

    The Legend of Zelda: Ocarina of Time Walkthrough! – #11

    European Broadcasting Union and NVIDIA Partner on Sovereign AI

    European Broadcasting Union and NVIDIA Partner on Sovereign AI

    Zelda Minish Cap 100% Walkthrough – Part 28/61 – Flippers, Bomb Bag & Quiver Upgrade (Commentary)

    Zelda Minish Cap 100% Walkthrough – Part 28/61 – Flippers, Bomb Bag & Quiver Upgrade (Commentary)

    Majora's Mask Walkthrough – 15 – Goron's Lullaby

    Majora's Mask Walkthrough – 15 – Goron's Lullaby

  • Tesla
    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

    Center Console Organizer Behind Screen Storage Box for 2024 Tesla Cybertruck…

    Center Console Organizer Behind Screen Storage Box for 2024 Tesla Cybertruck…

    Tesla is done in Germany: 94% say they won’t buy a Tesla car

    Tesla owners sue to break their leases over Musk making the cars ‘far-right totems’

    Flag Pole Holder Kit for Tesla Cybertruck, Lymorexan L Track Flag Pole Mount Kit for…

    Flag Pole Holder Kit for Tesla Cybertruck, Lymorexan L Track Flag Pole Mount Kit for…

    3PCS Center Console Accessories for Tesla New Model Y Juniper 2025 Model 3 Highland 2024…

    3PCS Center Console Accessories for Tesla New Model Y Juniper 2025 Model 3 Highland 2024…

    Car Sound Deadening Roller, Audio Sound Deadener Application Installation Metal Seam…

    Car Sound Deadening Roller, Audio Sound Deadener Application Installation Metal Seam…

    iZEEKER 2.5K Dash Cam WiFi Dash Camera for Cars, Mini Car Camera 1440P Front Dashcams…

    iZEEKER 2.5K Dash Cam WiFi Dash Camera for Cars, Mini Car Camera 1440P Front Dashcams…

    2 Pack For Tesla Model X 2017-2024 Front/Back Under Seat Storage Organizer,TPE…

    2 Pack For Tesla Model X 2017-2024 Front/Back Under Seat Storage Organizer,TPE…

  • UFO
    Trump Discusses Drone Sightings Along US East Coast | #CISNewsStudio1s

    Trump Discusses Drone Sightings Along US East Coast | #CISNewsStudio1s

    Roswell Conspiracies: Aliens, Myths & Legends, Vol. 1

    Roswell Conspiracies: Aliens, Myths & Legends, Vol. 1

    5 Shocking Nature Sky Phenomena That Actually Happened!

    5 Shocking Nature Sky Phenomena That Actually Happened!

    UFO Hunters – Season 1 (History) (Steelbook) [DVD]

    UFO Hunters – Season 1 (History) (Steelbook) [DVD]

    The Bizarre Handbag Figure Found In Mesoamerica

    The Bizarre Handbag Figure Found In Mesoamerica

    NOVA: What are UFOs?

    NOVA: What are UFOs?

    They Are Already Here: UFO Culture and Why We See Saucers

    They Are Already Here: UFO Culture and Why We See Saucers

    Alien: Romulus

    Alien: Romulus

    Top 25 Alien Encounters: UFO Case Files Exposed [DVD]

    Top 25 Alien Encounters: UFO Case Files Exposed [DVD]

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    Bridging the Gap: New Datasets Push Recommender Research Toward Real-World Scale

    Artificial Intelligence

    7 Python Errors That Are Actually Features

    Artificial Intelligence

    10 Awesome OCR Models for 2025

    Artificial Intelligence

    5 Error Handling Patterns in Python (Beyond Try-Except)

    Artificial Intelligence

    Top 5 Alternative Data Career Paths and How to Learn Them for Free

    Artificial Intelligence

    Implementing Machine Learning Pipelines with Apache Spark

    Artificial Intelligence

    Learn Power BI for Free This Week

    Artificial Intelligence

    Build GraphRAG applications using Amazon Bedrock Knowledge Bases

    Artificial Intelligence

    How to Use Deep Research Like a Pro

  • Crypto
    Strategy Begins Nasdaq Trading of New Stock With $980M Bitcoin-Fueled Momentum

    Strategy Begins Nasdaq Trading of New Stock With $980M Bitcoin-Fueled Momentum

    Crypto Prices Set To Move Higher After US Progress on Trade

    Crypto Prices Set To Move Higher After US Progress on Trade

    Crypto ETF Surge: Bitcoin and Ether Funds Attract Over $550 Million as Inflows Continue

    Crypto ETF Surge: Bitcoin and Ether Funds Attract Over $550 Million as Inflows Continue

    From ETFs to Strategic Bitcoin Reserve: Inside Trump’s crypto playbook

    From ETFs to Strategic Bitcoin Reserve: Inside Trump’s crypto playbook

    Crypto Lost $1.64 Billion to Hackers in Q1 2025

    Why Is Crypto Up Today? – June 11, 2025

    UK FCA Creates New Deputy Chief Executive Role to Oversee Regulation of Stablecoin and Crypto Firms

    UK FCA Creates New Deputy Chief Executive Role to Oversee Regulation of Stablecoin and Crypto Firms

    Bitcoin Bull Cycle is Over: CryptoQuant CEO

    GameStop Bought 4,710 Bitcoin in 5 Weeks

    Moscow Exchange Launches Landmark Bitcoin Index

    Moscow Exchange Launches Landmark Bitcoin Index

    ETH Short Liquidations May Send Ether Price to $3K

    ETH Short Liquidations May Send Ether Price to $3K

  • Cybersecurity
    Cybersecurity

    5 Lessons from River Island

    Cybersecurity

    INTERPOL Dismantles 20,000+ Malicious IPs Linked to 69 Malware Variants in Operation Secure

    Cybersecurity

    SinoTrack GPS Devices Vulnerable to Remote Vehicle Control via Default Passwords

    Cybersecurity

    Researchers Uncover 20+ Configuration Risks, Including Five CVEs, in Salesforce Industry Cloud

    Cybersecurity

    Adobe Releases Patch Fixing 254 Vulnerabilities, Closing High-Severity Security Gaps

    Cybersecurity

    Researcher Found Flaw to Discover Phone Numbers Linked to Any Google Account

    Cybersecurity

    CISA Adds Erlang SSH and Roundcube Flaws to Known Exploited Vulnerabilities Catalog

    Cybersecurity

    Malicious Browser Extensions Infect 722 Users Across Latin America Since Early 2025

    Cybersecurity

    Empower Users and Protect Against GenAI Data Loss

  • Deals
    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

    acer Aspire Premium Laptop | AMD Ryzen 7 5700U (Beats i7-1250U) CPU | 64GB RAM | 2TB SSD…

    WALI Dual Monitor Mount, Adjustable Gas Spring Monitor Desk Stand for 2 Monitors, Heavy…

    WALI Dual Monitor Mount, Adjustable Gas Spring Monitor Desk Stand for 2 Monitors, Heavy…

    Lekvey Ergonomic Mouse, Vertical Wireless Mouse – Rechargeable 2.4GHz Optical Vertical…

    Lekvey Ergonomic Mouse, Vertical Wireless Mouse – Rechargeable 2.4GHz Optical Vertical…

    GTPLAYER Gaming Chair, Computer Office Chair with Pocket Spring Cushion, Linkage…

    GTPLAYER Gaming Chair, Computer Office Chair with Pocket Spring Cushion, Linkage…

    South Park: The Stick of Truth – Xbox 360 (Renewed)

    South Park: The Stick of Truth – Xbox 360 (Renewed)

    Dangerous Game: The Legacy Murders [DVD]

    Dangerous Game: The Legacy Murders [DVD]

    TOSY Flying Disc – 16 Million Colors RGB or 36 LEDs, Extremely Bright, Smart Modes,…

    TOSY Flying Disc – 16 Million Colors RGB or 36 LEDs, Extremely Bright, Smart Modes,…

    Transcend TS256GMTE220S 256GB M.2 PCIe Gen3x4 80mm Internal Solid State Drive

    Transcend TS256GMTE220S 256GB M.2 PCIe Gen3x4 80mm Internal Solid State Drive

    Cable Matters 10Gbps Short USB C to Micro USB 3.0 Cable – 1ft, USB-C Hard Drive Cable,…

    Cable Matters 10Gbps Short USB C to Micro USB 3.0 Cable – 1ft, USB-C Hard Drive Cable,…

  • Gaming
    Pokemon Violet Walkthrough Part 6: Paldea is Our Cloyster!

    Pokemon Violet Walkthrough Part 6: Paldea is Our Cloyster!

    How To Get KINGAMBIT in Pokemon Scarlet and Violet!

    How To Get KINGAMBIT in Pokemon Scarlet and Violet!

    Aniimo: Breaking Down This Beautiful Creature Collector – Sign Up for a Closed Beta!

    Aniimo: Breaking Down This Beautiful Creature Collector – Sign Up for a Closed Beta!

    Zelda Ocarina of Time HD 100% Walkthrough – Part 15 – Zora's Domain | King Zora

    Zelda Ocarina of Time HD 100% Walkthrough – Part 15 – Zora's Domain | King Zora

    My Let's Play Zelda Ocarina of Time Walkthrough 25 HD

    My Let's Play Zelda Ocarina of Time Walkthrough 25 HD

    The Legend of Zelda: Ocarina of Time Walkthrough! – #11

    The Legend of Zelda: Ocarina of Time Walkthrough! – #11

    European Broadcasting Union and NVIDIA Partner on Sovereign AI

    European Broadcasting Union and NVIDIA Partner on Sovereign AI

    Zelda Minish Cap 100% Walkthrough – Part 28/61 – Flippers, Bomb Bag & Quiver Upgrade (Commentary)

    Zelda Minish Cap 100% Walkthrough – Part 28/61 – Flippers, Bomb Bag & Quiver Upgrade (Commentary)

    Majora's Mask Walkthrough – 15 – Goron's Lullaby

    Majora's Mask Walkthrough – 15 – Goron's Lullaby

  • Tesla
    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Dashboard Mobile Phone Holder, Non-Slip 360 Degree Rotatable Navigation Bracket,…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

    Skechers Car Floor Mats,Heavy Duty Rubber Car Mats Full Set,All WeatherFloor…

    Center Console Organizer Behind Screen Storage Box for 2024 Tesla Cybertruck…

    Center Console Organizer Behind Screen Storage Box for 2024 Tesla Cybertruck…

    Tesla is done in Germany: 94% say they won’t buy a Tesla car

    Tesla owners sue to break their leases over Musk making the cars ‘far-right totems’

    Flag Pole Holder Kit for Tesla Cybertruck, Lymorexan L Track Flag Pole Mount Kit for…

    Flag Pole Holder Kit for Tesla Cybertruck, Lymorexan L Track Flag Pole Mount Kit for…

    3PCS Center Console Accessories for Tesla New Model Y Juniper 2025 Model 3 Highland 2024…

    3PCS Center Console Accessories for Tesla New Model Y Juniper 2025 Model 3 Highland 2024…

    Car Sound Deadening Roller, Audio Sound Deadener Application Installation Metal Seam…

    Car Sound Deadening Roller, Audio Sound Deadener Application Installation Metal Seam…

    iZEEKER 2.5K Dash Cam WiFi Dash Camera for Cars, Mini Car Camera 1440P Front Dashcams…

    iZEEKER 2.5K Dash Cam WiFi Dash Camera for Cars, Mini Car Camera 1440P Front Dashcams…

    2 Pack For Tesla Model X 2017-2024 Front/Back Under Seat Storage Organizer,TPE…

    2 Pack For Tesla Model X 2017-2024 Front/Back Under Seat Storage Organizer,TPE…

  • UFO
    Trump Discusses Drone Sightings Along US East Coast | #CISNewsStudio1s

    Trump Discusses Drone Sightings Along US East Coast | #CISNewsStudio1s

    Roswell Conspiracies: Aliens, Myths & Legends, Vol. 1

    Roswell Conspiracies: Aliens, Myths & Legends, Vol. 1

    5 Shocking Nature Sky Phenomena That Actually Happened!

    5 Shocking Nature Sky Phenomena That Actually Happened!

    UFO Hunters – Season 1 (History) (Steelbook) [DVD]

    UFO Hunters – Season 1 (History) (Steelbook) [DVD]

    The Bizarre Handbag Figure Found In Mesoamerica

    The Bizarre Handbag Figure Found In Mesoamerica

    NOVA: What are UFOs?

    NOVA: What are UFOs?

    They Are Already Here: UFO Culture and Why We See Saucers

    They Are Already Here: UFO Culture and Why We See Saucers

    Alien: Romulus

    Alien: Romulus

    Top 25 Alien Encounters: UFO Case Files Exposed [DVD]

    Top 25 Alien Encounters: UFO Case Files Exposed [DVD]

No Result
View All Result
Techcratic
No Result
View All Result
Home Hacker News

dipampaul17/KVSplit: Run larger LLMs with longer contexts on Apple Silicon by using differentiated precision for KV cache quantization. KVSplit enables 8-bit keys & 4-bit values, reducing memory by 59% with

Hacker News by Hacker News
May 16, 2025
in Hacker News
Reading Time: 15 mins read
124 6
A A
0
Share on FacebookShare on XShare on LinkedIn

2025-05-16 16:04:00
github.com

Differentiated KV Cache Quantization for Apple Silicon

GitHub Stars
License
Platform

KV Cache Memory Usage

Run larger context windows and heavier LLMs on your Mac by applying different quantization precision to keys vs values in the attention mechanism’s KV cache. KVSplit enables you to:

  • Reduce memory usage by up to 72% with minimal quality loss
  • Run 2-3x longer contexts in the same memory budget
  • Maintain or improve inference speed compared to FP16
  • Optimize for Apple Silicon with full Metal support

Configuration VRAM @ 8K tokens Tokens/sec Perplexity Change
FP16 (base) 176.00 MB (100%) 54,360 —
K8V8 (8-bit) 93.50 MB (47%) 51,503 +0.03%
K8V4 71.50 MB (41%) 57,438 +0.86%
K4V8 71.50 MB (41%) 58,690 +6.06%
K4V4 (4-bit) 49.50 MB (28%) 55,193 +6.15%

Memory Savings by Sequence Length

Configuration 128 tokens 2048 tokens 4096 tokens 8192 tokens
FP16 (baseline) 5.50 MB 44.00 MB 88.00 MB 176.00 MB
K8V8 (8-bit) 2.92 MB 23.38 MB 46.75 MB 93.50 MB
K8V4 (mixed) 2.23 MB 17.88 MB 35.75 MB 71.50 MB
K4V8 (mixed) 2.23 MB 17.88 MB 35.75 MB 71.50 MB
K4V4 (4-bit) 1.55 MB 12.38 MB 24.75 MB 49.50 MB

  • Independent quantization of keys and values in the KV cache
  • Optimized for Apple Silicon with Metal support
  • Comprehensive benchmarking suite with perplexity measurement
  • Memory usage and performance analysis tools
  • Publication-quality visualization tools
  • Easy setup and usage
  • macOS (tested on Apple Silicon)
  • Homebrew package manager
  • Xcode Command Line Tools

⚡ One-Command Installation

# Clone the repository
git clone https://github.com/dipampaul17/KVSplit.git
cd kvsplit

# Run the installer script
chmod +x scripts/install_kvsplit.sh
./scripts/install_kvsplit.sh

The installer will:

  • Set up the project structure
  • Clone and build llama.cpp with Metal support
  • Configure for differentiated KV cache quantization
  • Download a small test model (optional)
  • Set up Python environment for visualization

Want to see the benefits immediately? Run a quick comparison with your model:

# Run quick comparison with different configurations
python scripts/quick_compare.py --model models/your-model.gguf

This will show you a side-by-side comparison of FP16, K8V8, K8V4, K4V8, and K4V4 with memory usage, speed, and quality metrics.

Memory vs Quality

Configuration VRAM @ 8K tokens Memory Savings Quality Impact
FP16 (base) 176.00 MB — —
K8V8 (8-bit) 93.50 MB 47% +0.03%
K8V4 71.50 MB 59% +0.86%
K4V8 71.50 MB 59% +6.06%
K4V4 (4-bit) 49.50 MB 72% +6.15%

Using KVSplit doesn’t just save memory—it often improves inference speed by 5-15%!

Configuration Tokens/sec (8K ctx) Speedup vs FP16
FP16 54,360 —
K8V8 51,503 -5.3%
K8V4 57,438 +5.7%
K4V8 58,690 +8.0%
K4V4 55,193 +1.5%

kvsplit/
├── llama.cpp/      # Optimized llama.cpp build
├── models/         # LLM model files
├── scripts/        # Utility scripts
│   ├── benchmark_kvsplit.py    # Comprehensive benchmark tool
│   ├── install_kvsplit.sh      # One-command installer
│   ├── quick_compare.py        # Quick comparison utility
│   ├── capture_memory.sh       # GIF creation for memory visualization
│   └── visualize_results.py    # Generate publication-quality plots
├── results/        # Benchmark results (CSV/JSON)
├── plots/          # Generated visualizations
└── README.md       # This file
Configuration Summary

KV cache memory is dominated by storing key and value vectors for each token. Our research has revealed a critical insight: keys are significantly more sensitive to quantization than values.

  • Asymmetric Impact: Keys require higher precision than values for maintaining quality
  • Sweet Spot: K8V4 (8-bit keys, 4-bit values) provides optimal balance
    • Only 0.86% perplexity degradation vs. FP16
    • 59% memory reduction
    • Faster inference than FP16
  • Confirmation: K4V8 configuration shows 7x more quality degradation than K8V4, despite using the same total bits

This asymmetry allows for more efficient memory usage without compromising model quality, enabling longer context windows and larger models on consumer hardware.

Running with Different KV Cache Precisions

# Baseline (FP16)
./llama.cpp/build/bin/llama-cli -m models/your-model.gguf -p "Your prompt" \
  -t 8 --flash-attn

# ⭐ RECOMMENDED: 8-bit keys, 4-bit values (K8V4) 
# Best balance of quality and memory savings
./llama.cpp/build/bin/llama-cli -m models/your-model.gguf -p "Your prompt" \
  -t 8 --flash-attn --kvq 8

# 4-bit keys, 8-bit values (K4V8)
# Shows why key precision matters more than value precision
./llama.cpp/build/bin/llama-cli -m models/your-model.gguf -p "Your prompt" \
  -t 8 --flash-attn --kvq-key 4 --kvq-val 8

# 4-bit keys and values (K4V4)
# Maximum memory savings (72% reduction) with acceptable quality
./llama.cpp/build/bin/llama-cli -m models/your-model.gguf -p "Your prompt" \
  -t 8 --flash-attn --kvq 4

Long Context Example (32K)

# Run with a 32K context (would require ~1.4GB in FP16, only ~400MB with K8V4)
./llama.cpp/build/bin/llama-cli -m models/your-model.gguf \
  -c 32768 -n 4096 -t 8 --flash-attn --kvq 8 \
  -f your-long-document.txt

🚩 Command-Line Arguments

Flag Description Recommendation
-t 8 Number of threads 8 is optimal for most Apple Silicon chips
--flash-attn Enables optimized attention Recommended for Apple Silicon
--kvq N Sets both key and value bits to N Use --kvq 8 for K8V4 configuration
--kvq-key N Sets key bits only Key precision has major quality impact
--kvq-val N Sets value bits only Value precision has minor quality impact
-c N Context size in tokens Longer contexts benefit more from KVSplit
-n N Number of tokens to generate Adjust based on your needs
-f FILE Input file For processing documents
-m MODEL Model path Path to your .gguf model file

📏 Advanced Benchmarking

For comprehensive performance analysis, use our full benchmark suite:

# Run the full benchmark suite (all configurations and sequence lengths)
python scripts/benchmark_kvsplit.py

# Run a specific configuration test
python scripts/benchmark_kvsplit.py --config K8V4 --seq-len 4096

# Generate publication-quality visualizations
python scripts/visualize_results.py

The benchmarking script provides thorough measurements of:

  • 📊 Memory Usage: VRAM and KV cache specifically
  • ⚡ Performance: Tokens per second across different sequence lengths
  • 🎯 Quality: Perplexity measurement using llama-perplexity
  • 📈 Scaling: How memory usage and performance scale with sequence length

Results are saved in CSV/JSON formats with automatic summary statistics, and the visualization script generates publication-quality plots showing key insights.

MIT

🎬 Visual Memory Savings

You can visualize memory savings with our capture tool:

# Capture memory reduction in Activity Monitor
./scripts/capture_memory.sh

🍎 Apple Silicon Optimization

  • Metal Performance: Fully optimized for Apple’s Metal framework
  • Memory Efficiency: Critical for memory-constrained M1/M2/M3 devices
  • Activity Monitor: Use our capture_memory.sh script to visualize real-time memory reductions
  • Alignment: 256B page alignment in llama.cpp means actual memory savings might differ slightly from theoretical calculations
  • Differentiated Precision: Independent key and value bit precision (K8V4, K4V8, etc)
  • Apple Silicon Optimization: Full Metal support for M1/M2/M3 chips
  • Comprehensive Benchmarking: Memory, speed, and quality metrics
  • Publication-Quality Visualization: Beautiful plots for analysis
  • Simple User Interface: One-command install and quick comparison tools
  • Memory Visualization: Tools to capture and visualize memory savings

This project implements ideas from recent research including:

  • “More for Keys, Less for Values: Adaptive KV Cache Quantization” (2024)
  • “Unifying KV Cache Compression for Large Language Models with LeanKV” (2025)

Additional credits:

Contributions are welcome! Please open an issue or submit a pull request.

🧠 Configuration Recommendations

  • Best Overall: 🌟 K8V4 🌟 (8-bit keys, 4-bit values)

    • 59% memory reduction with only 0.86% quality loss
    • Improved inference speed (+5.7% vs FP16)
    • Great balance of quality and efficiency
  • Absolute Maximum Memory Savings: K4V4 (4-bit keys and values)

    • 72% memory reduction with ~6% quality loss
    • Good for memory-constrained devices
    • Acceptable for less sensitive applications
  • Best for Very Long Contexts: K8V4 or K4V4

    • Memory savings compound with context length
    • Run 2-3x longer contexts in the same memory budget

MIT

Contributions are welcome! Please open an issue or submit a pull request.

Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Help Power Techcratic’s Future – Scan To Support

If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.

As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!

BITCOIN

Bitcoin Logo

Bitcoin QR Code

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Scan the QR code with your crypto wallet app

DOGECOIN

Dogecoin Logo

Dogecoin QR Code

D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA

Scan the QR code with your crypto wallet app

ETHEREUM

Ethereum Logo

Ethereum QR Code

0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a

Scan the QR code with your crypto wallet app

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Share161Tweet101Share28
Previous Post

Systems Administrator/Manager Onsite

Next Post

Stellar Blade hits PC on June 11 with modest system requirements

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

GitHub – bloom42/markdown-ninja: Markdown-first CMS for bloggers, minimalists and startups. Open Source alternative to Substack, Mailchimp and Netlify
Hacker News

GitHub – bloom42/markdown-ninja: Markdown-first CMS for bloggers, minimalists and startups. Open Source alternative to Substack, Mailchimp and Netlify

June 11, 2025
1.3k
mgschwan/viture_virtual_display: Virtual display with Viture Pro XR glasses using hdmi in on an OrangePi
Hacker News

mgschwan/viture_virtual_display: Virtual display with Viture Pro XR glasses using hdmi in on an OrangePi

June 11, 2025
1.3k
The Hashtable Packing Problem
Hacker News

The Hashtable Packing Problem

June 11, 2025
1.3k
Tim Owens Jazz and Broadcast Collection Digitized by a Generous Grant by The Recording Academy’s GRAMMY Museum Grants Program – University Libraries
Hacker News

Tim Owens Jazz and Broadcast Collection Digitized by a Generous Grant by The Recording Academy’s GRAMMY Museum Grants Program – University Libraries

June 10, 2025
1.3k
John Graham-Cumming’s blog: Low-background Steel: content without AI contamination
Hacker News

John Graham-Cumming’s blog: Low-background Steel: content without AI contamination

June 10, 2025
1.3k
manaskamal/XenevaOS: The Xeneva Operating System
Hacker News

manaskamal/XenevaOS: The Xeneva Operating System

June 10, 2025
1.3k
Load More
Next Post
Stellar Blade hits PC on June 11 with modest system requirements

Stellar Blade hits PC on June 11 with modest system requirements

ADLEY the CAT DETECTiVE!! Cartoon Granny Lost her Cats! playing Roblox with Dad finding digital pet

ADLEY the CAT DETECTiVE!! Cartoon Granny Lost her Cats! playing Roblox with Dad finding digital pet

Dali’s V-16F subwoofer will break your back and your bank balance

Dali's V-16F subwoofer will break your back and your bank balance

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • AnandTech
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • Home
  • Apple
  • Gaming
  • Microsoft
  • AnandTech