TrojLLM: A Black-box Trojan Prompt Attack on Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are progressively being utilized as machine learning services and interface tools for various applications. However, the security implications of LLMs, particularly in relation to adversarial and Trojan attacks, remain insufficiently examined. In this paper, we propose TrojLLM, an automatic and black-box framework to effectively generate universal and stealthy triggers. When these triggers are incorporated into the input data, the LLMs' outputs can be maliciously manipulated. Moreover, the framework also supports embedding Trojans within discrete prompts, enhancing the overall effectiveness and precision of the triggers' attacks. Specifically, we propose a trigger discovery algorithm for generating universal triggers for various inputs by querying victim LLM-based APIs using few-shot data samples. Furthermore, we introduce a novel progressive Trojan poisoning algorithm designed to generate poisoned prompts that retain efficacy and transferability across a diverse range of models. Our experiments and results demonstrate TrojLLM's capacity to effectively insert Trojans into text prompts in real-world black-box LLM APIs including GPT-3.5 and GPT-4, while maintaining exceptional performance on clean test sets. Our work sheds light on the potential security risks in current models and offers a potential defensive approach. The source code of TrojLLM is available at https://github.com/UCF-ML-Research/TrojLLM.
Key facts. Cited by 31 papers in the map (data through 14 Oct 2026). Builds on 32 of its 46 references that are in the map. First posted on arXiv 12 Jun 2023.
Builds on
32 of 46 references.
References · 32
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,181
- 2019Language Models as Knowledge Bases?cited by 1,936
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
- 2017BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chaincited by 1,106
- 2019How Can We Know What Language Models Know?cited by 959
20 more
- 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 722
- 2018Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networkscited by 580
- 2022RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learningcited by 366
- 2020Weight Poisoning Attacks on Pre-trained Modelscited by 341
- 2021Neural Attention Distillation: Erasing Backdoor Triggers from Deep Neural Networkscited by 324
- 2021Hidden Killer: Invisible Textual Backdoor Attacks with Syntactic Triggercited by 222
- 2020Reformulating Unsupervised Style Transfer as Paraphrase Generationcited by 183
- 2021Differentiable Prompt Makes Pre-trained Language Models Better Few-shot Learnerscited by 115
- 2021Turn the Combination Lock: Learnable Textual Backdoor Attacks via Word Substitutioncited by 89
- 2021Prompt Waywardness: The Curious Case of Discretized Interpretation of Continuous Promptscited by 64
- 2022BadPrompt: Backdoor Attacks on Continuous Promptscited by 63
- 2021Compression, Transduction, and Creation: A Unified Framework for Evaluating Natural Language Generationcited by 60
- 2017Shakespearizing Modern Language Using Copy-Enriched Sequence-to-Sequence Modelscited by 57
- 2022Exploring the Universal Vulnerability of Prompt-based Learning Paradigmcited by 57
- 2022TrojViT: Trojan Insertion in Vision Transformerscited by 31
- 2023TrojText: Test-time Invisible Textual Trojan Insertioncited by 28
- 2022PromptAttack: Prompt-based Attack for Language Models via Gradient Searchcited by 15
- 2023SSL-Cleanse: Trojan Detection and Mitigation in Self-Supervised Learningcited by 11
- 2022ESTAS: Effective and Stable Trojan Attacks in Self-supervised Encoders with One Target Unlabelled Samplecited by 9
- 2022Audit and Improve Robustness of Private Neural Networks on Encrypted Datacited by 4
Built on by
Citing papers per year: 2023: 1; 2024: 10; 2025: 12; 2026: 8.
31 papers.
Sort:
By area:
- 2024BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Modelscited by 86
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Modelscited by 67
- 2025Commercial LLM Agents Are Already Vulnerable to Simple Yet Dangerous Attackscited by 49
- 2023Backdoor Attacks and Countermeasures in Natural Language Processing Models: A Comprehensive Security Reviewcited by 39
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2025Red Teaming the Mind of the Machine: A Systematic Evaluation of Prompt Injection and Jailbreak Vulnerabilities in LLMscited by 34
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularizationcited by 33
- 2025Towards Trustworthy Retrieval Augmented Generation for Large Language Models: A Surveycited by 30
- 2024ConfusedPilot: Confused Deputy Risks in RAG-based LLMscited by 22
- 2025A Survey of Attacks on Large Language Modelscited by 15
- 2024Stealthy Jailbreak Attacks on Large Language Models via Benign Data Mirroringcited by 12
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 11
19 more
- 2025CipherPrune: Efficient and Scalable Private Transformer Inferencecited by 10
- 2025Position: LLM Watermarking Should Align Stakeholders' Incentives for Practical Adoptioncited by 7
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Referencecited by 7
- 2024Adversarial Vulnerabilities in Large Language Models for Time Series Forecastingcited by 6
- 2024Neutralizing Backdoors through Information Conflicts for Large Language Modelscited by 5
- 2025TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generationcited by 4
- 2025Adversarial Attacks against Neural Ranking Models via In-Context Learningcited by 4
- 2024Mitigating Adversarial Attacks in LLMs through Defensive Suffix Generationcited by 1
- 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequencescited by 1
- 2025Boosting Adversarial Transferability via Commonality-Oriented Gradient Optimizationcited by 1
- 2025Stealthy Dual-Trigger Backdoors: Attacking Prompt Tuning in LM-Empowered Graph Foundation Modelscited by 1
- 2024Shortcuts Arising from Contrast: Effective and Covert Clean-Label Attacks in Prompt-Based Learningcited by 0
- 2025Breaking to Build: A Threat Model of Prompt-Based Attacks for Securing LLMscited by 0
- 2026Towards Unveiling Vulnerabilities of Large Reasoning Models in Machine Unlearningcited by 0
- 2026REALM: A Unified Red-Teaming Benchmark for Physical-World VLMscited by 0
- 2026Distill to Detect: Exposing Stealth Biases in LLMs through Cartridge Distillationcited by 0
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMscited by 0
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projectioncited by 0
- 2026Cancerous Backdoor Attack: Gradual Activation via Invisible Tokens and A Stage Controllercited by 0
- 2026Cancerous Backdoor Attack: Gradual Activation via Invisible Tokens and A Stage Controller8 Oct 2026
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection30 Sep 2026
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMs30 Sep 2026
- 2026Distill to Detect: Exposing Stealth Biases in LLMs through Cartridge Distillation1 Jul 2026
- 2026REALM: A Unified Red-Teaming Benchmark for Physical-World VLMs22 Jun 2026
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Framework25 Apr 2026
- 2026Towards Unveiling Vulnerabilities of Large Reasoning Models in Machine Unlearning5 Apr 2026
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference13 Mar 2026
- 2025Position: LLM Watermarking Should Align Stakeholders' Incentives for Practical Adoption21 Oct 2025
- 2025Stealthy Dual-Trigger Backdoors: Attacking Prompt Tuning in LM-Empowered Graph Foundation Models16 Oct 2025
- 2025Breaking to Build: A Threat Model of Prompt-Based Attacks for Securing LLMs4 Sep 2025
- 2025Adversarial Attacks against Neural Ranking Models via In-Context Learning21 Aug 2025
19 more
- 2025Boosting Adversarial Transferability via Commonality-Oriented Gradient Optimization8 Jun 2025
- 2025A Survey of Attacks on Large Language Models18 May 2025
- 2025Red Teaming the Mind of the Machine: A Systematic Evaluation of Prompt Injection and Jailbreak Vulnerabilities in LLMs7 May 2025
- 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequences21 Mar 2025
- 2025TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generation15 Mar 2025
- 2025CipherPrune: Efficient and Scalable Private Transformer Inference24 Feb 2025
- 2025Commercial LLM Agents Are Already Vulnerable to Simple Yet Dangerous Attacks12 Feb 2025
- 2025Towards Trustworthy Retrieval Augmented Generation for Large Language Models: A Survey8 Feb 2025
- 2024Mitigating Adversarial Attacks in LLMs through Defensive Suffix Generation18 Dec 2024
- 2024Adversarial Vulnerabilities in Large Language Models for Time Series Forecasting11 Dec 2024
- 2024Neutralizing Backdoors through Information Conflicts for Large Language Models27 Nov 2024
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularization18 Nov 2024
- 2024Stealthy Jailbreak Attacks on Large Language Models via Benign Data Mirroring28 Oct 2024
- 2024ConfusedPilot: Confused Deputy Risks in RAG-based LLMs9 Aug 2024
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models10 Jun 2024
- 2024BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Models3 Jun 2024
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models22 May 2024
- 2024Shortcuts Arising from Contrast: Effective and Covert Clean-Label Attacks in Prompt-Based Learning30 Mar 2024
- 2023Backdoor Attacks and Countermeasures in Natural Language Processing Models: A Comprehensive Security Review12 Sep 2023
- 2023Backdoor Attacks and Countermeasures in Natural Language Processing Models: A Comprehensive Security Reviewcited by 39
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2025Red Teaming the Mind of the Machine: A Systematic Evaluation of Prompt Injection and Jailbreak Vulnerabilities in LLMscited by 34
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularizationcited by 33
- 2024Stealthy Jailbreak Attacks on Large Language Models via Benign Data Mirroringcited by 12
- 2025Position: LLM Watermarking Should Align Stakeholders' Incentives for Practical Adoptioncited by 7
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Referencecited by 7
- 2024Neutralizing Backdoors through Information Conflicts for Large Language Modelscited by 5
- 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequencescited by 1
- 2025Stealthy Dual-Trigger Backdoors: Attacking Prompt Tuning in LM-Empowered Graph Foundation Modelscited by 1
- 2024Shortcuts Arising from Contrast: Effective and Covert Clean-Label Attacks in Prompt-Based Learningcited by 0
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMscited by 0
12 most cited of 14 All 14 (JSON)
- 2026Cancerous Backdoor Attack: Gradual Activation via Invisible Tokens and A Stage Controller8 Oct 2026
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection30 Sep 2026
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMs30 Sep 2026
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference13 Mar 2026
- 2025Position: LLM Watermarking Should Align Stakeholders' Incentives for Practical Adoption21 Oct 2025
- 2025Stealthy Dual-Trigger Backdoors: Attacking Prompt Tuning in LM-Empowered Graph Foundation Models16 Oct 2025
- 2025Red Teaming the Mind of the Machine: A Systematic Evaluation of Prompt Injection and Jailbreak Vulnerabilities in LLMs7 May 2025
- 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequences21 Mar 2025
- 2024Neutralizing Backdoors through Information Conflicts for Large Language Models27 Nov 2024
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularization18 Nov 2024
- 2024Stealthy Jailbreak Attacks on Large Language Models via Benign Data Mirroring28 Oct 2024
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models10 Jun 2024
12 newest of 14 All 14 (JSON)
- 2025Commercial LLM Agents Are Already Vulnerable to Simple Yet Dangerous Attackscited by 49
- 2025A Survey of Attacks on Large Language Modelscited by 15
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 11
- 2025TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generationcited by 4
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Framework25 Apr 2026
- 2025A Survey of Attacks on Large Language Models18 May 2025
- 2025TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generation15 Mar 2025
- 2025Commercial LLM Agents Are Already Vulnerable to Simple Yet Dangerous Attacks12 Feb 2025
- 2024BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Modelscited by 86
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Modelscited by 67
- 2025Towards Trustworthy Retrieval Augmented Generation for Large Language Models: A Surveycited by 30
- 2024ConfusedPilot: Confused Deputy Risks in RAG-based LLMscited by 22
- 2025Towards Trustworthy Retrieval Augmented Generation for Large Language Models: A Survey8 Feb 2025
- 2024ConfusedPilot: Confused Deputy Risks in RAG-based LLMs9 Aug 2024
- 2024BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Models3 Jun 2024
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models22 May 2024
- 2025CipherPrune: Efficient and Scalable Private Transformer Inferencecited by 10
- 2024Adversarial Vulnerabilities in Large Language Models for Time Series Forecastingcited by 6
- 2025Adversarial Attacks against Neural Ranking Models via In-Context Learningcited by 4
- 2024Mitigating Adversarial Attacks in LLMs through Defensive Suffix Generationcited by 1
- 2025Boosting Adversarial Transferability via Commonality-Oriented Gradient Optimizationcited by 1
- 2026Distill to Detect: Exposing Stealth Biases in LLMs through Cartridge Distillationcited by 0
- 2026Distill to Detect: Exposing Stealth Biases in LLMs through Cartridge Distillation1 Jul 2026
- 2025Adversarial Attacks against Neural Ranking Models via In-Context Learning21 Aug 2025
- 2025Boosting Adversarial Transferability via Commonality-Oriented Gradient Optimization8 Jun 2025
- 2025CipherPrune: Efficient and Scalable Private Transformer Inference24 Feb 2025
- 2024Mitigating Adversarial Attacks in LLMs through Defensive Suffix Generation18 Dec 2024
- 2024Adversarial Vulnerabilities in Large Language Models for Time Series Forecasting11 Dec 2024