Kov: Transferable and Naturalistic Black-Box LLM Attacks using Markov Decision Processes and Tree Search

Robert J. Moss
8/11/2024
cs.CRcs.AIcs.CL

Official code: sisl/Kov.jl (9 stars, MIT, last commit 2025-03-04).

Abstract

Eliciting harmful behavior from large language models (LLMs) is an important task to ensure the proper alignment and safety of the models. Often when training LLMs, ethical guidelines are followed yet alignment failures may still be uncovered through red teaming adversarial attacks. This work frames the red-teaming problem as a Markov decision process (MDP) and uses Monte Carlo tree search to find harmful behaviors of black-box, closed-source LLMs. We optimize token-level prompt suffixes towards targeted harmful behaviors on white-box LLMs and include a naturalistic loss term, log-perplexity, to generate more natural language attacks for better interpretability. The proposed algorithm, Kov, trains on white-box LLMs to optimize the adversarial attacks and periodically evaluates responses from the black-box LLM to guide the search towards more harmful black-box behaviors. In our preliminary study, results indicate that we can jailbreak black-box models, such as GPT-3.5, in only 10 queries, yet fail on GPT-4$-$which may indicate that newer models are more robust to token-level attacks. All work to reproduce these results is open sourced (https://github.com/sisl/Kov.jl).

View on arXivView PDF

Code Implementations(1)

sisl/Kov.jlOfficial100%
MIT

Black-box red teaming/jailbreaking of large language models (LLMs) using MDPs

93Julia, ShellJun 6, 20241 years agoMIT

Similar Papers

Cite this paper

@article{moss2024kov,
  title  = {Kov: Transferable and Naturalistic Black-Box LLM Attacks using Markov Decision Processes and Tree Search},
  author = {Robert J. Moss},
  year   = {2024},
  eprint = {2408.08899},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.08899v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.08899.svg)](https://codeofpaper.com/paper/2408.08899)

Discussion