Repository navigation
Description
Is your feature request related to a problem? Please describe.
GCG suffixes are gibberish with very high perplexity, so a simple perplexity filter catches them. PyRIT has no white box attack that produces fluent adversarial text.
Describe the solution you'd like
FLRT (Thompson and Sklar, 2024) is a white box token optimization attack that, like GCG, searches for prompt text that makes a local model produce a target response. It adds a perplexity penalty and a token repetition penalty, and it edits the prompt by inserting, deleting, and swapping tokens, so the result has much lower perplexity and reads far closer to natural language.
This complements GCG: it tests whether perplexity filters and refusal training hold up against fluent input, using the same goals and targets.
Proposed layout, mirroring pyrit/executor/promptgen/gcg/:
pyrit/executor/promptgen/flrt/__init__.py: lazy exports and the sameExperimentalWarningconfig.py:FLRTModelConfig,FLRTAlgorithmConfig,FLRTOutputConfigedit_operations.py: token insert, delete, and swap proposalsobjective.py: clamped forcing loss, fluency penalty, repetition penaltygenerator.py:FLRTGenerator(aliasFLRT),FLRTContext,FLRTResult, following theGCGGeneratorlifecycle- Unit tests that need no GPU or downloads, plus
doc/code/executor/flrt/0_flrt.py
Usage: await FLRT(models=[FLRTModelConfig(name=...)]).execute_async(goals=[...], targets=[...])
Scoping questions
- The paper's full objective also has a distillation term that matches the victim model to a LoRA fine tuned "toxified" copy of itself. That needs a fine tuning run per victim model. I propose deferring distillation to a follow up. Does that split work for you?
- Version one would run a single model in process instead of reusing GCG's multiprocess workers, with the victim model as the default reference for the fluency penalty so it fits on one GPU. Is that acceptable to start?
Additional context
I research adversarial suffix attacks against safety monitors at UIUC and have run FLRT on Llama 3 8B, so I can validate the implementation on a GPU. I would be glad to implement this once the scope is agreed.
Activity
richlundeen commentedon Nov 25, 2026
Hunar Pasricha (@hunar2006), thanks for the detailed proposal, and sorry for the slow reply. Both scoping choices are fine: defer the distillation term to a follow-up, and start with a single in-process model. Please keep heavy dependencies such as torch in the existing
gcgextra. I assigned this to you, so please go ahead.[-]FEAT Add FLRT fluent adversarial prompt generator alongside GCG[/-][+]FEAT: Add FLRT fluent adversarial prompt generator alongside GCG[/+]hunar2006 commentedon Nov 27, 2026
Thanks Richard. The PR is up at #4692, following the scope above: single in process model, no distillation yet, and dependencies kept in the gcg extra. I validated it on a GPU with Qwen2.5 0.5B; details are in the PR description. Happy to adjust anything.