NEXAUR / Abhimanyu AI / Technical paper II
Abhimanyu AGI Inference Engine: CARB-X Injection, Speculative Subspace Decoding and Recursive Loop Continuation
How a sovereign on-premise engine reaches 28.1 tokens per second and 1,414.86 ms time-to-first-token on local hardware, using prefix KV-cache reuse, a 0.5B draft model and stateful completion recovery.
Token generation velocity (baseline 11.2)
Faster time-to-first-token (3,850 to 1,414.86 ms)
Generation speed-up from speculative decoding
Code-fence truncation with RLC active (baseline 14.5%)
Abstract
On-premise language model deployment is limited by memory bandwidth during autoregressive decoding and by context exhaustion during long, multi-file generation. This paper describes three mechanisms in the Abhimanyu AGI engine: CARB-X matrix injection, which pins a static prefix in the KV cache and injects a per-query problem matrix; speculative subspace decoding, where a 0.5B draft model proposes K=5 tokens that the primary model verifies in one forward pass; and Recursive Loop Continuation (RLC), a stateful protocol that resumes truncated generations and repairs code-fence seams. A native C++ AVX2 suffix-trie halts repetition loops. In our testing team's measurements on consumer GPU hardware, token velocity rose from 11.2 to 28.1 tok/s, time-to-first-token fell from 3,850 ms to 1,414.86 ms, and code-fence truncation fell from 14.5% to 0.0%.
01The on-premise bandwidth bottleneck
In autoregressive decoding every new token requires reading all model weights from VRAM, while the arithmetic per token is small. Decoding is therefore memory-bandwidth bound (the roofline argument, ref. 3). With B the memory bandwidth, Np the parameter count and b the bytes per parameter, the throughput ceiling is:
Two consequences follow. First, a bigger GPU compute budget does not raise decode speed; only fewer weight reads per accepted token does. Speculative decoding (Section 3) attacks exactly this. Second, long generations hit the context limit mid-output, which leaves unclosed code fences that break downstream parsers. RLC (Section 4) attacks that.
Bandwidth starvation
Each token costs one full pass over the weights. Throughput is set by B, not by FLOPs.
Context exhaustion and fence inversion
When finish_reason == "length" fires inside a code block, the output ends with an open fence and the result is unusable without repair.
02CARB-X matrix context injection
The CARB-X broker inspects prompt complexity before execution and injects a problem-matrix header into the prefix of the KV cache. Static system instructions stay pinned in native memory (logits_all=False), so only the new part of the prompt is prefilled.
Prefill cost model
Let N be the prompt length, P the reused prefix length, tpf the per-token prefill time and T0 the fixed overhead. Then:
Measured result. End-to-end TTFT fell from 3,850.0 ms to 1,414.86 ms, a 2.72× improvement. (Derived.) If TTFT is dominated by prefill, this means about 63.2% of baseline prefill work was removed (1 − 1,414.86/3,850). The gap to the 256× bound is expected, because fixed overhead T0 and the newly injected matrix header are not cached.
03Speculative subspace decoding
A lightweight draft model (Qwen2.5-0.5B) proposes K = 5 tokens. The primary model (Qwen2.5-Coder-7B) scores all of them in a single forward pass and keeps the longest accepted prefix, plus one corrected token. Draft and primary model must share one tokenizer vocabulary. With per-token acceptance probability α (assumed independent), the expected tokens produced per verification step are:
Let c be the cost of one draft step relative to one primary step. In the bandwidth-bound regime, c ≈ 0.5/7 ≈ 0.071, the ratio of weight bytes read. One iteration costs Kc + 1 primary-step equivalents, so the speed-up over plain decoding is:
This is the analysis of refs. 1 and 2. (Derived.) Setting S = 2.5 with K = 5 and c = 0.071 gives an implied acceptance rate of 0.76, meaning roughly three of four drafted tokens are accepted. This is an interpretation of the measured 2.5× velocity, not a separate measurement.
04Recursive Loop Continuation (RLC)
When a pass ends early, RLC starts a stateful continuation instead of returning a broken answer. A pass is flagged as incomplete when any of three conditions holds:
While T(y) = 1, the next prompt is rebuilt from the system prompt, the query, a bounded tail of the output so far and a continuation directive:
If each pass can emit at most B new tokens, an output of total length L needs m = ⌈L/B⌉ passes. The static System and Query segments are prefix-cached (Section 2), so continuation passes do not pay full prefill again.
Seam sanitization
A model resuming inside a code block often re-emits an opening fence such as ```html, which would split one file into two blocks. _sanitize_continuation_seam detects that the previous tail ended with F = 1 and the continuation begins with a fence opener, and drops that opener. The merged output then satisfies F = 0 when generation completes normally.
05C++ AVX2 SuffixTrie loop breaker
Small models can fall into repetition loops. The engine passes the recent window to native code (bridge.detect_repetition_loop_cxx), outside the Python interpreter. With wt the last W = 3,000 tokens and ℓ*(wt) the length of the longest suffix of wt that also occurs earlier in the window, the stream halts when:
Because the analysed window is bounded, the cost of each check does not grow with total output length. After a halt, RLC can resume with a directive that steers away from the repeated clause.
06Benchmarks and token velocity
Live telemetry recorded by the NEXAUR testing team during multi-file code generation and deep research tasks on consumer GPU hardware.
| Parameter | Baseline (standard GGUF) | Abhimanyu v3.7 | Gain |
|---|---|---|---|
| Time-to-first-token | 3,850.0 ms | 1,414.86 ms | 2.72× faster |
| Token generation velocity | 11.2 tok/s | 28.1 tok/s | 2.51× |
| Code-fence truncation rate | 14.5% | 0.0% (RLC active) | −14.5 pp |
| VRAM fragment allocation | High fragmentation | None (expandable segments) | Qualitative |
End-to-end latency model
(Derived from the measured values.) Generating L tokens takes:
For L = 1,000 tokens that is about 93.1 s versus 37.0 s (2.52×). Short answers benefit most from the TTFT gain (2.57× at L = 100), and long outputs converge to the velocity ratio of 2.51×.
07Limitations and methodology notes
The four measured rows come from our internal testing team on consumer GPU hardware. The 0.0% truncation result is the rate observed on the test set and is not a guarantee for every prompt. Values marked “derived” or “analytical” follow from the stated formulas and assumptions (independent acceptance, bandwidth-bound regime, prefill-dominated TTFT). They are not independent measurements. Speed-ups depend on the draft model’s acceptance rate, which varies with the task. Code generation is typically more predictable than open-ended prose.
References
- Y. Leviathan, M. Kalman, Y. Matias. Fast Inference from Transformers via Speculative Decoding. ICML 2023. arXiv:2211.17192.
- C. Chen et al. Accelerating Large Language Model Decoding with Speculative Sampling. 2023. arXiv:2302.01318.
- S. Williams, A. Waterman, D. Patterson. Roofline: An Insightful Visual Performance Model for Multicore Architectures. Communications of the ACM, 2009.
Cite this paper
If you use or discuss this work, please cite it as follows.
@techreport{abhimanyu_inference_2026,
title = "Abhimanyu AGI Inference Engine: CARB-X Matrix Injection, Speculative Subspace Decoding and Recursive Loop Continuation",
author = "Inference Architecture Group, NEXAUR Technologies Private Limited",
institution = "NEXAUR Technologies Private Limited",
year = "2026",
month = "nov",
url = "https://nexaur.online/abhimanyu-inference"
}
Related: Paper I: Multi-tenant RAG and cognitive memory · Abhimanyu AI model overview · Privacy policy · Paper III: Benchmarks