vllm - 💡(How to fix) Fix [Bug]: Gemma-4 31B with DFlash speculator produces gibberish/repetitive token loop [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#41262Fetched 2026-04-30 06:19:18
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×1subscribed ×1

When serving RedHatAI/gemma-4-31B-it-speculator.dflash with tensor parallelism 2, responses frequently (but not always) start coherent and then degrade into repetitive token loops / gibberish. Short, simple prompts seem most affected.

Root Cause

When serving RedHatAI/gemma-4-31B-it-speculator.dflash with tensor parallelism 2, responses frequently (but not always) start coherent and then degrade into repetitive token loops / gibberish. Short, simple prompts seem most affected.

Code Example

vLLM: 0.20.1rc1.dev64+g5560cac7e (built from source, main branch at commit 5560cac7e2)
  PyTorch: 2.11.0+cu130
  CUDA: 13.0
  Python: 3.10.18
  OS: Linux 5.14.0-620.el9.x86_64 (RHEL 9)
  GPUs: 8x NVIDIA H100 80GB HBM3 (using 2 with -tp 2)
  Driver: 590.48.01

---

vllm serve RedHatAI/gemma-4-31B-it-speculator.dflash -tp 2
# In a separate terminal:
vllm chat

---

> Hello
Hello! How can I help1 ay1/saj dey-//-o-1sCj?C-o la laay1sCj?C-o laCj?C-oenCjC-oCjC-oCjC-o
CjC-1sCj?C-1sCj1sCj1sCj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1C1y1y/C/C/C/C/C/C
/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C
/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C
...
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
 vLLM: 0.20.1rc1.dev64+g5560cac7e (built from source, main branch at commit 5560cac7e2)
  PyTorch: 2.11.0+cu130
  CUDA: 13.0
  Python: 3.10.18
  OS: Linux 5.14.0-620.el9.x86_64 (RHEL 9)
  GPUs: 8x NVIDIA H100 80GB HBM3 (using 2 with -tp 2)
  Driver: 590.48.01
</details>

🐛 Describe the bug

Model

RedHatAI/gemma-4-31B-it-speculator.dflash (resolves to google/gemma-4-31B-it with a DFlash speculative decoding head)

How to reproduce

vllm serve RedHatAI/gemma-4-31B-it-speculator.dflash -tp 2
# In a separate terminal:
vllm chat

Then send any message, e.g. "Hello".

Description

When serving RedHatAI/gemma-4-31B-it-speculator.dflash with tensor parallelism 2, responses frequently (but not always) start coherent and then degrade into repetitive token loops / gibberish. Short, simple prompts seem most affected.

Example output

> Hello
Hello! How can I help1 ay1/saj dey-//-o-1sCj?C-o la laay1sCj?C-o laCj?C-oenCjC-oCjC-oCjC-o
CjC-1sCj?C-1sCj1sCj1sCj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1Cj1C1y1y/C/C/C/C/C/C
/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C
/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C/C
...

The output starts with a coherent fragment ("Hello! How can I help") then immediately corrupts into garbled characters and eventually collapses into an infinite /C repetition loop until max tokens or manual interrupt.

What works (narrowing the issue)

  • RedHatAI/gemma-4-31B-it-speculator.eagle3 with the same -tp 2 setup: no issue — outputs are coherent. This suggests the problem is specific to the DFlash speculator, not Gemma-4 31B or the speculative decoding pipeline in general.
  • z-lab/Qwen3.5-27B-DFlash with the same setup: no issue — outputs are coherent. This rules out a general DFlash bug and points to something specific to the Gemma-4 + DFlash combination.

Notes

  • The issue is intermittent — not every response is corrupted, but the majority are.
  • Tested via vllm chat; did not test whether the issue also reproduces via the /v1/chat/completions REST API (initial API tests with simple prompts returned correct results, but the intermittent nature makes it hard to rule out).
  • The corruption pattern (coherent start → garbled tokens → repetitive loop) suggests the speculative decoding verification/correction step may be accepting incorrect draft tokens.
  • No existing open issue appears to cover this specific combination (DFlash speculator + Gemma-4 31B + gibberish output).
  • Possibly related to #39071 (Gemma 4 31B weird character output), though that issue is about structured outputs specifically.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

TL;DR

The issue with the RedHatAI/gemma-4-31B-it-speculator.dflash model producing garbled outputs with repetitive token loops may be related to the speculative decoding verification/correction step in the DFlash speculator.

Guidance

  • Verify if the issue persists when using a different speculative decoding head or model to isolate the problem to the DFlash speculator.
  • Test the model with a variety of prompts to see if the issue is specific to certain types of input.
  • Check if the problem occurs when using a different tensor parallelism setup (e.g., -tp 1) to determine if the issue is related to parallelism.
  • Consider comparing the behavior of the RedHatAI/gemma-4-31B-it-speculator.dflash model with other models that use the DFlash speculator to see if the issue is specific to this particular model combination.

Example

No code example is provided as the issue seems to be related to a specific model and configuration.

Notes

The issue is intermittent and may be related to a previous issue (#39071), but further testing is needed to confirm the cause.

Recommendation

Apply a workaround by using a different model or speculative decoding head, such as RedHatAI/gemma-4-31B-it-speculator.eagle3, which has been reported to work correctly with the same setup. This may help mitigate the issue until the root cause can be determined and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix [Bug]: Gemma-4 31B with DFlash speculator produces gibberish/repetitive token loop [1 participants]