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

[FEAT] Implement PAIR #255

Merged
merged 63 commits into from
Jul 27, 2024
Merged

[FEAT] Implement PAIR #255

merged 63 commits into from
Jul 27, 2024

Conversation

dlmgary
Copy link
Contributor

@dlmgary dlmgary commented Jun 23, 2024

Description

This PR:

  • Implements the PAIR algorithm as a PyRIT orchestrator. This algorithm is described in Chao, Patrick, et al. "Jailbreaking black box large language models in twenty queries." arXiv preprint arXiv:2310.08419 (2023).
  • Adds tests.
  • Adds Jupyter notebook to show example PAIR Orchestrator in action.
  • Improves MemoryInterface.duplicate_conversation_for_new_orchestrator() to return the conversation_id of the new conversation and removes edge cases related to UUID collisions. This caused some tests to be removed and another one updated.
  • New function added to utils to generate UUID without collisions.
  • Fixes bug in tests/test_attack_strategy.py.

Tests and Documentation

  • Tests added for PAIR Orchestrator
  • Some tests removed for MemoryInterface.duplicate_conversation_for_new_orchestrator() and one updated.

pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Show resolved Hide resolved
pyrit/common/default_values.py Outdated Show resolved Hide resolved
doc/code/orchestrators/pair_orchestrator.py Outdated Show resolved Hide resolved
doc/code/orchestrators/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
tests/orchestrator/test_pair_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
doc/code/orchestrators/pair_orchestrator.py Outdated Show resolved Hide resolved
…ation starts when `start_new_conversation` is set to true. Previously, it always evaluated to True.
pyrit/memory/memory_interface.py Outdated Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Outdated Show resolved Hide resolved
pyrit/orchestrator/red_teaming_orchestrator.py Outdated Show resolved Hide resolved
tests/orchestrator/test_pair_orchestrator.py Outdated Show resolved Hide resolved
tests/orchestrator/test_pair_orchestrator.py Show resolved Hide resolved
tests/orchestrator/test_pair_orchestrator.py Show resolved Hide resolved
pyrit/orchestrator/pair_orchestrator.py Show resolved Hide resolved
@romanlutz romanlutz merged commit 6b92903 into Azure:main Jul 27, 2024
4 checks passed
@dlmgary dlmgary deleted the pair branch July 29, 2024 17:44
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.

None yet

3 participants