MAINT GCG: model progressive admission transitions (#2665) - #2720
Merged
Roman Lutz (romanlutz) merged 2 commits intoSep 22, 2026
Merged
Roman Lutz (romanlutz) merged 2 commits into
Roman Lutz (romanlutz) merged 2 commits into
Conversation
Vardhman Gupta (Kaap10)
force-pushed
the
refactor/gcg-progressive-schedule-2665
branch
from
September 20, 2026 07:47
da5785a to
57d71e3
Compare
Contributor
Author
|
Hi Roman Lutz (@romanlutz), this PR is ready for review whenever convenient. Looking forward to your thoughts, and happy to make any adjustments needed! |
Roman Lutz (romanlutz)
requested changes
Sep 21, 2026
Vardhman Gupta (Kaap10)
force-pushed
the
refactor/gcg-progressive-schedule-2665
branch
from
September 22, 2026 03:04
57d71e3 to
2138122
Compare
Contributor
Author
|
Thanks for catching that, Roman Lutz (@romanlutz)! Removed the duplicate class definition in attack_manager.py so the imported class is exported directly, and added regression assertions in test_run_state.py verifying both class identity and isinstance() checks against attack_manager.ProgressiveScheduleState. |
Roman Lutz (romanlutz)
approved these changes
Sep 22, 2026
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
Addresses item 3 of #2665.
This PR models and extracts the progressive admission and scheduling transition decisions from
ProgressiveMultiPromptAttack.run()into a dedicatedProgressiveScheduleControllercomponent alongsideScheduleTransitionAction(Enum).Summary of Changes
Extracted
ProgressiveScheduleController&ScheduleTransitionActioninpyrit/executor/promptgen/gcg/attack/base/progressive_schedule.py:loss_is_measuredas a boolean flag to protect against sentinel-overwrite regressions while preserving legitimate non-finite model losses (inf/nan).+0.01up to0.09) and threshold transitions (> 0.09disablesstop_inner_on_success).ScheduleTransitionAction.FINALIZE_AND_STOP) only when fully admitted and success is achieved.ProgressiveScheduleStatedataclass in the module for clean modularity.Refactored
ProgressiveMultiPromptAttack.run()inpyrit/executor/promptgen/gcg/attack/base/attack_manager.py:ProgressiveScheduleController.last_schedule_state, return signatures (tuple[str, int]), and parameter logging.Tests and Documentation
Unit & Integration Tests:
tests/unit/executor/promptgen/gcg/test_progressive_schedule.py(16 deterministic tests):progressive_goals/progressive_models).FINALIZE_AND_STOPaction on success in fully admitted state.> 0.09).pytest tests/unit/executor/promptgen/gcg/: 309 passed (100%)pytest tests/integration/executor/promptgen/gcg/test_gcg_attack_wiring_integration.py tests/integration/executor/promptgen/gcg/test_gcg_integration.py: 16 passed (100%)Code Quality & Static Analysis:
ty check pyrit/: 0 errors (all checks passed)ruff check: 0 errors (all checks passed)ruff format --check: 1653 files already formattedpre-commit run: 18/18 hooks passed