Theory / Mathematical model
Control theory
The mathematics behind sparse internal control.
Near the unpatched model, a frozen Transformer acts as a linear map from intervention strengths to behavior. Choosing drivers becomes a controllability question: can a few columns reach the requested displacement, and at what energy?
A frozen network.
A few handles.
An intervention adds scaled directions to a handful of internal activations during the forward pass. The parameters \(\theta\) never change, and \(\beta = 0\) recovers the original model exactly.
01 / Specify
The behavior
Choose a scalar readout \(b\), a target \(\tau_i\) for each target prompt \(x_i\), and a panel of off-target prompts \(\tilde x_j\) whose outputs must not move.
02 / Actuate
The drivers
A candidate \(v = (s_v, u_v, c_v)\) pairs a site with a direction and a cost. Candidates with a nonzero strength form the driver set \(S_\beta = \operatorname{supp}(\beta)\).
03 / Certify
The control
An intervention counts as control only when target error, off-target change and energy all pass in the full nonlinear model.
The readout change on the target prompts, \(b(f_\theta^{\beta}, x_i) - b(f_\theta, x_i)\).
Relative target error, the share of the requested displacement left unmet.
Mean divergence of the output distribution on the off-target panel.
Intervention energy, how hard the selected sites are pushed.
02 / Objective
One sparse program.
Pick the fewest, cheapest drivers whose intervention passes the certificate, with energy as a tie breaker.
Weighted sparsity
Counts the selected sites, each at its own cost, so a residual stream position and an attention head need not be priced alike.
Energy
A quadratic budget on the strengths. It keeps the intervention near the unpatched model, where the local analysis is valid.
Certificate
Three tolerances checked together in the nonlinear model. A proposal that misses any one of them is rejected.
Can the drivers
reach the target?
At first order the target moves by \(\bar G_S \beta_S\). Reaching \(\bar q\) needs two things: \(\bar q\) must lie in the span of the selected columns, and the cheapest exact fit must cost no more than \(\kappa\).
Two target prompts with scalar readouts, so \(\bar q\) lives in a plane. Each candidate contributes one column of \(\bar G\), its first order effect on both prompts. Energy uses \(W = I\).
Support S
- \(\operatorname{rank} \bar G_S\)
- 2
- \(\bar q \in \operatorname{range}(\bar G_S)\)
- yes
- \(E_{\min}(S)\)
- —
- \(\chi_\kappa(S)\)
- —
The reachable set \(\{\bar G_S\beta : \beta^{\top}\beta \le \kappa\}\) is an ellipse centred on the unpatched model. The lime point is the energy constrained best fit; the dashed segment is the residual that \(\chi_\kappa(S)\) normalizes.
Six results.
From the effect dictionary to the selectors: what the local analysis guarantees, and where the nonlinear model takes over.
- Definition B.1
Local effect dictionary
\(g_{i,v} = J_{i,s_v}\, u_v(x_i)\)\(J_{i,s_v} = \dfrac{\partial b(f_\theta, x_i)}{\partial h_{s_v}(x_i)}\)\(q \approx G\beta\)Each candidate’s first order effect on every target readout is one column of \(G\), taken at the unpatched model. A preservation dictionary \(H\) is built the same way from a differentiable surrogate of the off-target observable.
- Theorem 1
Local linearization error
\(\|\Phi_S(\beta_S) - G_S\beta_S\|_2 \le \dfrac{L_S}{2}\, \beta_S^{\top} W_{SS}\, \beta_S\)Inside the energy ball the model departs from its linearization by at most the curvature bound \(L_S\) times half the energy. Target recovery therefore holds whenever \(\|q - G_S\beta_S\|_2 + L_S\kappa/2 \le \varepsilon(\|q\|_2 + \xi)\).
- Equation B.19
Local target controllability
\(\chi_\kappa(S) = \displaystyle\min_{\beta_S^{\top} W_{SS}\beta_S \le \kappa} \frac{\|\bar q - \bar G_S\beta_S\|_2}{\|\bar q\|_2 + \xi}\)A support reaches the target exactly at first order within budget if and only if \(\bar q \in \operatorname{range}(\bar G_S)\), a span condition, and \(E_{\min}(S) \le \kappa\), an energy condition.
- Theorem 2
Minimum energy interpolation
\(\beta_S^{\dagger} = W_{SS}^{-1/2}\, \tilde G_S^{+}\, \bar q\)\((\beta_S^{\dagger})^{\top} W_{SS}\, \beta_S^{\dagger} \le \dfrac{\|\bar q\|_2^2}{\sigma_{\min}^{+}(\tilde G_S)^2}\)In whitened coordinates \(\tilde G_S = \bar G_S W_{SS}^{-1/2}\), the cheapest exact fit is a pseudoinverse. A support with a small nonzero singular value can demand far more energy to reach the same target.
- Proposition 1
Energy constrained refit
\(\beta_S^{\star}(\nu) = \big(\hat G_S^{\top}\hat G_S + (\lambda + \nu) W_{SS}\big)^{-1} \hat G_S^{\top}\hat q\)Target fit and a quadratic preservation term are refit jointly on the chosen support. Energy decreases monotonically in the multiplier \(\nu\), so the budget \(\kappa\) is met exactly by bisection.
- Proposition 2
Saturated coverage
\(C(S) = \sum_j w_j \min\Big(1, \sum_{v \in S} a_{jv}\Big)\)\(C(S_{\mathrm{greedy}}) \ge (1 - 1/e)\, C(S^{\star})\)Coverage is monotone submodular, so greedy selection under a pure cardinality budget is within \(1 - 1/e\) of optimal.
Proofs, assumptions and constants are in Appendix B.
Read the appendix05 / Selectors
Two selectors.
One pipeline.
Driver-OMP
Fits the requested displacement by sparse residual fitting: add the candidate best aligned with what is still missing, refit, repeat. In its simplest setting it reduces to orthogonal matching pursuit.
Coverage-Driver
Adds candidates by saturated coverage across prompts, so the support keeps working when the prompt changes. Greedy selection carries the \(1 - 1/e\) guarantee.