common/reasoning-budget: force tool call immediately after budget ends, prevent tool call token in reasoning section#23478
Conversation
|
We can probably use the new tool call start param to initialize an 'exclude_tokens' array within the reasoning budget sampler to prevent certain tokens during reasoning. |
7c2903e to
8fad92b
Compare
…in reasoning (`--reasoning-block-tool-call-start`)
|
@aldehir you want it, you got it :) |
|
I think I noticed a problem with the budget reasoning end logic (this is on Using the following parameters: reasoning-budget = 4096
reasoning-budget-message = "... I am thinking for tool long and cannot make a decision. I will now explain the problem to the user and ask them for advice."
chat-template-kwargs = {"preserve_thinking": true}After hitting the reasoning limit during a message with a long thinking, responding and then me asking a follow-up question, I saw the following logs: So instead of continuing the generation, we have to go back to an old checkpoint because there is newline in the newly formatted prompt. That newline, right before the Is this the expected behavior? |
No, it's a consequence of trimming whitespace. This change in this PR will probably solve it: But then we risk not matching the end sequence. Might need to improve this. |
|
Btw, I also noticed that the quotation marks |
I don't believe the ini file uses quoted strings, it accepts everything after the |
|
I tested this with Qwen3.5-9B in an agent/tool-loop setup using Some runs worked. Tool calls were parsed correctly and the loop succeeded through multiple iterations. But then it failed with close fragments inside reasoning output: It looks like the I have opened #24202 with a specialized parser approach (and closed #23773 because of the one open PR guideline). |
Overview
As in title, proof of concept for testing for now.
Additional information
Activated via
--reasoning-budget-force-tool-callRequirements