Skip to content

Fix infinite looping for MiMo - #163

Merged
ltmoerdani merged 5 commits into
ltmoerdani:mainfrom
Barragek0:patch-1
Aug 18, 2026
Merged

Fix infinite looping for MiMo#163
ltmoerdani merged 5 commits into
ltmoerdani:mainfrom
Barragek0:patch-1

Conversation

@Barragek0

@Barragek0 Barragek0 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📝 What does this change?

Adds repetition_penalty: 1.2 to MiMo payloads to fix infinite-thinking-loop observed in MiMo v2.5 / v2.5 Pro.

XiaomiMiMo/MiMo-Code#914 - Important excerpt from the Root Cause Analysis section: NVIDIA community notes that repetition_penalty=1.2 mitigates MiMo "Thought Loop" failure mode

Contrary to most information I found on this issue, it does seem to happen when reasoning is off in MiMo too, it just seems to be less frequent, so I added it for both reasoning on and off.

🧪 How did you test it?

Tested with MiMo v2.5 / v2.5 Pro on High and Off reasoning effort, no longer loops endlessly.

✅ Checklist

  • npm run compile passes
  • npm run lint passes
  • npm test passes (324/324)
  • npm run package produces a VSIX
  • I tested it works
  • I updated docs/CHANGELOG

@Barragek0
Barragek0 marked this pull request as draft August 18, 2026 01:15
@Barragek0
Barragek0 marked this pull request as ready for review August 18, 2026 01:24
@ltmoerdani

Copy link
Copy Markdown
Owner

Nice one @Barragek0, this is a clean fix and the upstream research checks out.

Verified on my side: checked out the branch, tests 324/324, compile clean. Also confirmed repetition_penalty doesn't trip bodyRequestsThinking(), so the Go gateway #37635 workaround path is unaffected.

Context for anyone reading later: this is a third mitigation on top of what we shipped for #36 (budget_tokens cap + suffix-repetition detection in the stream extractor). A sampling-level penalty makes sense, and applying it with reasoning off matches the upstream analysis, the loop just fires less often there.

Two things:

  1. Checklist says "I updated docs/CHANGELOG" but the diff doesn't touch CHANGELOG.md. Can you add an entry? Happy to handle it on merge if that's easier, just let me know.

  2. Small nit, not a blocker: consider pulling 1.2 into a named constant next to MIMO_BUDGET_MAP (e.g. MIMO_REPETITION_PENALTY) so it reads as a tuning knob instead of a magic number. Fine to keep inline if you prefer.

Once the CHANGELOG entry is sorted I'll merge with a merge commit so your three commits stay intact.

@ltmoerdani
ltmoerdani merged commit ef844c6 into ltmoerdani:main Aug 18, 2026
2 checks passed
@Barragek0
Barragek0 deleted the patch-1 branch August 18, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants