Resident Streaming Architectures for ColBERT-MaxSim RAG: A Conceptual Model
Extrapolated from the reasoning line developed in the dialogue "ONNX alternatives discussion."
Abstract
Standard retrieval-augmented generation (RAG) stacks inherit their serving model from general-purpose ML frameworks: monolithic runtimes (ONNX, Hugging Face from_pretrained()) that bundle tokenization, weights, and execution into a single opaque unit, and a request/response lifecycle that loads, infers, and discards state per call. This paper develops a conceptual architecture that rejects both defaults. We argue for (1) disaggregating the inference stack into independently composable components (tokenizer, weights, kernels), (2) replacing request/response serving with a permanently resident computation model driven by producer-consumer ring buffers, (3) treating ColBERT-style multi-vector retrieval as pure post-hoc geometry over already-materialized points rather than a model-bound operation, (4) replacing artificial chunking with a native sliding-window representation that yields multi-vector structure as an emergent property rather than a constructed one, (5) reframing embedding vectors as signals amenable to frequency-domain compression (an explicit JPEG/JPEG2000 analogy), and (6) exploiting the fact that weights and activations are mathematically indistinguishable tensors to enable lightweight, resident, contextual-bandit-style online adaptation. We position the resulting architecture relative to three established serving paradigms and argue that the gap it fills is a consequence of field immaturity and tooling path-dependence rather than technical infeasibility.
1. Introduction
Contemporary RAG systems are built on a stack of abstractions optimized for generality, portability, and ease of adoption — not for control over hardware execution. This is a reasonable trade-off for most applications, but it forecloses a specific design space: systems in which indexing, retrieval, and adaptation are treated as concurrent workloads against a single, long-lived computational state, rather than as sequential, stateless batch jobs.
This paper does not propose a new model or a new benchmark. It develops, in a structured way, the architectural consequences of a small number of first-principles observations:
- A model is a composition of three independent concerns, not an indivisible object.
- If weights are kept resident, the only meaningful cost left is data movement, not setup — which changes the economics of streaming versus batching.
- Multi-vector similarity (ColBERT/MaxSim) is geometry, not inference, once the vectors exist.
- A vector is a sequence of coefficients, not merely a point — which licenses frequency-domain treatment.
- Weights and activations are tensors distinguished only by update frequency, not by type — which licenses online mutation of "fixed" parameters.
Each section below develops one of these observations and extrapolates its architectural consequences. Section 9 integrates them into a single system diagram.
2. Disaggregating the Inference Stack
The core motivation is control through decomposition. ONNX, PyTorch's from_pretrained(), and the Hugging Face Transformers stack conflate three logically independent concerns:
- Tokenizer — a CPU-side string-to-ID mapping.
- Weights — the actual learned state.
- Execution graph / kernels — the decision of which operation runs when, on which hardware, with which memory layout.
The rejection of ONNX is not a matter of taste; it follows directly from the fact that ONNX removes the third layer — kernel selection, scheduling, memory layout — from developer control. That layer is precisely the one this architecture depends on.
The consequence is a deliberate recomposition into three independently replaceable building blocks: