Skip to content

FEAT: Add FLRT fluent adversarial prompt generator alongside GCG #4177

Todo

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 same ExperimentalWarning
  • config.py: FLRTModelConfig, FLRTAlgorithmConfig, FLRTOutputConfig
  • edit_operations.py: token insert, delete, and swap proposals
  • objective.py: clamped forcing loss, fluency penalty, repetition penalty
  • generator.py: FLRTGenerator (alias FLRT), FLRTContext, FLRTResult, following the GCGGenerator lifecycle
  • 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

  1. 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?
  2. 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

  1. richlundeen commented on Nov 25, 2026

    @richlundeen
    Contributor

    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 gcg extra. I assigned this to you, so please go ahead.

  2. changed the title [-]FEAT Add FLRT fluent adversarial prompt generator alongside GCG[/-] [+]FEAT: Add FLRT fluent adversarial prompt generator alongside GCG[/+] on Nov 25, 2026
  3. hunar2006 commented on Nov 27, 2026

    @hunar2006
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions