For anyone running language models locally, model size is only part of the story. Quantization determines whether weights fit in memory; the KV cache can grow to rival the model itself; and inference speed depends on whether a workload is processing a prompt or generating its answer. These mechanics explain why two models with similar parameter counts can behave very differently on the same hardware.
This guide focuses on text-based large language models (LLMs), including chat, coding and agent systems. The terms matter in practice: they help explain hardware requirements, benchmark results and the tradeoffs behind local model choices.
Models are learned relationships between tokens
An LLM is a statistical system trained on large collections of text, such as material from websites, books and transcripts. It works with tokens: units that can represent whole words, word fragments, code, punctuation or other symbols. The model uses learned relationships among tokens to predict what token should come next. Its output is produced as a sequence of those predictions.
The trained model contains parameters, commonly called weights. These numbers determine how strongly different patterns influence one another. For a simple illustration, the relationships that help predict the next part of “naval,” “nachos” or “Naruto” will differ. Training adjusts the weights; using a model to generate text doesn’t ordinarily change them. Changing the learned behavior requires further training or fine-tuning.
Model names often include parameter counts such as 4B, 8B or 20B, where “B” means billions of weights. Some frontier systems are described at the scale of trillions. A larger count can mean more capacity, but it doesn’t guarantee better answers. The learned patterns and how effectively the model uses them matter as much as the raw number.
Open-weight models, including examples such as Llama, DeepSeek and Kimi, make their weights available for download, subject to the terms set by their providers. That lets users run or adapt them if their hardware can handle the workload. Access to weights doesn’t reveal the full training data or process, and it isn’t the same as receiving open-source software.
Quantization makes weights fit more hardware
Data types describe how computers represent numbers. FP16 and BF16 use floating-point values with less precision than FP64; INT8 and INT4 use 8-bit and 4-bit integers. Lower-width formats can reduce memory demands and may run efficiently on supported hardware, while higher precision can preserve finer numerical detail. Which format is suitable depends on the workload.
Training generally needs higher precision than many users can afford to store for inference. Quantization reduces the precision of a model’s weights after training, roughly by rounding values into a smaller representation. The process involves tradeoffs: smaller weights can make a model practical on a consumer GPU or a system such as a Mac Studio, but reduced precision can affect output quality. The outcome depends on the model and quantization method.
Open-weight releases may offer several formats for the same model. Llama 3.3 70B, for instance, can be run in BF16 or in quantized INT4 variants. The smaller version uses less memory, potentially making local inference possible on less capable hardware. Model listings on Hugging Face commonly indicate these variants, so parameter count alone won’t tell you how much VRAM a particular download needs.
Context and cache set the memory budget
The context window is the token capacity available to a model during a session. It includes the conversation, system instructions, uploaded files and material retrieved from links or other sources. A million-token context window is common among frontier models, but the capacity consumes memory, and more context doesn’t automatically produce better results.
To the model, this information is processed as tokens in a shared sequence. The separation between instructions and supplied content is therefore an imperfect distinction; the model has to infer how each part should be treated. This helps explain why separating “data” from “code” is technically impossible to guarantee through token processing alone.
Models can also struggle to use information consistently across very long contexts. The “lost in the middle” effect describes a tendency for a model to attend more readily to material near the beginning or end than to details buried between them. A larger advertised window expands what can be supplied, but each model still has limits in how well it handles that material.
The KV cache stores intermediate key and value data produced while processing tokens. In a continuing conversation, the model can reuse that data instead of recalculating it for the existing history every time a new question or token arrives. This is especially useful as sessions grow: without a cache, previously processed tokens would need to be revisited repeatedly.
That convenience has a memory cost. The cache grows with the context and can consume more space than the model’s weights, particularly in long sessions. Quantizing cache data can lower its footprint, usually accepting some reduction in numerical precision. For local inference, the memory budget must account for both weights and cache; a fast SSD can serve as an overflow option, though keeping the cache in VRAM is preferable for speed.
Mixture-of-experts models activate selected parts
A mixture-of-experts (MoE) model contains multiple sub-models, or experts, alongside a router that chooses which ones to activate. During training, experts develop different token patterns. Despite the name, they aren’t necessarily specialists in human subjects such as programming or painting. Their distinctions come from learned relationships among tokens, not an explicit understanding of topic areas.
The practical appeal is that a model can contain many parameters while activating only a portion for each token. The router selects experts as generation proceeds, allowing the system to draw on a larger collection of learned patterns without running every part at every step. That can improve speed relative to activating the entire model, while the full collection of weights still takes memory to store.
Retrieval adds outside information to a prompt
Retrieval-augmented generation (RAG) supplies a model with relevant information at answer time. A chat application might search the web, company documents, email or spreadsheets, then add the retrieved text to the prompt. The model can use that context to answer questions about material it didn’t encounter during training or information that may have changed since then.
Search is often a multi-step process. A smaller model may draft the queries or determine what to look for in a connected account; the main model then receives the retrieved material as tokens. The benefit is richer context. The cost is that retrieved pages or documents can add hundreds of thousands of tokens to a prompt that otherwise contains only a fraction of that volume, increasing processing time and memory use.
Inference has two distinct phases
Inference is the process of using a trained model to generate a response. It begins with prefill: the system tokenizes and processes the input, including conversation history and any retrieved or uploaded material. Prefill handles input tokens in parallel, builds the KV cache and contributes heavily to the time before the first response token appears. That delay is commonly measured as time to first token (TTFT), alongside prefill throughput in tokens per second.
Decode follows. The model generates the response one token at a time, using the cache to account for earlier tokens. Because each new token depends on the preceding sequence, decode is sequential. It often depends more on memory bandwidth than raw compute: the hardware must repeatedly read model weights and cache data. Decode throughput is typically reported as tokens per second (TPS).
Speculative decoding tries to speed up that sequential stage. A smaller drafting mechanism proposes several tokens, then the main model checks them in a parallel pass. Accepted guesses reduce the work needed to generate those tokens; rejected guesses are discarded, with the main model’s output retained. Multi-token prediction (MTP), in which a model is trained to predict several upcoming tokens, can provide that draft mechanism.
For hardware comparisons, the useful question is therefore not simply how many parameters a model has. Prompt length affects prefill, context length drives cache use, quantization changes the weight footprint, and memory bandwidth shapes decode speed. Understanding those pieces gives a clearer picture of whether a model will fit, how quickly it will respond and what quality tradeoffs to expect.