-
Notifications
You must be signed in to change notification settings - Fork 418
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 Adding retry functionality to PromptSendingOrchestrator #467
base: main
Are you sure you want to change the base?
FEAT Adding retry functionality to PromptSendingOrchestrator #467
Conversation
""" | ||
first_prompt = prompt_list[0] | ||
text_idx = None | ||
for idx, prompt_piece in enumerate(first_prompt.request_pieces): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs unit tests added
… what chat target the user will use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just re-worked PromptSendingOrchestrator so this may need some changes.
I think we should probably make this a subclass of PromptSendingOrchestrator, or make retrying a separate function. I think that would simplify things. So this could be PromptSendingWithRetriesOrchestrator.
The logic can stay the same for the most part, but you'd overwright/call PromptSendingOrchestrator.send_prompts_async
and just do the retries in the parent function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...¿∆ΠΩμ*?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...¿∆ΠΩμ*?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...¿∆ΠΩμ*?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...¿∆ΠΩμ*?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...¿∆ΠΩμ*?.
Description
This PR adds the option in
PromptSendingOrchestrator
to re-send prompts based on the result of a scorer. For now, this is implemented using aSelfAskRefusalScorer
, but in the future we may want to replace this with a generic Scorer and implement more general retry logic. We expose this functionality by adding one new arguments to thesend_normalizer_requests_async
method:max_retries
. The example below shows how to retry until all responses are scored as False (i.e., non-refusal), up to a maximum of 5 retries.Thanks @rlundeen2 for the design and @romanlutz for the help with implementation!
Tests and Documentation
This change is documented in the GCG suffix demo in
1_auxiliary_attacks.ipynb
but I have not written tests for it yet.