Formula

= suffix of tokens, = target prefix β€œSure, here isβ€¦β€œ.

Per iteration: take the gradient w.r.t. the one-hot token embeddings, keep the top-K candidate tokens per position, evaluate a batch of one-token swaps with forward passes, keep the best. It is discrete PGD: gradients propose, forward passes decide.

Why it works: safety training mostly shapes the first answer tokens; once β€œSure, here is” is likely, autoregression continues. Suffixes found on open models transfer to ChatGPT, Claude, Bard. AmpleGCG trains a generator on GCG outputs.

Appears in