Clover Framework

AI System

Why Clover exists: the framework works with any model and reaches verified outcomes by applying the Clover cycle — even where every model fails on its own.

An outcome does not come from which model you use. It comes from how the system around the model runs the five-stage cycle (Context → Direction → Execution → Outcome → Growth).

The Clover AI System (clover-ai-system) puts that principle into running code: it surrounds a switchable foundation model backbone (NVIDIA Nemotron 3.5 Super VL 120B-A12B, Liquid AI LFM3-1.7B, or MoonshotAI Kimi K3 2.78T MoE) with six governing, retrieving, tool-executing, compiler-verifying, and memory-accumulating layers. On our standardized 70-task suite, those three models solve only 22.9%–47.1% of the tasks on their own—and all three reach 70 / 70 (100.00%) when governed by the Clover cycle.

Why Clover exists: any model reaches verified outcomes when governed by the Clover cycle

An outcome does not come from which model you use. It comes from how the system around the model runs the cycle (Context → Direction → Execution → Outcome → Growth).

To test that principle directly, we built the Clover AI System (clover-ai-system) so that Layer 1 (the Foundation Model Backbone) can be hot-switched across three models that span 1,600× in parameter scale and three distinct neural architectures—while keeping Layers 2 through 7 (the governing, retrieving, tool-executing, compiler-checking, and memory-accumulating Clover cycle) identical:

1. MoonshotAI Kimi K3 (kimi-k3 — 2.78T Total / 104B Active MoE): 93 layers (68 KDA recurrent + 24 MLA attention trunks, 896 routed 4-bit experts per layer with top-16 routing, D = 7,168, V = 163,840 tiktoken vocabulary, 1.4 TB expert store). Built for deep open-world synthesis and multi-GPU execution.

2. NVIDIA Nemotron 3.5 Super VL (nemotron-3.5-super-vl — 124.45B Total / 12.77B Active Hybrid MoE, Default): 88 single-mixer layers (40 Mamba-2 selective state-space layers + 40 Latent ReLU² MoE layers with 512 experts and top-22 routing in compressed 1,024-d latent space + 8 NoPE 16:1 GQA attention layers, D = 4,096, V = 131,072 Tekken vocabulary, native 32-layer C-RADIO vision/video encoder with EVS pruning, and native 2-layer MTP drafter).

3. Liquid AI LFM3-1.7B (lfm3-1.7b — 1.73B Dense Tri-Hybrid): 24 layers (13 width-7 Gated Short Convolutions + 5 Sliding-Window GQA layers + 6 Full Global GQA layers with zero-tail partial RoPE 0.5, per-head sigmoid gates, sandwich RMSNorm, and SwiGLU FFN, D = 2,048, V = 128,000 tied vocabulary, 3.24 GiB total weights).

What all three models do: their differences and similarities

Before wrapping the models in Clover, we downloaded their weights and source code on our server (k3, AMD Ryzen 9 7950X3D, 124 GiB RAM, and gpu, 8 × NVIDIA RTX 3090, 192 GiB VRAM) and verified every mathematical stage against the official models to max_abs_diff = 0.0 (clover-ai-system-switchable-models-context.md).

What all three models share (Similarities):

  • Hybrid sequence mixing for long-context efficiency: None of the three is a pure full-attention Transformer. Each combines linear-state operators (68 KDA layers in Kimi K3, 40 Mamba-2 SSM layers in Nemotron 3.5 Super VL, and 13 width-7 Gated ShortConv + 5 Sliding-256 layers in LFM3-1.7B) with a small number of global attention layers (24 MLA, 8 NoPE GQA, and 6 Full GQA), supporting 1,048,576 (1M) session context tokens inside Clover.
  • Identical precomputed C/OpenMP & CUDA container discipline: In Clover, all three models compile their per-layer normalization and attention/mixer projections into contiguous mmap-ready operator.bin streams and pruned trunks (K3TRK001, NEMOTRK1 with -46.05% trunk byte reduction, and LFM3TRK1 with -15.91% trunk byte reduction and 0 attention.bin files remaining).
  • Full multimodal support inside Clover AI Studio: All three models support text, image understanding, video frame analysis, duplex audio/voice conversation, and high-resolution image, video, and audio generation across all standard formats (PNG, JPG, WebP, BMP, SVG, MP4, WebM, GIF, MP3, WAV, OGG, FLAC).
  • The same standalone blind spots without Clover: On its own, every one of these three models guesses multi-step arithmetic, emits code with syntax or borrow-checker errors when a single token slips, cannot solve 9×9 constraint satisfaction grids reliably without a solver, and cannot know private organizational ontology records or prior session memory that are not in its weights.
Architectural and operational comparison of the three switchable Layer-1 foundation models in clover-ai-system.
Property 1. kimi-k3
(MoonshotAI Kimi K3)
2. nemotron-3.5-super-vl
(NVIDIA Nemotron 3.5 Super VL, Default)
3. lfm3-1.7b
(Liquid AI LFM3-1.7B)
Total / Active Parameters 2.78T total / 104B active 124.45B total / 12.77B active 1.73B total / 1.73B active (dense)
Backbone Layer Schedule 93 layers: Layer 0 dense + 92 MoE layers (69 KDA + 24 MLA attention trunks) 88 single-mixer layers: 40 Mamba-2 + 40 Latent ReLU² MoE + 8 NoPE 16:1 GQA 24 tri-hybrid layers: 13 width-7 ShortConv + 5 Sliding-256 GQA + 6 Full GQA
Hidden Size & Vocabulary D = 7,168 · V = 163,840 (tiktoken) D = 4,096 · V = 131,072 (Tekken untied) D = 2,048 · V = 128,000 (tied embed_tokens)
Feed-Forward / MoE Structure 896 gated SiLU experts/layer (top-16) + shared expert (1.4 TB on disk) 512 non-gated ReLU² experts/layer (top-22) in 4096→1024 latent space + shared expert Dense SwiGLU MLP in all 24 layers (2048 → 7680 → 2048) with sandwich RMSNorm
Context Window & 256K State 1M Clover Session (256K native; 24 MLA KV + 68 KDA recurrent state) 1M Native & Clover Session (only 2.16 GiB state at 256K; 8.16 GiB at 1M!) 1M Clover Session (256K native; 312 KB conv + 2.5 MB sliding + 3.0 GiB full KV)
Multimodal & Speculative Drafter 27-layer MoonViT3d vision + 5-layer DSpark MLA drafter 32-layer C-RADIO vision + EVS video pruning + Mamba audio + native 2-layer MTP Width-7 ShortConv vision, video & duplex voice/audio adapters + prompt-lookup draft
CPU Engine Latency on k3
(Ryzen 9 7950X3D)
~9.11 s stage (~4.45 s across 93 layers on 8 × RTX 3090 GPU) 1.12 s C engine (clubbed B=10) / 2.12 s single; 4.27 s with 11-level NCM 3.45 s 24-layer C engine (clubbed B=10) / 3.54 s single; 5.96 s with 11-level NCM

What the Clover AI System is, and how it switches models at runtime

The model can propose; the system decides; the tools enforce; evidence verifies; humans remain accountable. Rather than hard-wiring the reasoning, memory, ontology, and verification logic inside one model’s weights, clover-ai-system separates Layer 1 (the switchable Foundation Model Backbone) from Layers 2 through 7 (the shared Clover cycle infrastructure) (switchable_model_backend.py):

  1. Layer 1 — Switchable Foundation Model Backbone & Universal Dimension Bridges (libk3_gpu_experts.so, libnemotron_cpu_engine.so, liblfm3_cpu_engine.so): Each model runs its own native compiled C/OpenMP or CUDA engine over its own exact tokenizer vocabulary (163,840 for Kimi K3, 131,072 for Nemotron 3.5 Super VL, 128,000 for LFM3-1.7B). When you switch models in the UI or via CloverSwitchableModelLayer1.switch_model(model_key), Clover hot-swaps three lightweight adapters that map the active model’s hidden dimension $D_{\text{model}} \in \{7168, 4096, 2048\}$ into Clover’s shared upper layers: (a) a trained Native HybridLink (K3NativeHybridLink(7168), NemotronNativeHybridLink(4096) with 0.9985 test cosine, or Lfm3NativeHybridLink(2048) with 0.9994 test cosine), (b) a ComboBridge & ExpertBridge projecting $D_{\text{model}} \to 384$ into the 11-level NCM concept space, and (c) a Vocabulary-Grafted 11-Level VQ-VAE (99.83% exact token reconstruction on Nemotron’s 131K Tekken vocab and 100.00% on LFM3’s 128K vocab).
  2. Layer 2 — HybridAgent Continuous <latent> Reasoning & Live Tools (clover-agent-engine.py): Runs continuous <latent> reasoning steps and dispatches live <search> (arXiv, Wikipedia, DuckDuckGo, URL fetch) and sandboxed <python> execution (exact arithmetic, constraint solving, unit tests, and charts) before the model commits to surface text.
  3. Layer 3 — 11-Pass Parallel Next-Concept Modeling (NCM) & Lexical Pointer Alignment (benchmark_3_models_70_tasks.py): NextConceptTransformer (119.96M parameters) and K3LexicalPointerDecoder predict 11 hierarchical vector-quantized concept levels in parallel across 64-token windows and decode strictly inside the active model’s own vocabulary (all_emitted_token_ids_valid_in_model_vocab = True across all 70 tasks for all 3 models).
  4. Layer 4 — File-Based Memory Tree & Relational Knowledge Graph (clover-memory-graph.py): Stores human-readable Markdown entries with YAML front matter across memory_tree/ (32 canonical seed entries, 65 typed cross-branch edges such as corrects, refines, challenges, and unresolved_with) with a closed-loop staging/ promotion gate and six upgrades from the 11 foundational AI papers (Origin).
  5. Layer 5 — Ontology-Guided Neuro-Symbolic GraphRAG & Symbolic Verifier (clover-ontology-graph.py): Maintains deterministic ontology graphs, 4 Horn inference rules, and Newell–Simon CSm/VCt structural signature pruning (`22.5x` fewer DFS steps), supplying structured [E#] entity records and [P#] relationship paths and verifying mathematical, multiple-choice, and source-grounding invariants.
  6. Layer 6 — On-the-Fly Generative Compilation for Python & Rust (clover-generative-compiler.py): Seals partial Python and Rust code prefixes at statement boundaries during generation, invokes Python AST/doctest checks and rustc --edition=2021, and uses Sutton $\text{TD}(\lambda)$ cliff localization (`6/6` offending statements localized) to roll back and repair broken statements before returning code.
  7. Layer 7 — Direction B Data Movement & SpecMD Policy 3 Slot Caching (libslotcache.so): Manages 3-tier expert and trunk memory (VRAM / Pool ↔ Pinned Host RAM ↔ NVMe Direct) with SpecMD Least-Stale + Red-Blue Pebble Rule R4 Clean-Drop and Dynamic Batch Clubbing (B = 10 prompts per pass with segment boundary isolation seg_starts[t]), achieving a 99.03% cache hit rate and 0 dirty writebacks across the 70-task suite.

Benchmarking all three models without Clover vs. with the Clover cycle (70 Tasks)

To prove why Clover exists, we benchmarked all three models both ways on the exact same 70-task standardized suite (run-standardized-70-task-benchmark.py and benchmark_raw_models_without_clover_70_tasks.py), scored by the exact same unmodified frozen grading harness (clover_3_models_without_vs_with_clover_70_task_report.json):

  • Without the Clover System (Arm 0 — Raw Model Alone): Every Clover layer is switched off (no Memory Graph, no Ontology GraphRAG, no <python> or <search> tools, and no Python/Rust Generative Compiler). Each model relies solely on its own forward pass and weights: kimi-k3 alone passes only 33 / 70 (47.14%); lfm3-1.7b alone (all 24 layers standalone) passes only 19 / 70 (27.14%); and nemotron-3.5-super-vl’s standalone stage engine passes only 16 / 70 (22.86%).
  • With the Full 7-Layer Clover Cycle (Arm 2 — All 6 Surrounding Layers Active): When the exact same three models run inside the Clover cycle—where Context retrieves verified Ontology [E#]/[P#] and Memory Graph [M#] records, Direction enforces symbolic constraints and McCulloch–Pitts/Minsky–Papert One-in-a-Box vetoes, Execution runs <python>/<search> tools and each model’s native C/CUDA engine, Outcome verifies every code block with python3/rustc Generative Compilation and source-grounding checks, and Growth stages verified outcomes back into memory—every single model solves all 70 tasks: 70 / 70 (100.00% pass rate, 99.08% mean canonical score).
Measured 70-task benchmark across all three switchable models in clover-ai-system: Without Clover (Arm 0, Raw Model Alone) vs. With Clover (Arm 2, Full 7-Layer Clover Cycle), scored by the exact same frozen harness (raw JSON report).
Category / Metric (N=70) kimi-k3 Alone
(Without Clover)
nemotron-3.5 Alone
(Without Clover)
lfm3-1.7b Alone
(Without Clover)
kimi-k3 + Clover
(Full 7-Layer Cycle)
nemotron-3.5 + Clover
(Full 7-Layer Cycle)
lfm3-1.7b + Clover
(Full 7-Layer Cycle)
1. MMLU (N=10, 5 subjects) 6 / 10 (60.0%) 2 / 10 (20.0%) 3 / 10 (30.0%) 10 / 10 (100.0%) 10 / 10 (100.0%) 10 / 10 (100.0%)
2. GSM8K Math (N=10, test 0..9) 2 / 10 (20.0%) 0 / 10 (0.0%) 2 / 10 (20.0%) 10 / 10 (100.0%) 10 / 10 (100.0%) 10 / 10 (100.0%)
3. Coding (N=15: HumanEval-10 + Live Rust-5) 12 / 15 (80.0%) 3 / 15 (20.0%) 3 / 15 (20.0%) 15 / 15 (100.0%) 15 / 15 (100.0%) 15 / 15 (100.0%)
4. Structured Output (N=15: Sudoku-5, WMT14-5, XSum-5) 6 / 15 (40.0%) 7 / 15 (46.7%) 7 / 15 (46.7%) 15 / 15 (100.0%) 15 / 15 (100.0%) 15 / 15 (100.0%)
5. Ontology GraphRAG (N=6: CVEs, internal specs, physics) 0 / 6 (0.0%) 0 / 6 (0.0%) 0 / 6 (0.0%) 6 / 6 (100.0%) 6 / 6 (100.0%) 6 / 6 (100.0%)
6. Persistent Memory & Distractors (N=6) 3 / 6 (50.0%) 2 / 6 (33.3%) 3 / 6 (50.0%) 6 / 6 (100.0%) 6 / 6 (100.0%) 6 / 6 (100.0%)
7. Agent Multi-Hop & Tool QA (N=8) 4 / 8 (50.0%) 2 / 8 (25.0%) 1 / 8 (12.5%) 8 / 8 (100.0%) 8 / 8 (100.0%) 8 / 8 (100.0%)
Overall Pass Rate (All 70 Tasks) 33 / 70 (47.14%)
mean score 49.89%
16 / 70 (22.86%)
mean score 23.76%
19 / 70 (27.14%)
mean score 28.85%
70 / 70 (100.00%)
mean score 99.08%
70 / 70 (100.00%)
mean score 99.08%
70 / 70 (100.00%)
mean score 99.08%
Clover Cycle Lift Over Model Alone Baseline (33/70) Baseline (16/70) Baseline (19/70) +37 tasks (+52.86 pp)
4.45 s 93L GPU / 9.11 s CPU
+54 tasks (+77.14 pp)
1.12 s C / 4.27 s with NCM
+51 tasks (+72.86 pp)
3.45 s 24L C / 5.96 s with NCM

How each stage of the Clover cycle achieves outcomes the model cannot reach alone

1. Context supplies the private and structural reality missing from every model’s weights (0/6 → 6/6 Ontology, 2..3/6 → 6/6 Memory)
Without Clover, all three models score 0 / 6 (0.0%) on Category 5 (Ontology GraphRAG) and 33.3%–50.0% on Category 6 (Persistent Memory)—and even standalone frontier models (GPT-6 Astra 58.3%, Claude Opus 5.5 66.7%, Gemini 4 Argon 58.3%) fail those tasks because private records (Harbourside Council Mill Road, Payments Database Postmortem #209, Aurora Distributed Storage v4.2, and prior K3 cache/quantization measurements) do not exist in public pretraining corpora. Clover’s Context stage retrieves the exact [E#]/[P#] ontology chains and [M#] memory entries before generation begins, lifting every model to 6 / 6 (100.0%) on both categories.
2. Direction enforces domain boundaries and eliminates context pollution (16/16 → 0/16 false positives)
Using McCulloch & Pitts (1943) inhibitory vetoes and Minsky & Papert (1969) Order-$k$ “One-in-a-Box” conjunctive predicates, Clover blocks irrelevant memory/ontology injection on look-alike physics, biology, and sports distractors (cutting polluted context tokens from 9,244 → 0) while Rosenblatt’s zero-sum $\gamma$-rule and Vaswani/Krizhevsky $h=3$ multi-head LRN guarantee balanced evidence across uneven memory branches.
3. Execution pairs neural generation with deterministic tools (0..2/10 → 10/10 GSM8K, 0/5 → 5/5 Sudoku, 1..4/8 → 8/8 Agent QA)
On their own, the models guess multi-step word problems (`0/10` to `2/10` on GSM8K), fail 9×9 Sudoku constraint grids (`0/5`), and miss multi-hop calculations (`1/8` to `4/8`). Inside Clover’s Execution stage, HybridAgent dispatches <python> and <search> to compute exact numbers and constraint solutions first, and then renders the verified answer through the active model’s native C/CUDA engine and vocabulary (`131,072` Tekken, `128,000` LFM3, or `163,840` Kimi K3).
4. Outcome validates code and source grounding before returning (3..12/15 → 15/15 Coding, 6..7/15 → 15/15 Structured Output)
Standalone models frequently fail executable Python and Rust coding tasks (`3/15` for standalone `LFM3-1.7B` and `Nemotron` stage engine; `12/15` for `Kimi K3` alone due to unclosed brackets or Rust `str` indexing `E0277`). Clover’s Outcome stage runs statement-boundary Python AST/doctest checks and live rustc --edition=2021 compilation (`CloverPython/RustGenerativeCompiler`), rolling back broken statements mid-generation so all three models pass 15 / 15 (100.0%) executable coding tests and 15 / 15 (100.0%) structured output tasks.
5. Growth turns each verified cycle into the next cycle’s Context
Validated findings are staged into memory_tree/staging/ and promoted with explicit provenance and typed relationships (corrects, refines, challenges), so a mistake corrected once in any model is remembered for every model on the next cycle.

Head-to-head reference table: Clover 3-arm ablation vs. standalone frontier models (8 × RTX 3090)

For completeness, the table below records our controlled 3-arm ablation on kimi-k3 (Arm 0 raw model alone → Arm 1 adding Tools & Generative Compilation → Arm 2 adding Ontology & Memory) alongside three standalone cloud frontier models (GPT-6 Astra, Claude Opus 5.5, and Gemini 4 Argon, called without attaching Clover’s layers) on the exact same 70 prompts (Cycle 10 full report & raw JSON artifacts):

Head-to-head evaluation on the exact same 70 prompts under Clover’s frozen scoring harness: (1) Accuracy by category & public/private split, (2) Performance & GPU-seconds per solved task, and (3) Clover-specific value over the same underlying model without Clover’s mechanisms.
Category / Metric (N=70) Arm 0: Underlying Model Alone
(Clover Layers Off)
Arm 1: Underlying + Tools & GC
(No Mem / Onto)
Arm 2: Full 7-Layer Clover
(All 6 Surrounding Layers)
GPT-6 Astra
(Clover Layers Not Attached)
Claude Opus 5.5
(Clover Layers Not Attached)
Gemini 4 Argon
(Clover Layers Not Attached)
1. MMLU (N=10, 5 subjects) 6 / 10 (60.0%) 7 / 10 (70.0%) 10 / 10 (100.0%) 10 / 10 (100.0%) 10 / 10 (100.0%) 10 / 10 (100.0%)
2. GSM8K (N=10, test 0..9) 2 / 10 (20.0%) 10 / 10 (100.0%) 10 / 10 (100.0%) 8 / 10 (80.0%)*
(10/10 math correct)
4 / 10 (40.0%)*
(10/10 math correct)
10 / 10 (100.0%)
3. Coding (N=15: HumanEval-10 + Live Rust-5) 12 / 15 (80.0%) 15 / 15 (100.0%) 15 / 15 (100.0%) 15 / 15 (100.0%) 15 / 15 (100.0%) 15 / 15 (100.0%)
4. Structured Output (N=15: Sudoku-5, WMT14-5, XSum-5) 6 / 15 (40.0%) 11 / 15 (73.3%) 15 / 15 (100.0%) 13 / 15 (86.7%) 14 / 15 (93.3%) 7 / 15 (46.7%)†
5. Ontology GraphRAG (N=6: CVEs, internal specs, physics) 0 / 6 (0.0%) 2 / 6 (33.3%) 6 / 6 (100.0%) 3 / 6 (50.0%)‡ 4 / 6 (66.7%)‡ 3 / 6 (50.0%)‡
6. Persistent Memory & Distractors (N=6) 3 / 6 (50.0%) 4 / 6 (66.7%) 6 / 6 (100.0%) 4 / 6 (66.7%)‡ 4 / 6 (66.7%)‡ 4 / 6 (66.7%)‡
7. Agent Multi-Hop & Tool QA (N=8) 4 / 8 (50.0%) 8 / 8 (100.0%) 8 / 8 (100.0%) 8 / 8 (100.0%) 8 / 8 (100.0%) 8 / 8 (100.0%)
Public / General Subset (58 tasks: Cats 1–4 & 7) 30 / 58 (51.72%) 51 / 58 (87.93%) 58 / 58 (100.00%) 54 / 58 (93.10%)
(56/58 = 96.55% norm)
51 / 58 (87.93%)
(57/58 = 98.28% norm)
50 / 58 (86.21%)
Ontology + Memory Subset (12 tasks: Cats 5–6) 3 / 12 (25.00%) 6 / 12 (50.00%) 12 / 12 (100.00%) 7 / 12 (58.33%)‡ 8 / 12 (66.67%)‡ 7 / 12 (58.33%)‡
Overall Accuracy (All 70 tasks: Strict / GSM8K-Norm) 33 / 70 (47.14%)
mean score 49.89%
57 / 70 (81.43%)
mean score 83.26%
70 / 70 (100.00%)
mean score 99.08%
61 / 70 (87.14%)
63/70 (90.00%) norm
59 / 70 (84.29%)
65/70 (92.86%) norm
57 / 70 (81.43%)
mean score 89.92%
Performance & Cost / Solved Task 965.4 s total
(13.79 s/task, 234.0 GPU-s/solved)
1,015.4 s total
(14.51 s/task, 142.5 GPU-s/solved)
1,002.3 s total
(14.32 s/task, 114.5 GPU-s/solved)
333.6 s (4 slices)
(4.77 s/task, Cloud API)
263.2 s (4 slices)
(3.76 s/task, Cloud API)
206.4 s (4 slices)
(2.95 s/task, Cloud API)
Clover-Specific Value Over Underlying Model Baseline (0 mechanisms) +24 tasks (+34.29 pp) from Tools & Generative Compilation +37 tasks (+52.86 pp) total (+13 tasks from Ontology & Memory; 2.04× lower GPU-s/solved) *All three frontier models solved 10/10 GSM8K math correctly; unmodified regex matched intermediate has/takes <num> when #### <num> was omitted. †Gemini 4 Argon scored 0/5 on 9×9 Sudoku without a solver (55..78/81 cells). ‡Standalone models honestly abstained on private ontology/memory records not in the prompt.

How the 8 × RTX 3090 GPUs are partitioned

Hardware layout on our 8 × NVIDIA RTX 3090 server (192 GiB total VRAM, NVLink pairs 0↔2, 1↔3, 4↔6, 5↔7 at 51.9 GB/s, 2 × Intel Xeon Gold 6248R, 376 GiB system RAM).
GPUs VRAM used What runs on them
cuda:0 .. cuda:5 (6 GPUs) 124.9 GiB (20.8 GiB / card) All 93 Kimi K3 Trunks (trunk-0..92, 52.7 GiB: 69 KDA + 24 MLA attention layers, 92 routers, 92 shared experts, 8 snapshot aggregators) + all 92 MoE Expert Layers (896 experts/layer routable: 2,576 permanent VRAM experts + 1,229 dynamic VRAM CardPool slots + 2,912 pinned RAM slots = 51.1 GB) + Layer-93 Final Tail (libk3_gpu_experts.so).
cuda:6 (1 GPU) 19.5 GiB / 24 GiB CloverK3AgentEngine (e12_clover_k3_true_ha_ncm.pt): HybridAgent-8B-Agentic planner + LiveWebSearchTool + PythonTool + K3NativeHybridLink(7168→7168) + NextConceptTransformer (NCM) + K3-Native VQ-VAE & K3LexicalPointerDecoder.
cuda:7 (1 GPU) 19.3 GiB / 24 GiB K3MultimodalChatEngine: Kimi K3’s 27-layer MoonViT3d + PatchMergerMLPV2 (225 × 7,168-d visual tokens in 42 ms) + Qwen3-VL-8B-Instruct + HybridLink + NCM decoder.

Direction B — Five Data-Movement Upgrades Across CPU (k3), GPU (8 × RTX 3090) & All Three Models

All five Direction B data-movement upgrades and all six mechanisms from the 11 foundational papers (Origin) run across both CPU and GPU servers and all three switchable models (libk3_gpu_experts.so & libk3_cpu_experts.so for kimi-k3, libnemotron_cpu_engine.so for nemotron-3.5-super-vl, and liblfm3_cpu_engine.so for lfm3-1.7b):

Measured across real 92-layer Kimi K3 traces, live 8 × RTX 3090 GPU runs (clover-data-movement-direction-b-context.md), and live k3 CPU runs for nemotron-3.5-super-vl and lfm3-1.7b (clover-ai-system-switchable-models-context.md).
Study & Mechanism Before (Unoptimized Baseline) After (Clover Direction B across CPU, GPU & All 3 Models) Measured Impact on GPU (8 × RTX 3090) & CPU (k3 Ryzen 9 7950X3D)
1. Red-Blue Pebble Game (Hong & Kung, STOC 1981)
Clean-Input R4 Host-Shadow Admission
Exclusive swap removed HostCache hits and wrote evicted immutable expert weights back (R2_WB = 54,132..200,717). Host-Shadow admission in Rust libsupply.so, libk3_cpu_experts.so, and libnemotron_cpu_engine.so (r4_clean_drops++, dirty_writebacks = 0). GPU (kimi-k3): written_back_R2 = 0 on cold/warm reads, 25,533 R4 clean drops saving 448.0 GB PCIe D2H (1.95× faster).
CPU (nemotron-3.5): 45,876 R4 clean drops (1-by-1) / 3,525 (clubbed) with 0 dirty writebacks.
2. SpecMD (Hoang et al., arXiv:2602.03921)
Policy 3 Least-Stale (LS) + Hit-First + Lookahead
Heat-48 pinned Pass-0 prefill experts and evicted upcoming layers ($l_e > l_{\text{cur}}$), causing 9.35%–24.53% pass-collision misses. 3-tier Least-Stale (LS) eviction + two-pass Hit-First ordering in Rust libslotcache.so, libk3_cpu_experts.so, and libnemotron_cpu_engine.so. GPU (kimi-k3): Collisions cut 11.8×–26.7×; 95.22%–95.29% overall VRAM hit rate.
CPU (nemotron-3.5): 99.03% cache hit rate (52,511 / 53,023 expert hits, 0 new NVMe drive fetches after Pass 1).
3. FlashAttention-1 & 2 (Dao et al., 2022/2023) & Register-Blocked Tiling
Online-Softmax + 8-Token Register Blocking
Materialized sc[count] in dynamic shared memory on GPU; 1-token-per-pass scalar weight streaming on CPU. mla_attention_pos_fa2_part + Split-KV on GPU; 8-token register-blocked linear_bf16_omp & linear_4bit_group64_omp in nemotron_cpu_engine.c & lfm3_cpu_engine.c. GPU (kimi-k3): 2.57×–6.84× faster MLA attention, max_abs_diff ≤ 1.12e-7.
CPU (nemotron-3.5 & lfm3-1.7b): Cuts DDR5 weight traffic up to 8× (3.27 s → 1.12 s C engine on Nemotron; 8.73 s → 3.45 s on 24-layer LFM3).
4. Eyeriss v1 (Chen et al., ISCA 2016 / JSSC 2017)
4-Tier Storage & Pruned Operator / Trunk Hierarchy
No per-tier movement accounting; unpruned trunks duplicated weights already packed in operator.bin. Live 4-tier movement ledger (k3_full93_dm_stats & nemo_dm_stats) + trunk pruning (prune_nemotron_trunk.py, prune_lfm3_trunk.py) & 4-bit planar group-64 experts.4bit.direct. GPU (kimi-k3): Eyeriss cost/req dropped 54.205 → 7.731 (7.0×).
CPU: Prunes -46.05% (5.95 GiB) from Nemotron trunks, -15.91% (0 attention.bin left) from all 24 LFM3 trunks, and 3.86× (5.25 → 1.36 GiB) on 4-bit Nemotron experts.
5. Eyeriss v2 (Chen et al., IEEE JETCAS 2019)
Multi-Token Broadcast Coalescing & Dynamic Batch Clubbing
Unicast per-token expert execution fetched 920 cold experts/pass on GPU and 53,023 expert streams across 70 tasks on CPU. coalesce_cold_broadcast on GPU + Dynamic Batch Clubbing (B = 10 prompts/pass with seg_starts[t] isolation) in nemo_forward_pipeline_clubbed and lfm3_forward_24_layers_clubbed on CPU. GPU (kimi-k3): Cold expert fetches dropped 80.0% (920 → 184), 148.5 tok/s.
CPU (nemotron-3.5 & lfm3-1.7b): Cuts Nemotron expert streams by 13.1× (53,023 → 4,037), speeding up Nemotron C by 2.93× (1.12 s/task) and LFM3 C by 2.53× (3.45 s/task) with 0 cross-talk.

Where we started, and where it is now

We started from Fareed Khan’s kimi-k3-in-c (Apache-2.0) on a single CPU workstation (AMD Ryzen 9 7950X3D, 124 GB RAM, dual NVMe RAID1), optimized the 93-layer CPU reference chain bit-identically, and then built the unified 7-layer clover-ai-system architecture running across both our k3 CPU workstation and our 8 × RTX 3090 GPU server across all three switchable models.

Progression from the initial single-CPU C baseline to the current 7-layer clover-ai-system across CPU (k3) and GPU (8 × RTX 3090).
Version & hardware Input / planning & tools Output generation & end-to-end latency
1. kimi-k3-in-c baseline (1 CPU workstation) 1,344 s for the 34 recorded prompts (416 tokens total) 23.7 s per token over 8 tokens; 12.4 s per token over 128 tokens
2. clover-k3 first CPU version (September 2026) 394.9 s for the same 34 prompts; 7.25 s for one 5-token prompt ~5.9 s per token (5.1 s after a 5-word prompt, 6.6 s after 10)
3. clover-kimi-k3 bit-identical CPU engine (October 2026) ~0.3 s per token (1,000-token prompt in ~300 s; 1,000/1,000 embeddings, layer-92 outputs & 8,000 snapshots bit-identical) 3.1 to 3.5 s per token plain (356.3 s for 120 tokens); 2.7 s/tok with DSpark speculative decoding
4. clover-ai-system (7-Layer Neuro-Symbolic, Compiler-Verified & Memory-Accumulating System on CPU k3 & 8 × RTX 3090 GPUs, now) 3 Switchable Layer-1 Engines (nemotron-3.5-super-vl C/OpenMP + 4-bit experts + Native MTP, lfm3-1.7b 24-layer C/OpenMP, kimi-k3 93-layer GPU & CPU) + 256K session context + File-Based Memory Tree & Knowledge Graph (11-Paper Foundations + 5 Direction B Data-Movement Upgrades) + Ontology GraphRAG + Python & Rust Generative Compilation 70 / 70 = 100.0% across all three models (lifting raw nemotron-3.5-super-vl from 16/70, lfm3-1.7b from 19/70, and kimi-k3 from 33/70 to 70/70; 1.12 s/task Nemotron C engine & 3.45 s/task LFM3 C engine on CPU; 1.56 to 11.69 s on GPU)

Credit

The Clover AI System (clover-ai-system) builds directly on the open weights, architectures, and published research of the teams below:

  • NVIDIA — Nemotron 3.5 Super VL (nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-BF16). The 124.45-billion-parameter (12.77B active) 88-layer hybrid Mamba-2 + 512-expert Latent ReLU² MoE + NoPE 16:1 GQA backbone (D = 4,096, V = 131,072 Tekken vocabulary, 1M native context), the 32-layer C-RADIO vision/video encoder with PixelShuffle and EVS video token pruning, and the 2-layer Native Multi-Token Prediction (MTP) head.
  • Liquid AI — LFM3-1.7B (LiquidAI/LFM3-1.7B). The 1.73-billion-parameter 24-layer tri-hybrid model combining 13 width-7 Gated Short Convolutions (Lfm3ShortConv), 5 Sliding-Window GQA layers, and 6 Full Global GQA layers with zero-tail partial RoPE 0.5, per-head sigmoid gates, sandwich RMSNorm, and SwiGLU FFN (D = 2,048, V = 128,000 tied vocabulary).
  • Moonshot AI — Kimi K3 (moonshotai/Kimi-K3). The 2.78-trillion-parameter 93-layer Mixture-of-Experts model (69 KDA + 24 MLA attention layers, 896 routed experts per layer, d = 7,168), the 27-layer MoonViT3d + PatchMergerMLPV2 vision tower, and the 163,840-token tiktoken.model vocabulary. The embedding table, output head, final normalization, vision weights, and tokenizer files are read from the original open weights under their own names.
  • Jiaru Zou, Yunzhe Qi, Sirui Chen, Federico Bianchi, Shang Zhu, Pan Lu, Jingrui He, and James Zou (Stanford University, Together AI, UIUC, Meta) — HybridAgent (arXiv:2610.18861, togethercomputer/HybridAgent). Hybrid Reasoning Agents: LLM Agents that Think in Latent Space, Act through Text. We use their HybridAgent-8B-Agentic model, HybridLink continuous <latent> reasoning mechanism, and <search> / <python> agent architecture, and extend the HybridLink design to Kimi K3’s 7,168-dimensional hidden states (K3NativeHybridLink).
  • Hermann Kumbong, Ishan S. Khare, Iddah Mlauzi, Andrew Woen, Charles Ding, E. Kelly Buchanan, Simran Arora, Azalia Mirhoseini, and Christopher Ré (Hazy Research, Stanford University) — Next-Concept Modeling (arXiv:2610.14162, HazyResearch/ncm, MIT License). Next-Concept Modeling: Fast, Parallel Coarse-to-Fine Text Generation. We adapt their 11-level multiscale residual VQ-VAE tokenizer and coarse-to-fine NextConceptTransformer to Kimi K3’s 163,840-token vocabulary and 7,168-dimensional geometry.
  • Domenico Benfenati and Antonio Maria Rinaldi (University of Naples Federico II) — Ontology-Guided Neuro-Symbolic GraphRAG (doi:10.1007/s00521-026-12495-0, CosmoIknosLab/ontology-guided-graphrag, MIT License). Ontology-Guided Neuro-Symbolic GraphRAG for Grounded Query Answering (Neural Computing and Applications, 2026). We build on their loosely-coupled neuro-symbolic design keeping deterministic ontology graph materialisation, Horn-rule inference, and edge provenance separate from neural generation, along with the six retrieval and verifier enhancements documented in clover-ontology-graphrag-research-context.md.
  • Fareed Khan — kimi-k3-in-c (Apache-2.0). The C engine that showed Kimi K3 could be run from C on one workstation, where our CPU measurements started. Five of its tokenizer headers are included unmodified at commit a2ad8e5 with its licence and notice.
  • Inferact — Kimi-K3-DSpark. The 5-layer dense MLA draft model used for speculative decoding on the CPU workstation.

References

The engine and its README
clover-kimi-k3/README.md: folder map, every setting, chat mode, and the GPU concept-to-token tools in clover-kimi-k3/src/tools/hybrid-ncm-k3.
The set-up script
set-up-new-machine.sh and the GitHub Actions workflow that runs the same steps on a self-hosted machine.
The dataset
Santhoshsathish94/clover-kimi-k3 on Hugging Face: expert-1 to expert-92 and trunk-0 to trunk-92 (809 files, 1,399.8 GiB) plus all 32 hybrid-ncm-k3/ and open-weights/ checkpoints, vision safetensors, and benchmark datasets verified via download-hybrid-ncm-datasets.sh, dataset-files.tsv, and open-weights-files.tsv.