Xingcheng Xu

Author directory

2026

While prompt engineering enhances the capabilities of Large Language Models (LLMs), it also exposes critical safety concerns. Due to the inherent brittleness of their static safety boundaries, LLMs are vulnerable to jailbreak prompts, i.e. adversarial inputs designed to bypass safeguards and induce the generation of harmful content. Existing detection mechanisms rely on static model components or fixed decision thresholds, limiting their ability to generalize to evolving attack patterns and continual model updates. To bridge this gap, we propose RLShield, a dynamic jailbreak detection framework that employs reinforcement learning for adaptive threshold selection. RLShield incorporates three key innovations: (i) a dynamic retrieval and LLM-based rewriting module to simulate diverse adversarial contexts; (ii) a cross-layer representation analysis to pinpoint safety-critical parameters; and (iii) a Soft Actor-Critic (SAC) based agent that learns to predict optimal, sample-specific detection thresholds. Experimental results demonstrate that RLShield consistently outperforms state-of-the-art baselines in detection performance while maintaining high computational efficiency. Notably, it improves F1 by up to 7.3%, while achieving an average of 3× gain in inference efficiency across multiple LLM backbones.
Reusable skills are becoming a common interface for extending large language model agents, packaging procedural guidance with access to files, tools, memory, and execution environments. However, this modularity introduces attack surfaces that are largely missed by existing safety evaluations: even when the user request is benign, unsafe influence may reside in skill guidance, local artifacts, or execution-environment files that steer the agent toward unsafe actions. We present SkillSafetyBench, a runnable benchmark for evaluating such skill-mediated safety failures. SkillSafetyBench includes 155 adversarial cases across 47 tasks, 6 risk domains, and 30 safety categories, each evaluated with a case-specific rule-based verifier. Experiments with multiple CLI agents and model backends show that non-user attacks can consistently induce unsafe behavior, with distinct failure patterns across domains, attack methods, and scaffold–model pairings. Our findings suggest that agent safety depends not only on model-level alignment, but also on how agents interpret skills, trust workflow context, and act through executable environments. We release the data and code in an anonymous repository to support reproducibility. The complete benchmark is available at https://github.com/AI45Lab/skill-safety-bench.
The proliferation of large language models (LLMs) has enabled a new class of psychologically grounded malicious comments, shifting fake news attacks from surface-level textual noise to deep cognitive and logical manipulation. This shift severely undermines existing detectors, which conventionally rely on static attack assumptions and fixed training distributions. To bridge this gap, we introduce CogniDir, an adaptive distributional learning framework that reformulates robust detection as a dynamic, optimal data mixture optimization problem for social media content safety. Grounded in cognitive psychology, we first formalize mechanism-specific cognitive adversarial paradigms to systematically expose deep-seated detector vulnerabilities. To address the vulnerability heterogeneity, CogniDir derives an information-theoretic score coupling empirical accuracy with probabilistic confidence, which is then parameterized into a Dirichlet prior. This formulation enables smooth, feedback-driven reallocation of training exposure, mathematically guaranteeing the optimal data mixture ratio toward the most brittle attack mechanisms. Experimental results on three benchmarks demonstrate that CogniDir yields state-of-the-art robustness, improving F1 scores by up to 17.9% over competitive baselines under heterogeneous, AI-generated adversarial pressures.
Distributed agents need to exchange textual evidence across organizational boundaries, but these exchanges can expose two types of private information. One is carried by explicit identifiers. The other appears as source signatures spread across formatting, vocabulary, and syntax. Existing PII detection and masking methods mainly handle localized identifiers, leaving these broader source signals largely intact. Even masking 19.2% of tokens reduces TF-IDF stylometric attribution by only 18.6%. To address this problem, we propose *DiSan*, which treats text sanitization as a representation learning problem. A two-stream encoder maps text into orthogonal role and style subspaces. The role subspace captures task semantics shared across sources, while the local style subspace captures variation associated with source identity. The style representation is never transmitted directly. Prototype alignment supports joint training without centralizing raw text, while adversarial regularization limits source leakage in shared representations and prototypes. We test leakage in sanitized text, learned representations, and uploaded prototypes. On a distributed multi-agent RAG benchmark, *DiSan* reduces PII exposure in answers by 20× while preserving 83% answer faithfulness. On Enron emails, it reduces TF-IDF stylometric attribution by 73.2%, compared with 18.6% for the strongest masking baseline. Embedding and prototype attribution are also close to random. Together, these results show that *DiSan* reduces explicit and distributional leakage while retaining task utility.

2025

Transformer-based models excel in various tasks but their generalization capabilities, especially in arithmetic reasoning, remain incompletely understood. Arithmetic tasks provide a controlled framework to explore these capabilities, yet performance anomalies persist, such as inconsistent effectiveness in multiplication and erratic generalization in modular addition (e.g., modulo 100 vs. 101). This paper develops a unified theoretical framework for understanding the generalization behaviors of transformers in arithmetic tasks, focusing on length generalization. Through detailed analysis of addition, multiplication, and modular operations, we reveal that translation invariance in addition aligns with relative positional encoding for robust generalization, while base mismatch in modular operations disrupts this alignment. Experiments across GPT-family models validate our framework, confirming its ability to predict generalization behaviors. Our work highlights the importance of task structure and training data distribution for achieving data-efficient and structure-aware training, providing a systematic approach to understanding of length generalization in transformers.