TL;DR
The paper introduces Llama-Mobile, a framework that compresses the Llama 3.2 11B Vision Instruct model down to just 3.7 GB (2.7 bits per parameter) for efficient deployment on mobile Arm CPUs. By combining a novel weight-packing format called S3D8 with a data-free Quantization-Aware Training (QAT) pipeline, the authors achieve sub-3-bit compression while maintaining strong performance on visual question-answering tasks without needing access to the original training data.
What Problem Does This Paper Address?
Vision-Language Models (VLMs) are incredibly capable, but their massive memory and compute footprints make mobile deployment a massive headache. While quantization (reducing weight precision) is a standard solution, compressing models below 3 bits per parameter typically causes severe performance degradation.
To fix this, researchers usually turn to Quantization-Aware Training (QAT). However, standard QAT requires access to the original training dataset and pipeline, which are often proprietary or too massive to manage. Existing data-free alternatives work well for text-only models but struggle to maintain the delicate balance of multimodal instruction-following required by VLMs.
Methods
The authors tackle these constraints with a two-part hardware-software co-design:
1. The S3D8 Format (Signed 3D 8-bit)
Instead of standard scalar quantization, the authors propose a vector quantization format that packs three signed weights into a single byte.
- How it works: Each byte contains a shared 5-bit centroid index (pointing to a lookup table of 32 absolute-value vectors) and 3 individual sign bits (one for each weight).
- Hardware Optimization: During inference, the format leverages the 64-entry vector table lookup (
TBL) instruction available on Arm CPUs. By clever bit-packing, it requires only 5 logical instructions to decode 48 elements directly into INT8 format, bypassing complex alignment or padding overhead.
2. Synthetic QAT Data Pipeline
To perform QAT without the original training data, the framework uses a "data-free" knowledge distillation approach where the unquantized model acts as a teacher:
- Image Source: They pull raw, diverse images from ImageNet.
- Prompt Generation: Instead of static prompts, they implement a randomized prompting strategy that mixes generic questions, instruction templates, and length constraints.
- Distillation: The teacher VLM generates responses to these images and prompts. The quantized student model is then trained to minimize the Kullback-Leibler (KL) divergence between its token predictions and the teacher's.
Datasets
- Training/Generation: ImageNet (1.28 million images) was used strictly as a source of diverse natural images to seed the synthetic prompt-generation pipeline.
- Evaluation: The framework was evaluated on 1024-example subsets of four standard visual question-answering benchmarks: VQAv2, ChartQA, DocVQA, and AI2D.
Key Insights and Ideas
- Prompt Diversity is Non-Negotiable: One of the biggest "aha" moments was that using a fixed prompt like "Describe the image:" during synthetic data generation causes downstream task performance to crater. VLMs need to be exposed to a wide variety of instruction styles during distillation to retain their generalization capabilities.
- Output Channel Packing: Standard quantization formats pack weights that are consecutive along the reduction axis (input channels). S3D8 packs elements corresponding to consecutive output channels. This design choice eliminates the need for expensive interleaving or unzipping instructions inside the execution kernel.
- Vector Quantization Wins at Low Bit-Widths: At sub-3-bit levels, uniform integer quantization (INT) breaks down. Short vector quantization (like S3D8) provides a fundamentally superior rate-distortion trade-off by shaping centroids to match the actual weight distribution.
Key Results
The authors evaluated their approach by quantizing the Llama 3.2 11B Vision Instruct model (originally 21.3 GB in bfloat16) down to 3.57 GB (2.68 bits per parameter).
- Accuracy Retention: The S3D8 + QAT model achieved an average task score of 0.661 across the benchmarks, compared to the original model's 0.744. This significantly beats size-matched scalar baselines like INT3 (0.347) and Lloyd-Max (0.436).
- On-Device Speed: On a commercial smartphone (Google Pixel 8a, using 5 cores), the S3D8 implementation achieved a text decoding speed of 3.8 tokens/second.
- Server CPU Speedup: On an AWS Graviton4 server CPU, S3D8 hit 36.8 tokens/second, outperforming plain INT8 (26.4 tokens/s). Because the model is memory-bandwidth bound during generation, reading 1/3 fewer bytes from memory yielded a direct performance uplift.
Limitations and Future Work
While promising, the authors note a few limitations:
- Hardware Specificity: S3D8 is highly optimized around the Arm architecture's 64-entry table lookup decoder. Porting this efficiently to other CPU architectures or GPUs would require specialized kernel redesigns.
- Scope: The evaluation was restricted to a single model family (Llama 3.2 11B).
- Data Optimization: The prompt and image selection strategy for generating the synthetic dataset was heuristic; further optimization of the synthetic data mix could bridge the remaining accuracy gap.
Summary updated