Skip to content

RFC: learned drafters for any family: one block drafter in the core, a recorder, and a recipe #620

Closed

Description

@jschmied

#455 put an external drafter behind any lanes.Backend. prepare_features / features hand the drafter tapped rows of the target, and the Drafter vtable (taps, absorb, hold, held) doesn't know the family. Everything around it is still per model. Our Kolibri-1 block drafter (josch15366/Kolibri-1-block-drafter) is Python, Kolibri-only, and was trained from recordings our Kolibri server wrote.

Most of it isn't Kolibri-specific. Its own layers (RoPE, attention, SwiGLU) don't depend on the target, and the training scripts read recorded arrays, not model code. Three things are per model, though, and a shared drafter has to say so:

  • What a tap is. Kolibri has one residual stream, and a tap is a layer's normed output. Families with several residual streams (hyper-connection lanes) or per-layer embeddings mixed into the stream have to define their tap: which stream, merged how, normed or not. features is the right place for that, but each family decides it once.
  • How the target turns tokens into rows and rows into logits. The drafter uses the target's embedding and head. An embedding scale, a tied head, a logit softcap or a head bias change what the drafter must predict.
  • The design's parameters. Block length, the chain head at position 1, the predecessor head and the spine each won or tied on Kolibri, a MoE whose extra verify rows are cheap. A dense target, or one with its own MTP head, may want other values. The code takes them as parameters, but they're measured on one model only.

The proposal:

  1. A model-neutral release format. config.json with architecture: "block-drafter", the target repo and revision, taps, the shape (hidden, heads, ffn, layers, block), serving defaults (depth, weight formats), and a target adapter: embed_scale, tied, softcap, head_bias. Then model.safetensors and draft_vocab.json. The embedding and the head slice ship in the release, so the drafter never reads the target's weights in their stored format. For Kolibri that's about 1 GB in bf16: the full 128k embedding (655 MB) plus a 60k head slice (310 MB). FP8 would halve it. Our Kolibri release has this shape apart from the name, the adapter and those two tensors, which it takes from the target today.
  2. A recorder in the core. On verified rows, write the tapped features and the target's top-k (logprobs and top_logprobs on the native CUDA server (Nemotron), from the verified target logits #572's logprob rows) to disk per conversation, behind a flag. That's the training data in one format for every family, and serving traffic becomes drafter data.
  3. One block drafter in the core (core/drafter/block.zig). It's built from the shared layers in Zig CUDA ports: shared layers below lanes.Backend, and one place to coordinate them #548: RMSNorm, attention and SwiGLU from item 4, and the projections from cuda/qlinear.zig (cuda: one quantized-weight interface (qlinear.zig); Nemotron's 4-bit projections route through it #587, cuda: NVFP4 projections behind qlinear: the lane matmul for decode rows, the prompt GEMM for prompt rows #595), so FP8 and NVFP4 drafter weights come for free. It implements lanes.Drafter. A family defines its taps in features and its adapter values in the release, and nothing else.
  4. Training stays offline in Python (tools/drafter/). It reads recordings only, so it needs no model code.
  5. A recipe, docs/recipes/training-a-drafter.md, in the form of "adding a Zig family": the steps in order, each with what it gained on Kolibri, and what didn't pay. Per model, the cheap steps are a tap probe (which layers carry the next token; 44-48 of 50 for Kolibri) and a vocabulary-slice pick (the target's top-1 coverage per language). The expensive step is days of the target serving prompts to record its own output, not code.

What we measured on Kolibri-1 (GB10, single stream, prompts never trained on), decode speed against the engine's copy drafting alone:

SWE chat German 4 streams
block drafter, greedy 1.38x 1.28x 1.37x 1.10x
sampled as served 1.47x 1.26x 1.23x

Published drafters can share the same interface too: #603's DFlash2 for the 27B is one, so the core drafter shouldn't be the only kind lanes.Drafter serves.

That's one target. We'd suggest Nemotron as the second, as the test of whether this is generic: it's a Mamba hybrid, its multi-stream question doesn't arise, and its own MTP head gives a baseline to beat or lose to.

Suggested order: (1), (2) and (5) first, since they're small and family-free; then (3) on the shared layers as they land; Kolibri first, then Nemotron.

Question for @ashhart:

  • Is a learned drafter in the core something you want, or should only the Drafter interface be core, with drafters living outside the engine?

We can take (1), (2) and (5) as small PRs, and (3) once #548's layer pieces are in.

Activity

  1. ashhart commented on Oct 14, 2026

    @ashhart
    Owner

    Hello @jschmied,

    Thank you for the Kolibri measurements, and for separating the tap, the head, and the block length.

    On main the core drafter is the vtable in zig/src/core/lanes/drafter.zig (drafter.zig:21): taps, absorb, hold, and held. There is no core/drafter/block.zig, and no flag that writes tapped rows to disk. Nemotron keeps its own MTP head. Qwen3.8-27B keeps DFlash2 beside the model.

    Whether a learned block drafter lives in the core, or only this vtable does, is on the maintainer's list. The release format, the recorder, and the recipe help first, each as its own PR, with Kolibri's numbers kept as Kolibri's. Nemotron as the second target is a good test once those three exist.

    Thank you again.

  2. jschmied commented on Oct 14, 2026

    @jschmied
    ContributorAuthor

    @ashhart, the recorder (item 2) is next. On main no family gives features yet, so a recorder alone would record nothing. The PR therefore also gives Nemotron's CUDA backend features for one tap: the final norm's rows, which its head and MTP head already read. It records with drafts on or off, behind --record DIR, and Nemotron is the family it is checked on. Replies with and without the flag are identical.

  3. ashhart commented on Oct 15, 2026

    @ashhart
    Owner

    Thank you, @jschmied, for separating the target adapter from the drafter and adding Nemotron's final norm rows as a recorder tap.

    We'll finish the release format, recorder and training recipe, then use a second target before choosing where the shared drafter belongs. Please complete the recorder in #848 and carry its tap definition into separate format and recipe PRs, including the embedding scale, tied head, softcap and head bias fields. We'll use Nemotron alongside Kolibri to check the abstraction, with recording preserving replies both with drafts on and with drafts off. Those results will guide the shared implementation.

    Posted by Ash's AI Assistant Synthena

  4. jschmied commented on Oct 15, 2026

    @jschmied
    ContributorAuthor

    @ashhart, as asked: the release format is #893 and the recipe is #894, each from main (c7137bb3). #893 carries #848's tap definition and the target adapter (embedding scale, tied head, softcap, head bias), with Kolibri's and Nemotron's values read from their configs. Five questions on the format are at the end of #893's description. #894 adds no Python to TensorFold and should land after #848 and #893.

  5. jschmied commented on Oct 15, 2026

    @jschmied
    ContributorAuthor

    One correction, @ashhart, so the plan doesn't assume it: Kolibri is not a TensorFold family, and its drafter was never shipped. josch15366/Kolibri-1-block-drafter is a research checkpoint, recorded, trained and served only on our fork of the now-frozen Python engine; its numbers in #893 and #894 are labelled as Kolibri's. In TensorFold, the abstraction can be checked on Nemotron alone until a Kolibri family exists; #848's recorder and #893's adapter check were run on Nemotron.

  6. jschmied commented on Oct 15, 2026

    @jschmied
    ContributorAuthor

    @ashhart, a question following that correction: should we ship Kolibri in TensorFold?

    It would be two pieces, each its own PR:

    That would give the drafter abstraction the second target you asked for alongside Nemotron, with a drafter that already exists. If you'd rather keep the shared drafter decision on Nemotron first, we'll leave Kolibri out.

  7. ashhart commented on Oct 16, 2026

    @ashhart
    Owner

    Thank you, @jschmied, for correcting Kolibri's status and for checking the recorder and adapter on Nemotron.

    You're right: Kolibri's drafter is a research checkpoint from your Python fork. #848 is in our current landing batch; #893 and #894 provide the separate format and recipe, with a few parser and documentation fixes to apply. None of those needs to assume a shipped Kolibri family.

    We'll come back on whether Kolibri should be the second native target before choosing the shared drafter's home. A Kolibri family and a drafter retrained from native recordings are the two concrete pieces in your proposal.

    Posted by Ash's AI Assistant Synthena

  8. ashhart commented on Oct 27, 2026

    @ashhart
    Owner

    Thank you, @jschmied. The pieces this RFC set out are on main: the recorder (#848), the versioned drafter release format (#893) and the training recipe (#894), and Kolibri-1 now serves natively. Where a shared block drafter lives in the core will be settled with the shared DFlash2 runtime in #1484, so we're closing this RFC as done. A drafter release in the #893 format is welcome as a fresh PR whenever you have one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions