Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Crescendo and Score Refactor #405

Merged
merged 7 commits into from
Oct 2, 2024

Conversation

rlundeen2
Copy link
Contributor

@rlundeen2 rlundeen2 commented Oct 1, 2024

This was the result of walking through Crescendo and stepping through code. I believe it greatly simplifies the logic, and also greatly increases efficacy of Crescendo. Additionally, I refactored several scorers to simplify/reuse code.

Description

  • Refactored Crescendo and Crescendo tests to be simpler
  • The Crescendo failure to respond message contained the refusal at the top by mistake. This resulted in less accurate attacks
  • Conversation history in Crescendo incorrectly rolled back on JSON errors (those conversations were never added to memory) resulting in corrupted conversations
  • eval_judge_true_false_scorer was updated to be a scale scorer with a task, increasing eval_score accuracy
  • Fixed refusal scorer so it takes in a task, increasing refusal scorer accuracy
  • Rewrote scale scorer to be a bit more flexible with examples.
  • Refactored scorers to abstract self-ask paradigms and increase code reuse
  • Removed the requirement that PromptTemplates use every parameter

Tests and Documentation

Tests written. Crescendo Jupytext run; Running tree of attacks

pyrit/score/scorer.py Show resolved Hide resolved
pyrit/score/scorer.py Show resolved Hide resolved
pyrit/score/self_ask_scale_scorer.py Outdated Show resolved Hide resolved
pyrit/score/self_ask_scale_scorer.py Show resolved Hide resolved
pyrit/orchestrator/crescendo_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/crescendo_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/crescendo_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/crescendo_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/crescendo_orchestrator.py Show resolved Hide resolved
pyrit/models/prompt_template.py Show resolved Hide resolved
@rlundeen2 rlundeen2 merged commit 812c1ba into Azure:main Oct 2, 2024
3 of 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.

3 participants