Searcharxiv⌕ Search

arXiv · 2610.17929

Enforcing a Strict Safety Margin in LLM Text Generation via Barrier Lyapunov Control

Abstract

Large language models are increasingly deployed without formal guarantees against toxic text generation. Existing control barrier function (CBF) based safety filters can keep the generation trajectory within a toxicity-free region, but do not enforce a positive distance from its boundary, allowing formally safe trajectories to approach the toxicity threshold arbitrarily closely and leaving little buffer against modelling errors or disturbances. We address this limitation with a Barrier Lyapunov Function (BLF) safety filter that enforces a prescribed clearance margin throughout generation while retaining the continuous-time transformer dynamics, including feedforward layers. The resulting safe input set is a half-space defined by a constraint affine in the control input, and is non-empty under certified surjectivity and classifier-nondegeneracy conditions. For margin-compatible initial conditions we prove that the clearance margin is never violated and that the prescribed clearance is restored exponentially, yielding an explicit clearance floor, and show that, as the margin vanishes, the admissible trajectories satisfy the exponential second-order CBF condition. We further derive an explicitly computable sufficient disturbance budget under which the clearance guarantee degrades gracefully. Simulations on a small transformer illustrate the resulting improvement in safety clearance.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Anand Singh, Shubham Singh, Anjali Tiwari, Katsuki Fujisawa. 2026-10-13. Enforcing a Strict Safety Margin in LLM Text Generation via Barrier Lyapunov Control. https://arxiv.org/abs/2610.17929

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Constrained coalition games for USV swarm confrontation

This paper formulates unmanned surface vehicle (USV) swarm confrontation as a constrained coalition game, capturing cooperation within swarms and competition between swarms. Local task costs are aggregated into coalition objectives to account for tradeoffs among target approach, interception, and formation maintenance, subject to individual geographic constraints and supply line limits shared within each swarm. For prescribed formation sizes and task assignments, explicit linear matrix inequalities in the task weights are derived to establish strong monotonicity of the coalition pseudogradient, thereby guaranteeing the existence of a unique Nash equilibrium (NE) whenever the joint feasible set is nonempty. A distributed robust NE seeking strategy is then developed by integrating gradient tracking and action estimation with projected primal-dual dynamics using local information and neighbor communication. Adaptive compensation addresses unknown hydrodynamic parameters and bounded time-varying disturbances. The disturbance compensation gains are adjusted through local error feedback without requiring disturbance measurements, prior knowledge of disturbance bounds, or a prescribed disturbance generation model. Under the derived weight conditions, the stated dynamics and communication assumptions, and suitable gain conditions, the physical states of all USVs are shown to converge asymptotically to the unique feasible NE. Numerical simulations demonstrate the effectiveness of the proposed algorithm.

eess.SY↗

Distributed Optimization with Nesterov Momentum and Finite-Time Quantized Consensus

In modern large-scale networked systems, rapidly solving optimization problems while utilizing communication resources efficiently is critical for addressing complex tasks. In this paper, we consider an unconstrained distributed optimization problem in which information exchange among nodes is governed by a directed communication graph. In our setup we focus on two key challenges. The first is the zigzag phenomenon caused by the objective functions of individual nodes having significantly different curvature along different directions. The second is that the communication channels among nodes are subject to limited bandwidth, which motivates the use of compressed (quantized) messages. To address both challenges simultaneously, we propose QANM, a distributed optimization algorithm that combines Nesterov momentum with a distributed finite-time quantized consensus protocol. Under strong convexity and smoothness assumptions, we show that our proposed algorithm converges linearly to a neighborhood of the optimal solution. Finally, we evaluate QANM on a distributed sensor-fusion problem. With each method's step size tuned separately, QANM exhibits the fastest initial error reduction among the tested methods, including QAGD, Acc-DNGD-SC, and MSDA. Comparisons with QAGD under the same quantized averaging framework illustrate the empirical benefit of momentum, while experiments at two quantization levels demonstrate quantization-dependent error floors.

eess.SY↗

Bearing-based Circumnavigation with Collision Avoidance in Time-varying Graphs under Limited Target Information

In this paper, we study distributed circumnavigation of a stationary target by a heterogeneous team of agents. Each agent is modelled as a disk rather than a point mass to account for its physical dimensions. The target location is assumed to be accessible only to a small subset of agents, called leaders. The rest, called followers, therefore use only local information available from their designated out-neighbour in the interaction graph characterised by the selection of nearest neighbours. By controlling only angular speeds, we develop a distributed guidance law to circumnavigate a stationary target. The proposed guidance law works for both static and time-varying interaction graphs. Inter-agent collision avoidance is enforced through a logarithmic Barrier Lyapunov (BLF) Function, which guarantees forward invariance of the collision-free set. We show that every follower converges to circumnavigation about the same target as the leader at the end of its directed path in the interaction graph, provided the initial conditions are admissible. Numerical simulations illustrate the effectiveness of the proposed method for both static and time-varying topologies.

eess.SY↗