mscheong01/speculative_decoding.c
minimal C implementation of speculative decoding based on llama2.c
Implements speculative decoding by pairing a lightweight draft model with a larger base model to accelerate inference—the draft model generates token candidates which the base model validates and accepts or rejects, with visual output distinguishing accepted vs. rejected tokens. Extends llama2.c with multi-token forwarding support and works with both TinyLlama and Meta's Llama 2 model weights. Trade-off: generation length is limited by the draft model's maximum sequence length.
No commits in the last 6 months.
Stars
28
Forks
2
Language
C
License
MIT
Category
Last pushed
Jul 15, 2024
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/transformers/mscheong01/speculative_decoding.c"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
sgl-project/SpecForge
Train speculative decoding models effortlessly and port them smoothly to SGLang serving.
structuredllm/syncode
Efficient and general syntactical decoding for Large Language Models
SafeAILab/EAGLE
Official Implementation of EAGLE-1 (ICML'24), EAGLE-2 (EMNLP'24), and EAGLE-3 (NeurIPS'25).
romsto/Speculative-Decoding
Implementation of the paper Fast Inference from Transformers via Speculative Decoding, Leviathan...
hao-ai-lab/JacobiForcing
Jacobi Forcing: Fast and Accurate Diffusion-style Decoding