Evaluating and Improving the Robustness of Large Language Models to Input Sequence Variations
cs.CR, cs.CL, cs.LG
Submitted: 2026-10-01
Updated: 2026-10-08
Comments: PhD thesis, 2026. 118 pages. v2: corrected a name spelling in the acknowledgements
Code: https://github.com/sail-sg/Agent-Smith
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large language models (LLMs) in production systems face prompt injections, trojans (backdoors), and manipulation of automatic quality metrics.
Terminology
Abstract
Large language models (LLMs) in production systems face prompt injections, trojans (backdoors), and manipulation of automatic quality metrics. This thesis develops models, methods, and algorithms for evaluating and improving LLM robustness to adversarial input sequence variations. We propose R stab(f), a generative robustness metric based on the Jensen-Shannon divergence between per-step output distributions under small input perturbations. For localized attacks we prove V(h) <= 1 - R class(h), where R class(h) is the probability that a decision operator h keeps its decision under small perturbations. For non-localized attacks we propose a calibrated empirical model. For LLM-as-a-Judge systems we develop ASA, an adaptive evolutionary black-box attack that reaches an attack success rate (ASR) of up to 73.8%, with transfer between open models up to 62.6%. On Trojan Detection Challenge 2023 data (Pythia-1.4B), surrogate triggers reach REASR 0.99 while recall of the true triggers is 0.17 against a baseline of 0.14. On SaTML CTF 2024 we systematize four classes of bypasses of multi-layer defenses, which reduce the ASR from 90% to 15-25%. Committees of 5-7 heterogeneous models reduce the ASR for Gemma-3-4B by 47-55 percentage points, to 19.3% with 7 models. For agentic systems based on the Model Context Protocol (MCP), we propose AttestMCP, which attests tool calls with HMAC-protected packets at under 0.1 ms per call, and the Commit Boundary isolation pattern. On the MCPBench benchmark of 847 scenarios they reduce the average ASR from 53.7% to 12.4%. The methods are implemented in the JudgeGuard and TrojanArmor software suites and the MCPSec module.
Sources
- Explaining and Harnessing Adversarial Examples
- Towards Deep Learning Models Resistant to Adversarial Attacks
- Universal and Transferable Adversarial Attacks on Aligned Language Models
- Ignore Previous Prompt: Attack Techniques For Language Models
- Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena
- Investigating the Vulnerability of LLM-as-a-Judge Architectures to Prompt-Injection Attacks
- Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystems
- Breaking the Protocol: Security Analysis of the Model Context Protocol Specification and Prompt Injection Vulnerabilities in Tool-Integrated LLM Agents
- Sleeper Channels and Provenance Gates: Persistent Prompt Injection in Always-on Autonomous AI Agents
- Prompt Injection Attacks in Defended Systems
- DIALOG-22 RuATD Generated Text Detection
- Adversarial Attacks on LLM-as-a-Judge Systems: Insights from Prompt Injections
- Intriguing properties of neural networks
- Holistic Evaluation of Language Models
- Jailbroken: How Does LLM Safety Training Fail?
- TextAttack: A Framework for Adversarial Attacks, Data Augmentation, and Adversarial Training in NLP
- Prompt Injection attack against LLM-integrated Applications
- Adversarial Suffix Filtering: a Defense Pipeline for LLMs
- Jailbreak Attacks and Defenses Against Large Language Models: A Survey
- Characterizing and Evaluating the Reliability of LLMs against Jailbreak Attacks
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs