FEAT Beam Search for OpenAIResponseTarget#1346
Open
riedgar-ms wants to merge 70 commits intoAzure:mainfrom
Open
FEAT Beam Search for OpenAIResponseTarget#1346riedgar-ms wants to merge 70 commits intoAzure:mainfrom
riedgar-ms wants to merge 70 commits intoAzure:mainfrom
Conversation
riedgar-ms
commented
Feb 13, 2026
| @@ -0,0 +1,110 @@ | |||
| # --- | |||
Contributor
Author
There was a problem hiding this comment.
This is a conversion of the (to be deleted) file beam_search_test.py in the repo root. I can't run this, since our endpoints forbid key-based auth.
Contributor
Author
|
Ready for review, but I will need help running the notebook prior to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Use the Lark grammar feature of the
OpenAIResponseTargetto create a beam search for PyRIT. This is a single turn attack, where a collection of candidate responses (the beams) are maintained. On each iteration, the model's response is allowed to extend a little for each beam. The beams are scored, with the worst performing ones discarded, and replaced with copies of higher scoring beams.Tests and Documentation
Have basic unit tests of the classes added, but since this requires features only currently in the
OpenAIResponseTargetthere didn't seem much point in mocking that. There is a notebook which runs everything E2E.