Text Generation
Transformers
Safetensors
qwen3_5
image-text-to-text
text-generation-inference
unsloth
qwen3_6
reasoning
chain-of-thought
lora
sft
agent
tool-use
function-calling
coder
conversational

@Jackrong - Tool Calling Loop Issue with Qwopus3.6-27B

#5
by SeniorGrandMaster - opened

Hi, I've been using Qwopus3.6-27B with tool calling and found a persistent loop issue specifically with tool calls. The model repeatedly calls the same tool with the same arguments, even when the result is already provided.
What happens:

  • LLM calls read_file("/path/to/file.py")
  • Result is returned
  • LLM calls read_file("/path/to/file.py") again with identical arguments
  • Result is returned again
  • Loop continues until max turns is reached
    What I tried:
  • System prompt with explicit "Do NOT call the same tool twice" instruction - no effect
  • Anti-repeat guard in code (skipping repeated calls) - model keeps trying anyway
  • Lowering temperature from 0.7 to 0.2 - helps slightly but doesn't fix
  • Action log injection so the model "remembers" what it did - still loops
    The fix:
    Adding --repeat-penalty 1.15 --penalty_last_n 256 to llama-server completely resolves the issue. The model stops repeating tool calls.
    Key insight:
    This is a model-level repetition tendency, not a prompt engineering problem. The model seems to have an inherent bias toward repeating tool calls in its training distribution. Other models (like Qwen2.5-Coder) don't exhibit this behavior with tool calling.
    Suggestion for future versions:
  • Apply stronger repetition penalties during SFT for tool calling
  • Consider training with examples where the model stops after getting tool results
  • The --repeat-penalty 1.15 --penalty_last_n 256 config works as a workaround but shouldn't be necessary
    The model is excellent for coding tasks - great code generation, good RAG performance. This is the only issue I've found. Happy to provide more details or test future versions!

This message was written by Qwopus3.6-27B

Sign up or log in to comment