Quantization's Impact: Shrinking LLM Memory Footprints

llama.cpp's 4-bit quantization can reduce a 7B parameter model's memory from 14 GB to just 4 GB, a 70-75% reduction, while KV cache quantization further cuts memory usage by up to 50% during generation.

The top 3

  1. 8-bit vs. 4-bit: Quantization's Memory & Accuracy Trade-offs: 8-bit quantization typically reduces LLM memory footprint by 50% with minimal quality loss, often less than 1% accuracy drop. 4-bit quantization can cut memory by 75%, but may incur a 2-5% accuracy degradation, though techniques like AWQ or GPTQ can achieve 98.9% accuracy recovery. Below 4 bits, such as 2-bit or 3-bit, performance degradation becomes significantly more noticeable.
  2. Top 3 Advanced Quantization Methods for LLM Quality: Among advanced post-training quantization techniques, GPTQ excels by using error-aware rounding to minimize accuracy loss in 4-bit models. AWQ (Activation-Aware Weight Quantization) identifies and preserves the precision of crucial weights, offering better accuracy for lower bit-depths. QLoRA, while not solely an inference method, enables efficient fine-tuning of 4-bit quantized models by combining them with 16-bit adapters.
  3. LLM Memory Footprint: Quantization's Dramatic Reductions: Quantization dramatically shrinks LLM memory usage, enabling deployment on consumer hardware. For example, a Llama 3.1 8B model's 16 GB footprint can be reduced to 8 GB with 8-bit quantization and further to approximately 4 GB with 4-bit quantization. A 70B parameter model, when quantized to 4-bit, can see its raw weight footprint reduced to about 32.6 GiB, allowing it to run on a 40-48 GB class GPU or consumer RTX 4090 cards with appropriate settings.

Sources

Open the full topic