UNDER THE HEATSINK
How silicon
becomes intelligence.
From a typed question to a streamed answer: the physics, memory and mathematics behind local AI. No engineering degree required.
The journey of a single answer.
Text → Tokens→Prompt processing→Next-token prediction→Repeat & decode text
A tokenizer turns text into numbered pieces. The transformer converts these into vectors, applies learned transformations and attention, then scores possible next tokens. A sampling rule chooses a token; that token joins the sequence and the process repeats until a stopping condition. This is inference: using learned weights, rather than retraining them.
01 / PARALLEL MATH
Why a GPU helps.
Neural networks repeatedly multiply matrices and apply nonlinear operations. A GPU has many execution units that work on pieces of these operations in parallel. Specialized matrix hardware accelerates supported low-precision formats.
A CPU still coordinates the program, loads data and runs other tasks. A fast GPU does not remove software overhead or make every task parallel.
02 / THE WORKSPACE
VRAM is capacity.
Dedicated GPU memory holds model weights, temporary buffers and the conversation’s attention cache. More VRAM lets you fit larger weights or longer contexts without spilling work to slower storage paths.
System RAM is separate on a typical desktop GPU. Offloading layers to CPU/RAM can make a model runnable, but it changes performance. Two 16 GB cards do not automatically behave like one 32 GB card.
03 / THE SUPPLY LINE
Bandwidth is movement.
GB/s describes how much data memory can move per second. In single-user dense-model decoding, repeatedly reading weights is often a bottleneck. Bigger memory and faster memory are different advantages.
Advertised TOPS measures arithmetic under particular precision and sparsity assumptions. It cannot directly tell you how quickly your chat will respond.
04 / SMALLER NUMBERS
Quantization buys room.
Representing weights with fewer bits reduces their storage footprint. A rough 14-billion-parameter weight-only calculation is 28 GB at 16 bits, 14 GB at 8 bits, or 7 GB at 4 bits.
Real formats add scales, metadata and mixed precision. Quality and speed depend on the scheme, model and kernel. Less memory use does not guarantee better output or universally higher speed.
05 / CONTEXT COSTS MEMORY
The KV cache remembers attention.
Keys and values from previous tokens are stored so the model does not recompute all of them every step. For a basic transformer cache, a useful sketch is:
2 × layers × KV heads × head dimension × cached tokens × bytes per value × sequences
The factor of two accounts for keys and values. Grouped-query attention reduces KV heads. Sliding windows, cache quantization and hybrid architectures change this model. A long advertised context window is a capability limit, not free memory.
06 / MIXTURE OF EXPERTS
Active is not total.
A mixture-of-experts model routes each token through a subset of expert networks. It can use fewer active parameters per token than its total parameter count suggests.
But the total weights still need storage or an explicit expert-offloading strategy. A “30B with 3B active” model should not be sized like a dense 3B model.
07 / SOFTWARE IS THE BRIDGE
CUDA, ROCm and other backends.
The runtime translates a model’s operations into GPU kernels. CUDA targets NVIDIA; ROCm supports selected AMD configurations. Other paths include Vulkan and Intel-focused runtimes.
Support depends on the exact GPU, application, OS, driver and model operators. A GPU may have enough VRAM yet still lack an efficient supported path.
08 / GAMES HAVE A DIFFERENT JOB
FPS is not AI throughput.
A game transforms geometry, shades pixels, traces rays and composites frames. Resolution, effects and CPU simulation shape frame time. AI inference has different memory and numerical workloads.
Upscaling reconstructs an image; frame generation synthesizes intermediate frames. Displayed FPS can rise without an equivalent gain in game simulation rate or input responsiveness. Compare native frames and latency alongside feature support.