Skip to content

Fix mmlu_pro fewshot answers leaking into user role under chat template#3693

Open
kiwaku wants to merge 1 commit intoEleutherAI:mainfrom
kiwaku:fix/mmlu-pro-chat-template-fewshot
Open

Fix mmlu_pro fewshot answers leaking into user role under chat template#3693
kiwaku wants to merge 1 commit intoEleutherAI:mainfrom
kiwaku:fix/mmlu-pro-chat-template-fewshot

Conversation

@kiwaku
Copy link
Copy Markdown

@kiwaku kiwaku commented Apr 9, 2026

Fixes #2780.

When using --apply_chat_template, fewshot reasoning was being included in the user turn instead of split across user/assistant roles.

Changes:

  • Added format_cot_target helper and fewshot_to_target partial in utils.py
  • Changed fewshot_to_text to exclude the answer content
  • Updated _default_template_yaml to use the new target function
  • Added minimal regression test

Based on the fix approach proposed by @Moreh-LeeJunhyeok in #2780.

fewshot_to_text included the full cot_content while fewshot_config.doc_to_target was empty, so fewshot answers were rendered into the user role instead of an assistant turn.

Add format_cot_target, point doc_to_target at it, and keep fewshot_to_text limited to the answer stub.

Fixes EleutherAI#2780
@kiwaku kiwaku requested a review from 0xSMT as a code owner April 9, 2026 09:39
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
All committers have signed the CLA.

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.

mmlu_pro bug in fewshot + chat_template

2 participants