Aggregate and conquer: detecting and steering LLM concepts by combining nonlinear predictors over multiple layers
Beaglehole, Daniel, Radhakrishnan, Adityanarayanan, Boix-Adserà, Enric, Belkin, Mikhail
A trained Large Language Model (LLM) contains much of human knowledge. Yet, it is difficult to gauge the extent or accuracy of that knowledge, as LLMs do not always ``know what they know'' and may even be actively misleading. In this work, we give a general method for detecting semantic concepts in the internal activations of LLMs. Furthermore, we show that our methodology can be easily adapted to steer LLMs toward desirable outputs. Our innovations are the following: (1) we use a nonlinear feature learning method to identify important linear directions for predicting concepts from each layer; (2) we aggregate features across layers to build powerful concept detectors and steering mechanisms. We showcase the power of our approach by attaining state-of-the-art results for detecting hallucinations, harmfulness, toxicity, and untruthful content on seven benchmarks. We highlight the generality of our approach by steering LLMs towards new concepts that, to the best of our knowledge, have not been previously considered in the literature, including: semantic disambiguation, human languages, programming languages, hallucinated responses, science subjects, poetic/Shakespearean English, and even multiple concepts simultaneously. Moreover, our method can steer concepts with numerical attributes such as product reviews. We provide our code (including a simple API for our methods) at https://github.com/dmbeaglehole/neural_controllers .
Feb-5-2025
- Country:
- Africa > Middle East
- Egypt (0.04)
- Asia
- China (0.04)
- Middle East
- Qatar (0.04)
- Oman (0.04)
- Republic of Türkiye (0.04)
- UAE (0.04)
- Iraq (0.04)
- Iran (0.04)
- Kuwait (0.04)
- Saudi Arabia (0.04)
- Israel (0.04)
- Myanmar > Andaman Sea (0.04)
- Europe
- Middle East (0.04)
- United Kingdom > England
- Lincolnshire (0.04)
- North America
- Mexico (0.14)
- United States
- California
- Los Angeles County > Los Angeles (0.04)
- San Diego County > San Diego (0.04)
- Colorado (0.04)
- Georgia > Fulton County
- Atlanta (0.04)
- Massachusetts > Middlesex County
- Cambridge (0.04)
- Ohio (0.04)
- California
- Pacific Ocean > North Pacific Ocean
- San Francisco Bay > Golden Gate (0.04)
- Africa > Middle East
- Genre:
- Personal (1.00)
- Research Report > New Finding (0.68)
- Industry:
- Leisure & Entertainment > Sports
- Football (1.00)
- Banking & Finance (1.00)
- Education (0.93)
- Government
- Health & Medicine
- Consumer Health (1.00)
- Pharmaceuticals & Biotechnology (1.00)
- Therapeutic Area > Infections and Infectious Diseases (0.68)
- Law (1.00)
- Consumer Products & Services > Food, Beverage, Tobacco & Cannabis (1.00)
- Materials > Chemicals (0.93)
- Law Enforcement & Public Safety > Crime Prevention & Enforcement (1.00)
- Leisure & Entertainment > Sports
- Technology: