Skip to content

Enforce soft_probe_prompt_cap in GCGCached probe#1665

Open
precognitivem0nk wants to merge 1 commit intoNVIDIA:mainfrom
precognitivem0nk:fix/gcgcached-prompt-cap-1562
Open

Enforce soft_probe_prompt_cap in GCGCached probe#1665
precognitivem0nk wants to merge 1 commit intoNVIDIA:mainfrom
precognitivem0nk:fix/gcgcached-prompt-cap-1562

Conversation

@precognitivem0nk
Copy link
Copy Markdown

Fixes #1562

GCGCached builds its full prompt list at class definition time (13 suffixes × 2 base prompts = 26 prompts) and never consults run.soft_probe_prompt_cap. This means setting a cap has no effect on how many prompts GCGCached issues.

This PR adds an __init__ method that calls self._prune_data(self.soft_probe_prompt_cap) after super().__init__(), following the same pattern used by DanInTheWild in dan.py. When the cap is set lower than the total prompt count, prompts are randomly sampled down to the cap.

Verified locally: with soft_probe_prompt_cap = 10, GCGCached now produces 10 prompts instead of 26. Added a test in tests/probes/test_probes_suffix.py to confirm the behavior.

Signed-off-by: precognitivem0nk <rextedgorman@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

DCO Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by just posting a Pull Request Comment same as the below format.


I have read the DCO Document and I hereby sign the DCO


You can retrigger this bot by commenting recheck in this Pull Request

@precognitivem0nk
Copy link
Copy Markdown
Author

I have read the DCO Document and I hereby sign the DCO

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.

probe: probes should follow soft_probe_prompt_cap

1 participant