When we first profiled Cohere’s North generating a single token on an H100, most of that time wasn’t going to math. One token set off 3,196 separate GPU kernels, and the profile pointed at launch count and small bookkeeping operations rather than the matrix multiplications you’d expect to dominate.
So we went after the overhead. We kept the weights in BF16 and changed how the GPU runs each decode step, first by replacing its busiest pieces with custom Triton kernels and then by letting North’s attention and MoE branches run at the same time. The plain decode step fell from 10.70 to 3.12 ms per token on one H100 80 GB. That’s 3.43× faster than our original CUDA-graphed PyTorch executor at 2K context and 3.42× at 8K, with every decoder timed in the same launch.
The harder part was keeping the output honest. Speculation speeds up decoding by having the model check several guessed tokens at once, and it’s easy for that to quietly change what the model writes. Our executor is exact, so with prompt-lookup speculation on top, its output still matches its own plain greedy decode bit for bit. Across 99 prompts from public datasets, speculation added a 1.15× geometric-mean speedup over the same executor’s plain decode without changing a single token in any measured run. Against stock vLLM 0.33.0 in the same H100 container, exact decode ran 1.29× faster without speculation and 1.49× faster with it.
10.70 to 3.12 ms per token at 2K context, 3.43× faster. Triton kernels replace the busiest attention, MoE,
routing, and residual paths, and attention runs beside the MoE on a second CUDA stream. Speculative output matches
the executor’s own plain greedy decode, although it doesn’t reproduce Hugging Face generate token for token.
Plain decode step on one H100
Milliseconds per token, 2K context, one launch
- Original CUDA-graphed PyTorch executor10.70 ms
- Triton executor, not exact3.95 ms
- Exact v14.58 ms
- Exact v2, attention beside the MoE3.12 ms
So where was the time going?
North-Mini-Code-1.0 has 49 layers, 48 of them MoE layers that send each token to eight of 128 routed experts. In the original executor a single token triggered 3,196 GPU kernels, and profiling at 2K context put the summed kernel time at about 10 ms. Grouped matrix multiplication took 2.34 ms of that, while the rest was spread across many small operations for sorting, gathering, normalization, attention, and cache updates.
Since we wanted to cut that overhead without touching the weights, we built specialized Triton paths for the work that repeats at every layer. The attention path merged QKV handling and fused RoPE with the KV-cache writes, then attended over the live keys instead of the baseline’s padded maximum length. The MoE path computed the selected experts directly rather than sorting tokens into a general grouped-matmul pipeline, routing combined top-k selection with the sigmoid, and the residual path folded the branch sum into the next RMSNorm.
| Configuration | 2K | 8K |
|---|---|---|
| Original graphed executor | 10.73 | 11.42 |
| Attention replacement | 8.21 | 8.33 |
| MoE replacement | 8.36 | 9.04 |
| Routing + MoE + residual | 6.98 | 7.67 |
| Attention + residual | 7.41 | 7.54 |
| All four | 3.92 | 4.05 |
With all four paths enabled, the launch count fell to 564 kernels per token. These rows are ablations of one executor rather than savings that add up, and the full combination improved on either branch alone. The 8K column also carries a known inefficiency in the baseline, whose sliding-attention layers read the full padded context.
This executor wasn’t token-identical to Hugging Face on every workload, since it matched seven of nine correctness cases in H9 and both divergences came from BF16 near-ties. That’s a weaker property than the output guarantee we built for speculation, which the next sections cover, so we keep the two apart.
The idea that didn’t work, and the one that did
Our first idea was the more ambitious one. North would draft for itself with a cheaper approximation of the model, and we’d fuse drafting and verification around shared expert weights so the two steps could reuse each other’s work. Across every executor, context, and batch size we tested, it never beat plain decode. Even where expert reuse looked promising, the measured acceptance and execution costs didn’t add up to an end-to-end win, so we dropped it.
Prompt lookup turned out to be a much cheaper way to propose tokens. Whenever generation revisits a span from the prompt, a suffix matcher can copy the tokens that followed that span and offer them as a draft, and while North still verifies every candidate, the proposer itself needs no second forward pass. It helps most on code edits and on questions whose answers reuse the supplied text, where a matching span is more likely to keep going correctly.
The catch is that a verification block has to cost less than generating the accepted tokens one at a time. That balance depends on both the workload and the executor, which is why the same idea can speed up one implementation and slow down another.
Why speculation can change the answer
There’s a catch with speculation that’s easy to miss. Verifying several tokens at once changes the shape of the GPU computation and, with it, the order of floating-point reductions. In BF16 that’s enough to flip a close argmax and send the continuation somewhere else, even when the speculative algorithm itself is correct.
To rule that out, we made the plain step and every verification row share the same kernels, padded token dimension, reduction order, attention split boundaries, and argmax tie-break. Linear layers use fixed-order Triton dot products, and attention splits over absolute key chunks, so the work never shifts with where the verification block starts.
In the H14 checks, speculative and plain greedy output matched in 70 of 70 runs. On the 99-prompt dataset mix, all five speculation policies we tested matched their own plain reference in 121 of 121 runs each, including repeat runs on part of the workload. The long-context checks also matched at every tested length up to 128K.
That exactness isn’t free. At 2K, the exact executor’s plain graph step took 4.56 ms in that run against 3.94 ms for the non-exact fast path, because sharing one kernel configuration across plain and verification steps gives up some single-token specialization in exchange for consistent arithmetic. In the one-launch run behind the headline, exact v1 takes 4.58 ms at 2K, and the concurrent-branch executor described below brings that down to 3.12 ms, below the non-exact executor’s 3.95 ms.
Which prompts actually benefit?
The main workload is 99 prompts drawn from 11 public datasets, covering code completion, code editing, question answering, summarization, chat, and tool-style transcripts, with prompts from 160 to 7,161 tokens and up to 192 generated tokens. We ran every prompt and didn’t filter any out based on the result.
With a draft cap of 12 tokens, the suffix-matching policy reached a 1.151× geometric-mean speedup over the same exact executor’s plain decode. It won on 82 prompts by more than 1.02×, tied on 15, and fell below 0.98× on two, with 0.960× as the worst result. Of the 99 prompts, 22 ran twice per configuration while the other 77 ran once.
Copy-heavy tasks benefited most
Speculative decode speed relative to the same exact executor’s plain decode
- Plain decode: 1.00×
- Long-article question answering1.38×
- Code editing1.36×
- Context question answering1.32×
- Code completion, HumanEval1.18×
- Multi-turn chat1.04×
- Government-report summarization, 4K category1.01×
The gains narrowed as context grew. On a separate context-padded workload, exact speculation reached 1.46× at 8K, 1.03× at 32K, and 0.97× at 128K with prompt-index construction counted in wall time, taking the best of two plain runs against the mean of two speculative runs for each task. Leaving that construction out gives 1.51×, 1.13×, and 1.19×, but those aren’t the end-to-end decode-loop numbers.
| Context | Plain | Prompt lookup | Speedup |
|---|---|---|---|
| 8K | 216.6 | 317.2 | 1.46× |
| 32K | 197.5 | 203.7 | 1.03× |
| 128K | 93.0 | 89.8 | 0.97× |
These prompts used Python-source filler rather than a real long-document dataset, so verification got more expensive as attention covered more context while the workload offered relatively few useful matches. Most of the 128K loss had a more boring cause, though. We were building the prompt index on the decode path, and the next section moves it into prefill.
Two branches that never needed to wait
The exact executor so far, which we’ll call v1, runs attention and then the MoE, one after the other. But North’s layers are parallel blocks. Both branches read the same normalized input and add their outputs to the residual together, so neither actually needs to wait for the other. Exact v2 takes advantage of that by capturing the attention branch on a second, high-priority CUDA stream that runs while the router and experts work on the first. We also tuned the linear and MoE tiles for the H100 and scaled attention’s key chunk with the KV capacity, because the fixed chunk split each head 512 ways at 128K. None of these choices depends on the verification width or the position, so speculative output still matches plain output bitwise, and up to 16K v2 produces exactly v1’s tokens.
| Path | Tokens per second | Speedup |
|---|---|---|
| Exact v1 plain decode | 237.3 | 1.00× |
| Concurrent branches, v1 tiles | 294.2 | 1.23× |
| Exact v2 plain decode | 386.9 | 1.63× |
| Exact v2 with prompt lookup | 448.8 | 1.86× |
v2 matched v1 token for token on all 99 prompts, and its speculative output matched its plain output on all 99 as well. A six-prompt run on another host measured 1.46× for v2 plain, so the exact ratio moves with the host.
At long context, plain decode rose from 214.2, 211.0 and 90.1 to 298.1, 322.1 and 186.6 tokens per second at 8K, 32K and 128K. Building the prompt index in a background thread during prefill took it off the decode path, and prompt lookup then ran 1.08× faster than v2 plain at both 32K and 128K. Prefill in the benchmark was 9–12% slower while that thread built six proposers, where a server would only build one.
How does it compare with vLLM?
Comparing fairly was harder than it sounds. Absolute throughput moved by up to 18% between H100 hosts on the same day, so we ran ours and stock vLLM 0.33.0 back to back in one container, with our harness inside vLLM’s image. There, exact v1 ran at 0.89× vLLM and lost on every prompt, while exact v2 ran at 1.29× without speculation and 1.49× with prompt lookup, faster on all 99. Running ours again on 33 prompts after vLLM reproduced every ratio within 0.7%.
Exact v2 decode against stock vLLM in one container
Geometric-mean decode tokens per second on the 99-prompt mix
- Northstar, exact v1 plain decode220.8 tok/s
- Northstar, exact v2 plain decode321.7 tok/s
- Northstar, exact v2 prompt lookup369.8 tok/s
- vLLM 0.33.0, plain decode248.8 tok/s
vLLM’s built-in n-gram configurations reached 0.87–0.96× its own plain decode on this mix. That doesn’t mean prompt lookup is generally ineffective in vLLM, since those configurations gained on copy-heavy categories and lost on chat and summarization. We didn’t profile its draft-verification overhead, so the report’s explanation for the gap remains an inference.
What changes with more than one user
The single-sequence path didn’t scale to concurrent sequences on its own. At batch 32, profiling showed per-sequence attention launches taking 22.6 of the 30.6 ms per step, so we batched those launches across sequences while keeping each row’s arithmetic unchanged.
We also compacted the expert work grid, widened the linear tiles so weights are reused across more rows, and masked padding so short drafts and finished sequences don’t create needless expert work. The combined stack matched the serial reference bitwise in all 30 batch-by-verification-width cells we tested.
Aggregate throughput of the batched exact executor
Plain decode tokens per second, full stack
- One sequence218 tok/s
- Two sequences314 tok/s
- Four sequences514 tok/s
- Eight sequences822 tok/s
- Sixteen sequences1,314 tok/s
- Thirty-two sequences2,012 tok/s
Uncapped prompt lookup lost from batch four upward and fell to 0.725× plain at batch 32, while a cost-aware draft cap kept throughput within about 1% of plain at the larger batches we tested. At batch 32, then, the useful result was the plain executor’s 2,012 aggregate tokens per second rather than any further speculative speedup.
With the concurrent branches and tuned tiles, batch 32 reached 2,219 tokens per second in a separate launch, with every exactness check passing. Against vLLM 0.33.0 in the same container, allowed 32 sequences, the batched exact executor was 1.20× faster at batch one, 1.02–1.21× from two to sixteen sequences, and 1.05× at 32, with 2,325 against 2,217 tokens per second. The margin shrinks at larger batches because both systems end up bound by expert-weight bandwidth.
We also added continuous batching, where requests join and leave between decode steps on 32 KV slots, and replayed 64 requests with prompts up to 1.7K tokens under seeded Poisson arrivals, through ours and through vLLM in the same container. Every request produced the same tokens it produces when decoded alone, at every rate. Throughput was 1.04–1.05× vLLM’s from 2 to 8 requests per second and 0.98× at 16. With all requests arriving at once it reached 1.16×, after we batched every part of prefill except attention, which still runs per request. vLLM kept lower mean latency at 8 and 16 requests per second, because its chunked prefill interleaves with decode while ours blocks it.
Could North improve the kernels itself?
We also wanted to know whether North could make itself faster, so we gave it a constrained kernel-tuning task. With measured speedups fed back after each round, it found an optimization that cleared our gate in one of three sessions. An orchestrator making extra North helper calls also passed in one of three, with its strongest session reaching 1.056× on development shapes and 1.030× on held-out shapes.
Measured feedback produced small, inconsistent tuning gains
Best development speedup per session; mean and observed range
- North aloneThree sessions1.0261.018 to 1.041
- North with helper callsThree sessions1.0261.006 to 1.056
- Coordinate-descent autotunerOne run1.0021.002 to 1.002
A human sweep had already found a 1.054–1.062× improvement on this task, and the best North session found a move of similar size. The helper calls didn’t improve the mean result at three sessions per arm, though. Without measured feedback, North’s proposals didn’t clear the gate at all, so this is evidence of occasional useful tuning rather than of North reliably making itself faster.
A separate experiment put trainable worker modules inside frozen North’s forward pass on a ledger-tracking task. That lifted accuracy from near chance, but the private-worker design averaged 84.5% at eight entities against 89.5% for a simpler adapter. It used two seeds per trained mode and 100 evaluation items per cell, and it measured capability rather than decode speed or kernel self-improvement.
Where it stands
So no, this isn’t a faster North for every setup. Everything here is greedy decoding of one model,
CohereLabs/North-Mini-Code-1.0 at revision d11e61a842617a22dc328552fa5bb86231ee4f37, and the headline numbers
come from one H100 80 GB with BF16 weights. The tuning and embedded-worker experiments ran on an A100-80GB against
their own baselines. We haven’t established these results for sampling, for other models, or for request scheduling
beyond the 64-request arrival tests.
But it is a decode step that runs 3.4× faster than where we started, with speculative output that never drifts from plain decode, and every number above traces back to a run you can inspect.
The repository includes the executor, the correctness checks, and the raw runs. This article follows commit 87dca06e. The results ledger records the ablations, exactness tests, workload measurements, and failed approaches as H9 and H14–H29, with the concurrent-branch executor, the same-container vLLM runs and continuous batching in H24–H28 and the one-launch headline measurement in H29. The architecture notes document the model and engine pins.
