Local LLM Inference Speedup: A Practical Guide to Capacity Planning and Speculative Decoding
This guide explains how to run large language models locally on a unified-memory machine, focusing on the real bottleneck: memory capacity and bandwidth rather than peak compute. It walks through capacity estimation for a 284B-parameter 4-bit model on a 192GB system, how draft models and multi-token prediction accelerate generation through speculative decoding, which metrics to track (first-token latency, steady-state throughput, and long-run stability), a reproducible benchmarking workflow, and notes on quantization and runtime selection. Readers will get a practical checklist for choosing model size, validating speedup gains, and building repeatable baselines for on-premise AI workloads.
\n## 1. Why Local LLM Inference Is Back in Focus\n\nOver the past two years, the dominant form of LLM inference has been centralized cloud services: requests go to a remote cluster and results come back. But requirements such as keeping internal enterprise data within the network, compliance auditing, offline environments, and predictable long-term cost have made “running the model in your own server room” a realistic option again. The core constraint of local inference has never been peak compute; it is memory capacity and memory bandwidth. Model weights, the KV cache, context, and the runtime framework all need to stay resident in memory, and if capacity is insufficient, the model cannot even start.\n\nRecently emerged unified memory architectures let the CPU and the accelerator share the same large address space, eliminating explicit copies between host memory and video memory. The significance is that configurations above 128GB become possible, allowing a quantized model with more than 200B parameters to stay resident on a single machine. This article uses a desktop host equipped with 192GB of unified memory and an integrated high-performance accelerator as the observation target, discussing capacity planning and acceleration methods for local inference.\n\n## 2. Capacity Is the First Threshold: Do the Math Before Chasing Speed\n\nThe first step in any local deployment is capacity accounting, not benchmarking. Take a 284B-parameter model with 4-bit quantization as an example: the weights alone occupy roughly 140GB; in practice, the accelerator-side reading after startup is about 129GB, rising to about 140GB once a draft model is added. The remaining capacity must cover:\n\n- The context KV cache (grows linearly with concurrency and context length);\n- The runtime and computation graph of the inference framework itself;\n- The draft model / multi-token prediction head;\n- The operating system and file cache.\n\nA reusable estimation formula:\n\ntext\nTotal demand ≈ weights(parameters × bytes per parameter) + KV cache + runtime overhead + draft model + system reserve\n4-bit approximation: ~0.5 Byte per parameter, plus 5%~10% quantization metadata\nRecommend reserving ≥ 8%~12% of total capacity for the system\n\n\nThe conclusion is straightforward: only at the 192GB tier does “main model + acceleration components resident simultaneously” turn from paper into something feasible. When capacity planning falls short, the typical symptoms are failure during the loading stage or frequent paging that causes throughput to fall off a cliff.\n\n## 3. Draft Model Acceleration: The Engineering Essence of Speculative Decoding\n\nA draft model (or a multi-token prediction head built into the model) follows the idea of speculative decoding: a lightweight component first guesses several tokens, then the main model verifies them all in parallel at once; accepted tokens are adopted directly, and rejected ones are rolled back and recomputed. It does not reduce the main model’s computation; instead, it turns “token-by-token serial” generation into “batch verification,” which yields especially clear benefits in the memory-bandwidth-bound local scenario.\n\nMeasured data reflects this: a certain 284B-class quantized model improved generation speed from about 17 tokens/s to about 26 tokens/s, an increase of about 53%; another 125B-class model with a multi-token prediction head averaged about 34 tokens/s. The first-token latency for both stayed in the 0.4–0.5 second range.\n\nThree points need attention in practice:\n\n1. Acceptance rate determines the gain. The closer the draft and main model distributions are, the higher the acceptance rate; when the distributions differ greatly, it instead introduces extra overhead.\n2. The draft model also consumes capacity. It must share the same address space as the main model, so capacity planning must deduct it in advance.\n3. Prompts affect comparability. Benchmarks should fix the same prompt and the same output length; otherwise the speed numbers are meaningless.\n\n## 4. Benchmarking Methodology: Breaking “Fast” into Comparable Metrics\n\nLocal inference experience is determined by at least three metrics together, and looking at any single one leads to misjudgment:\n\n| Metric | Meaning | Influencing factors |\n| —- | —- | —- |\n| First-token latency | Time from request to first output | Weight loading, prefill length, memory bandwidth |\n| Generation throughput | Steady-state tokens output per second | Bandwidth, batch size, draft acceptance rate |\n| Long-run stability | Degradation over long time / long context | Cooling, power profile, KV cache management |\n\nRecommended benchmarking workflow:\n\ntext\n1. Fix the hardware power/performance profile and record ambient temperature\n2. Pre-download model files to avoid triggering network IO during the benchmark\n3. Unify the prompt and output length (e.g., require outputting the full text of the same long article)\n4. Test separately: main model only / main model + draft model\n5. Repeat each configuration 3 times, take the median, and record video memory / memory usage\n6. Record first-token latency and steady-state throughput together\n\n\nOnly by recording the power profile, quantization format, and context length together does the data have reproducible value.\n\n## 5. Quantization and Framework Selection\n\n4-bit quantization is the current cost-performance sweet spot for local deployment: capacity drops to about a quarter of half precision, and the accuracy loss is acceptable for most generation tasks. More aggressive low-bit schemes can fit larger models, but quality regression must be evaluated. At the framework level, the common practice is to choose a runtime that supports unified memory, supports speculative decoding and multi-token prediction, and can directly load common quantization formats, avoiding lock-in to a single hardware ecosystem.\n\nIf you go the cloud route, the same general-purpose capabilities can handle it: object storage holds model files, a container platform hosts inference services, logging and monitoring/alerting track latency and throughput, and a message queue smooths request peaks. Baidu AI Cloud offers corresponding product categories for these general capabilities, which can be combined as needed.\n\n## 6. Interfaces and Deployment Form\n\nFor local AI devices that are fixed in place and shared over a LAN, the point of interfaces is “connection” rather than “mobility”: multiple general-purpose serial interfaces for peripherals and debugging, a high-bandwidth network interface for multi-machine coordination and data synchronization, and video output and audio interfaces for local interaction terminals. Combining these interfaces with the inference service yields a model service node usable within the intranet.\n\n## 7. Implementation Checklist\n\n- Work backward from capacity to determine the feasible model size before discussing speed optimization;\n- Prioritize validating the throughput gain from speculative decoding while monitoring the acceptance rate;\n- Fix benchmarking conditions and establish a reproducible baseline;\n- Long-run testing cannot be skipped; power profile and cooling directly determine sustained output;\n- For data-not-leaving-the-network scenarios, prefer local deployment, and consider cloud general-purpose capabilities to supplement elastic peak demand.\n\nOverall, large-memory unified architecture turns “running a very large parameter model on a single machine” into an engineering problem rather than a conceptual one; combined with speculative decoding techniques such as draft models, local inference throughput can already satisfy many intranet business scenarios. The real tuning space still lies in three things: capacity planning, quantization selection, and benchmarking discipline.
