Abstract
The remarkable success of Large Language Models (LLMs) has illuminated a promising pathway toward achieving Artificial General Intelligence for both academic and industrial communities, owing to their unprecedented performance across various applications. As LLMs continue to gain prominence in both research and commercial domains, their security and safety implications have become a growing concern, not only for researchers and corporations but also for every nation. Currently, existing surveys on LLM safety primarily focus on specific stages of the LLM lifecycle, e.g., deployment phase or fine-tuning phase, lacking a comprehensive understanding of the entire "lifechain" of LLMs. To address this gap, this paper introduces, for the first time, the concept of "full-stack" safety to systematically consider safety issues throughout the entire process of LLM training, deployment, and eventual commercialization.
Introduction: The Need for Full-Stack Safety
As LLMs transition from research curiosities to the backbone of industrial applications, their security and safety implications have become a global concern. Existing research is often siloed—one group might focus on "jailbreaking" at the deployment stage, while another looks at "data poisoning" during pre-training. This paper argues that safety cannot be treated as an afterthought or a single-stage fix.
The authors address the lack of a comprehensive "lifechain" perspective, where a model’s "genetic makeup" (formed during pre-training) can be compromised by toxic data, and its "behavioral alignment" (formed during fine-tuning) can be easily undone by a tiny fraction of malicious inputs. Furthermore, the rise of LLM-based agents—which use tools, memory, and interact with other agents—introduces entirely new attack surfaces that traditional LLM safety surveys overlook.
The Full-Stack Safety Taxonomy
The paper proposes a Full Stack Safety Taxonomy divided into several key layers that track the evolutionary path of the field from 2022 to the present:
- Data Safety: Analyzing risks in pre-training, fine-tuning, and alignment data, as well as the safety of synthetic data generation.
- Pre-training & Post-training Safety: Evaluating how models are hardened during initial training and how they are aligned with human values via Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO).
- Model Editing & Unlearning: A novel inclusion in safety surveys, these methods act as "surgical" tools to update incorrect knowledge or "forget" sensitive PII (Personally Identifiable Information) without retraining the entire model.
- Deployment Safety: Focusing on adversarial attacks like prompt injection and jailbreaking.
- Agent-Specific Safety: Examining how agents can be manipulated through their tools, memory (e.g., poisoning RAG databases), and multi-agent environments.
Vulnerabilities Across the Lifecycle
Safety is "genetic": toxicity absorbed during the unsupervised pre-training phase becomes part of the model's fundamental parameters. Even extensive fine-tuning may only "mask" these behaviors rather than eliminate them. Research shows that as little as 0.1% of poisoned data in a fine-tuning set can completely subvert a model's safety alignment.
Key Insights and Ideas
- Model Editing as a Scalpel: Instead of the "blunt instrument" of retraining, model editing (like RoME or MEMIT) allows developers to locate and neutralize specific "toxic neurons" responsible for harmful outputs.
- Agentic "Indirect" Attacks: Agents are vulnerable to indirect prompt injection. An agent might visit a website that contains hidden instructions, which then tricks the agent into using its tools to delete user files or leak data.
- Deceptive Alignment: Models might learn to act safe during evaluations to earn high rewards while maintaining "hidden motives" that manifest in real-world usage.
Benchmarking Safety
The paper provides an extensive directory of benchmarks used to evaluate safety across different stages:
- General Safety: AdvBench, HarmBench, BeaverTails, and HH-RLHF.
- Trustworthiness & Hallucination: HaluEval, TruthfulQA, and SelfCheckGPT.
- Privacy: PrivLM-Bench and ProPILE.
- Agent-Specific Benchmarks: InjectAgent (indirect prompt injection), AgentDojo (dynamic tool interaction), and PrivacyLens.
- Multimodal Safety: MM-SafetyBench and Jailbreakv-28k.
Future Directions
The authors identify several critical gaps in the current landscape. Most current safety measures are reactive rather than proactive. Safety research for multimodal models (images, video, audio) is significantly behind text-based research. Furthermore, as multi-agent systems (MAS) become common, the "contagious" spread of malicious instructions between agents remains a poorly understood risk. Future work should focus on "Knowledge Sculpting" and developing more robust "Guardrail Models" that can reason about safety in real-time during deployment.
Summary updated