You Don't Need 512 GB of RAM

Most consumer PCs sit at 16–64 GiB; the paper's frontier MoE is 155 GiB at FP4. Engines keep VRAM and RAM apart, so the SSD supplies 86–99% of their prefill expert traffic. Tideway pools them: 1.97×.

11 min中文版
local-llmmoememoryinference
Cover for the English essay, You Don't Need 512 GB of RAM

No benchmarks of our own here. The numbers come from arXiv 2611.14848 ("Tideway", Duke University, Nov 10, 2026) and the authors' open-source code. It is a preprint: we found no independent reproduction, and two of the four baselines are the authors' reimplementation of mechanisms, not the original systems. Anything we computed ourselves is labeled.

Paper: arXiv 2611.14848 | Code: Afterglow231/Tideway

A machine with 64 GiB of RAM and a 32 GB GPU is reading a 32K-token prompt.

Its RAM can hold 44% of the expert weights, yet once prefill finishes, 86–99% of the expert traffic comes from the SSD.

This is where that 86–99% comes from — and why the same memory runs 1.97× faster under a different memory manager.

Some terms first. MoE (mixture of experts) splits each layer's feed-forward network into many small "experts" and routes each token to a few of them. Prefill is the phase that reads the prompt; decode is the phase that emits tokens one at a time. TTFT is the time to first token and TPOT the time per output token; the KV cache is the attention state that grows with the conversation, and a CUDA Graph is a captured sequence of GPU kernels that can be replayed without re-dispatching from the CPU.

Those 44% barely did any work. And this is not one engine being sloppy: all four baselines (FreeToken, llama.cpp, FlashMoE, SSD-LLaMA) fall into the same hole.

The problem is not that the model is too big. It is that they treat memory as three caches that never talk to each other. VRAM caches RAM, RAM caches the SSD, and each tier runs its own replacement policy — mostly LRU (least recently used), a learned policy in FlashMoE, and in llama.cpp the OS mmap (page granularity, which thrashes once it reaches the SSD).

Start with the bill.

Start with the bill: 512 GiB of RAM costs $41,000

The largest model in the paper is DeepSeek-V4-Flash. Even stored in FP4, it is 155 GiB.

Now look at the machines people actually own. The paper pulls four 2026 datasets: prebuilt desktop quotes, 3DMark submissions, BOINC hosts, and the Steam hardware survey. Same story in all four:

  • 16–64 GiB is the mainstream: it covers 64–84% of the three RTX 5090 populations and 99% of Steam machines
  • More than 128 GiB shows up in at most 11% of any population
  • Even people who bought the most expensive consumer GPU stop at 64 GiB

Price is a different matter. The paper plots prebuilt quotes against RAM size: under $10k up to 128 GiB, then a cliff — about $26k at 256 GiB, about $41k at 512 GiB (usually marketed as 512 GB).

RAMCoveragePrebuilt priceFits 155 GiB of weights?
16–64 GiB64–84% of RTX 5090 owners, 99% of Steamunder $10kno
128 GiBa minorityunder $10kno, 27 GiB short
256 GiBunder 11%about $26kyes, KV cache aside
512 GiBrarerabout $41kyes

(Coverage and prices are the paper's; "27 GiB short" is 155 − 128.)

"Just buy more RAM" is not an option. Such a machine costs two to four times as much. And even at 256 GiB, 155 GiB of weights takes 60% of it (our arithmetic: 155 ÷ 256), leaving 101 GiB for the KV cache and activations.

So what if the problem is not how much memory you have, but how it gets used?

The weights have to spill: VRAM, RAM, SSD

The test machine has an RTX 5090 with 32 GB of VRAM. The authors cap host RAM between 16 and 128 GiB to simulate different budgets. Three models:

ModelTotal params (active)PrecisionWeight sizeGap on a 32 GB card
Qwen3.6-35B-A3B35B (3B)BF16about 70 GBabout 38 GB
Gemma4-26B-A4B26B (4B)BF16about 52 GBabout 20 GB
DeepSeek-V4-Flashnot reportednative FP4155 GiBabout 123 GiB

The first two weight sizes are our arithmetic at 2 bytes per parameter (BF16), and their gaps subtract the card's nominal 32 GB; DeepSeek's 123 GiB is 155 GiB − 32 GiB. None of it comes from the paper.

None of the three fits in 32 GB. DeepSeek-V4-Flash is the extreme case: it is already FP4, four bits per parameter. Compressing further is a quality decision, not a format switch. We wrote about that in our quantization piece: quantization is not free.

So the weights spill: what does not fit in VRAM goes to RAM, and what does not fit in RAM goes to the SSD. This is not a failed load. It is a transfer that can happen on every forward pass.

Which leaves one question: how should the tiers be arranged so that moving weights does not become the main cost?

What existing systems get wrong: three tiers, three independent caches

Most inference engines manage memory the way a datacenter would. DRAM is expensive, SSD is cheap, so VRAM caches RAM and RAM caches the SSD, and each tier evicts on its own.

Datacenter servers have abundant DRAM, so the assumption usually holds.

On a consumer PC it kills the system. Two phases, two ways.

Prefill (reading the prompt). One 8K-token chunk activates nearly every expert in every layer. Prefill does not need "a few experts"; it needs a full sweep of the model. Once the expert pool exceeds RAM, the sweep becomes cyclic: loading later layers evicts earlier ones, and the next chunk starts over.

So a 64 GiB machine holds 44% of the pool, and the SSD still supplies 86–99% of the baselines' prefill expert traffic. Tideway comes in at 52% in the same setting. (Figure 1)

Decode (generating). Each step touches only a few experts, but a single miss stalls it. Dynamic paging also breaks CUDA Graph: a fixed-shape capture cannot express "fetch one expert from the SSD mid-layer," so engines fall back to eager execution and pay host dispatch and sync on every token. llama.cpp is the opposite extreme: almost no launch overhead, but 92% of its decode time goes to computing experts on the CPU.

The two failures are different in kind. Prefill fails at retention; decode fails at execution. A system has to solve both.

Insight one: PCIe beats the SSD, so the RAM copy is worth keeping

One measurement in the paper underpins everything else.

On the same machine, PCIe 5.0 delivers 57.6 GB/s host-to-device, 57.3 GB/s device-to-host, and 102.1 GB/s bidirectional; the NVMe drive reads at 6.8 GB/s.

PathMeasuredvs SSD
PCIe H2D (RAM→VRAM)57.6 GB/sabout 8.5×
PCIe D2H (VRAM→RAM)57.3 GB/sabout 8.4×
PCIe bidirectional102.1 GB/sabout 15×
NVMe read (SSD→RAM)6.8 GB/s1×

The ratios are our division of the paper's numbers, not the paper's.

So re-serving an expert that already sits in RAM costs roughly one eighth of reading it back from the SSD.

Yet in a three-cache design, an expert evicted from VRAM and absent from RAM is simply dropped. The next access pays for an SSD read. The most valuable copy gets thrown away.

Tideway instead makes VRAM and RAM one pool:

  • one directory (the Residency Table) recording which slot holds each expert in VRAM and in RAM
  • deduplication across tiers, with a small set of hot experts allowed to live in both
  • on VRAM eviction, check RAM first: if a copy exists, drop the GPU one; if not, write the victim back to RAM instead of discarding it
  • only when neither works does the expert leave for the SSD

The point is not what Tideway implements. The point is the judgment underneath: on a consumer PC, crossing a tier costs several times more than staying in it, not a little more. Keeping the copy one tier up is worth real money.

(The 8.5× comes with a hardware caveat: PCIe 5.0 and a WD_BLACK SN850X. On PCIe 4.0 or a slower SSD the ratio shrinks, but "PCIe is several times faster than the SSD" still holds on mainstream hardware.)

Insight two: prefill streams, decode caches

The second insight: the two phases do not merely want different layouts. They want opposite ones.

Prefill wants throughput. Every chunk sweeps all experts anyway, so stop optimizing hit rate and start hiding transfers behind compute. Tideway splits VRAM three ways during prefill: experts, a double buffer, and workspace. Layer l computes while layer l+1's weights are already in flight. In RAM, reusable experts are pinned with anchors, and a small streaming window is left for experts arriving from the SSD.

Decode wants capacity. Each step touches few experts, but it touches them again and again. VRAM returns to fixed-address slots so hit rates stay stable; RAM becomes an LRU cache. Each layer is captured as three CUDA Graph segments — attention, router, experts — once at warmup. After that, a hit or a miss only updates slot IDs and replays the same graphs; nothing is recaptured.

The switch. When prefill ends, anchors are released, borrowed VRAM goes back, and the layout flips to the decode version. Most systems keep one layout across both phases (SSD-LLaMA fixes one), so at least one phase pays. Figure 2 shows the same pool under both layouts, using 64 GiB of RAM as the example.

How much faster, and where

First, what "1.97× faster" means: against the fastest of four baselines, averaged over 270 fixed-shape configurations. It is not an absolute wall-clock number, and it is not "two seconds become one."

MetricAverageRangeWhat it measures
End-to-end latency (static average)1.97×1.13–3.18× static, 1.20–3.14× agent tracesa full request
TTFT2.40×1.15–9.04×prefill
Decode throughput1.61×1.20–2.28×generation

The most interesting number is not in the average: when the pool (VRAM + RAM) holds every expert, Tideway is still 1.13–1.58× faster.

At that point the SSD is out of the picture. The gap comes from removing CPU dispatch and overlapping PCIe transfers with compute. Managing memory is not only about reducing spill; it is performance by itself.

Here is what each mechanism is worth:

VersionIncrementalCumulativeWhat it added
Base: per-tier LRU, sync loads, eager—1×starting point
+ cross-tier memory manager1.23×1.23×stops prefill thrash, dedups
+ async transfers and prefill pipeline1.36×1.67×overlaps transfers with compute
+ piecewise decode graphs1.36×2.28×removes paging dispatch cost

(The cumulative column is our multiplication: 1.23 × 1.36 ≈ 1.67, then × 1.36 ≈ 2.28; the paper's total is 2.28×.)

TTFT gets to 2.94× from the first two; TPOT reaches 2.04× mostly through the decode graphs.

One more sensitive knob: prefill chunk size. From 1K to 8K, Tideway's edge over the fastest baseline widens from 1.18× to 1.57×. Bigger chunks mean more compute per layer to hide transfers behind.

And in absolute terms: if a baseline TTFT is 100 seconds, 2.40× puts you near 42. On the static-shape average, a 10-minute request becomes about 5 minutes; on the agent traces the range is 1.20–3.14×, so 10 minutes becomes 3 to 8. (Those conversions are our hypotheticals, not measured absolute values.)

What it does not fix

Time to brake.

LimitWhat it means for you
Still needs SSD backing155 GiB does not shrink; what shrinks is re-reading it
One GPU, one machinemulti-GPU, concurrency, and queuing are not evaluated
KV cache is reserved firstlonger context leaves fewer expert slots
Two baselines are reproductionsFlashMoE and SSD-LLaMA are closed-source; mechanisms were reproduced on FreeToken, not the original systems
No vLLM baselinenot tested; we think the paper's serving assumptions (single GPU, single stream, model fits) differ
Preprint, no independent reproduction we foundthe 8 agent traces are TraceLab replays; the experiments come from one group
The platform is PCIe 5.0ratios move with hardware; the 16 GiB case is a RAM cap on a 251 GiB box

It is not a drop-in replacement for llama.cpp. The implementation is about 11.8K lines (Python and C, with GPU kernels in Triton and CuTe DSL) — a research prototype.

One thing needs saying: it does not fit the model into memory. A 155 GiB model on a 64 GiB machine still streams a lot of weights from the SSD. Tideway makes the price of spilling acceptable.

Two smaller notes. The overhead is small: graph capture takes seconds, and persistent buffers use under 3% of VRAM. All write-backs stay between VRAM and RAM; the SSD is read-only, which is good for its endurance.

So how should you look at your machine?

Three questions, in order.

  1. How far apart are the weights and (VRAM + RAM)? Do the arithmetic first: model size, KV cache, activation workspace. Ten gigabytes short and ninety gigabytes short are different problems.
  2. Is prefill or decode your bottleneck? Long prompts, multi-turn agents, re-reading a large context: prefill (TTFT). Long outputs, single turns: decode (TPOT). The optimizations point in opposite directions.
  3. What generation is your PCIe link, and how fast is your SSD? If your SSD is SATA-class (about 0.5 GB/s) and your bus is PCIe 4.0, keeping experts in RAM is worth less than on the paper's machine, and spilling costs more.

Three things you can do tomorrow:

  1. Do your own memory arithmetic. Weights (params × bytes per parameter) + KV cache (tokens × layers × KV heads × head dim × 2 × bytes) + activations and framework overhead. Ten minutes of arithmetic beats ten benchmark posts.
  2. Measure your own TTFT/TPOT split. Most engines log both. Run one 32K prompt and see where the time goes; that tells you whether to tune chunk size or offload policy.
  3. Put "phase-aware" on your evaluation checklist. Whether you run llama.cpp, FreeToken, or something else, ask: does prefill use the same layout as decode? If it does, that is the headroom this paper is talking about.

We wrote the product-side version of the same problem in Chinese: a 125B model running on a 12GB card. That piece is "how to use it"; this one is "why the existing stack is slow, and where the time goes." For the quantization route, see 122B one layer at a time; for memory as the bottleneck from another angle, the LFM3 piece.

If you are evaluating on-prem deployment, our services page describes how we approach it.

Memory is not too small. VRAM and RAM simply never get treated as one pool. What you need is not 512 GB — it is a scheduler that does not treat RAM as a trash can.