The Geometry of Control at Inference Time: Stochastic Constraints, Normalized Steering, and a Safety Clamp for Small LLMs

Read full text
Authors: Hamza Bouajila
Cited by: 0

Abstract

Large language model (LLM) control is typically exerted through pre-training,parameter updates, or context engineering. This paper studies a fourth mechanism:inference-time stochastic constraints that act directly on either (i) the output distribu-tion via logit-space interventions or (ii) internal representations via residual-streamsteering. We present a reproducible experimental suite on a small instruction-tunedmodel (Qwen2.5-0.5B-Instruct; CPU inference) demonstrating: (1) hard constraintscan enforce exact lexical and structural requirements via logit masking; (2) softconstraints can shape token distributions but exhibit non-monotonic mode collapse;(3) internal manifold injection via forward hooks achieves low-latency control(tens of microseconds per hook in our setup) and, when combined with a smalloutput bias, yields reliable style transfer; (4) a dual-site “safety clamp” can over-ride external output pressure (attacker logit bias) and induce refusals for harmfulrequests; and (5) norm-preserving injection (renormalized steering) enlarges thesafe operating region and correlates failure with entropy spikes, consistent with amanifold-stability interpretation. All code and console-logged runs are included inthe accompanying repository.

Fields of Study & Subjects

Adversarial Robustness in Machine Learning Security and Verification in Computing Parallel Computing and Optimization Techniques

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
5 January 2026
Language
EN
Document type
Preprint