[GH-ISSUE #1161] [Feature Request] Port ngram-mod & other ngram-* self-speculative techniques? #484

Closed
opened 2026-11-04 01:43:26 +07:00 by bsakaguchi · 8 comments
Owner

Originally created by @Interpause on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1161

Opening this as more of a discussion rather than feature request. llama.cpp has a series of self-speculation techniques that use the convo history. Very useful when it comes to repeated one-shot coding, but more importantly agentic coding (most edit tools require you repeat what you are about to replace ad verbatim, and models tend to draft full snippets of the code during reasoning before writing out the exact same thing).

See: https://github.com/ggml-org/llama.cpp/blob/master/docs/speculative.md

Also it is possible to stack the different self-speculation techniques together which is what I did back in llama.cpp: ngram-mod + ngram-map-k4v + spec-dflash together. ngram-mod handles large copy and pastes, ngram-map-k4v handles smaller edits, and spec-dflash (dflash2) handles anything less than 5 tokens long.

Originally created by @Interpause on GitHub (Oct 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1161 Opening this as more of a discussion rather than feature request. llama.cpp has a series of self-speculation techniques that use the convo history. Very useful when it comes to repeated one-shot coding, but more importantly agentic coding (most edit tools require you repeat what you are about to replace ad verbatim, and models tend to draft full snippets of the code during reasoning before writing out the exact same thing). See: <https://github.com/ggml-org/llama.cpp/blob/master/docs/speculative.md> Also it is possible to stack the different self-speculation techniques together which is what I did back in llama.cpp: ngram-mod + ngram-map-k4v + spec-dflash together. ngram-mod handles large copy and pastes, ngram-map-k4v handles smaller edits, and spec-dflash (dflash2) handles anything less than 5 tokens long.
Author
Owner

@ladno64 commented on GitHub (Oct 6, 2026):

Не совсем понял о чем вы говорите. Можно услышать больше информации или пните в нужную сторону.

<!-- gh-comment-id:6018063028 --> @ladno64 commented on GitHub (Oct 6, 2026): Не совсем понял о чем вы говорите. Можно услышать больше информации или пните в нужную сторону.
Author
Owner

@ladno64 commented on GitHub (Oct 6, 2026):

прочитал. весьма интересная функция и может ускорить предсказание,

<!-- gh-comment-id:6018239437 --> @ladno64 commented on GitHub (Oct 6, 2026): прочитал. весьма интересная функция и может ускорить предсказание,
Author
Owner

@j-luwierski commented on GitHub (Oct 6, 2026):

I have a plan to extend the speculative decoding methods in Strata(dflash and maybe dflash2). I already have some ideas for the implementation and integration, and I’ll share more details once I’ve worked through the design.

<!-- gh-comment-id:6022863404 --> @j-luwierski commented on GitHub (Oct 6, 2026): I have a plan to extend the speculative decoding methods in Strata(dflash and maybe dflash2). I already have some ideas for the implementation and integration, and I’ll share more details once I’ve worked through the design.
Author
Owner

@j-luwierski commented on GitHub (Oct 9, 2026):

https://github.com/Niko1221/Strata/pull/1426

I'm currently using this drafter myself, and so far I haven't found anything better:
https://huggingface.co/PixelML/Qwen3.8-Flash-Next-NVFP4-DFlash

Unfortunately, this drafter has a lower acceptance rate than MTP :/

<!-- gh-comment-id:6081895724 --> @j-luwierski commented on GitHub (Oct 9, 2026): https://github.com/Niko1221/Strata/pull/1426 I'm currently using this drafter myself, and so far I haven't found anything better: https://huggingface.co/PixelML/Qwen3.8-Flash-Next-NVFP4-DFlash Unfortunately, this drafter has a lower acceptance rate than MTP :/
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156027120 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Author
Owner

@Interpause commented on GitHub (Oct 14, 2026):

7. Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

This is not a bug report, but a feature request. I suggest using issue tags.

<!-- gh-comment-id:6160447576 --> @Interpause commented on GitHub (Oct 14, 2026): > 7\. Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. > If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too. This is not a bug report, but a feature request. I suggest using issue tags.
Author
Owner

@j-luwierski commented on GitHub (Oct 16, 2026):

Just a quick update: the NVFP4 version of the model achieves a DFlash acceptance rate of 81.02%.

Unfortunately, I don't have a GPU with native NVFP4 support. Would anyone with a compatible GPU be willing to test it and share their results? I'd really appreciate it!
@Niko1221 @Interpause

<!-- gh-comment-id:6223644640 --> @j-luwierski commented on GitHub (Oct 16, 2026): Just a quick update: the NVFP4 version of the model achieves a **DFlash acceptance rate of 81.02%**. Unfortunately, I don't have a GPU with native NVFP4 support. Would anyone with a compatible GPU be willing to test it and share their results? I'd really appreciate it! @Niko1221 @Interpause
Author
Owner

@Interpause commented on GitHub (Oct 17, 2026):

am rtx 4090, no nvfp4 support here unfortunately

<!-- gh-comment-id:6227760948 --> @Interpause commented on GitHub (Oct 17, 2026): am rtx 4090, no nvfp4 support here unfortunately
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#484
No description provided.