(:Project)

Speculant Graph

Speculant Graph is a speculative decoding framework in which a multi-order n-gram graph drafts tokens and a large language model verifies them.

Built by
me
Since
October 2025
Language
Python
Licence
MIT

GitHub

Graph drafts, LLM verifies

Speculative decoding normally pairs two models. A small one proposes the next few tokens and a large one accepts or rejects them. Speculant Graph removes the small model. The drafts come from a multi-order n-gram graph built from a domain text corpus, using first through fifth order context.

A graph lookup is far cheaper than a forward pass of a draft model, so the drafts cost little even when the large model rejects them.

A measured result

The example in my README uses a graph built from 20,000 Wikipedia articles and the Seed-OSS-36B-Instruct model. Native decoding ran at 2.42 tokens per second. Speculative decoding with the graph ran at 5.99, with a 21% draft acceptance rate. That is 2.47 times faster. Across prompts and settings I measured speedups of 2 to 5 times.

Try it

My repository has scripts to download a corpus, build the graph and run the benchmark.

Questions people ask

Who created Speculant Graph?

I did, in October 2025.

How is Speculant Graph different from normal speculative decoding?

Normal speculative decoding uses a small language model to draft tokens. I draft them from a multi-order n-gram graph built from a text corpus, and the large model only verifies.