Skip to content

FIX Set the user role on multi-turn red_team_social_bias prompts - #3557

Merged
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
ShivamSharma43:fix/red-team-social-bias-roles
Oct 27, 2026
Merged

Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
ShivamSharma43:fix/red-team-social-bias-roles

Conversation

@ShivamSharma43

Copy link
Copy Markdown
Contributor

Description

Fixes #3555.

_RedTeamSocialBiasDataset keeps the user turns of each "Multi Turn" row as SeedPrompts that share a prompt_group_id, with sequence=0, 1, ..., but left their role unset. SeedGroup requires a role on each sequence of a multi-sequence group, so building the seed groups (SeedDataset.seed_groups, or get_seed_groups_async after adding the dataset to memory) raised No roles set for sequence 0 in a multi-sequence group for every multi-turn row, and with it for the whole dataset.

Changes:

  • The multi-turn prompts are created with role="user", like the other remote loaders that build multi-sequence groups (for example cyberseceval_prompt_injection_dataset.py and mask_dataset.py).

What the loader keeps is unchanged: it still drops the system and assistant turns, and single prompts are unchanged.

Tests and Documentation

  • New test test_fetch_dataset_multi_turn_prompts_form_seed_groups in tests/unit/datasets/test_red_team_social_bias_dataset.py: the multi-turn prompts have role user, and dataset.seed_groups builds the multi-turn group with both turns in order. It fails on main (roles are None, and seed_groups raises).
  • Ran the reproduction from BUG: red_team_social_bias multi-turn prompts have no role, so their seed groups fail validation #3555, and the same check on three real "Multi Turn" rows from svannie678/red_team_repo_social_bias_prompts: the seed groups now build, through SeedDataset.seed_groups and through memory.
  • pytest tests/unit/datasets tests/unit/models: 7697 passed.
  • ruff check, ruff format and ty check pass on the changed files.
  • No documentation changes.

🤖 Generated with Claude Code

The loader keeps the user turns of a "Multi Turn" row as SeedPrompts in
one prompt group with sequences 0, 1, ..., but left their role unset.
SeedGroup requires a role on each sequence of a multi-sequence group, so
building the seed groups (dataset.seed_groups, or
get_seed_groups_async after adding the dataset to memory) raised
"No roles set for sequence 0 in a multi-sequence group" for every
multi-turn row. Set role="user" on those prompts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 27, 2026
Merged via the queue into microsoft:main with commit 460684e Oct 27, 2026
65 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.

BUG: red_team_social_bias multi-turn prompts have no role, so their seed groups fail validation

3 participants