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

Kasra Fallah1,* Rudramani Singha2,* Hannah Ghanei3 Paul Sajda4 James Anderson1 Erfan Zabeh5,†

1 Electrical Engineering, Columbia University · 2 Peter O’Donnell Jr. Brain Institute, UT Southwestern Medical Center

3 Computer Science and Electronic Engineering, University of Surrey · 4 Biomedical Engineering, Columbia University

5 Center for Theoretical Neuroscience, Zuckerman Institute, Columbia University

* Equal contribution† Correspondence: ez2290@columbia.edu

Figure 1. Borrowing from closed-loop neurostimulation, we steer LLMs with robust \(H_\infty\) feedback and derive a score characterizing steering reliability under distribution shift.

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 inevitable mismatch between tractable dynamical models and the nonlinear transformer they approximate by adopting a robust control approach. As one principled realization of this framework, we develop an \(H_\infty\)-based steering controller that explicitly limits sensitivity to disturbances and linearization mismatches. Across multiple steering benchmarks, the resulting controller improves performance over existing steering baselines, with particularly pronounced gains under out-of-distribution conditions and varying length complexities—regimes in which the assumptions underlying locally identified dynamics are increasingly challenged. 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.

An Example of Multilingual Grade-School Mathematics

A successful perturbation is not the same as reliable control.

  1. First, the effect of stimulation depends on the state in which it is delivered: across invasive and non-invasive paradigms, state alters the magnitude, direction and behavioral consequence of otherwise identical stimulation.

  2. At deployment, shifts in prompt, context, or activation trajectory alter the network’s local Jacobians and therefore how the same intervention propagates. Distribution shift thus changes not only the state being controlled but also the dynamics of control itself.

  3. Language models and biological circuits are not equivalent systems, but both are high-dimensional, nonlinear and imperfectly modeled, and intervention in both inherits the same reliability problem.

Can a language model’s internal dynamics tell us, before deployment, whether a representation will remain reliably steerable as those dynamics change?
Figure 2. Closed-loop stimulation enables controlled modulation of the system’s behavioral dynamics.

Robust activation steering

We treat transformer depth as a finite control horizon, hidden representations as states, and activation interventions as control inputs. Given a target behavior, desired and undesired calibration activations define reduced behavior coordinates. Projected Jacobians estimate local dynamics, while empirical residuals identify the directions and scales of model mismatch:

\[\xkp = \Ak\xk + \Bk\uk + \Dk\wk.\]

Here, \(\Ak\) describes nominal layer dynamics, \(\Bk\uk\) the activation intervention, and \(\Dk\wk\) the structured mismatch. Rather than assuming that mismatch is negligible or isotropic, we design the controller against its amplification through the network.

For a candidate attenuation \(\gamma\), robust feedback solves a finite-horizon dynamic game subject to the local dynamics above:

\[\min_{\pi}\max_{w_{1:L}}\;x_{L+1}^{\top}Q_f x_{L+1}+\sum_{k=1}^{L}\left(\lVert\zk\rVert_2^2-\gamma^2\lVert\wk\rVert_2^2\right).\]

The controller minimizes steering error and intervention cost; the adversary acts through the empirical mismatch channels. The regulated output \(\zk\) combines target-tracking error, intervention effort, and optional off-target representation change. A backward \(H_\infty\) recursion and attenuation search produce the layer-wise policy \(\uk=-\steervar{K_k^\star}\xk.\)

Feedback makes the intervention depend on the current activation state; robustness accounts for the fact that the local model is imperfect. Model weights remain unchanged, and dynamics estimation and controller synthesis are performed offline.

Read the methodology in the paper

Benchmark results

We ask whether feedback controllers identified at calibration time remain effective when the deployment distribution changes.

Prompt-language shift (TruthfulQA)

Across all four model families, \(\mathrm{H}_{\infty}\) attains the highest T×I under both ID and OOD evaluation.

Figure 4. TruthfulQA under prompt-language shift. Left: truthfulness–informativeness frontiers for matched English (ID) and Spanish-input, English-output transfer (OOD). Right: category-level GPT-2 XL performance for the original model, strongest competitor, and \(\mathrm{H}_{\infty}\).

Overall performance

T×I ↑ · Table 1(a)
ModelEnglish (ID)Spanish (OOD)
Baseline\(H_\infty\)Baseline\(H_\infty\)
GPT-2 XL34.91 ± 2.5835.18 ± 0.439.93 ± 0.9518.14 ± 1.31
Llama-3-8B57.81 ± 0.2961.42 ± 1.1552.81 ± 0.6955.29 ± 0.35
Qwen-2.5-14B69.66 ± 0.6276.27 ± 0.4280.40 ± 0.5282.57 ± 0.50
OLMo-2-32B81.74 ± 0.6586.31 ± 0.4282.70 ± 1.1491.50 ± 1.07

Adversarial prompt shift (HarmBench)

Across the three models and six prompt conditions, \(\mathrm{H}_{\infty}\) has lower ASR than both the unsteered model and A-LQR (the strongest competing method) in all 18 model–condition comparisons.

Figure 5. Robust refusal under adversarial prompting. Left: ASR across direct requests and five frozen jailbreak templates for three Llama scales. Center: mean ASR versus safe-concept relevance. Right: response-type decomposition. Lower ASR is better.

Overall performance

Attack success (%) ↓ · Table 1(b)
ModelDirect (ID)Jailbreak (OOD)
Baseline\(H_\infty\)Baseline\(H_\infty\)
Llama-3.2-1B9.58 ± 1.762.92 ± 1.405.50 ± 0.250.92 ± 0.26
Llama-3.2-3B16.67 ± 2.488.33 ± 1.8611.59 ± 1.323.67 ± 0.43
Llama-3.1-8B15.83 ± 4.023.33 ± 1.8410.83 ± 1.990.50 ± 0.36

Multilingual input shift (MGSM)

At the individual language level, \(\mathrm{H}_{\infty}\) exceeds A-LQR accuracy in 13 of 15 model–language pairs.

Figure 6. Cross-lingual transfer on MGSM. Left: capability loss relative to the unsteered model versus response quality. Right: accuracy retained relative to the original model across transfer languages. Controllers are calibrated in English and frozen before multilingual evaluation.

Overall performance

Accuracy (%) / Spanish relevance · Table 1(c)
ModelAccuracy (%)Spanish relevance
OriginalA-LQR\(H_\infty\)A-LQR\(H_\infty\)
Qwen-3-4B41.6 ± 2.522.4 ± 2.332.2 ± 2.41.81 ± 0.021.44 ± 0.03
Phi-4-mini45.4 ± 2.60.0 ± 0.035.2 ± 2.61.09 ± 0.041.21 ± 0.04
Granite-3.3-2B22.2 ± 2.018.8 ± 2.021.2 ± 1.90.04 ± 0.020.00 ± 0.00

Context-length shift (L-CiteEval)

Controllers are calibrated at 8K context and evaluated at both 8K and 16K using matched question identities.

Figure 7. Context-length transfer and residual growth. A: answer recall and citation F1 at matched 8K and shifted 16K context for Qwen2.5-3B. B: growth of local-model residuals with prediction horizon in language-model representations and an illustrative nonlinear biological network.

Overall performance

Answer recall (%) ↑ · Table 1(d)
Model8K (ID)16K (OOD)
Baseline\(H_\infty\)Baseline\(H_\infty\)
Qwen-2.5-3B72.1 ± 9.366.4 ± 7.965.2 ± 7.665.2 ± 8.6
Llama-3.2-1B59.8 ± 9.361.7 ± 7.850.1 ± 8.047.9 ± 7.8

Baseline denotes the strongest non-\(H_\infty\) result. Full results are available in the paper.

Robust steerability

Intuitively, it characterizes how much deviation from the identified dynamics can be tolerated before the same model is no longer sufficient for reliable intervention.

\[\Srob = \frac{1}{\gammastar}, \qquad \gammastar = \inf_{\steervar{K}} \lVert T_{w\to z}(\steervar{K})\rVert_\infty.\]

A larger \(\Srob\) therefore corresponds to a regime in which steering is less sensitive to modeling error and uncertainty.

Figure 8. Robust steerability across models and tasks. \(S_{\mathrm{rob}}\) exhibits task-dependent structure across model–benchmark pairs, while within a fixed task it also varies systematically with model scale.

Citation

@unpublished{fallah2026mindcontrol,
  title = {Mind Control of {LLMs} via Closed-Loop Stimulation:
           Out-of-Distribution Robustness},
  author = {Fallah, Kasra and Singha, Rudramani and Ghanei, Hannah
            and Sajda, Paul and Anderson, James and Zabeh, Erfan},
  year = {2026},
  note = {Manuscript}
}