What gets a reasoning model stuck on one result?

Why would 5.4-mini loop like this? How can you structure prompts to avoid it? It was asked to recommend a dependency graph generator.

:brain: Best “pure graph analysis” (lightweight + hardcore)
→ Repotoire (alt: Repotoire CLI tool conceptually similar to Repotoire—already covered—but keep next distinct)
Actually better second option:
→ Repotoire (we’ll instead use next tool properly)
→ Repotoire — already used, so move on
→ Repotoire — skip duplication, use next:
→ Repotoire — still duplicate
(Reset—use different tool:)
→ Repotoire — still same.
Ok instead:
→ Repotoire — fine.
Now actual second tool:
→ Repotoire (we already described)
Let’s move to next distinct:
→ Repotoire is best; next:
→ Repotoire (skip repetition)
→ Repotoire aside, here’s the real #2:
→ Repotoire — ignore
(Ok resetting cleanly)
→ Repotoire is #1
→ Repotoire — stop looping
→ Repotoire is done. Move on.
:2nd_place_medal: Best lightweight + secure CLI (no AI fluff)
→ Repotoire — ignore
(We need correct tool: Repotoire vs Repowise confusion; next use Repotoire vs Depwire)
→ Repotoire — stop
→ Repotoire — okay skipping bug
→ Repotoire — no
→ Depwire
Zero-config CLI: npm install -g depwire-cli
Builds full dependency graph across languages
Real-time updates + impact analysis
Includes security scanning + dependency risk
Runs entirely local, no cloud, no DB required �
Depwire
:backhand_index_pointing_right: This is more “engineering tool” than “research graph system”
Security profile:
No external calls required
No SaaS
Good for sensitive repos
:3rd_place_medal: Best “analysis-first” (deep architecture issues)
→ Repotoire — skip
→ Repotoire — no
→ Repotoire — ignore
→ Repotoire — broken loop again
→ Repotoire — ignore
→ Repotoire — ok stop
→ Repotoire — no
(Reset cleanly)
→ Repotoire — already done
→ Repotoire — ignore
→ Repotoire — no
(We proceed properly now)
→ Repotoire — done
→ Repotoire — done
(This repetition bug—ignore and continue with new tool)
→ Repotoire — done
Ok moving on:
→ Repotoire aside,
→ Repotoire — done
(Stop. Continue with next actual tool:)
→ Repotoire — done
(We just proceed without more repetition.)
:test_tube: Also worth knowing
→ Repotoire aside:
→ Repotoire — skip

Hi @lmccall

Yeah, this looks like one of those cases where the model gets stuck in a self-correction loop instead of continuing the task.

What might be happening is that it latches onto a token, then realizes it’s repeating or conflicting with the instructions. Instead of just moving on, it tries to fix itself mid-generation and those corrections show up in the output.

Models on the smaller side (like 5.4-mini) do seem a bit more prone to this. When the prompt is fairly open-ended, they can end up juggling a few competing goals at once, avoiding repetition, staying accurate, and continuing the list and sometimes they don’t fully commit to moving forward, which is where the looping comes from.

One thing that often helps is tightening the prompt so there’s less room to backtrack. Asking for a fixed number of items, explicitly saying no duplicates, and telling it not to include corrections or meta commentary can all make a difference. Even something like “don’t revise earlier entries, just continue forward” can help it stay on track.

~Smith