TL;DR
FreeToken is an edge-native inference engine designed to run frontier-scale Mixture-of-Experts (MoE) models—up to a massive 753 billion parameters—directly on consumer hardware like laptops and gaming desktops. By dynamically balancing execution across available CPU, GPU, and PCIe resources based on real-time bandwidth profiling, it achieves up to a 2.3x throughput speedup over existing edge frameworks. Crucially, it introduces semantic-aware caching to eliminate the severe multi-second latency spikes common in multi-turn AI agent workflows.
What Problem Does This Paper Address?
While open-weight large language models (LLMs) are rapidly closing the capability gap with proprietary giants, running them still practically requires million-dollar datacenter GPU clusters. Mixture-of-Experts (MoE) architectures offer a potential solution for local deployment because they only activate a small fraction of their parameters (experts) for any single token.
However, consumer devices lack the VRAM required to hold the entire pool of experts simultaneously. Existing edge serving frameworks (like llama.cpp or KTransformers) rely on static offloading strategies—pinning some experts to the GPU and leaving the rest on the CPU. This approach fails to handle the dynamic routing of MoEs, suffers from massive PCIe bottlenecks during prompt processing, and falls flat when faced with real-world AI agent workloads where context windows grow and change dynamically across multiple turns.
Methods
FreeToken completely re-architects the local serving stack around the realities of consumer hardware and agentic workloads using three core techniques:
- Bandwidth-Adaptive Execution: Instead of treating hardware limits as static bottlenecks, FreeToken profiles the machine's host-memory bandwidth ($B_H$) and PCIe transfer bandwidth ($B_P$) at deployment. During the prompt prefill phase, it uses full-layer double buffering to stream the next layer's experts over PCIe while the GPU computes the current layer. During token decoding, it applies a closed-form mathematical policy ($q^*$) to dynamically split expert cache misses between PCIe streaming (for GPU execution) and direct CPU execution, maximizing total hardware utilization.
- Semantic-Aware Caching: AI agents frequently edit context history (e.g., deleting intermediate "thinking" blocks or truncating old tool outputs). FreeToken anchors recurrent-state checkpoints at semantic boundaries (special tokens like
<think>or<tool_call>). When an agent modifies history, FreeToken resumes from the nearest surviving semantic anchor, saving thousands of tokens of redundant re-computation. For decoding, a shared Least Recently Used (LRU) expert cache captures token-to-token routing locality. - Elastic Edge Resource Management: Because consumer devices run concurrent applications (browsers, games), VRAM availability fluctuates. FreeToken can dynamically resize and rebuild its GPU expert cache at runtime scheduler safe points without needing to restart the engine or reload weights from disk.
Datasets & Workloads
Rather than relying on simple single-turn benchmarks, the authors evaluated FreeToken using four highly realistic, multi-turn agentic scenarios:
- W1 (Math Reasoning): AIME competition problems utilizing long chain-of-thought decoding without tools.
- W2 (Coding Agent): SWE-bench repository issues solved via the OpenCode harness over three turns.
- W3 (Coding Agent, Native Protocol): Complex software engineering tasks driven by Claude Code, spawning concurrent subagents and growing contexts up to 65k tokens.
- W4 (Email/Calendar Agent): A 13-turn mailbox automation workflow via OpenClaw carrying a large system context.
Models evaluated: Qwen3.6-35B-A3B, DeepSeek-V4-Flash (284B parameters), and GLM-5.2 (753B parameters).
Key Insights and Ideas
- The Prefill Sparsity Illusion: While MoE models are sparse at the individual token level, processing a long prompt (prefill) touches almost every expert in a layer. FreeToken recognizes that prefill is entirely an I/O transfer bottleneck and successfully hides it behind GPU computation using pipelined layer loading.
- Co-Execution Beats Pure Offloading: Traditional systems treat an expert cache miss as a binary choice: either wait to transfer it to the GPU or execute it entirely on the CPU. FreeToken proves that the optimal approach is a hybrid split that saturates the PCIe link while simultaneously utilizing the remaining host memory bandwidth for concurrent CPU execution.
- Agents are Context-Changers: Standard KV-caches assume text is strictly appended. Because agent frameworks actively slice and dice prompt history, caching at arbitrary token intervals is highly inefficient. Caching specifically at semantic anchors is the key to preventing massive time-to-first-token (TTFT) delays.
Key Results
- Throughput Speedups: On an NVIDIA RTX 5090, FreeToken sustains 77–83 tok/s on Qwen3.6-35B and 22–25 tok/s on DeepSeek-V4-Flash, outperforming state-of-the-art edge engines by 1.5x to 2.3x.
- Eliminating Tail Latency Stalls: FreeToken kept the worst-case TTFT below 44 seconds across all agent workloads. In contrast, competing baselines frequently stalled for over 150 seconds (and up to 946 seconds), long enough to trigger client application timeouts.
- Hardware Democratization: FreeToken shifts the boundaries of what local hardware can practically serve:
- Runs a 35B model at 39.3 tok/s on a modest 8GB RTX 4060 laptop.
- Serves a 284B model interactively on a 32GB gaming desktop.
- Serves the massive 753B GLM-5.2 model at 14.9 tok/s on a single workstation GPU.
Limitations and Future Work
- OS and Driver Restrictions: FreeToken's high-speed execution path relies heavily on pinning host memory for direct DMA transfers over PCIe. On certain operating systems or specific driver configurations where memory pinning fails, the system must fall back to a slower, pageable pure-CPU MoE backend.
- Static Bandwidth Profiling: The bandwidth parameters used to calculate the optimal CPU/GPU work split ($q^*$) are empirically profiled at engine deployment. If a user runs another highly memory-intensive background application during inference, these profiled baselines may shift, leading to slightly sub-optimal scheduling choices.
Summary updated