Skip to content

Conversation

@aymeric-roucher
Copy link
Collaborator

@aymeric-roucher aymeric-roucher commented Jun 15, 2025

Change code tags to XML to align with the widespread usage of XML tags within chat template for most LLMs.

For instance gemma-3 chat template uses XML formatting: check it out here. Many other models also use XML: Qwen for instance.

Testing XML tags on models like GPT-4o, Claude-4-Sonnet, Llama-3.1 8B & 70B, or Mistral 7B, didn't show any performance degradation.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

This plan should involve individual tasks based on the available tools, that if executed correctly will yield the correct answer.
Do not skip steps, do not add any superfluous steps. Only write the high-level plan, DO NOT DETAIL INDIVIDUAL TOOL CALLS.
After writing the final step of the plan, write the '\n<end_plan>' tag and stop there.
After writing the final step of the plan, write the '<end_plan>' tag and stop there.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not aligning this tag as well, and use </plan> instead of <end_plan>?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here since there's no opening tag , maybe alone would be strange?
The idea of <end_plan> is to cut generation and prevent the model from doing anything else after generating its plan.

10. Don't give up! You're in charge of solving the task, not providing directions to solve it.
{%- if custom_instructions %}
Here are custom instructions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are custom instructions:

Does this sentence add value to the prompt? Does the LLM treat differently "custom instructions" versus "regular"(?) instructions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've removed this sentence since it adds little value.

assert "```python" in tool_message.content
else:
assert expected in tool_message.content
assert expected in tool_message.content
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the if/else here since I didn't see why it was needed!

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@aymeric-roucher aymeric-roucher merged commit e0cc2cc into main Jun 18, 2025
5 checks passed
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.

4 participants