Mind Control of LLMs via Closed-Loop Stimulation: Out-of-Distribution Robustness

Kasra Fallah, Rudramani Singha, Hannah Ghanei, Paul Sajda, James Anderson, Erfan ZabeharXiv 2026 · arXiv

TL;DR

This paper introduces a robust, closed-loop feedback framework for steering Large Language Model (LLM) behavior, inspired by neurostimulation techniques used in biological brains. By treating LLM layers as a dynamical system and applying $H_\infty$ control theory, the authors create steering controllers that are significantly more resilient to distribution shifts—such as changes in language, context length, or adversarial attacks—than traditional "open-loop" methods.

What Problem Does This Paper Address?

Activation steering—perturbing an LLM's internal representations to encourage specific behaviors like "truthfulness" or "refusal"—is a powerful tool for model alignment without retraining. However, these interventions are typically "open-loop": a fixed vector is calculated on a calibration set and applied blindly at inference time.

The problem is that LLMs are highly nonlinear. A steering vector that works for English prompts often fails when the model is prompted in Spanish or when the context grows very long. The authors argue that this is because the "local dynamics" of the model change as the internal state moves away from the calibration regime. They draw a direct parallel to neuroscience, where fixed-pulse brain stimulation often fails because it doesn't account for the brain's ongoing, changing state.

Methods

The authors reframe activation steering as a feedback control problem. Instead of a static intervention, they design a controller that "observes" the hidden state at each layer and adjusts the perturbation accordingly.

  1. Dynamical Modeling: They treat the sequence of transformer layers as a time-indexed dynamical system. They linearize the dynamics around a desired "reference trajectory" (the behavior they want to elicit).
  2. Structured Mismatch: Recognizing that a linear model is always an imperfect approximation of a nonlinear transformer, they explicitly model the "mismatch" between their model and the actual model as a structured disturbance ($D_k w_k$).
  3. $H_\infty$ Control: They use $H_\infty$ control theory to synthesize a feedback law ($u_k = -K_k x_k$). Unlike standard optimal control (like LQR), which minimizes average error, $H_\infty$ minimizes the worst-case amplification of modeling errors and disturbances.
  4. Robust Steerability ($S_{rob}$): They introduce a new metric, $S_{rob}$, which quantifies how much modeling uncertainty a specific model-task pair can tolerate before the steering fails.
Figure 2: Method Schematic. Closed-loop stim- ulation enables controlled modulation of the sys- tem’s behavioral dynamics.

Datasets

The framework was stress-tested across four distinct types of distribution shifts:

  • TruthfulQA: Testing truthfulness when shifting from English (In-Distribution) to Spanish (Out-of-Distribution) inputs.
  • HarmBench: Testing the robustness of safety "refusal" behaviors against five different adversarial jailbreak templates.
  • MGSM (Multilingual Grade School Math): Steering the model to output in Spanish while attempting to preserve mathematical reasoning across five different input languages (Chinese, French, Japanese, Swahili, Telugu).
  • L-CiteEval: Testing how steering for "positive sentiment" holds up as context length increases from 8K to 16K tokens.

Key Insights and Ideas

  • Feedback is the Key to Robustness: Just as closed-loop neurostimulation is more effective for the brain, closed-loop steering allows LLMs to "self-correct" when the internal state drifts due to a distribution shift.
  • Modeling Error as an Adversary: By treating the gap between their linear model and the real transformer as an adversarial disturbance, the $H_\infty$ controller produces a "cautious" intervention that doesn't over-rely on potentially inaccurate local dynamics.
  • Steerability is a System Property: The $S_{rob}$ metric reveals that some tasks are inherently harder to steer robustly than others, and interestingly, larger models tend to be more "robustly steerable" than smaller ones.
Linearization residuals: Showing how modeling error (mismatch) grows as the system moves away from its calibration regime in both human brains and GPT-2.

Key Results

The robust $H_\infty$ controller consistently outperformed existing steering baselines (like Activation Addition or A-LQR), especially in OOD scenarios:

  • TruthfulQA: On GPT-2 XL, $H_\infty$ steering nearly doubled the performance on Spanish transfer compared to the best baseline.
  • HarmBench: $H_\infty$ reduced the Attack Success Rate (ASR) of jailbreaks to near zero in several models. For Llama-3.1-8B, ASR dropped from ~11% (baseline) to just 0.5%.
  • MGSM: While other steering methods often "broke" the model's ability to do math when forced to speak Spanish, $H_\infty$ retained ~77-95% of the original reasoning capability.
  • Context Length: In L-CiteEval, the robust controller showed much more stable performance as context length doubled, whereas baselines saw significant degradation in citation quality.

Limitations and Future Work

  • Local Linearity: The approach still relies on local linearizations. While $H_\infty$ handles the errors of these linearizations well, it doesn't fully capture the global nonlinearities of the transformer.
  • Offline Synthesis: The controller gains are currently computed offline based on calibration data. Future work could explore "adaptive" control where the gains update in real-time during inference.
  • Biological Translation: The authors suggest that their $S_{rob}$ metric could eventually be applied back to neuroscience to identify which brain regions or states are most amenable to robust clinical stimulation.

Summary updated

Abstract

Brains and large language models need not be considered equivalent systems to reveal an interpretable commonality: both exhibit high-dimensional, nonlinear dynamics whose behavior can only be modeled imperfectly. This creates a shared challenge whenever we seek to intervene in their dynamics. A controller may either rely on a model identified around a particular operating regime and risk failure as the system moves away from that regime, or explicitly account for uncertainty and a changing internal state. Neurostimulation has confronted an analogous problem for decades. The limitations of fixed, open-loop stimulation have motivated closed-loop and state-dependent approaches that condition intervention on the ongoing state of the neural system. Inspired by this principle, we formulate LLM steering as a feedback-control problem in which the network's internal state, rather than a fixed intervention alone, determines how the system is perturbed. We further account for the mismatch between tractable dynamical models and the nonlinear transformer they approximate through robust control. As one principled realization of this framework, we develop an $H_\infty$-based steering controller that limits sensitivity to disturbances and linearization mismatches. Across multiple steering benchmarks, the controller improves performance over existing baselines, with particularly pronounced gains under out-of-distribution conditions and varying length complexities. Beyond controller performance, we introduce robust steerability, $S_{\mathrm{rob}}$, a pre-deployment measure of tolerance to dynamics mismatch; across model-task pairs, it exhibits task-specific structure and varies systematically with model scale. Beyond robust LLM steering, our measure asks not merely whether control is possible, but how much uncertainty it can survive; a principle that may span artificial and biological neural systems.
BibTeX
@misc{fallah2026mind,
  author = {Kasra Fallah and Rudramani Singha and Hannah Ghanei and Paul Sajda and James Anderson and Erfan Zabeh},
  title = {{Mind Control of LLMs via Closed-Loop Stimulation: Out-of-Distribution Robustness}},
  year = {2026},
  eprint = {2611.06418},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.06418},
}
Figure