SCAR: Sparse Conditioned Autoencoders for Concept Detection and Steering in LLMs

Ruben Härle, Felix Friedrich, Manuel Brack, Björn Deiseroth, Patrick Schramowski +1 more
11/11/2024
cs.CL

No official code found. Best implementation: ml-research/SCAR (9 stars, last commit 2025-05-19).

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in generating human-like text, but their output may not be aligned with the user or even produce harmful content. This paper presents a novel approach to detect and steer concepts such as toxicity before generation. We introduce the Sparse Conditioned Autoencoder (SCAR), a single trained module that extends the otherwise untouched LLM. SCAR ensures full steerability, towards and away from concepts (e.g., toxic content), without compromising the quality of the model's text generation on standard evaluation benchmarks. We demonstrate the effective application of our approach through a variety of concepts, including toxicity, safety, and writing style alignment. As such, this work establishes a robust framework for controlling LLM generations, ensuring their ethical and safe deployment in real-world applications.

View on arXivView PDF

Code Implementations(1)

ml-research/SCARCommunity100%

Official implementation of SCAR

90Shell, PythonNov 11, 20241 years ago

Similar Papers

Cite this paper

@article{hrle2024scar,
  title  = {SCAR: Sparse Conditioned Autoencoders for Concept Detection and Steering in LLMs},
  author = {Ruben Härle and Felix Friedrich and Manuel Brack and Björn Deiseroth and Patrick Schramowski and Kristian Kersting},
  year   = {2024},
  eprint = {2411.07122},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.07122v2}
}

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/2411.07122.svg)](https://codeofpaper.com/paper/2411.07122)

Discussion