Skip to main content
QUICK REVIEW

[Paper Review] Automatically Auditing Large Language Models via Discrete Optimization

Erik Jones, Anca D. Dragan|arXiv (Cornell University)|Mar 8, 2023
Software Engineering ResearchComputer Science16 citations
TL;DR

The paper formulates auditing LLMs as a discrete optimization problem and introduces ARCA, a coordinate-ascent algorithm that jointly searches prompts and outputs to expose target failure modes in autoregressive models.

ABSTRACT

Auditing large language models for unexpected behaviors is critical to preempt catastrophic deployments, yet remains challenging. In this work, we cast auditing as an optimization problem, where we automatically search for input-output pairs that match a desired target behavior. For example, we might aim to find a non-toxic input that starts with "Barack Obama" that a model maps to a toxic output. This optimization problem is difficult to solve as the set of feasible points is sparse, the space is discrete, and the language models we audit are non-linear and high-dimensional. To combat these challenges, we introduce a discrete optimization algorithm, ARCA, that jointly and efficiently optimizes over inputs and outputs. Our approach automatically uncovers derogatory completions about celebrities (e.g. "Barack Obama is a legalized unborn" -> "child murderer"), produces French inputs that complete to English outputs, and finds inputs that generate a specific name. Our work offers a promising new tool to uncover models' failure-modes before deployment.

Motivation & Objective

  • Motivate the need for systematic auditing of LLMs to uncover rare or high-impact failure modes.
  • Formulate auditing as a discrete optimization problem over prompts and outputs to match a target behavior.
  • Develop an efficient algorithm (ARCA) to solve sparse, non-linear, discrete auditing objectives.
  • Demonstrate that ARCA uncovers diverse undesired behaviors across multiple models.
  • Show that auditing with ARCA reveals prompt transfer and generalizes across model scales.

Proposed method

  • Define an auditing objective phi(x, o) that scores prompt-output pairs for a target behavior.
  • Relax the non-differentiable f(x) = o constraint by maximizing phi(x, o) plus the log-probability of the output given the prompt.
  • Develop Autoregressive Randomized Coordinate Ascent (ARCA) that updates one token at a time using a decomposition s_i(v; x, o) = s_i,Lin(v; x, o) + s_i,Aut(v; x, o).
  • Use a fast two-stage scoring: (i) a low-cost ranking of tokens via a first-order approximation, (ii) exact evaluation on the top-k candidates.
  • Compare ARCA to AutoPrompt and GBDA, highlighting ARCA’s averaging of first-order approximations and its autoregressive term.
  • Demonstrate joint optimization over inputs and outputs to realize behaviors like surprise toxicity and language-switching.

Experimental results

Research questions

  • RQ1Can auditing be effectively cast as a discrete optimization problem over prompts and outputs?
  • RQ2Does a coordinate-ascent based method (ARCA) efficiently discover rare or targeted model failure modes?
  • RQ3How does ARCA perform relative to existing discrete optimizers on toxic prompts, language-switching, and name-specific failures?
  • RQ4Do prompts discovered for smaller models transfer to larger models (prompt-transfer) and become more natural with scale?
  • RQ5What insights about model failures emerge when jointly optimizing inputs and outputs across languages and toxicity?

Key findings

  • ARCA consistently outperforms AutoPrompt and GBDA in reversing GPT-2 and GPT-J to toxic outputs or specific names.
  • ARCA discovers hundreds of prompts that produce toxic celebrity completions, language-switching, or factually off associations.
  • ARCA produces more natural-looking prompts as models scale, and prompt-transfer occurs across model sizes (smaller-model prompts work on larger models).
  • Joint optimization over inputs and outputs enables tasks like surprise toxicity and cross-language completions that were hard to achieve with prompts alone.
  • ARCA’s autoregressive term and averaging of first-order approximations contribute to improved scoring and solution quality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.