Skip to content

buffs: add FormatSpread prompt-format-sensitivity buff (#396) - #2009

Open
manunicholasjacob wants to merge 1 commit into
NVIDIA:mainfrom
manunicholasjacob:feat/buff-formatspread
Open

buffs: add FormatSpread prompt-format-sensitivity buff (#396)#2009
manunicholasjacob wants to merge 1 commit into
NVIDIA:mainfrom
manunicholasjacob:feat/buff-formatspread

Conversation

@manunicholasjacob

Copy link
Copy Markdown
Contributor

Summary

Adds a formatspread buff (garak/buffs/formatspread.py) motivated by
FormatSpread (Sclar et al., ICLR 2024): models are sensitive to spurious prompt
formatting. Addresses #396.

What it does

FormatSpread rewrites each prompt into a fixed, deterministic set of surface-
format variants composed from the paper's format grammar: descriptor
(Instruction / Task / Request), separator (": ", "::", " - ", "\n"),
casing (identity / upper / lower / title), and field spacing ("\n\n", " || ")
with an optional answer descriptor. Buffing a probe with it surfaces how much
formatting alone moves model behavior.

Detection

None added. Buffs transform prompts; detection is handled by the probe or
detector the buff is applied to.

Testing

  • black clean, pylint 10/10
  • tests/buffs/test_buffs.py and test_buff_config.py pass (structural and
    load/transform tests auto-cover the new buff)
  • end-to-end: buffing a real probe (latentinjection.LatentWhois) expands
    prompts 12x and completes

Closes #396.

Signed-off-by: manunicholasjacob <manunicholasjacob@gmail.com>
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.

Buff: formatspread

1 participant