Abhimanyu AI logoAbhimanyuResearch II

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.

AuthorsInference Architecture Group (@Saurabh et al.)PublishedNovember 2026Enginev3.7 / v8.2InstitutionNEXAUR Technologies Private Limited
28.1tok/s

Token generation velocity (baseline 11.2)

2.7×

Faster time-to-first-token (3,850 to 1,414.86 ms)

2.5×

Generation speed-up from speculative decoding

0.0%

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:

vmax ≤ BNp · b

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.

ℳcarb = PreLook(τquery, ℋhistory) ⇒ prefix KV-cache reuse

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:

TTFT ≈ T0 + (N − P) · tpf, R = T0 + N·tpfT0 + (N−P)·tpf
Upper bound. When T0 → 0 and P = 255N/256, R = N/(N−P) = 256. This is the best case behind the “up to 256×” prefill figure. It applies only to a prompt that is almost entirely static prefix.

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.

Figure 1. TTFT in ms (lower is better). Testing team measurement.
Figure 2. Tokens per second (higher is better).
Figure 3. Code-fence truncation rate in % (lower is better).

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:

E[N] = ∑i=0K αi = 1 − αK+11 − α

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:

S(α, K, c) = 1 − αK+1(1 − α)(Kc + 1)

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.

Figure 4. Analytical model: expected tokens per verification step E[N] versus acceptance rate α.
Figure 5. Analytical speed-up S versus α with c = 0.071. The marker is the measured 2.5× and its implied α.
Why K = 5. Larger K adds Kc draft cost but yields diminishing gains in E[N] because αK+1 shrinks geometrically. At α ≈ 0.76 the curves in Figure 5 are already flattening around K = 5.

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:

T(y) = 𝟙[ finish_reason = length  ∨  F(y) = 1  ∨  unclosed <think> ], F(y) = (#fence delimiters in y) mod 2

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:

Promptpass+1 = System ∥ Query ∥ Tailcontext ∥ 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:

ℓ*(wt) > 24 characters

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.

Table 1. Measured by the testing team. The Gain column is derived from the two measured columns.
ParameterBaseline (standard GGUF)Abhimanyu v3.7Gain
Time-to-first-token3,850.0 ms1,414.86 ms2.72× faster
Token generation velocity11.2 tok/s28.1 tok/s2.51×
Code-fence truncation rate14.5%0.0% (RLC active)−14.5 pp
VRAM fragment allocationHigh fragmentationNone (expandable segments)Qualitative

End-to-end latency model

(Derived from the measured values.) Generating L tokens takes:

T(L) = TTFT + Lv, Tbase = 3.85 + L/11.2 s, TAbh = 1.415 + L/28.1 s

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×.

Figure 6. Total generation time versus output length, computed from the measured TTFT and velocity.

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

  1. Y. Leviathan, M. Kalman, Y. Matias. Fast Inference from Transformers via Speculative Decoding. ICML 2023. arXiv:2211.17192.
  2. C. Chen et al. Accelerating Large Language Model Decoding with Speculative Sampling. 2023. arXiv:2302.01318.
  3. 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