Abstract
A local language model faces an information constraint and a physical memory constraint. Retrieval-augmented generation (RAG) brings authorized external evidence into its context. A neural pager manages the placement of model weights across memory tiers. Their composition can make a locally grounded workflow feasible within a smaller device budget.
Our current experiment preserves a trained mixture-of-experts (MoE) router while moving selected expert weights from system RAM to GPU buffers. On a 16 GiB NVIDIA GeForce RTX 5060 Ti, a Qwen3-30B-A3B test spanning its first two transformer blocks reduced explicit expert-buffer allocation from 747.00 MiB to 70.03 MiB. The ordered expert selections matched an independent CPU reference within the tested fixtures. This report preserves that controlled result and adds an end-to-end experiment in which a small local worker requests and uses advice from the full paged model.
Research update · November 25, 2026. A Gemma E2B worker now completes a local consultation through all 48 Qwen3-30B-A3B layers and uses the returned advice in its mission. The two-block fixture remains the narrower numerical comparison. The new end-to-end trial verifies the handoff and a correct answer. Broader numerical equivalence, answer-quality gains and production performance remain open evaluations.

Two memory systems, one request
RAG selects source passages. Neural paging selects which weight pages occupy fast memory. The passage selection affects the model’s input and can change its answer. Weight placement is evaluated against the same model, input and trained router, with numerical agreement as its acceptance condition.
| Property | RAG | Neural paging |
|---|---|---|
| Unit of retrieval | Passage, document or structured evidence | Layer–expert weight page |
| Selection signal | Query, lexical match, embeddings and reranking | The checkpoint’s trained neural gate |
| Working memory | Evidence index and bounded prompt context | GPU buffers, system RAM and backing storage |
| Primary purpose | Supply relevant, attributable information | Fit required computation within a device budget |
| Correctness evidence | Source relevance, access scope and citation fidelity | Routes, tensor outputs and generated token agreement |
| Main cost | Retrieval, reranking and longer prompt processing | Transfers, cache misses and synchronization |
| Privacy surface | Documents, embeddings, compiled context and provider requests | RAM, GPU buffers, caches and input-dependent execution traces |
The Forge retrieval prototype combines lexical ranking and locally computed semantic similarity, then reranks candidates and compiles evidence with source identifiers and revision offsets. Its budget counts serialized UTF-8 bytes, including citation metadata. Token count remains a separate model-context constraint.
A small retrieval fixture placed its expected source first and compiled two citations into 438 of 570 available bytes. The tiny generator still produced an incorrect answer. Retrieval quality, execution fidelity and answer quality therefore require individual measurements. Lewis et al., RAG.
Execution and mathematics
Let Da denote the passages authorized for the current request. Let q be the query, and let B bound compiled evidence. The following expression describes the retrieval stage at the level of its public interfaces.
The authorized corpus is ranked, fused and compiled into a bounded evidence context.
At layer ℓ and token position t, let u be the normalized hidden state, Wg the trained gate and Fℓ,e expert e. For the tested Qwen3 gate, expert indices are selected by top-k logits and their selected weights are normalized with softmax.
αℓ,t = softmax((Wg,ℓuℓ,t)S)
hℓ+1,t = rℓ,t + ∑e ∈ Sℓ,t αℓ,t,e Fℓ,e(uℓ,t)
The original gate determines the selected experts and their contributions.
Here r is the layer’s attention residual. The pager must have every selected expert available before its contribution is computed. A missed page incurs a transfer or an explicitly supported equivalent execution path. The reference experiment compares original packed GGUF weights through independent CPU dequantization and GPU kernels. Dense shared operations and trained routing remain part of the model’s execution.
The expert cache contributes one term to the total GPU budget.
Wℓ,e counts stored bytes, including quantization layout. C is the set of resident layer–expert pages. Total GPU usage also includes shared tensors, key/value cache, activations, workspaces and runtime overhead. The measured 70.03 MiB is the expert-buffer component of this equation.
Demand and prefetch traffic are counted independently of initial preload.
The traffic term counts actual issued transfers. A useful first estimate of transfer service time is bytes divided by effective bandwidth. Compute and copies can overlap, so a latency model must account for dependencies and queue contention. Prefetch accuracy, demand hit rate and total bytes transferred should be measured together.
Measured observations
The figure and this table refer to the same recorded run. It used six distinct first-position token IDs, repeated in reverse order, for 12 independent one-token fixtures. Two layers with 128 experts each produced 24 router decisions and 192 expert selections. The trained gate selected eight experts per layer.
| Measurement | Resident | Paged |
|---|---|---|
| GPU expert slots | 256 | 24 |
| Explicit expert buffers | 783,286,272 bytes | 73,433,088 bytes |
| Demand cache hits | 192 | 99 |
| Demand page loads | 0, following preload | 93 |
| Evictions | 0 | 69 |
| Demand transfer volume | 0, following preload | 271.37 MiB |
| Median two-block fixture | 28.15 ms | 29.05 ms |
| Ordered router agreement | Matched reference | Matched reference |
| Maximum final hidden-state error | 3.052 × 10⁻⁵ | 3.052 × 10⁻⁵ |
The explicit expert-buffer reduction is exactly 90.625%. The 93 demand loads moved 93 × 3,059,712 = 284,553,216 packed bytes. Cumulative transfers can exceed the instantaneous cache allocation. Numerical acceptance used elementwise |Δh| ≤ 2 × 10⁻⁴ + 3 × 10⁻⁴ |href|.
These paired fixture timings describe this run’s two-block work. A useful language-service evaluation needs full prompt processing, time to first token, sustained decode, queue delay and concurrent requests under equivalent conditions. Download the public measurement summary.
Supporting the smaller model
The purpose of this work is to extend what a small local model can accomplish. Gemma E2B remains the primary worker. When it requests deeper reasoning, Forge passes a focused question to the neural node. The paged Qwen model generates advice, and Gemma receives that result in the same mission, checks it and completes its response. The model weights retain their trained values during this process.
The new experiment executes the complete 48-layer Qwen3-30B-A3B network, including causal attention, its trained expert selection and the final output projection. A bounded expert cache manages weight residency. The trial also uses a bounded host window over a memory-mapped GGUF, so the operating system’s file cache participates. Physical SSD reads were unmeasured.
We tested a public arithmetic fixture. A part costs $72, and the requested gross margin is 20%. The correct selling price is $72 ÷ (1 − 0.20) = $90. Gemma answered correctly on its own. In the assisted run, the neural node returned “$90,” and Gemma checked the calculation in its final response.
| Observed measure | Gemma E2B alone | Gemma with neural node |
|---|---|---|
| Final answer | $90 | $90 |
| End-to-end mission time | 8.26 s | 68.46 s |
| Neural consultation time | — | 54.21 s |
| Sampled whole-GPU high-water mark | 5.83 GiB | 9.02 GiB |
| Sampled system RAM high-water mark | 40.83 GiB | 53.36 GiB |
These are sequential single runs on the same 16 GiB RTX 5060 Ti workstation with approximately 64 GB of system memory and other applications present. The marks include those applications. The worker remained loaded during the consultation. The baseline was a recorded tool-free mission on the same question and model.

The consultation processed 74 input tokens and generated three answer tokens. Its allocated expert buffers occupied 373.50 MiB, while cumulative expert transfers reached 22.94 GiB. Shared tensors, attention state and temporary buffers contribute additional memory. Repeated transfers help explain why a correct handoff can still have substantial latency.
The trial establishes a working local consultation path. It provides no measured accuracy improvement over Gemma alone, and the assisted mission took longer. A separate multiplication fixture matched all three generated token IDs against an independent CPU llama.cpp run. For the pricing fixture, that reference returned the same amount in a different sentence. Exact-text comparison failed, and full numerical equivalence remains unproven.
An earlier trial exhausted its answer allowance while explaining the formula. Asking the node to give its conclusion first produced the completed short answer shown here. This illustrates why completion checks need to examine the returned advice as well as the primary worker’s final response. Download the consultation measurement summary.
Privacy and trust boundaries
Local retrieval can keep source documents, query embeddings and compiled evidence on the workstation when the encoder and generator also execute locally. When a remote generation provider is selected, the evidence included in its request can cross the device boundary. That data flow needs an explicit user decision and an auditable scope.
Embeddings are derived from private text and deserve appropriate access controls. Published research has demonstrated text recovery from particular embedding systems under defined conditions. Its findings motivate careful handling of vector indexes and do not establish a corresponding attack against Forge. Morris et al., Text Embeddings Reveal (Almost) As Much As Text.
Weight paging changes memory residency. Security also depends on process permissions, disk protection, operating-system caches and how temporary buffers are handled. A path to a local model provides a location reference. The model’s license, file integrity and implementation compatibility require their own checks.
The consultation passes the worker’s supplied question to a local research process. Private evidence included in that question remains sensitive. Execution receipts and routing traces can contain prompts, token IDs, generated text, source offsets and workstation paths. Routing is input-dependent, so access patterns can correlate activity. Public reports should use reviewed fixtures and scrubbed measurement summaries. The Mission Board capture here uses a recorded test with private paths and account details excluded.
A joint research objective
The next step is to evaluate evidence policy a and placement policy π jointly. A stronger system should minimize measured end-to-end latency while meeting constraints on evidence quality, authorized disclosure, physical memory and faithful execution. The expression below specifies a proposed evaluation objective.
Minimize the measured 95th-percentile request latency over a declared held-out workload.
Subject to
Ea(q) ⊆ Da, bytes(Ea) ≤ B
Qevidence(a) ≥ Qmin, egressprivate(a) ≤ Papproved
supt MGPU(π, t) ≤ Vusable
Spaged(q, Ea) = Sreference(q, Ea)
|hpaged − hreference| ≤ εabs + εrel |hreference|
L includes retrieval, prompt processing, generation and queueing for a specified held-out workload. Q is an explicit evidence rubric. P records approved private-text disclosure. V reserves GPU space for the entire request. The route and tensor constraints compare the same checkpoint and compiled context. Changing retrieved evidence can legitimately change the hidden state and trained route.
Answer quality belongs in the evaluation alongside this constrained objective. A model can faithfully execute an incorrect answer, and a relevant document can exceed an available context or privacy budget. The current measurements establish local components of this program. Further experiments must test whether the composition improves useful task outcomes.
Next experiments
- Expand numerical coverage. Extend the full-model comparisons across varied prompts, sequence lengths and decode steps. Investigate output differences using layer states, routing decisions and logits against the same checkpoint.
- Measure resident working sets. Track per-layer reuse, expert hit rates, packed transfer bytes and effective bandwidth under diverse tasks.
- Test the memory hierarchy. Establish RAM-backed performance, then evaluate an explicitly bounded SSD tier with cold and warm-cache results.
- Evaluate useful answers. Evaluate Gemma alone, Gemma with RAG, Gemma with the neural node, and their combination on held-out tasks. Fix the answer rubric and resource budgets before testing.
- Measure service behavior. Include p50 and p95 latency, cancellation, concurrent requests, fairness and recovery after interrupted loads.
The long-term direction is expert-addressable storage and coordinated local execution. Predictive loading becomes useful when its transfer cost, memory footprint and measured accuracy of prediction improve the complete request.
References and acknowledgements
- Lewis et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.
- Shazeer et al. (2017). Outrageously Large Neural Networks.
- Eliseev and Mazur (2023). Fast Inference of Mixture-of-Experts Language Models with Offloading.
- Qwen team. Qwen3-30B-A3B model card.
- Morris et al. (2023). Text Embeddings Reveal (Almost) As Much As Text.
This work builds on published sparse-model research and open tools including PyTorch, Hugging Face Transformers, llama.cpp/GGUF, PyOpenCL and React Flow. Model weights and dependencies retain their respective authorship and license terms.
Published November 25, 2026 · Forge Runtime Research · Static Labs