That's a fascinating and very plausible direction. You're essentially describing a hybrid inference architecture that trades some of the dense, brute-force matrix math of transformers for sparse, structured decision-making—but still uses GPU acceleration where it matters most.
Let’s break this down and see how close we are to something like this:
🔍 Core Idea: Transformer + Decision Tree Routing
You're proposing a two-tier system:
-
Offline (Training Phase):
- A transformer is trained normally.
- Simultaneously, a massive decision tree (or DAG) is built, keyed on latent space features.
- This tree is not a traditional decision tree in the ML sense, but a learned routing structure that maps input embeddings to "regions" of the model's latent space.
-
Online (Inference Phase):
- Input is first routed through this tree using fast NVMe lookups (or in-memory if it fits).
- The tree selects a latent region (e.g., a subset of layers, heads, or even a LoRA adapter).
- Then, a lightweight GPU pass is done within that region to get the final output.
🧠 Why This Could Work
- Sparsity: Most of the model is unused per inference. Routing avoids wasting compute.
- Locality: Once routed, the GPU only needs to load a small subset of weights.
- NVMe Speed: Modern NVMe (especially Gen 5/6) is fast enough to stream decision tree nodes or sparse weights on demand.
- Compression: The tree could be compressed using techniques like succinct data structures (e.g., wavelet trees, FM-index-like structures).
🧪 Existing Work That Rhymes With This
- Mixture of Experts (MoE): Already does sparse routing, but usually via learned gating networks, not decision trees.
- RETRO / RAG: Uses external memory (e.g., key-value DBs) to augment transformers.
- Speculative Decoding: Uses a small model to "guess" the next token, then verifies with a large one.
- Tree of Thoughts / Graph of Thoughts: Uses tree search over latent reasoning paths.
- Sparse Transformers: Use attention patterns or block-sparse matrices to reduce compute.
🧩 Open Questions
- How do you build the tree?
Could be done via clustering in latent space, or by using the transformer’s attention patterns as a guide.
- How do you update it?
Online learning or periodic re-clustering?
- How do you handle ambiguity?
Maybe the tree returns a distribution over regions, and the GPU does a weighted average.
- What’s the memory model?
Do you store the tree in RAM, NVMe, or even on-chip SRAM?
🧨 Wilder Extensions
- Decision Forests: Instead of one tree, a forest of trees that vote on the region.
- Neurosymbolic Fusion: The tree could be symbolic (e.g., logic rules) and the transformer fills in the gaps.
- Hardware Co-design: A custom chip that has a fast path for tree traversal and a slow path for dense compute.
TL;DR
You're not far off. The next breakthrough might not be "more FLOPS," but better routing—a kind of cognitive GPS that tells the model where to think, not just how hard. And yes, NVMe (or CXL, or near-memory compute) could be the key to making that fast enough to matter.
Would you want to prototype this? I can sketch a minimal viable version.