What is CPU inference?
CPU inference is running an AI model on a processor and system memory alone, without a GPU or other accelerator; for language models it is usually done with quantised small and mid-sized models.
Unlike CPU offloading, where computation mostly stays on the GPU while system memory is extra storage, CPU inference does all computation on the processor. It is slower than a GPU but makes running a model possible where no GPU exists.
- Topic
- Inference and performance
- Also known as
- CPU-only inference
How CPU inference works
- Model weights load into system memory, often with low-bit quantisation to cut memory needs.
- Matrix multiplications run on the processor's vector instructions and multi-core parallelism.
- The decode phase reads all weights for every token, so speed depends largely on system memory bandwidth.
- Processing long prompts is compute-heavy, so core count and processor speed set time to first token.
In more detail
Matrix units in CPUs: Intel AMX and ARM SME
Modern server and client CPUs go beyond basic SIMD vector units (AVX2/AVX-512/NEON) by integrating dedicated matrix-multiply accelerators such as Intel AMX (Advanced Matrix Extensions) and ARM SME. These hardware tiles dramatically accelerate the compute-bound prefill stage for INT8 and BF16 workloads, narrowing time-to-first-token gaps on long prompts.
NUMA topology and memory channel saturation
Dual-socket enterprise servers use Non-Uniform Memory Access (NUMA), where each CPU socket owns local DDR5 memory channels. Running a single model instance carelessly across sockets triggers cross-socket interconnect bottlenecks; pinning threads and weights per NUMA node and populating all memory channels evenly maximise effective bandwidth.
1.58-bit ternary models and small mixture of experts models
Two developments significantly expand CPU viability: 1.58-bit ternary models (such as BitNet b1.58 with lookup-table kernels) and small sparse Mixture-of-Experts (MoE) models. Because a small MoE reads only its active subset of parameters from system RAM per token, it achieves far higher decode speeds on CPU than a dense model of the same total size.
Commonly confused terms
| Term | How it differs |
|---|---|
| Edge and NPU inference | Edge / on-device inference refers to running models locally on client devices (laptops, phones, IoT) that often include integrated NPUs or mobile GPUs, whereas enterprise CPU inference specifically targets GPU-less servers and air-gapped data centres relying solely on x86/ARM server CPUs. |
| Quantisation | Low-bit quantisation is a model compression technique (reducing weights from 16-bit to 4-bit or ternary), whereas CPU inference is the execution target; quantisation is typically a prerequisite for practical CPU LLM inference because it cuts memory-bandwidth pressure. |
Why CPU inference matters for on-premises AI
CPU inference lets small models run without data leaving the organisation in in-house environments with no GPU or with GPUs reserved for other work, such as air-gapped networks or branch servers. It can suffice for classification, short summaries, embedding generation and assistants with few users. With large models and multi-user chat, speed and concurrency often fall short, so hardware decisions are made alongside target response time and user count.
A public body runs a quantised small language model on its existing servers' processors to classify incoming correspondence by department on an air-gapped network with no GPUs; speed suffices for its daily volume.
Common questions
Which tasks is CPU inference enough for?
Often for classification, short summaries, embedding generation and assistants with few users, using small, quantised models.
What sets speed in CPU inference?
For text generation, mostly system memory bandwidth; for processing long prompts, core count and processor speed.
Related terms
Sources
- Shen et al., Efficient LLM Inference on CPUs, 2023
- Pope et al., Efficiently Scaling Transformer Inference, 2022
In the glossary: Glossary, A to C