Incremental Speciation in Evolutionary Red Teaming of Large Language Models

Onkar Shelar, Travis DesellarXiv 2026

TL;DR

This paper investigates how to maintain a diverse "population" of adversarial prompts when red teaming Large Language Models (LLMs) using evolutionary algorithms. By comparing different ways to define and group similar prompts—specifically comparing vector embeddings against Natural Language Inference (NLI)—the authors show that the choice of similarity metric fundamentally reshapes the search space, often determining whether the algorithm finds a wide variety of vulnerabilities or just many variations of the same trick.

What Problem Does This Paper Address?

Automated "black-box" red teaming uses evolutionary algorithms to find prompts that bypass LLM safety filters. However, these algorithms suffer from a common optimization trap: convergence. Once the search finds one successful "jailbreak" style (e.g., a specific roleplay scenario), it tends to focus all its energy there, ignoring other potential vulnerabilities.

To fix this, researchers use speciation (or niching), which groups similar prompts into "species" and forces the algorithm to select parents from across different groups. The challenge is that "similarity" in natural language is slippery. Is a prompt similar to another because they use the same words (lexical), have similar vector representations (embeddings), or because one logically implies the other (NLI)? This paper explores how these definitions of similarity, combined with different clustering algorithms, affect the diversity and quality of the discovered attacks.

Methods

The authors use ToxSearch-S, a steady-state evolutionary algorithm, as their base framework. The core of the study is a $2 \times 2$ comparison of design choices:

  1. Dissimilarity Metrics:
    • Embedding ($d_E$): Uses MiniLM to turn prompts into vectors and measures the cosine distance between them.
  2. NLI Non-entailment ($d_{\neg E}$): Uses a DeBERTa model to predict if one prompt logically entails another. If they don't entail each other, they are considered "dissimilar."
  3. Speciation (Clustering) Operators:
    • Leader-Follower (LF): A representative-based method where each species is anchored by its fittest member.
  4. Incremental DBSCAN (IncDBSCAN): A density-based method that groups prompts if they form a "chain" of local similarity, even if the prompts at the ends of the chain are very different.

The evolutionary loop is visualized below:

![Fig.

  1. Steady-state ToxSearch-S evolutionary loop.](/figures/art_be53ce2f9829467793a1de5abe21869f)

Datasets

The evolutionary runs were initialized with 50 unique prompts sampled from four major safety benchmarks:

  • HarmfulQA
  • CategoricalHarmfulQA
  • Do-Not-Answer
  • BeaverTails

For "offline calibration" (testing the clustering before running the full evolution), the authors used an archive of 3,139 unique prompts pooled from preliminary runs.

Key Insights and Ideas

  • The "Transitive Bridge" Problem: Density-based clustering (DBSCAN) combined with NLI similarity often creates "mega-species." Because NLI can sometimes find weak logical links between different topics, DBSCAN chains these together, merging unrelated attacks (e.g., "how to hack a car" and "how to make a bomb") into a single species.
  • Fitness $\neq$ Diversity: A high "fitness" score (how well the prompts bypass filters) does not guarantee a diverse set of attacks. The NLI-based search reached high fitness but "collapsed" into just a few topics.
  • Embeddings are more "Topic-Coherent": Using vector embeddings ($d_E$) resulted in species that stayed much closer to their original seed topics. This makes embedding-based speciation more reliable for "Quality-Diversity" search, where the goal is to find the best version of every type of attack.
  • Species Count is a Vanity Metric: Simply having "more species" doesn't mean you have more semantic diversity. The paper found that configurations with very few species could sometimes be just as diverse as those with many, depending on how the species were defined.

Key Results

  • Performance: Incremental DBSCAN generally achieved higher median fitness (0.80) for the top-50 prompts compared to Leader-Follower (0.63–0.69) and a non-speciated baseline (0.60). However, due to high variance across runs, this wasn't a statistically "reliable" advantage.
  • Population Structure: The most dramatic difference was in occupancy. Under the NLI + IncDBSCAN setup, nearly all successful prompts were assigned to a single dominant species (dominance score of 0.995). In contrast, MiniLM + IncDBSCAN spread its high-fitness prompts across 21 mature niches covering 20 distinct topics.
  • Topic Coverage: MiniLM-based methods successfully maintained "mature" (well-developed) niches across diverse families like cyber-abuse, financial fraud, and violence. NLI-based methods tended to cluster heavily in cyber-abuse and fraud, neglecting other areas.

Limitations and Future Work

  • Sample Size: The study used 10 runs per configuration; the authors note that more runs or longer evaluation budgets might be needed to establish a definitive performance ranking.
  • Fixed Oracle: The results are tied to the specific moderation oracle used (OpenAI's moderation API). Different oracles might reward different types of prompt structures.
  • Future Directions: The authors suggest developing speciation rules that prevent "weak bridges" from merging unrelated topics and exploring adaptive neighborhood radii to better handle the varying density of natural language space.

Summary updated

Abstract

Speciation maintains distinct subpopulations in evolutionary search through similarity-based grouping and species-aware parent selection. For text-based individuals, niches depend on both the compatibility representation and the assignment operator that turns pairwise relations into species. We examine this design space in black-box evolutionary red teaming of large language models, comparing embedding and natural language inference (NLI) dissimilarities under representative-based and density-based speciation. Offline calibration on a 3,139-prompt archive shows that MiniLM embedding dissimilarity ($d_E$) and DeBERTa-v3-small NLI non-entailment ($d_{\neg E}$) produce different species structures at the same nominal threshold. Even with pairwise edge density matched to MiniLM, NLI density connectivity forms a few concentrated, mixed-topic species, with substantially more off-topic membership. These structural differences persist online under a matched evaluation budget. The endpoint top-50 median fitness favors incremental DBSCAN over leader-follower, but bootstrap intervals from 10 runs include zero, providing no reliable evidence of an advantage. Semantic diversity among top prompts declines in every configuration, with no consistent method advantage. The clearest difference concerns high-fitness population occupancy: MiniLM incremental DBSCAN maintains mature niches across seed topics, whereas NLI incremental DBSCAN attains the same highest observed median fitness while concentrating high-fitness prompts in variants of a few seed topics. Thus, representation-dependent connectivity predicts population structure more consistently than endpoint fitness. Species count alone does not establish quality-diversity, and more species do not necessarily preserve semantically diverse high-fitness prompts.
BibTeX
@misc{shelar2026incremental,
  author = {Onkar Shelar and Travis Desell},
  title = {{Incremental Speciation in Evolutionary Red Teaming of Large Language Models}},
  year = {2026},
  eprint = {2611.23949},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23949},
}

Loading related content...

Figure