Manuscript Offprint

arXiv:2609.00597

Topological Steering

Benoît Guérand, Tan Minh Nguyen

Abstract

With the rapid rise of large language models (LLMs), controlling undesirable model behaviors has become increasingly important. Existing behavioral control methods typically intervene directly in activation or feature space, but such approaches can be sensitive to outliers, distributional shifts, noise, and other local perturbations. Motivated by Topological Data Analysis (TDA), which captures global rather than purely local structure, we propose Topological Steering, a new framework for steering LLM behavior through the topological representation of activation spaces. Using persistence diagrams, our method connects activation-based steering with TDA and enables more robust behavioral control. We show that Topological Steering consistently modifies LLM behavior across multiple model families and model sizes.

1 Introduction

Large language models (LLMs) are increasingly deployed as general-purpose assistants, yet their behavior remains difficult to control reliably. Even highly aligned models can produce harmful, dishonest, sycophantic, or otherwise undesirable outputs under adversarial or distribution-shifted prompts. As a result, a growing line of work has sought lightweight mechanisms for controlling model behavior at inference time, without retraining the model or modifying its weights [3, 16, 2].

A particularly promising direction is activation steering [15], which intervenes directly on internal representations. Early methods showed that adding a fixed steering vector to the residual stream can induce predictable changes in sentiment, refusal, truthfulness, or safety-related behavior. Subsequent approaches, including contrastive activation addition [14] and more recent nonlinear or rotational interventions [16], have improved the flexibility of this paradigm. However, most existing steering methods are fundamentally geometric and local: they construct directions from means, linear contrasts, or low-dimensional subspaces in activation space. Such approaches can be effective, but they implicitly assume that the behavioral concept of interest is well captured by a simple global direction or a smooth local transformation.

This assumption is often too restrictive. Behavioral representations in LLMs may be multimodal, nonlinearly organized, and distributed across heterogeneous regions of activation space. For example, refusal behavior may not correspond to a single cluster or linear axis; instead, it may be supported by several distinct activation substructures associated with different prompt types, semantic contexts, or safety mechanisms. In such settings, a global mean-difference vector can dilute or average away the relevant signal, while purely local geometric interventions may be sensitive to outliers, noise, and small perturbations. These limitations motivate a more structural view of activation space: rather than asking only where individual activations lie, we ask what shape the activation cloud has and which multiscale structures distinguish one behavioral regime from another.

Topological Data Analysis (TDA) provides mathematical tools precisely for this purpose. Persistent homology summarizes the multiscale topology of a point cloud by tracking when connected

Preprint.

components, loops, and higher-dimensional features appear and disappear as a distance scale varies. The resulting persistence diagrams are stable summaries of global structure and have been widely studied as robust descriptors of complex high-dimensional data. Historically [1, 5], however, the use of TDA in large-scale machine learning has been limited by computational cost: persistent homology can be expensive to compute inside training loops or on very large datasets. In the context of inference-time steering, this bottleneck is substantially reduced. Steering requires only a finite collection of activation vectors from contrastive prompt sets, making it possible to use persistent topology as an actionable signal for intervention design.

Contribution. In this paper, we introduce Topological Steering, a new inference-time method for controlling LLM behavior through the topology of activation spaces. Given contrastive prompt sets, such as refusal-eliciting and compliance-eliciting prompts, we extract residual-stream activations and view them as point clouds. We then apply joint dimensionality reduction, compute Vietoris–Rips persistence diagrams, and compare the diagrams of the two behavioral regimes. Features that are both persistent and specific to the target behavior are used to identify coherent activation subsets, rather than averaging indiscriminately over all examples. These subsets define localized contrastive directions, which are aggregated into a steering vector and injected into the residual stream during generation.

The key idea is that topology provides a mechanism for moving beyond global centroid shifts. Classical activation steering [14] constructs a direction from the mean difference between positive and negative activations. Topological Steering instead identifies robust, behavior-specific substructures in the positive activation cloud and steers using directions derived from those substructures. This allows the intervention to reflect the heterogeneous organization of behavioral concepts in representation space, while also providing an interpretable account of which activation components support the steering signal.

Our contributions are three-fold:

  1. Topology-Aware Steering for LLMs: We introduce Topological Steering, an inference-time framework that uses tools from Topological Data Analysis to construct steering directions from the multiscale structure of LLM activation spaces. By applying TDA outside the training loop, our method avoids the computational bottlenecks that have historically limited its use in large-scale deep learning.

  2. Structural Interpretability via Persistence Diagrams: In contrast to linear or angular steering methods [16] that operate through geometric shifts in activation space, our approach uses persistence diagrams to identify robust topological features of behavioral representations, such as connected components and higher-order structures. This provides an interpretable way to localize behavior-relevant regions in the residual stream.

  3. Empirical Validation for Topological Intervention: We demonstrate that Topological Steering consistently improves over unsteered baselines and produces measurable behavioral changes across model families and sizes. While the current implementation is not intended to outperform highly optimized geometric steering methods, it offers a complementary trade-off: sacrificing some raw efficacy in exchange for a more structured and inspectable intervention mechanism grounded in the topology of activation space.