Title: Semantic Regexes: Auto-Interpreting LLM Features with a Structured Language
Primary area: interpretability and explainable AI
Keywords: automated interpretability, LLM features, structured languages

Abstract: Automated interpretability aims to translate large language model (LLM) features into human understandable descriptions. However, these natural language feature descriptions are often vague, inconsistent, and require manual relabeling. In response, we introduce *semantic regular expressions*, a structured language for describing LLM features. By combining primitives that capture linguistic and semantic feature patterns with modifiers for contextualization, composition, and quantification, semantic regular expressions produce precise and expressive feature descriptions. Across quantitative benchmarks and qualitative analyses, we find that semantic regexes match the accuracy of natural language while yielding more concise and consistent feature descriptions. Moreover, their inherent structure affords new types of analyses, including quantifying feature complexity across layers, scaling automated interpretability from insights into individual features to model-wide patterns. Finally, user studies show that semantic regexes improve interpreters’ ability to understand and reason about LLM features.

TL;DR: We develop a structured language to describe LLM features, resulting in accurate, concise, and consistent descriptions that inherently describe each feature's level of abstraction and help humans reason about LLMs.