SearcharxivSearch

arXiv subjects

Dan Wilson

Publications and source records attributed to Dan Wilson.

16 recordsLinked to original sources

Enforcing LLM Safety through DMD-based Classification of Prompt-Response Embedding Dynamics

Large Language Models (LLMs) are increasingly deployed in high-stakes applications, yet their tendency to generate toxic, harmful, or policy-violating content poses significant risks. Detecting these unsafe outputs efficiently in a black-box manner remains an open challenge. In this paper, we extend a recently proposed dynamical systems framework designed for hallucination detection to LLM safety classification. By projecting both prompts and responses into high-dimensional embedding spaces and fitting separate Koopman-based predictive models for safe and unsafe regimes, we classify new outputs using a new differential residual score that compares prediction errors of the safe and unsafe regimes. A key contribution is the incorporation of the prompt and response embedding dynamics, yielding fitted Koopman operators that capture crucial interaction patterns. We evaluate our black-box method across three safety benchmarks using three embedding models. Our results show that incorporating prompt embeddings yields consistent improvements, particularly for interaction-dependent violations when paired with causal decoders (e.g., in Llama-3), while response-only violations benefit more from dense semantic embedding representations. These findings opens the door for using dynamical systems to analyze AI systems rather than the dominant paradigm of using AI to model dynamical systems.

cs.AI

Guarantees on Dynamical System Distinguishability for LLM Token Generation

Recent work has shown that classifying large language models (LLMs)' responses can be distinguished by modeling token embeddings as trajectories of a black-box dynamical system (DS) and comparing prediction residuals of two DSs. Despite the empirical success of this dynamical approach, a theoretical understanding of why it works, how well it scales as a function of the token sequence, and when it transfers across embedding models remains lacking. We address these questions by formalizing the classification task as a binary hypothesis test between two stochastic linear DSs. We show that the total variation distance between the stationary marginal distributions of the two DSs can be arbitrarily small even when the dynamics differ substantially, which provides a fundamental accuracy floor for any classifier that ignores token dynamics. We then show that the misclassification probability of DS-based classification decays exponentially in the sequence length $L$, with the decay governed by a dynamical discriminability quantity $\delta^2$ that captures the spectral distance between the two DSs. We also characterize cross-embedding generalization by introducing an approximate intertwining condition between embedding models and establishing a lower bound on the transferable discriminability in terms of the intertwining map's smallest singular value. Together, these results explain the empirical performance of DS-based classification and motivate further investigation into using DS theory to analyze AI systems, in contrast to the more common approach of using AI to model dynamical systems.

cs.LG

Low-Cost Black-Box Detection of LLM Hallucinations via Dynamical System Prediction

Large Language Models (LLMs) frequently generate plausible but non-factual content, a phenomenon known as hallucination. While existing detection methods typically rely on computationally expensive sampling-based consistency checks or external knowledge retrieval, we propose a new method that treats the LLM as a black-box dynamical system. By projecting LLM responses into a high-dimensional manifold via an embedding model, we characterize the resulting vector sequences as observable realizations of the model's latent state-space dynamics. Leveraging Koopman operator theory, we fit the transition operators for both factual and hallucinated regimes and define a differential residual score based on their respective prediction errors. To accommodate varying user requirements and domain-specific sensitivities, we introduce a preference-aware calibration mechanism that optimizes the classification threshold based on a small set of demonstrations. This approach enables low-cost hallucination detection in a single-sample pass, avoiding the need for secondary sampling or external grounding. Extensive testing across three data benchmarks demonstrates that our method achieves state-of-the-art performance with reduced resource overhead.

cs.LG

Uncertainty Quantification in Data-Driven Dynamical Models via Inverse Problem Solving

Data-driven model identification strategies can be used to obtain phenomenological models that capture the temporal evolution of observable data. While it is usually straightforward to obtain such a model from time series data, for instance with least-squares fitting, it is generally difficult to quantify the uncertainty associated with the prediction of the temporal evolution of the observables. This paper considers a general framework for uncertainty quantification in data-driven dynamical models by framing prediction error through the lens of inverse problem theory. Building on Koopman-inspired model identification strategies that are suited for nonlinear dynamical models, we consider a prediction as an approximate measurement from which the original input state can be faithfully recovered, and define the prediction error as the MSE of solving the inverse problem that would yield this prediction. We demonstrate the efficacy of this approach on both numerical models and experimental data showing that it provides a robust uncertainty measure of model performance.

math.DS

Identification and Computation of Slow Manifolds Using the Isostable Coordinate System

Koopman analysis can be used to understand the dynamics of a nonlinear dynamical system in terms a linear, but generally infinite dimensional operator. The isostable coordinate system focuses on the slowest decaying principal Koopman eigenmodes. This work leverages the isostable coordinate framework in the identification of slow manifolds for dynamical systems with fixed point attractors, defined as surfaces for which the fastest decaying isostable coordinates are zero. Numerical challenges associated with separation between fast and slow timescales necessitate the development of new computational approaches to identify these slow manifolds. Two such strategies are developed which approximate backward-time solutions on the slow manifold starting near the fixed point and extending far beyond the linear regime. Application to a variety of examples illustrates the utility of these methods and their potential use for model order reduction purposes.

math.DS

Reduced Order Modeling of Nonlinear Dynamical Systems Using Slow Manifolds

Model order reduction in high-dimensional, nonlinear dynamical systems if often enabled through fast-slow timescale separation. One such approach involves identifying a low-dimensional slow manifold to which the state rapidly converges and subsequently studying the behavior on the slow manifold. This work investigates slow manifolds defined by the intersection of an unstable manifold of an unstable fixed point or periodic orbit and the stable manifold of a stable attractor. When the decay rates of perturbations transverse to the unstable manifold are sufficiently large, the resulting slow manifold can be used for reduced modeling purposes by leveraging the isostable coordinate framework. Detailed examples are provided for two different highly nonlinear dynamical systems, the first being a coupled system of Hodgkin-Huxley neurons and the second being a biophysically detailed model of circadian oscillations. The resulting reduced order models are illustrated in two different biologically motivated control objectives.

math.DS

Data-Driven Model Identification Near a Supercritical Hopf Bifurcation Using Phase-Based Approaches

A data-driven model identification strategy is developed for dynamical systems near a supercritical Hopf bifurcation with nonautonomous inputs. This strategy draws on phase-amplitude reduction techniques, leveraging an analytical representation for the phase and amplitude response curves of the Hopf normal form to infer system parameters. Fitting can be performed by recording the system output during the relaxation to the stable limit cycle after applying as few as two carefully timed pulse inputs. This strategy is illustrated in two examples with relevance to circadian oscillations. In each example, the proposed model identification strategy allows for the formulation, solution, and implementation of a closed loop nonlinear optimal control problem.

math.DS

N-Body Oscillator Interactions of Higher-Order Coupling Functions

We introduce a method to identify phase equations that include $N$-body interactions for general coupled oscillators valid far beyond the weak coupling approximation. This strategy is an extension of the theory from [Park and Wilson, SIADS 20.3 (2021)] and yields coupling functions for $N\geq2$ oscillators for arbitrary types of coupling (e.g., diffusive, gap-junction, chemical synaptic). These coupling functions enable the study of oscillator networks in terms of phase-locked states, whose stability can be determined using straightforward linear stability arguments. We demonstrate the utility of our approach with two examples. First, we use $N=3$ diffusively coupled complex Ginzburg-Landau (CGL) model and show that the loss of stability in its splay state occurs through a Hopf bifurcation \yp{as a function of non-weak diffusive coupling. Our reduction also captures asymptotic limit-cycle dynamics in the phase differences}. Second, we use $N=3$ realistic conductance-based thalamic neuron models and show that our method correctly predicts a loss in stability of a splay state for non-weak synaptic coupling. In both examples, our theory accurately captures model behaviors that weak and recent non-weak coupling theories can not.

q-bio.NC

Reduced Order Characterization of Nonlinear Oscillations Using an Adaptive Phase-Amplitude Coordinate Framework

We propose a general strategy for reduced order modeling of systems that display highly nonlinear oscillations. By considering a continuous family of forced periodic orbits defined in relation to a stable fixed point and subsequently leveraging phase-amplitude-based reduction strategies, we arrive at a low order model capable of accurately capturing nonlinear oscillations resulting from arbitrary external inputs. In the limit that oscillations are small, the system dynamics relax to those obtained from local linearization, i.e.,~that can be fully described using linear eigenmodes. For larger amplitude oscillations, the behavior can be understood in terms of the dynamics of a small number of nonlinear modes. We illustrate the proposed strategy in a variety of examples yielding results that are substantially better than those obtained using standard linearization-based techniques.

math.DS

Nonlinear Data-Driven Approximation of the Koopman Operator

Koopman analysis provides a general framework from which to analyze a nonlinear dynamical system in terms of a linear operator acting on an infinite-dimensional observable space. This theoretical framework provides a rigorous underpinning for widely used dynamic mode decomposition algorithms. While such methods have proven to be remarkably useful in the analysis of time-series data, the resulting linear models must generally be of high order to accurately approximate fundamentally nonlinear behaviors. This issue poses an inherent risk of overfitting to training data thereby limiting predictive capabilities. By contrast, this work explores strategies for nonlinear data-driven estimation of the action of the Koopman operator. General strategies that yield nonlinear models are presented for systems both with and without control. Subsequent projection of the resulting nonlinear equations onto a low-rank basis yields a low order representation for the underlying dynamical system. In both computational and experimental examples considered in this work, linear estimators of the Koopman operator are generally only able to provide short-term predictions for the observable dynamics while comparable nonlinear estimators provide accurate predictions on substantially longer timescales and replicate infinite-time behaviors that linear predictors cannot.

math.DS

Optimal Control of Oscillation Timing and Entrainment Using Large Magnitude Inputs: An Adaptive Phase-Amplitude-Coordinate-Based Approach

Given the high dimensionality and underlying complexity of many oscillatory dynamical systems, phase reduction is often an imperative first step in control applications where oscillation timing and entrainment are of interest. Unfortunately, most phase reduction frameworks place restrictive limitations on the magnitude of allowable inputs, limiting the practical utility of the resulting phase reduced models in many situations. In this work, motivated by the search for control strategies to hasten recovery from jet-lag caused by rapid travel through multiple time zones, the efficacy of the recently developed adaptive phase-amplitude reduction is considered for manipulating oscillation timing in the presence of a large magnitude entraining stimulus. The adaptive phase-amplitude reduced equations allow for a numerically tractable optimal control formulation and the associated optimal stimuli significantly outperform those resulting from from previously proposed optimal control formulations. Additionally, a data-driven technique to identify the necessary terms of the adaptive phase-amplitude reduction is proposed and validated using a model describing the aggregate oscillations of a large population of coupled limit cycle oscillators. Such data-driven model reduction algorithms are essential in situations where the underlying model equations are either unreliable or unavailable.

math.DS

Data-Driven Inference of High-Accuracy Isostable-Based Dynamical Models in Response to External Inputs

Isostable reduction is a powerful technique that can be used to characterize behaviors of nonlinear dynamical systems in a basis of slowly decaying eigenfunctions of the Koopman operator. When the underlying dynamical equations are known, previously developed numerical techniques allow for high-order accuracy computation of isostable reduced models. However, in situations where the dynamical equations are unknown, few general techniques are available that provide reliable estimates of the isostable reduced equations, especially in applications where large magnitude inputs are considered. In this work, a purely data-driven inference strategy yielding high-accuracy isostable reduced models is developed for dynamical systems with a fixed point attractor. By analyzing steady state outputs of nonlinear systems in response to sinusoidal forcing, both isostable response functions and isostable-to-output relationships can be estimated to arbitrary accuracy in an expansion performed in the isostable coordinates. Detailed examples are considered for a population of synaptically coupled neurons and for the one-dimensional Burgers' equation. While linear estimates of the isostable response functions are sufficient to characterize the dynamical behavior when small magnitude inputs are considered, the high-accuracy reduced order model inference strategy proposed here is essential when considering large magnitude inputs.

math.DS

An Adaptive Phase-Amplitude Reduction Framework Without $\mathcal{O}(\epsilon)$ Constraints on Inputs

Phase reduction is a well-established technique used to analyze the timing of oscillations in response to weak external inputs. In the preceding decades, a wide variety of results have been obtained for weakly perturbed oscillators that place restrictive limits on the magnitude of the inputs or on the magnitude of the time derivatives of the inputs. By contrast, no general reduction techniques currently exist to analyze oscillatory dynamics in response to arbitrary, large magnitude inputs and comparatively very little is understood about these strongly perturbed limit cycle oscillators. In this work, the theory of isostable reduction is leveraged to develop an adaptive phase-amplitude transformation that does not place any restrictions on the allowable input. Additionally, provided some of the Floquet multipliers of the underlying periodic orbits are near-zero, the proposed method yields a reduction in dimension comparable to that of other phase-amplitude reduction frameworks. Numerical illustrations show that the proposed method accurately reflects synchronization and entrainment of coupled oscillators in regimes where a variety of other phase-amplitude reductions fail.

math.DS

High-Order Accuracy Computation of Coupling Functions for Strongly Coupled Oscillators

We develop a general framework for identifying phase reduced equations for finite populations of coupled oscillators that is valid far beyond the weak coupling approximation. This strategy represents a general extension of the theory from [Wilson and Ermentrout, Phys. Rev. Lett 123, 164101 (2019)] and yields coupling functions that are valid to higher-order accuracy in the coupling strength for arbitrary types of coupling (e.g., diffusive, gap-junction, chemical synaptic). These coupling functions can be used to understand the behavior of potentially high-dimensional, nonlinear oscillators in terms of their phase differences. The proposed formulation accurately replicates nonlinear bifurcations that emerge as the coupling strength increases and is valid in regimes well beyond those that can be considered using classic weak coupling assumptions. We demonstrate the performance of our approach through two examples. First, we use diffusively coupled complex Ginzburg-Landau (CGL) model and demonstrate that our theory accurately predicts bifurcations far beyond the range of existing coupling theory. Second, we use a realistic conductance-based model of a thalamic neuron and show that our theory correctly predicts asymptotic phase differences for non-weak synaptic coupling. In both examples, our theory accurately captures model behaviors that weak coupling theories can not.

nlin.AO

Recent Advances in Coupled Oscillator Theory

We review the theory of weakly coupled oscillators for smooth systems. We then examine situations where application of the standard theory falls short and illustrate how it can be extended. Specific examples are given to non-smooth systems with applications to the Izhikevich neuron. We then introduce the idea of isostable reduction to explore behaviors that the weak coupling paradigm cannot explain. In an additional example, we show how bifurcations that change the stability of phase locked solutions in a pair of identical coupled neurons can be understood using the notion of isostable reduction.

nlin.AO

Computing Bounds on Product-Graph Pebbling Numbers

Given a distribution of pebbles to the vertices of a graph, a pebbling move removes two pebbles from a single vertex and places a single pebble on an adjacent vertex. The pebbling number $\pi(G)$ is the smallest number such that, for any distribution of $\pi(G)$ pebbles to the vertices of $G$ and choice of root vertex $r$ of $G$, there exists a sequence of pebbling moves that places a pebble on $r$. Computing $\pi(G)$ is provably difficult, and recent methods for bounding $\pi(G)$ have proved computationally intractable, even for moderately sized graphs. Graham conjectured that $\pi(G ~\square~ H) \leq \pi(G) \pi(H)$, where $G ~\square~ H$ is the Cartesian product of $G$ and $H$ (1989). While the conjecture has been verified for specific families of graphs, in general it remains open. This study combines the focus of developing a computationally tractable, IP-based method for generating good bounds on $\pi(G ~\square~ H)$, with the goal of shedding light on Graham's conjecture.We provide computational results for a variety of Cartesian-product graphs, including some that are known to satisfy Graham's conjecture and some that are not. Our approach leads to a sizable improvement on the best known bound for $\pi(L ~\square~ L)$, where $L$ is the Lemke graph, and $L ~\square~ L$ is among the smallest known potential counterexamples to Graham's conjecture.

math.CO