[Paper Review] Efficient LLM Inference on CPUs
The paper introduces an automatic INT4 weight-only quantization flow and a CPU-optimized LLM runtime to accelerate inference on CPUs, achieving fast per-token latency with minimal accuracy loss. It demonstrates results on LLMs from 3B to 20B parameters with single-socket 4th Gen Intel Xeon processors.
Large language models (LLMs) have demonstrated remarkable performance and tremendous potential across a wide range of tasks. However, deploying these models has been challenging due to the astronomical amount of model parameters, which requires a demand for large memory capacity and high memory bandwidth. In this paper, we propose an effective approach that can make the deployment of LLMs more efficiently. We support an automatic INT4 weight-only quantization flow and design a special LLM runtime with highly-optimized kernels to accelerate the LLM inference on CPUs. We demonstrate the general applicability of our approach on popular LLMs including Llama2, Llama, GPT-NeoX, and showcase the extreme inference efficiency on CPUs. The code is publicly available at: https://github.com/intel/intel-extension-for-transformers.
Motivation & Objective
- Motivate efficient deployment of large language models (LLMs) on CPU hardware.
- Propose an automatic INT4 weight-only quantization flow leveraging Intel Neural Compressor.
- Develop a CPU-tuned tensor library and LLM runtime with optimized kernels.
- Demonstrate accuracy and performance across popular LLMs (3B–20B) on 4th Gen Intel Xeon processors.
Proposed method
- Automatic INT4 quantization flow using Intel Neural Compressor with support for GPTQ, SignRound, AWQ, TEQ, RTN and tunable granularity (group sizes like 32, 64, 128, ... 1024).
- Generation of high-quality INT4 models with accuracy loss <1% relative to FP32 baseline.
- A CPU-focused tensor library inspired by ggml supporting INT4 kernels across ISA ranges (AVX2, AVX512, AVX512_VNNI, AMX) and dynamic input quantization.
- LLM runtime design with KV-cache optimization and a CPU-tensor backend enabling efficient decoder-only transformer inference.
- Evaluation against open-source LLMs (3B–20B) on 4th Gen Intel Xeon scalable processors, comparing against ggml-based implementations.

Experimental results
Research questions
- RQ1Can automatic INT4 quantization produce INT4 models with negligible accuracy loss (<1%) compared to FP32 Baseline across diverse LLMs?
- RQ2How does a CPU-optimized LLM runtime perform in latency for next-token generation on CPUs compared to a ggml-based baseline?
- RQ3What are the practical latency and accuracy gains when deploying 3B–20B parameter LLMs on single-socket 4th Gen Intel Xeon CPUs?
- RQ4What specific CPU-kernel and KV-cache optimizations contribute most to LLM inference speed on CPUs?
Key findings
- INT4 models achieve accuracy within <1% of FP32 baselines across multiple LLMs (e.g., GPT-J 6B, Llama-2 7B, Llama 7B, GPT-NeoX 20B, Falcon 7B).
- LLM runtime outperforms ggml-based solutions by up to 1.6x for group size 128 and 1.3x for group size 32 in next-token latency.
- Generation latency on CPU hardware ranges from 20 ms to 80 ms per token for 6B–20B models on a single socket of 4th Gen Intel Xeon Scalable processors.
- An end-to-end pipeline combining automatic INT4 quantization and CPU-tuned runtime yields efficient LLM inference with preserved accuracy on CPUs.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.