Local AI Inference Physics: Performance, Speed, and Impact on Intelligence
1. Speed Physics: Prompt Prefill (Compute-Bound) vs. Token Generation (Bandwidth-Bound)
Running local LLMs via **Apple MLX**, **llama.cpp**, **Ollama**, or **LM Studio** consists of two distinct mathematical phases:
1. **Prompt Processing / Prefill (Time-to-First-Token, TTFT)**: Reads your input prompt or codebase in parallel matrix-matrix multiplications (`GEMM`). This stage is **GPU compute-bound**. With up to 80 GPU cores and per-core M5 neural matrix accelerators, the Mac Studio M5 Ultra processes an 8,192-token document prompt at **~2,800 to 3,600 tokens/sec**, compared to **~850 to 1,150 tokens/sec** on the 20-core GPU Mac mini (**~3.1x faster TTFT**).
2. **Autoregressive Token Generation (Tokens/Second)**: Every single output token requires streaming the entire active model weight matrix from unified RAM through the GPU registers (`GEMV`). Consequently, maximum token generation speed is governed by the physical law:
`Max Tokens/Sec β (Effective Memory Bandwidth in GB/s) / (Active Model Weights in GB)`
- At **819 GB/s**, the Mac Studio M5 Ultra generates tokens **2.65x to 2.95x faster** than the Mac mini (`273β307 GB/s`) on every identical model.
2. Does Hardware Choice Impact AI Model Intelligence?
1. **Higher Quantization Precision on 70Bβ72B Frontier Models (`Q8_0` vs. `Q4_K_M`)**:
- On the **64 GB Mac mini**, a 70B/72B model (`Llama 3.3 70B` or `Qwen 2.5 72B`) *must* be compressed to **4-bit (`Q4_K_M`, ~42.5 GB)** to fit alongside a KV cache. While 4-bit preserves ~96% of general chat ability, multi-step coding, subtle syntax refactoring, and long-chain mathematical proofs suffer measurable perplexity degradation (`+0.08 to +0.14 WikiText-2 PPL`) compared to 8-bit.
- On the **96 GB Mac Studio**, that exact same 70B/72B model runs at **8-bit (`Q8_0`, ~74 GB)** or **6-bit (`Q6_K`, ~58 GB)**, which is mathematically indistinguishable from unquantized `FP16` (`<0.004 PPL delta`).
2. **Access to Larger Parameter Classes (`104Bβ123B Dense` & `109B MoE`)**:
- The 96 GB Mac Studio can run **Mistral Large 2 (123B)** at `4-bit (~69 GB)` or **Command R+ (104B)** at `4-bit (~60 GB)`. On the 64 GB Mac mini, a 123B model can only fit if crushed down to **2-bit / 3-bit (`IQ2_XS` / `Q3_K_S`)**, which severely degrades reasoning coherence and causes hallucinations.
3. **Uncompromised Long-Context KV Cache (`64Kβ128K` Context vs. `8Kβ16K`)**:
- At 70B parameters, an unquantized `FP16` 32,768-token KV cache consumes **~10.5 GB of RAM**. On the 64 GB Mac mini running a 42.5 GB 70B model, expanding context past 16Kβ24K tokens forces KV-cache quantization (`q4_0` KV cache) or triggers SSD swap thrashing. The 96 GB Mac Studio holds a 70B `Q6_K` model plus a full **64Kβ128K context window** entirely in high-speed unified RAM.