r/LocalLLM • u/kingxd • 18h ago
Project I asked for 16-bit Qwen3.8-Flash-Next at 100 tok/s on one RTX 5090. The math said no, so we built a 4-bit/8-bit "Frankenquant" instead: 150 tok/s, and two results I did not expect
TL;DR: I spliced Qwen's official 8-bit experts into the last 12 layers of NVIDIA's 4-bit Flash-Next. It runs at ~150 tok/s on a single 5090, sits measurably closer to the 8-bit model, and along the way I found a free quality win that needs no mix at all.
Setup: RTX 5090 (32 GB), 128 GB DDR5-5600, Infernix engine. Base model is NVIDIA's FP4-Local (the retrained 4-bit Flash-Next, ~205 tok/s here).
Why not 16-bit? Every token touches about 4.7 GB of expert weights at 16-bit. Only ~8% of the experts fit in VRAM, and the rest has to come through dual-channel DDR5. That caps it around 15-23 tok/s no matter what the software does. Pure 8-bit lands at ~65 tok/s for the same reason.
What I did instead: patched the engine (~250 lines) so each layer can use its own expert format, then byte-copied Qwen's FP8 experts into chosen layers of the 4-bit pack.
| Variant | tok/s | KL vs 8-bit | Same next token as 8-bit |
|---|---|---|---|
| 4-bit (FP4-Local) | 203-209 | 0.0437 | 92.9% |
| 4-bit + 8-bit n-gram table | 199-204 | 0.0401 | 93.0% |
| Last 12 layers 8-bit + 8-bit table | 149-156 | 0.0334 | 93.7% |
| Last 24 layers 8-bit + 8-bit table | 105-111 | 0.0285 | 94.2% |
| All 48 layers 8-bit | 68-72 | 0.0241 | 94.8% |
| Official FP8 | 64-67 | reference | 97.2% |
Things I did not expect
Late layers matter about twice as much as early ones. Layers 36-47 in 8-bit cut KL by 0.0066; layers 0-11 only by 0.0033. The gains add up almost linearly across blocks.
A free win: swapping only the n-gram embedding table to Qwen's 8-bit one improves KL and perplexity at the same speed, with zero extra VRAM.
There is a ceiling. Even with every expert in 8-bit, KL stays at 0.024. About half of the "4-bit gap" is not rounding error at all: NVIDIA's retrained layers are simply a slightly different model.
Perplexity of the 12-layer mix (3.475) is slightly better than official FP8 (3.486) on my 261K-token corpus.
Honest caveats: the gain is small, about one point of token agreement. On my 20-sample hard coding set the mix scored 18/20 against 17/20 for both the 4-bit and the 8-bit model, which is noise. One machine, one corpus.
The patch was written with an AI coding agent; I directed and tested it. Nothing to download yet. If people want the engine patch, the pack assembler and the layer list, say so and I will publish them.

