Source-linked AI summary
Large Language Models for Cyber Security: A Systematic Literature Review
Hanxiang Xu, Shenao Wang, Ningke Li, Kailong Wang, Yanjie Zhao, Kai Chen, Ting Yu, Yang Liu, Haoyu Wang
TL;DR
Cyber-threat growth has increased the need for intelligent systems that detect vulnerabilities, analyze malware, and respond to attacks, while prior surveys provide limited coverage of data and domain-specific techniques. This SLR analyzes 185 papers to map LLM use across cybersecurity tasks, models, adaptation methods, and data handling. It identifies autonomous LLM-based agents as an emerging direction for complex, multi-step security workflows.
Problem
Prior surveys often focus on security tasks without extensively analyzing the associated data and domain-specific techniques.
Method
The study conducts a systematic literature review of 185 papers examining security tasks, LLM models, adaptation techniques, and data handling.
Results
Autonomous LLM-based agents are emerging for complex, multi-step security workflows, including vulnerability lifecycles and penetration testing.
Takeaways & Limitations
The survey maps LLM4Security and synthesizes insights into how LLMs are reshaping the secure-software-engineering lifecycle.
Takeaways & Limitations
Hallucinations compromise LLM utility in cryptanalytic applications where exactitude is non-negotiable.
Abstract
from arXiv · showhide
The rapid advancement of Large Language Models (LLMs) has opened up new opportunities for leveraging artificial intelligence in a variety of application domains, including cybersecurity. As the volume and sophistication of cyber threats continue to grow, there is an increasing need for intelligent systems that can automatically detect vulnerabilities, analyze malware, and respond to attacks. In this survey, we conduct a comprehensive review of the literature on the application of LLMs in cybersecurity~(LLM4Security). By comprehensively collecting over 40K relevant papers and systematically analyzing 185 papers from top security and software engineering venues, we aim to provide a holistic view of how LLMs are being used to solve diverse problems across the cybersecurity domain. Through our analysis, we identify several key findings. First, we observe that LLMs are being applied to an expanding range of cybersecurity tasks, including vulnerability detection, malware analysis, and network intrusion detection. Second, we analyze application trends of different LLM architectures (such as encoder-only, encoder-decoder, and decoder-only) across security domains. Third, we identify increasingly sophisticated techniques for adapting LLMs to cybersecurity, such as advanced fine-tuning, prompt engineering, and external augmentation strategies. A significant emerging trend is the use of LLM-based autonomous agents, which represent a paradigm shift from single-task execution to orchestrating complex, multi-step security workflows.
1 INTRODUCTION
LLMs are being applied across a broadening range of cybersecurity tasks, while existing surveys often provide limited analysis of data and domain-specific techniques. This survey addresses that gap through a systematic, multidimensional review of LLM4Security.
- Growing cyber-threat volume and sophistication creates demand for systems that automatically detect vulnerabilities, analyze malware, and respond to attacks.
- LLMs support diverse tasks including vulnerable-code detection, patch generation, network-attack classification, malware analysis, and security-policy analysis.
- Existing surveys often focus on applicable security tasks without extensively analyzing data, task requirements, or domain-specific techniques.
- The review collects 47,135 relevant papers and systematically analyzes 185 papers from top security and software-engineering venues.
- The survey examines security tasks, LLMs, domain-adaptation techniques, datasets, preprocessing, and evaluation methods to provide a holistic landscape analysis.
• RQ3: What domain specification techniques are used to adapt LLMs to security tasks?
The survey characterizes how LLM-based security research adapts models and data to domain-specific tasks, while situating these methods within changing software-engineering workflows. It identifies a shift toward generation, repair, augmentation, and tool-orchestrated automation.
- Domain-specific techniques: LLM4Security methods evolve established software-engineering paradigms by applying generative capabilities to testing and program repair.
- Domain-specific techniques: Curated code corpora and LLM-based data augmentation align surveyed approaches with data-driven software engineering.
- Contributions: The survey provides a structured map of 185 high-quality papers selected from an initial pool exceeding 47,000 papers.
- Contributions: Its multidimensional analysis covers security tasks, LLM architectures, adaptation techniques, and data-centric training and evaluation practices.
- Key findings: Reported findings include movement from defect detection toward automated generation and repair, data augmentation for scarcity, and hybrid workflows orchestrating traditional tools.
2 METHODOLOGY
The study follows a staged systematic-literature-review protocol combining broad database searches, screening, quality assessment, and snowballing. The resulting corpus contains 185 papers, with rapid growth concentrated in 2023 and 2024.
- Protocol: The SLR is organized into planning, conducting, and reporting stages designed for comprehensive coverage and analysis.
- Selection: The selection process screens titles and abstracts, reviews full texts against predefined criteria, assesses quality, and applies forward and backward snowballing.
- Research questions: Researchers formulate four questions covering tasks, models, adaptation techniques, and data collection and preprocessing.
- Search strategy: Searches combine manually curated studies, keyword extraction, automated queries across seven databases, and coverage of security and software-engineering venues.
- Final corpus: 185 papers remained after quality assessment and snowballing, following an intermediate set of 151 papers.
- Corpus statistics: 82 papers were published in 2023 and 83 in 2024, following notable growth since 2020.
3 RQ1: WHAT TYPES OF SECURITY TASKS HAVE BEEN FACILITATED BY LLM-BASED APPROACHES?
LLMs have been applied across six cybersecurity domains and 29 tasks, with software and system security receiving the greatest research attention. Emerging autonomous-agent systems extend LLM use from isolated tasks to complex, multi-step security workflows.
- Cross-domain coverage: 185 papers were classified into six primary cybersecurity domains, covering diverse security tasks.The domains include software and system, network, information and content, hardware, and blockchain security; the supplied passage names five domains while stating six primary domains.
- Software and system security: Approximately 63% of research concerns software and system security, reflecting extensive code-LLM applications.This domain includes vulnerability detection, program repair, bug detection, and related software-security tasks.
- Network security: Network security accounts for approximately 14% of research, emphasizing traffic detection and network-threat analysis.Applications include network intrusion and anomaly detection, penetration testing, and user-level intrusion detection.
- Information and content security: Information and content security represents around 12% of research, including fake-content, spam, phishing, and scam detection.LLMs are also used for phishing-email generation, password-strength estimation, and harmful-content analysis.
- Core security tasks: LLM-based approaches support vulnerability discovery, malware analysis, code repair, fuzzing, log analysis, and secure-code generation.Reported applications include improved code coverage and vulnerability discovery, malware-variant construction, interactive repair, and prompt optimization for more secure code.
- Autonomous agents: Autonomous agents mark a shift from isolated security tasks toward orchestrating complex, multi-step workflows across major security domains.Successful software-security agents orchestrate classical tools such as static analyzers, debuggers, and program slicers rather than replacing them.
4 RQ2: WHAT LLMS HAVE BEEN EMPLOYED TO SUPPORT CYBERSECURITY TASKS?
The survey analyzes encoder-only, encoder-decoder, and decoder-only architectures across cybersecurity applications. Decoder-only models became dominant in 2023–2024, while the other architectures remained relevant for specialized tasks.
- Architecture taxonomy: The survey classifies cybersecurity LLMs into encoder-only, encoder-decoder, and decoder-only architectures.It also considers whether models are open-source and analyzes their distribution across cybersecurity domains.
- Encoder-only LLMs: Encoder-only models primarily generate contextualized embeddings for code, network traffic, and system logs used in downstream security tasks.BERT and its variants support representation learning and classification, including phishing, spam, and harmful-content detection.
- Encoder-decoder LLMs: Encoder-decoder models support sequence-to-sequence security tasks, including vulnerability repair with T5-based models such as VulRepair.Their effectiveness can vary by programming language, including in Java vulnerability repair.
- Architecture trends: In 2023, decoder-only models constituted approximately 69% of 86 instances, compared with 23% encoder-only and 8% encoder-decoder usage.In 2024, decoder-only models accounted for roughly 73% of 85 instances, while encoder-only and encoder-decoder models remained in use.
- Task-architecture alignment: Encoder-only models remain aligned with representation-heavy classification, while encoder-decoder models remain suited to structured tasks such as program repair.The resulting landscape is diverse rather than monolithic despite decoder-only dominance since 2023.
5 RQ3: WHAT DOMAIN SPECIFICATION TECHNIQUES ARE USED TO ADAPT LLMS TO SECURITY TASKS?
The survey groups LLM adaptation techniques for security tasks into prompt engineering, fine-tuning, and external augmentation, while identifying hybrid systems and data-centric strategies as major trends.
- Fine-tuning: 57 studies (31%) used fine-tuning, with prevalence highest in information and content security (50%) and software and system security (36%).Fine-tuning appeared in 10 of 20 information and content security papers and 43 of 119 software and system security papers.
- Fine-tuning: Fine-tuning adapts general-purpose LLMs with domain-specific knowledge and capabilities for classification, generation, repair, harmful-content detection, and anomaly detection.Applications include vulnerability management, code repair, harmful meme detection, network traffic, and system-log analysis.
- Fine-tuning: Parameter-efficient fine-tuning makes adaptation more accessible for very large models and resource-constrained environments while retaining effective task adaptation.Full fine-tuning updates all parameters but demands significant computational resources.
- External augmentation: External augmentation improves effectiveness across security tasks and can address hallucinations and high false-positive rates linked to weak domain knowledge and task alignment.The review identifies feature augmentation and other external techniques, including retrieval and tools, as recurring strategies.
- Technique prevalence: Prompt engineering appears in almost all 185 surveyed papers, making it the most widely used adaptation technique for security tasks.Fine-tuning was used in 31% of papers, while task-specific external augmentation appeared in 36%.
- Emerging trends: State-of-the-art LLM4Security applications increasingly use hybrid systems in which LLMs serve as reasoning engines within larger security workflows rather than standalone oracles.Researchers also use LLMs for synthetic code samples, malicious entities, and textual data to address training-data scarcity.
7 THREATS TO VALIDITY
The review identifies risks of missing or misclassifying relevant studies during retrieval and selection, despite combining automated, manual, and snowballing procedures with secondary review.
- Paper retrieval omissions: Relevant papers may be overlooked when abstracts are incomplete or omit cybersecurity-task and LLM keywords.The search combined manual searching, automated searches across seven publishing platforms, and forward and backward snowballing.
- Bias of research selection: Automated selection can mislabel papers when BibTeX records contain incomplete or ambiguous information.Papers that cannot be conclusively excluded require manual validation.
- Bias of research selection: Manual validation may introduce subjective-judgment bias when reviewers assess paper quality.Two experienced reviewers conducted a secondary review to reduce omission, misclassification, and selection-bias risks.
- Mitigation: The review provides a replication package for further examination by other researchers.This is presented as an additional measure supporting examination of the review process and results.
8.1 Challenges
The review highlights data, compute, generalization, interpretability, and cryptanalysis-specific limitations that constrain reliable deployment of LLMs in cybersecurity.
- Model size and deployment: LLM scale creates substantial storage, memory, computational, training-time, energy, and deployment demands.One example required more than $6,000 per GPU and 1,830 hours of training, while resource constraints can impede real-time deployment.
- Generalization: Variation in code and document context across 21 security tasks and five domains makes robust generalization difficult without task-specific validation and feedback.Without fine-tuning, validation, and continuous feedback across datasets, models risk overfitting and reduced real-world efficacy.
- Interpretability and trustworthiness: LLM black-box behavior, post-hoc self-explanations, hallucinations, and weak mathematical and logical capabilities undermine trust in sensitive security applications.Suggested responses include uncertainty estimation, consistency checks, source grounding, structured evaluation, and established XAI methods.
- Modern cryptanalysis: Probabilistic language modeling conflicts with cryptanalysis requirements for deterministic, precise, mathematically rigorous reasoning and exact outputs.The review reports limitations in multi-step mathematical computation, formal deduction, abstract concepts, and discovering new attacks without exploit data.
8.2 Opportunities
The review outlines opportunities to tailor models, combine them with external systems, broaden inputs, and extend LLM applications beyond currently concentrated security domains.
- Model selection: Pre-trained APIs favor rapid, lower-overhead task adaptation, whereas open-source frameworks offer broader customization at higher computational cost.The central trade-off is between deployment convenience and highly specialized models tailored to particular domains.
- Inter-model interaction: Collaborative interaction among multiple LLMs or specialized machine-learning models is proposed to improve efficiency and simplify complex security steps.The review anticipates more precise and higher-quality outcomes for intricate security tasks by combining model strengths.
- External retrieval and tools: External retrieval and specialized tools can provide task-relevant knowledge and real-time feedback to guide more factual, rational, robust, and consistent outputs.These approaches address limited domain expertise, hallucinations, and weak mathematical capabilities.
- Domain expansion: Domain-specific datasets and collaboration with practitioners could improve LLM effectiveness and alignment in fields lacking open-source data.Network and hardware security are identified as examples with limited open-source datasets and relatively limited LLM applications.
- New input formats: Voice, images, and multimodal video inputs could provide richer context and more natural interaction for cybersecurity tasks.Combining text, audio, and visuals is associated with more comprehensive contextual understanding and potentially more accurate, relevant outputs.
8.3 Roadmap
The roadmap emphasizes integrating specialized security knowledge, external augmentation, and autonomous agents to make LLM-based security systems more capable and reliable while addressing risks to the models themselves.
- Automating cybersecurity solutions: Security-agent research should support context-aware, tailored assistance for security operatives and more intuitive, efficient workflows.The roadmap connects natural-language tools and generative capabilities with improved understanding of requirements and faster security response times.
- Incorporating security knowledge into LLMs: Future LLM4Security research should integrate specialized cybersecurity knowledge and task solutions to reduce hallucinations and errors.Embedding domain rules and best practices is intended to improve task understanding and produce more robust, consistent solutions.
- Security agent: integrating external augmentation and LLMs: External augmentation strategies can be combined with LLMs across input, model, and output dimensions to optimize security-task performance.Security operators can select augmentation strategies for specific tasks and integrate them into automated security AI agents.
- Multimodal LLMs for security: Future work can extend LLM4Security beyond textual inputs and outputs to multimodal security information such as video, audio, and images.Examples include network-topology diagrams, screenshots, and recordings of security incidents or discussions for penetration-testing contexts.
- Security agent: integrating external augmentation and LLMs: LLM-based autonomous agents are positioned as a promising direction for continuous interaction with systems and increasingly complex security operations.The roadmap describes agents that perceive environments, make decisions, and take actions, while also noting that current models lack domain-specific knowledge and hallucinate.
- Security for Large Language Models: LLM4Security must balance cost-effective security-task automation with robust techniques that safeguard the LLMs themselves.The review highlights threats including model attacks, infrastructure vulnerabilities, misuse, and potential leakage of security-sensitive data.
9 CONCLUSION
This systematic review maps how LLMs are being integrated into cybersecurity and software engineering. It identifies shifts toward generation, repair, synthetic-data augmentation, hybrid tool workflows, and autonomous agents across the field.
- 9 CONCLUSION: The review analyzes 185 seminal papers through four questions covering security tasks, LLM models, adaptation techniques, and data-handling practices.It also outlines critical challenges and a roadmap for future research.
- 9 CONCLUSION: The survey provides a structured map of LLM4Security, synthesizes key insights, and offers guidance for researchers and practitioners.Its scope spans the rapidly evolving intersection of large language models and cybersecurity.
- 9 CONCLUSION: LLM4Security is shifting from defect detection toward automated generation and repair, with decoder-only models creating and validating vulnerability patches.The review presents this trend as progress toward self-healing software.
- 9 CONCLUSION: LLMs are increasingly used for generative data augmentation, producing synthetic security data such as vulnerable code snippets and textual repair suggestions.These outputs create richer and more diverse datasets for training security tools.
- 9 CONCLUSION: The most effective LLM security applications operate as hybrid systems that orchestrate static analyzers, fuzzers, verifiers, and other external tools.The review characterizes this neuro-symbolic integration as a de facto standard for reliable LLM-powered security workflows.
- 9 CONCLUSION: Autonomous LLM-based agents are emerging for complex, multi-step workflows, including vulnerability lifecycles and penetration testing.These agents can plan, use tools, and learn from interactions.