Mind Control of LLMs via Closed-Loop Stimulation: Out-of-Distribution Robustness
Organizations: Department of Electrical Engineering, Columbia University, New York, NY, USA · Peter O’Donnell Jr. Brain Institute, UT Southwestern Medical Center, Dallas, TX, USA · School of Computer Science and Electronic Engineering, University of Surrey, Guildford, UK · Department of Biomedical Engineering, Columbia University, New York, NY, USA ·
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 -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, , 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.
Figures & tables
| Model | ID Base | ID | OOD Base | OOD |
|---|---|---|---|---|
| GPT2-XL | 34.91 | 35.18 | 9.93 | 18.14 |
| Llama3-8B | 57.81 | 61.42 | 52.81 | 55.29 |
| Qwen2.5-14B | 69.66 | 76.27 | 80.40 | 82.57 |
| OLMo2-32B | 81.74 | 86.31 | 82.70 | 91.50 |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Controller | Synthesis information | Design objective | Interpretation |
|---|---|---|---|
| PID | Semantic error | Reactive error correction | No general finite-horizon optimum |
| LQR | Nominal quadratic performance | Optimal nominal tracking–effort trade-off | |
| Worst-case disturbance amplification | Finite-energy attenuation certificate |
| ID: Direct | OOD: Jailbreaks | |||||
|---|---|---|---|---|---|---|
| Model | Best base. | Best base. | ||||
| Llama-3.2-1B | 9.58 | 2.92 | 5.50 | 0.92 | ||
| Llama-3.2-3B | 16.67 | 8.33 | 11.59 | 3.67 | ||
| Llama-3.1-8B | 15.83 | 3.33 | 10.83 | 0.50 | ||
| Model | Method | Direct refusal | Safe partial compliance | Full compliance | USR |
|---|---|---|---|---|---|
| Llama-3.2-1B | Original | ||||
| A-LQR | |||||
| (ours) | |||||
| Llama-3.2-3B | Original | ||||
| A-LQR | |||||
| (ours) |
| Accuracy (%) | Spanish relevance (0–2) | |||||
|---|---|---|---|---|---|---|
| Model | Original | A-LQR | Original | A-LQR | ||
| Qwen3-4B | 41.6 | 22.4 | 32.2 | 0.00 | 1.81 | 1.44 |
| Phi-4-mini | 45.4 | 0.0 | 35.2 | 0.00 | 1.09 | 1.21 |
| Granite-3.3-2B | 22.2 | 18.8 | 21.2 | 0.00 | 0.04 | 0.00 |
| Model | Hugging Face repository | Revision | Benchmark(s) |
|---|---|---|---|
| GPT-2 XL | openai-community/gpt2-xl | 15ea56de | TruthfulQA |
| Llama-3-8B | meta-llama/Meta-Llama-3-8B | 8cde5ca8 | TruthfulQA |
| Qwen2.5-14B | Qwen/Qwen2.5-14B | 97e1e763 | TruthfulQA |
| OLMo-2-32B | allenai/OLMo-2-0325-32B-Instruct | b9602434 | TruthfulQA |
| Llama-3.2-1B-Instruct | meta-llama/Llama-3.2-1B-Instruct | 92131767 | HarmBench, L-CiteEval |
| Llama-3.2-3B-Instruct | meta-llama/Llama-3.2-3B-Instruct | 0cb88a4f | HarmBench |
| Benchmark | Direction | Dynamics | Disturbance | Selection |
|---|---|---|---|---|
| TruthfulQA | 200 + 200 false / true | 35 | 200 English prompts | 50 or 200 disjoint English prompts, depending on model |
| HarmBench | 50 + 50 harmful / safe | 50 | 50 direct-validation behaviors | Same 50 direct-validation behaviors |
| MGSM | 250 matched English–Spanish forms | 50 | Frozen GSM8K prompts; Bengali, German, Russian, and Thai translations for Phi/Granite | 50 prompts for Qwen; 100 translated prompts for Phi/Granite |
| L-CiteEval | 72 + 72 negative / positive AXBench responses | 50 | 200 short-context prompts | 50 short prompts for Qwen; 40 matched 8K HotpotQA prompts for Llama |
| Benchmark | Decoding | Response cap | Repetitions | Additional settings |
|---|---|---|---|---|
| TruthfulQA | Sampling | 50 tokens | 5; refreshed Llama H ∞ , GPT-2 XL, and OLMo-2-32B: 1 | , top- , repetition penalty |
| HarmBench | Greedy | 512 tokens (8B: 100) | 1 | Direct and five jailbreak templates share behavior identities |
| MGSM | Greedy | 256 tokens | 1 | Native eight-shot demonstrations for each input language |
| L-CiteEval | Greedy | 200 tokens | 1 | Official one-shot prompt; matched 8K and 16K contexts |
| Benchmark | Model | Accelerator allocation(s) | Artifacts | Calibration | Generation | Scoring | Total |
|---|---|---|---|---|---|---|---|
| TruthfulQA | GPT-2 XL | H200 | 0.3 | 0.7 | 0.7 | 0.1 | 1.9 |
| Llama-3-8B | H100; H200; RTX 5090 | 1.0 | 1.8 | 12.4 | 0.3 | 15.6 | |
| Qwen2.5-14B | H200; RTX 5090 | 2.5 | 1.4 | 29.7 | 0.5 | 34.0 | |
| OLMo-2-32B | H200 | 7.7 | 10.0 | 14.1 | 0.2 | 32.0 | |
| HarmBench | Llama-3.2-1B | RTX 5090 | 0.2 | 1.4 | 2.9 | 0.4 | 4.9 |
| Llama-3.2-3B | RTX 5090 | 0.7 | 2.8 | 21.5 | 0.1 | 25.1 |
| Model | Direct | APM Programmer | DNE Nonresponse | Jailbreak Bot | John Persona | YOJA/Nona Roleplay | Mean OOD | |
|---|---|---|---|---|---|---|---|---|
| Llama-3.2-1B | 7.688 | 97.08 | 99.58 | 98.33 | 99.58 | 98.75 | 99.17 | 99.08 |
| Llama-3.2-3B | 2.405 | 91.67 | 97.50 | 96.25 | 96.25 | 95.83 | 95.83 | 96.33 |
| Llama-3.1-8B | 3.487 | 96.67 | 99.17 | 100.00 | 100.00 | 98.33 | 100.00 | 99.50 |
| Method | Offline synthesis | Latency (ms/token) | Peak memory (GB) |
|---|---|---|---|
| A-LQR | ; 0.2015 s | 5.409 | 2.882 |
| (ours) | ; 0.1245 s | 5.459 | 2.882 |
| Method | State dim. | Median (s) | Mean SD (s) | Range (s) |
|---|---|---|---|---|
| A-LQR (deployed) | 2048 | 0.201472 | ||
| A-LQR (matched reduced core) | 8 | 0.003073 | ||
| (deployed) | 8 | 0.124515 |
| Method | Median latency | Mean SD | vs. Original | Peak / incremental GB |
|---|---|---|---|---|
| (ms/token) | (ms/token) | (%) | ||
| Original | 5.347 | 0.00 | 2.882 / 0.265 | |
| A-LQR | 5.409 | +1.16 | 2.882 / 0.265 | |
| (ours) | 5.459 | +2.09 | 2.882 / 0.265 |
Language Model Steering
Language model steering controls a model’s behavior at inference time by intervening in its representations, components, or decoding process.
See all 310 papers