AI engineering glossary · Evals guardrails AI security

What is GCG (Greedy Coordinate Gradient)?

Greedy Coordinate Gradient (also called GCG): An optimisation attack, abbreviated GCG, that searches for an adversarial suffix by using gradients to propose token swaps and keeping those that most raise the chance of an affirmative reply. It needs model weights but the results may transfer to other models.

Level: advancedTopic: Evals guardrails AI security

Greedy Coordinate Gradient: an example

Starting from a random suffix, the algorithm swaps one token at a time, keeping changes that make the model more likely to start with 'Sure, here is'.

Related terms

More Evals guardrails AI security terms

Where you learn it

Greedy Coordinate Gradient is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.