SearcharxivSearch

arXiv subjects

Rui Fang

Publications and source records attributed to Rui Fang.

At least 19 recordsLinked to original sources

HSMLog: Small Language Model-Assisted Hardware Security Module Log Anomaly Detection with Behavioral Analysis

Hardware Security Module (HSM) logs capture security-critical behavior, but anomalies emerge from relationships across event sequences, keys, object states, sessions, and temporal patterns rather than isolated events. Existing methods separate detection from HSM-specific evidence validation and reporting. In this paper, we present HSMLog, a two-stage framework for HSM log anomaly detection with retrieval-grounded behavioral analysis. In Stage 1, a small language model (SLM) identifies candidate alerts from sliding windows of structured HSM events and performs policy-guided assessment using HSM-specific operational rules. In Stage 2, retrieved policies and historical suspicious-key records strictly predating the alert window, together with candidate-related log context, support conservative candidate review and incident analysis. Evaluated on real industrial HSM background logs augmented with anomaly scenarios co-defined with industrial partners, HSMLog achieves 98.97% precision, 96.00% recall, 98.66% anomalous-event coverage, and a 97.46% F1 score, demonstrating effective anomaly alerting and incident triage in the studied setting.

cs.CR

Numerical analysis of data assimilation for slightly compressible flow

Continuous data assimilation improves flow predictions by continually nudging a model toward available observational data. For slightly compressible flow, a recent model addresses the limitations of velocity-only nudging by assimilating both velocity and pressure data and nudging both quantities into the incompressible Navier-Stokes equations [5]; continuous-in-time error estimates and preliminary experiments show that this joint nudging is effective and substantially reduces the model error relative to velocity-only nudging. Motivated by these results, we carry out the numerical analysis of the model and its finite element discretizations. We establish stability and error estimates for the semi-discrete scheme and for the fully discrete, linearized backward Euler scheme. The analysis shows an infinite predictability horizon: the effect of the initial error decays exponentially in time, and the model error is first order in the observation resolution H and of order $\mu_1^{-1/2}$ in the pressure nudging parameter $\mu_1$. Balancing these two error terms, we choose $\mu_1=\mathcal{O}(H^{-2})$, which yields the optimal convergence rate. Numerical experiments confirm the predicted rates.

math.NA

Action with Visual Primitives

Vision-Language-Action (VLA) models have emerged as a promising paradigm for generalist robotic manipulation. A common design in current architectures maps language instructions and visual observations to actions in a single forward pass. While conceptually simple, this formulation entangles instruction comprehension, spatial scene understanding, and motor control within a single learning objective. As a result, the action expert must implicitly relearn cognitive and perceptual capabilities already present in the pretrained VLM, which can limit both learning efficiency and generalization. We introduce AVP (Action with Visual Primitives), an end-to-end architecture that implements this visual-primitive-centric interface: the VLM infers the next-stage target and emits visual-primitive tokens that condition a flow-matching action expert, with supervision derived from end-effector kinematics. Real-robot experiments on general pick-and-place tasks show that AVP improves the success rate by 37.04% over pi_0.5 and outperforms other recent methods, with consistent gains in data efficiency, spatial-compositional generalization, and object-level transfer.

cs.RO

Interference-Aware Multi-Task Unlearning

Machine unlearning aims to remove the contribution of designated training data from a trained model while preserving performance on the remaining data. Existing work mainly focuses on single-task settings, whereas modern models often operate in multi-task setups with shared backbones, where removing supervision for one task or instance can unintentionally affect others. We introduce multi-task unlearning with two settings: full-task unlearning, which removes a target instance from all tasks, and partial-task unlearning, which removes supervision only from selected tasks. We show that shared parameters couple the forget and retain sets, causing task-level interference on non-target tasks and instance-level interference on other instances. To address this issue, we propose an interference-aware framework that combines task-aware gradient projection, which constrains updates within task-specific subspaces, with instance-level gradient orthogonalization, which reduces conflicts between forget and retain signals. Experiments on two multi-task computer vision benchmarks across five tasks show that our method achieves effective unlearning while maintaining strong generalization, reducing UIS compared with the strongest baseline by 30.3% in full-task unlearning and 52.9% in partial-task unlearning.

cs.AI

Amortized-Precision Quantization for Early-Exit Vision Transformers

Vision Transformers (ViTs) achieve strong performance across vision tasks, yet their deployment with low-precision early exiting remains fragile. Existing quantization methods assume static full-depth execution, making them unstable when exit decisions are perturbed by quantization noise, which can amplify errors along dynamic inference paths. In this paper, we introduce Amortized-Precision Quantization (APQ), a utilization-aware formulation that accounts for layer-wise stochastic exposure to quantization noise and reveals depth-precision trade-offs. Building on APQ, we propose Mutual Adaptive Quantization with Early Exiting (MAQEE), a bi-level framework that jointly optimizes exit thresholds and bit-widths under explicit risk control to improve inference stability. MAQEE establishes a superior Pareto frontier in the accuracy-efficiency trade-off, reducing BOPs by up to 95% while maintaining accuracy and outperforming strong baselines by up to 20\% across classification, detection, and segmentation tasks.

cs.CV

LoopQ: Quantization for Recursive Transformers

Looped language models (LoopLMs) improve parameter efficiency by recursively reusing Transformer blocks, enabling deeper computation under a fixed model size. However, this reuse makes LoopLMs more fragile under post-training quantization (PTQ). We present the first systematic study of quantization in LoopLMs and identify three challenges: distribution shift across roles, state reuse across loop transitions, and recursive error accumulation. To address these challenges, we propose LoopQ, a loop-aware PTQ framework that preserves a shared quantized backbone while introducing lightweight adaptations. LoopQ combines activation scaling, selective transformation, cross-loop state alignment, and trajectory-aware optimization to reduce distributional mismatch within loops and error accumulation across loops. Experiments across seven benchmarks show that, under W4A4 quantization, LoopQ improves average downstream accuracy by 68.8% and reduces average perplexity by 87.7% compared with the strongest static PTQ baseline.

cs.LG

Data assimilation for slightly compressible flow

Continuous data assimilation (CDA) nudges observational data into governing equations to recover the underlying flow and improve predictions. Existing rigorous CDA analyses focus primarily on incompressible flows, yet no physical flow is perfectly incompressible. Approximating a slightly compressible flow with an incompressible model introduces non-negligible model errors. Data assimilation for compressible flows remains challenging due to strong nonlinearities and the presence of shocks. We design an algorithm that addresses the limitations of velocity-only nudging for slightly compressible flow. This work incorporates both velocity and pressure data from the slightly compressible flow and nudges both quantities into the incompressible Navier--Stokes equations. Our analysis shows that the model error decays exponentially in the initial error, with an asymptotic residual of order $\mathcal{O}(H)$, where H denotes the observation resolution. The analysis also identifies a scaling for the pressure nudging parameter $\mu_1 = O(1/H^2)$ that ensures effective assimilation. We validate the theoretical results through a suite of numerical experiments: a convergence study confirming optimal rates, a modified Taylor--Green vortex benchmark demonstrating synchronization of energy, enstrophy, and pressure, and an acoustic wave propagation test that isolates the role of pressure nudging and achieves a $97.9\%$ reduction in pressure error relative to velocity-only assimilation. Together, these results provide a foundation for discrete error estimates and realistic compressible applications.

math.NA

ReLE: A Scalable System and Structured Benchmark for Diagnosing Capability Anisotropy in Chinese LLMs

Large Language Models (LLMs) have achieved rapid progress in Chinese language understanding, yet accurately evaluating their capabilities remains challenged by benchmark saturation and prohibitive computational costs. While static leaderboards provide snapshot rankings, they often mask the structural trade-offs between capabilities. In this work, we present ReLE (Robust Efficient Live Evaluation), a scalable system designed to diagnose Capability Anisotropy, the non-uniformity of model performance across domains. Using ReLE, we evaluate 304 models (189 commercial, 115 open-source) across a Domain $\times$ Capability orthogonal matrix comprising 207,843 samples. We introduce two methodological contributions to address current evaluation pitfalls: (1) A Symbolic-Grounded Hybrid Scoring Mechanism that eliminates embedding-based false positives in reasoning tasks; (2) A Dynamic Variance-Aware Scheduler based on Neyman allocation with noise correction, which reduces compute costs by 70\% compared to full-pass evaluations while maintaining a ranking correlation of $\rho=0.96$. Our analysis reveals that aggregate rankings are highly sensitive to weighting schemes: models exhibit a Rank Stability Amplitude (RSA) of 11.4 in ReLE versus $\sim$5.0 in traditional benchmarks, confirming that modern models are highly specialized rather than generally superior. We position ReLE not as a replacement for comprehensive static benchmarks, but as a high-frequency diagnostic monitor for the evolving model landscape.

cs.CV

Global Recovery from Local Data: Interior Nudging for 2D Navier-Stokes equations in a Physical Domain

In many real-world applications of data assimilation (DA), the strategic placement of observers is crucial for effective and efficient forecasting. Motivated by practical constraints in sensor deployment, we show that global recovery of the flow field can be achieved using observations available only in a subregion of the domain, possibly far from the boundary. We focus on the two-dimensional incompressible Navier-Stokes equations posed in a bounded physical domain with Dirichlet boundary conditions. Building on the continuous data assimilation framework of Azouani, Olson, and Titi (2014), we rigorously prove that the assimilated solution converges globally to the true solution under suitable conditions on the nudging parameter, spatial resolution, and the geometry of the observation region, specifically, when the maximum distance from any point in the domain to the observational subregion is bounded by a constant multiple of \( \nu^{1/2} \) (in terms of scaling). Our computational results, conducted via finite element methods over complex geometries, support the theoretical findings and reveal even greater robustness in practice. Specifically, synchronization with the true solution is achieved even when the observational subregion lies farther from the rest of the domain than the theoretical threshold permits. Across all three tested scenarios, the local nudging algorithm performs comparably to full-domain assimilation, reaching global accuracy up to machine precision. Interestingly, observational data near the boundary are found to be largely uninformative. This demonstrates that full observability is not necessary: carefully chosen interior observations, even far from the boundary, can suffice.

math.NA

KV Admission: Learning What to Write for Efficient Long-Context LLM Inference

Long-context LLM inference is bottlenecked by the quadratic attention complexity and linear Key-Value (KV) cache growth. Prior approaches mitigate this via post-hoc selection or eviction but overlook the root inefficiency: indiscriminate token admission. In this paper, we formalize KV management as a causal system of three primitives: KV Admission, Selection, and Eviction. We instantiate KV Admission via Write-Gated KV (WG-KV), a lightweight mechanism that learns to predict token utility before cache entry. By filtering out redundant states early to maintain a compact global cache alongside a sliding local cache, WG-KV significantly reduces memory usage and accelerates both prefill and decode phases. Our results demonstrate that learning what to write is a principled and practical recipe for efficient long-context inference. Code is available at https://github.com/EMCLab-Sinica/WG-KV.

cs.LG

Embodied Tree of Thoughts: Deliberate Manipulation Planning with Embodied World Model

World models have emerged as a pivotal component in robot manipulation planning, enabling agents to predict future environmental states and reason about the consequences of actions before execution. While video-generation models are increasingly adopted, they often lack rigorous physical grounding, leading to hallucinations and a failure to maintain consistency in long-horizon physical constraints. To address these limitations, we propose Embodied Tree of Thoughts (EToT), a novel Real2Sim2Real planning framework that leverages a physics-based interactive digital twin as an embodied world model. EToT formulates manipulation planning as a tree search expanded through two synergistic mechanisms: (1) Priori Branching, which generates diverse candidate execution paths based on semantic and spatial analysis; and (2) Reflective Branching, which utilizes VLMs to diagnose execution failures within the simulator and iteratively refine the planning tree with corrective actions. By grounding high-level reasoning in a physics simulator, our framework ensures that generated plans adhere to rigid-body dynamics and collision constraints. We validate EToT on a suite of short- and long-horizon manipulation tasks, where it consistently outperforms baselines by effectively predicting physical dynamics and adapting to potential failures. Website at https://embodied-tree-of-thoughts.github.io .

cs.RO

Learning Hamiltonian Flow Maps from Numerical-Scheme Residuals for Long-Time Multiscale Simulation

Hamiltonian systems with widely separated timescales arise in molecular dynamics, classical mechanics, and plasma physics. Long-time simulation of such systems is expensive because standard direct integrators generally need to resolve the fastest dynamics even when the quantities of interest evolve on much slower scales. The cost is particularly severe for large ensembles of trajectories. We develop a framework for learning Hamiltonian flow maps directly with neural networks. The map is trained either from the residual of a convergent numerical scheme or from reference trajectory data. For variable-timestep maps, truncated Taylor expansions enforce the correct short-time behavior while a neural network represents the remainder. For stiff oscillatory systems, the losses are measured in an energy-balanced norm that weights position errors according to their associated frequencies. We also introduce an HMC-$H_0$ procedure for generating training samples from microcanonical energy surfaces. The analysis clarifies what the residual training learns and how local flow-map errors propagate. Under a nonsingularity condition on the implicit part of a one-step scheme, every $C^1$ critical point of the unrestricted function-space residual functional has zero residual and therefore reproduces that numerical scheme. For a class of multiscale oscillatory Hamiltonians, the amplification rate of recursively applied flow-map errors is independent of the stiff frequencies when the local error is controlled in the energy-balanced norm; linear accumulation follows on the corresponding pre-asymptotic time window. Numerical experiments on separable, nonseparable, and noncanonical systems demonstrate long-time accuracy and identify regimes in which learned flow maps can reduce the cost of multiscale ensemble simulation.

math.NA

Modular data assimilation for flow prediction

This report develops several modular, 2-step realizations (inspired by Kalman filter algorithms) of nudging-based data assimilation $$Step \ 1 \quad \frac{\widetilde {v}^{n+1}-v^{n}}{k}+v^{n}\cdot \nabla \widetilde {v}^{n+1}-\nu \triangle \widetilde {v}^{n+1}+\nabla q^{n+1}=f(x)$$ $$\nabla \cdot \widetilde {v}^{n+1}=0$$ $$Step \ 2 \quad \frac{v^{n+1}-\widetilde {v}^{n+1}}{k}-\chi I_{H}(u(t^{n+1})-v^{n+1})=0.$$ Several variants of this algorithm are developed. Three main results are developed. The first is that if $I_{H}^{2}=I_{H}$, then Step 2 can be rewritten as the explicit step $$v^{n+1}=\widetilde {v}^{n+1}+\frac{k\chi }{1+k\chi }[I_{H}u(t^{n+1})-I_{H} \widetilde {v}^{n+1}].$$ This means Step 2 has the greater stability of an implicit update and the lesser complexity of an explicit analysis step. The second is that the basic result of nudging (that for $H$ small enough and $\chi$ large enough predictability horizons are infinite) holds for one variant of the modular algorithm. The third is that, for any $H>0$ and any $\chi>0$, one step of the modular algorithm decreases the next step's error and increases (an estimate of) predictability horizons. A method synthesizing assimilation with eddy viscosity models of turbulence is also presented. Numerical tests are given, confirming the effectiveness of the modular assimilation algorithm. The conclusion is that the modular, 2-step method overcomes many algorithmic inadequacies of standard nudging methods and retains a robust mathematical foundation.

math.NA

Data assimilation with model errors

Nudging is a data assimilation method amenable to both analysis and implementation. It also has the (reported) advantage of being insensitive to model errors compared to other assimilation methods. However, nudging behavior in the presence of model errors is little analyzed. This report gives an analysis of nudging to correct model errors. The analysis indicates that the error contribution due to the model error decays as the nudging parameter $\chi \to \infty$ like $\mathcal{O}(\chi^{-\frac{1}{2}})$, Theorem 3.2. Numerical tests verify the predicted convergence rates and validate the nudging correction to model errors.

math.NA

Adaptive Parameter Selection in Nudging Based Data Assimilation

Data assimilation combines (imperfect) knowledge of a flow's physical laws with (noisy, time-lagged, and otherwise imperfect) observations to produce a more accurate prediction of flow statistics. Assimilation by nudging (from 1964), while non-optimal, is easy to implement and its analysis is clear and well-established. Nudging's uniform in time accuracy has even been established under conditions on the nudging parameter $\chi$ and the density of observational locations, $H$, Larios, Rebholz, and Zerfas [1]. One remaining issue is that nudging requires the user to select a key parameter. The conditions required for this parameter, derived through \'a priori (worst case) analysis are severe (Section 2.1 herein) and far beyond those found to be effective in computational experience. One resolution, developed herein, is self-adaptive parameter selection. This report develops, analyzes, tests, and compares two methods of self-adaptation of nudging parameters. One combines analysis and response to local flow behavior. The other is based only on response to flow behavior. The comparison finds both are easily implemented and yield effective values of the nudging parameter much smaller than those of \'a priori analysis.

math.NA

Numerical Analysis of Penalty-based Ensemble Methods

The chaotic nature of fluid flow and the uncertainties in initial conditions limit predictability. Small errors that occur in the initial condition can grow exponentially until they saturate at $\mathcal{O}$(1). Ensemble forecasting averages multiple runs with slightly different initial conditions and other data to produce more accurate results and extend the predictability horizon. However, they can be computationally expensive. We develop a penalty-based ensemble method with a shared coefficient matrix to reduce required memory and computational cost and thereby allow larger ensemble sizes. Penalty methods relax the incompressibility condition to decouple the pressure and velocity, reducing memory requirements. This report gives stability proof and an error estimate of the penalty-based ensemble method, extends it to the Navier-Stokes equations with random variables using Monte Carlo sampling, and validates the method's accuracy and efficiency with three numerical experiments.

math.NA

Numerical analysis of a 1/2-equation model of turbulence

The recent 1/2-equation model of turbulence is a simplification of the standard Kolmogorov-Prandtl 1-equation URANS model. Surprisingly, initial numerical tests indicated that the 1/2-equation model produces comparable velocity statistics at reduced cost. It is also a test problem and first step for developing numerical analysis to address a full 1-equation model. This report begins the numerical analysis of the 1/2 equation model. Stability, convergence and error estimates are proven for a semi-discrete and fully discrete approximation. Finally, numerical tests are conducted to validate our convergence theory.

math.NA

Numerical Analysis of Locally Adaptive Penalty Methods For The Navier-Stokes Equations

Penalty methods relax the incompressibility condition and uncouple velocity and pressure. Experience with them indicates that the velocity error is sensitive to the choice of penalty parameter $\epsilon$. So far, there is no effective \'a prior formula for $\epsilon$. Recently, Xie developed an adaptive penalty scheme for the Stokes problem that picks the penalty parameter $\epsilon$ self-adaptively element by element small where $\nabla \cdot u^h$ is large. Her numerical tests gave accurate fluid predictions. The next natural step, developed here, is to extend the algorithm with supporting analysis to the non-linear, time-dependent incompressible Navier-Stokes equations. In this report, we prove its unconditional stability, control of $\|\nabla \cdot u^h\|$, and provide error estimates. We confirm the predicted convergence rates with numerical tests.

math.NA