Large Language Models (LLMs) are the heavyweights of the tech world—brilliant, but incredibly resource-hungry. Deploying a model like GPT-3 or LLaMA on a smartphone or an "edge" device is a nightmare because these models rely on billions of dense multiplications. In the world of computer hardware, multiplication is expensive; it consumes significant energy, takes up physical space on a chip, and creates latency bottlenecks.
The researchers behind ShiftAddLLM have proposed a radical "diet" for these models: what if we could get rid of multiplications entirely? By reparameterizing pretrained LLMs to use only bitwise shifts and additions, they’ve managed to slash memory and energy usage by over 80% without the need for expensive retraining.
TL;DR
ShiftAddLLM is a post-training method that replaces costly multiplications in LLMs with hardware-efficient bitwise shifts and additions. By optimizing for both weight and activation accuracy and using an automated bit-allocation strategy, it achieves significantly better performance than standard 2-bit or 3-bit quantization while drastically reducing energy and memory footprints.
What Problem Does This Paper Address?
The primary bottleneck in LLM deployment is the Multiply-Accumulate (MAC) operation. In hardware (like a 45nm CMOS chip), a floating-point multiplication can consume 30x more energy and 20x more area than a simple addition.
While "quantization" (reducing the precision of numbers) helps, standard low-bit quantization (like 2-bit) often causes a massive drop in model "intelligence" (measured as perplexity). Furthermore, existing "multiplication-less" models usually require training from scratch—a feat that is computationally impossible for most researchers working with massive, pretrained models. ShiftAddLLM solves this by providing a post-training solution that can be applied directly to existing models.
Methods
The authors introduce three main innovations to make multiplication-less LLMs a reality:
1. Shift-and-Add Reparameterization
They use Binary-coding Quantization (BCQ) to turn weight matrices into a sum of binary matrices scaled by factors. Crucially, they quantize these scaling factors to Powers of Two (PoT). In binary math, multiplying by a power of two is just a "shift" (moving bits left or right), and the binary weights turn the rest of the operation into simple additions facilitated by Look-Up Tables (LUTs).
2. Multi-Objective Optimization
Standard quantization usually only tries to make the new weights look like the old weights. ShiftAddLLM goes further by minimizing the error in the output activations. This is vital because LLMs often have "outlier" activations—specific values that are much larger than others—which can break a model if not handled carefully.
3. Automated Bit Allocation
Not all layers in a model are equally important. The researchers developed a strategy to automatically detect which layers are sensitive. Sensitive layers (like the Query/Key layers in attention blocks) get more bits, while robust layers get fewer, optimizing the trade-off between speed and accuracy.
Key Insights and Ideas
- The "Aha" Moment on Energy: The paper highlights that a 32-bit integer shift uses roughly 0.13 pJ of energy, while a 32-bit float multiplication uses 3.7 pJ. By moving to shifts and adds, you aren't just making the model smaller; you are fundamentally changing the energy physics of the computation.
- Activation Awareness is King: By focusing on the output of a layer rather than just the weights, the method compensates for the "outlier" problem that plagues other 2-bit quantization methods.
- Heterogeneity Matters: The discovery that later layers in a transformer block are more sensitive to reparameterization allowed the team to use "mixed-precision" effectively, squeezing out more efficiency than a "one-size-fits-all" bit-width approach.
Datasets and Evaluation
The researchers validated their approach across five major LLM families:
- Models: OPT, LLaMA-1, LLaMA-2, LLaMA-3, Gemma, Mistral, and BLOOM.
- Evaluation: They used WikiText-2 to measure perplexity (how well the model predicts text).
- Downstream Tasks: They tested zero-shot accuracy on eight standard benchmarks, including ARC, BoolQ, PIQA, and MMLU, to ensure the "shrunken" models still actually understood the tasks.
Key Results
- Superior Accuracy: Compared to the most competitive 2-bit and 3-bit quantized LLMs (like OPTQ or QuIP), ShiftAddLLM reduced average perplexity by 5.6 points at 3-bit and a staggering 22.7 points at 2-bit precision.
- Massive Savings: The method achieved more than 80% reduction in memory and energy consumption compared to the original FP16 models.
- Speedups: On an NVIDIA A100 GPU, their custom kernels provided up to 3.37x throughput improvement over standard baselines at a batch size of 8.
- Zero-Shot Success: On tasks like MMLU, ShiftAddLLM at 3-bit precision actually outperformed some 16-bit floating-point baselines in specific configurations, proving that you don't need high precision for high performance.
Limitations and Future Work
While the results are impressive, the authors note a few hurdles:
- Kernel Dependency: To see the actual latency speedups on a GPU, you need highly optimized CUDA kernels. While they developed these for their "Ours (Lat.)" version, their most accurate version ("Ours (Acc.)") currently lacks a similarly fast kernel.
- Hardware Specifics: The energy savings are currently estimated based on hardware simulators (like Eyeriss). Real-world savings will depend on the specific architecture of the chip running the model.
- Scope: The current work is tailored specifically for LLMs. Future work could explore applying these multiplication-less primitives to other domains like computer vision or speech recognition.
Check out the code and models: https://github.com/GATECH-EIC/ShiftAddLLM
Summary updated