Lune

USENIX Security2025顶会

StruQ: Defending Against Prompt Injection with Structured Queries

Sizhe Chen, Julien Piet, Chawin Sitawarin, David A. Wagner

摘要

Recent advances in Large Language Models (LLMs) enable exciting LLM-integrated applications, which perform text-based tasks by utilizing their advanced language understanding capabilities. However, as LLMs have improved, so have the attacks against them. Prompt injection attacks are an important threat: they trick the model into deviating from the original application's instructions and instead follow user directives. These attacks rely on the LLM's ability to follow instructions and inability to separate prompts and user data. We introduce structured queries, a general approach to tackle this problem. Structured queries separate prompts and data into two channels. We implement a system that supports structured queries. This system is made of (1) a secure front-end that formats a prompt and user data into a special format, and (2) a specially trained LLM that can produce high-quality outputs from these inputs. The LLM is trained using a novel fine-tuning strategy: we convert a base (non-instruction-tuned) LLM to a structured instruction-tuned model that will only follow instructions in the prompt portion of a query. To do so, we augment standard instruction tuning datasets with examples that also include instructions in the data portion of the query, and fine-tune the model to ignore these. Our system significantly improves resistance to prompt injection attacks, with little or no impact on utility. Our code is released at https://github.com/Sizhe-Chen/StruQ.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 63 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedback 引用了 Finetuned Language Models are Zero-Shot Learners
  • AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedback 引用了 Training language models to follow instructions with human feedback
  • Tree of Attacks: Jailbreaking Black-Box LLMs Automatically 引用了 Extracting Training Data from Large Language Models
  • The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections 引用了 Tree of Attacks: Jailbreaking Black-Box LLMs Automatically
  • The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections 引用了 Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections 引用了 DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM Agents
  • Formalizing and Benchmarking Prompt Injection Attacks and Defenses 引用了 Extracting Training Data from Large Language Models
  • Finetuned Language Models are Zero-Shot Learners 引用了 Training language models to follow instructions with human feedback
  • Training language models to follow instructions with human feedback 引用了 Finetuned Language Models are Zero-Shot Learners
  • Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templates 引用了 Tree of Attacks: Jailbreaking Black-Box LLMs Automatically
  • Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt Templates 引用了 Training language models to follow instructions with human feedback
  • Prompt Injection Attack to Tool Selection in LLM Agents 引用了 Tree of Attacks: Jailbreaking Black-Box LLMs Automatically
  • Prompt Injection Attack to Tool Selection in LLM Agents 引用了 Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • Prompt Injection Attack to Tool Selection in LLM Agents 引用了 Training language models to follow instructions with human feedback
  • Training language models to follow instructions with human feedback 引用了 Extracting Training Data from Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper63

  1. Formalizing and Benchmarking Prompt Injection Attacks and DefensesYupei Liu, Yuqi Jia, Runpeng Geng, Jinyuan Jia 等USENIX Security 2024 · 308 次引用
  2. Prompt Injection Attack to Tool Selection in LLM AgentsJiawen Shi, Zenghui Yuan, Guiyao Tie, Pan Zhou 等NDSS 2026 · 181 次引用
  3. The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt InjectionsMilad Nasr, Nicholas Carlini, Chawin Sitawarin, Sander V. Schulhoff 等USENIX Security 2026 · 134 次引用
  4. Keeping LLMs Aligned After Fine-tuning: The Crucial Role of Prompt TemplatesKaifeng Lyu, Haoyu Zhao, Xinran Gu, Dingli Yu 等NeurIPS 2024 · 131 次引用
  5. DRIFT: Dynamic Rule-Based Defense with Injection Isolation for Securing LLM AgentsHao Li, Xiaogeng Liu, Hung-Chun Chiu, Dianqi Li 等NeurIPS 2025 · 76 次引用

它引用的 Paper13

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
  2. Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu 等ICLR 2022 · 4,966 次引用
  3. Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski 等USENIX Security 2021 · 2,866 次引用
  4. AlpacaFarm: A Simulation Framework for Methods that Learn from Human FeedbackYann Dubois, Chen Xuechen Li, Rohan Taori, Tianyi Zhang 等NeurIPS 2023 · 948 次引用
  5. Tree of Attacks: Jailbreaking Black-Box LLMs AutomaticallyAnay Mehrotra, Manolis Zampetakis, Paul Kassianik, Blaine Nelson 等NeurIPS 2024 · 835 次引用

相关 Paper

  1. Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought LearningZhiyuan Chang, Mingyang Li, Yuekai Huang, Ziyou Jiang 等ACL Findings 2026
  2. SecAlign: Defending Against Prompt Injection with Preference OptimizationSizhe Chen, Arman Zharmagambetov, Saeed Mahloujifar, Kamalika Chaudhuri 等CCS 2025 · 1 次引用
  3. ASIDE: Architectural Separation of Instructions and Data in Language ModelsEgor Zverev, Evgenii Kortukov, Alexander Panfilov, Alexandra Volkova 等ICLR 2026 · 28 次引用
  4. Instructional Segment Embedding: Improving LLM Safety with Instruction HierarchyTong Wu, Shujian Zhang, Kaiqiang Song, Silei Xu 等ICLR 2025
  5. DRIP: Defending Prompt Injection via Token-wise Representation Editing and Residual FusionRuofan Liu, Yun Lin, Zhiyong Huang, Jin Song DongCCS 2026 · 3 次引用
黄昏的海面,两侧是细线勾勒的悬崖