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
Cybersecurity needs intelligent systems to detect vulnerabilities, analyze malware, and respond to increasingly sophisticated threats. This systematic literature review maps LLM applications in cybersecurity and finds autonomous agents emerging for complex, multi-step security workflows.
Problem
Increasingly sophisticated cyber threats create a need for intelligent systems that detect vulnerabilities, analyze malware, and respond to attacks.
Source: §1 · p. 2Method
The paper conducts a systematic literature review structured around planning, conducting, and reporting stages.
Source: §2 · p. 4Results
Autonomous LLM-based agents are emerging beyond single-task automation to handle complex, multi-step security workflows.
Source: §9 · p. 44Takeaways & Limitations
These agents point toward autonomous security operations spanning vulnerability lifecycles and penetration testing.
Source: §9 · p. 44LLM hallucinations compromise utility in cryptanalysis applications where exactitude is non-negotiable.
Source: §8.1.4 · p. 40
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 increasingly applied across cybersecurity to detect vulnerabilities, analyze malware, classify attacks, and support defensive workflows. This survey analyzes 47,135 papers and 185 studies to connect security tasks with datasets, preprocessing, and domain-adaptation techniques.
- Growing cyber threats create an urgent need for intelligent systems that detect vulnerabilities, analyze malware, and respond to attacks [23] [47].Source: §1 · p. 2
- LLMs support vulnerability detection and effective patch generation, security-policy document classification and violation detection, and classification of varied attacks from network traffic data [38] [54] [198].They can also detect malicious domains and URLs [134] [178].Source: §1 · p. 2
- Existing surveys often focus on applicable task types without extensively analyzing the associated data, domain-specific techniques, or connections between task requirements and technologies [215] [334].Source: §1 · p. 2, Table 1 · p. 3
Scope
- The survey collects 47,135 relevant papers and systematically analyzes 185 papers from top security and software-engineering venues to provide a holistic view of LLM4Security.It examines tasks alongside datasets, preprocessing techniques, and domain-adaptation methods to assess strengths, limitations, and promising research directions.Source: §1 · p. 2
Research questions
- The survey asks which security tasks LLM approaches facilitate and which LLMs support those tasks.Source: §1 · p. 3, • RQ1: What types of security tasks… · p. 3
• RQ3: What domain specification techniques are used to adapt LLMs to security tasks?
The survey analyzes domain-specific techniques for adapting LLMs to security tasks, including fine-tuning, external augmentation, and data-centric practices. It also identifies hybrid workflows in which LLMs orchestrate traditional software-engineering tools.
RQ3: Domain specification techniques
- LLM4Security uses curated code corpora and novel LLM-based data augmentation in ways aligned with data-driven software engineering.The survey presents these practices as part of an ongoing transformation within software engineering itself.Source: • RQ3: What domain specification… · p. 3
- The survey systematically examines domain-specific adaptation techniques, including fine-tuning and external augmentation, across 185 selected studies.These techniques form one dimension of the survey’s multi-dimensional analysis, alongside security tasks, LLM architectures, and data-centric training and evaluation practices.Source: • RQ3: What domain specification… · p. 4
- LLM-based adaptation supports a shift from defect detection toward automated generation and repair across the secure-software-engineering lifecycle.The survey connects this shift to generative capabilities that extend established software-engineering tasks such as automated testing and program repair.Source: • RQ3: What domain specification… · pp. 3–4
- Hybrid workflows emerge in which LLMs orchestrate traditional software-engineering tools, enabling a new form of security automation.The survey identifies this orchestration as a key finding alongside LLM use for data augmentation to address data scarcity.Source: • RQ3: What domain specification… · p. 4
2 METHODOLOGY
This section outlines the three-stage systematic literature review used to map LLM applications in cybersecurity, guided by four research questions and a multi-stage search, screening, and selection process. It describes the resulting dataset of 185 papers and the quality assessment, snowballing, and data-extraction procedures used to characterize the literature.
2 METHODOLOGY
- The methodology follows established SLR guidelines through Planning, Conducting, and Reporting stages.Planning defines research questions and the search protocol; Conducting covers literature search and analysis; Reporting presents findings through narratives, flowcharts, and tables.Source: §2 · pp. 4–5
2.1 Research Question
- The review asks which security tasks and LLM architectures are studied, how models are adapted, and how security-task data collection and preprocessing differ.The fourth question examines data collection and preprocessing as distinct dimensions and their relationship with security tasks and LLMs.Source: §2.1 · p. 5
2.2 Search Strategy
- The search covered six security venues, six software-engineering venues, arXiv, and seven databases using manual and automated strategies.The automated databases were ACM Digital Library, IEEE Xplore, Science Direct, Web of Science, Springer, Wiley, and arXiv.Source: §2.2 · p. 6
2.3.1 Coarse-Grained Inclusion and Exclusion Criteria.
- The selection pipeline reduced the corpus to 622 full research papers and then 236 papers for fine-grained full-text quality assessment.It applied four inclusion and eight exclusion criteria through automated filtering, manual title-and-abstract screening by three researchers, and consensus resolution of disagreements.Source: §2.3.1 · pp. 7–8
2.3.2 Fine-grained Quality Assessment.
- Fine-grained quality assessment used criteria adapted from established systematic-review guidelines in software engineering.The supplied methodology identifies the quality-assessment framework but does not specify its individual criteria.Source: §2.3.2 · p. 8
- Quality assessment scored five criteria from 0 to 2, retained papers scoring at least 6/10, and left 151 papers for subsequent snowballing.The criteria covered research goals, methodology, data collection and analysis, validity of results and conclusions, and reporting thoroughness.Source: §2.3.2 · p. 8
2.3.3 Forward and Backward Snowballing.
- Snowballing identified 1,072 forward and 2,927 backward papers, ultimately retaining 34 after filtering and quality assessment for a final dataset of 185 papers.Forward snowballing followed citations of selected papers, whereas backward snowballing followed their references.Source: §2.3.3 · p. 8
2.4 Statistics of Selected Papers
- The 185-paper corpus had 185 papers; its highest-frequency venue accounted for 10%, followed by venues at 8% and 7%, while publications rose from 1 in 2020 to 82 in 2023 and 83 in 2024.The review also included 6 early papers from 2025.Source: §2.4 · pp. 8–9
3 RQ1: WHAT TYPES OF SECURITY TASKS HAVE BEEN FACILITATED BY LLM-BASED APPROACHES?
This section organizes LLM-enabled cybersecurity applications across six security domains and 29 tasks, spanning software, system, network, information, content, hardware, and blockchain security. It synthesizes how these approaches support detection, analysis, testing, repair, and response, including increasingly complex workflows orchestrated by autonomous agents, while highlighting dependence on prompting, validation, feedback, and specialized security tools.
3 RQ1: WHAT TYPES OF SECURITY TASKS HAVE BEEN FACILITATED BY LLM-BASED APPROACHES?
- The review identifies LLM-based autonomous agents as an emerging shift from isolated security tasks to orchestrating complex, multi-step security workflows.This trend is presented as a significant development in the surveyed security applications.Source: §3 · p. 10
- Software and system security accounts for around 63% of research, followed by network security at approximately 14%, information and content security at around 12%, while hardware and blockchain security together account for approximately 5%.Source: §3 · p. 10
3.1 Application of LLMs in Network Security
- Network-security applications span web and protocol fuzzing, intrusion and anomaly detection, cyber-threat analysis, penetration testing, protocol analysis, and web-vulnerability detection.LLMs generate attack and test inputs, detect malicious traffic and user-level anomalies, support threat-response decisions, analyze protocol inconsistencies, and improve fuzzing coverage and vulnerability discovery over baseline fuzzers.Source: §3.1 · pp. 10–12
- LLMs support network penetration testing by gathering target information, generating targeted and complex malicious payloads, and automating privilege-escalation guidance; PentestGPT performed well on 13 scenarios and 182 subtasks.PentestGPT combines inference, generation, and self-interaction modules for penetration testing.Source: §3.1 · p. 12
3.2 Application of LLMs in Software and System Security
- Software and system security covers vulnerability and bug detection and repair, program fuzzing, reverse engineering, binary and malware analysis, and system-log analysis.LLMs leverage user-command understanding, program control and data-flow inference, and complex data-structure generation across these tasks.Source: §3.2 · pp. 12–13
- LLM-based static vulnerability detection improves over traditional approaches, while multi-task instruction fine-tuning supports detection, localization, and explanation.However, minor changes to function, variable, or library-function names can cause false positives; LATTE’s automated binary taint analysis discovered 37 new vulnerabilities.Source: §3.2 · p. 13
- LLMs support vulnerability repair, with encoder-decoder T5 performing better and contextual prompts improving JavaScript vulnerability-repair performance, although Java repair remains limited.Dataset construction and fine-tuning improve repair performance, while RAG and few-shot learning generate relevant patch examples; functionality correctness remains a challenge.Source: §3.2 · p. 13
- LLMs detect bugs by comparing generated and original code, using static-analysis feedback, fine-tuning without test cases, contrastive learning, and post-hoc validation to reduce false positives.RepresentThemAll supports bug detection and prediction of bug priority and severity across downstream tasks.Source: §3.2 · p. 14
- LLMs generate syntactically accurate, contextually relevant, and competitive patches for diverse defects, with fine-tuning and interactive feedback loops improving repair accuracy and software reliability.Approaches include CodeBERT, CodeT5, Codex, LLaMa, CodeLLaMa, CodeGEN, UniXcoder, T5, and Repilot, while generated code can still introduce bugs and vulnerabilities.Source: §3.2 · p. 14
- LLMs enhance fuzzing by generating diverse test cases, vulnerability-triggering inputs, fuzz drivers, and targeted tests guided by iterative querying, code coverage, and reinforcement learning.They also use historical bug reports, compiler source code, documentation, and dual-model interaction to construct specialized tests.Source: §3.2 · pp. 14–15
- LLMs assist reverse engineering and binary analysis by recovering names from stripped binaries, disassembling executables, generating source code, characterizing bytecode, and improving decompiler readability.SYMC demonstrates generalization and robustness across binary-analysis tasks, while LLMs also support authorship analysis of real-world APT malware.Source: §3.2 · p. 15
- LLMs extract semantic malware features for detection, with AVScan2Vec supporting large-scale malware classification, clustering, and nearest-neighbor search, while Maltracker augments training data with synthetic malicious samples.These approaches address the limited effectiveness of signature- and heuristic-based methods against unknown or obfuscated attacks [23].Source: §3.2 · p. 15
- LLMs support malware variant construction, log anomaly analysis, secure code generation, ADS verification, and code-obfuscation analysis, but performance declines on obfuscated code.SFT often outperforms ICL with sufficient labeled data, whereas ICL suits rapid deployment or limited-data settings; LLMs also help infer cloud-incident root causes and improve secure code through interactive analysis and prompt optimization.Source: §3.2 · pp. 15–16
3.3 Application of LLMs in Information and Content Security
- LLMs address phishing, spam, harmful-content detection, steganalysis, password generation, and digital forensics, but forensic systems remain supplementary rather than standalone tools.LLM-generated phishing emails have lower click-through rates than manually designed emails; few-shot steganalysis improves detection with few samples, and PassGPT produces more unseen passwords than GAN-based methods.Source: §3.3 · pp. 16–17
3.4 Application of LLMs in Hardware Security
- In hardware security, LLMs detect vulnerabilities from architecture documents and specifications, including identifying 8 vulnerabilities in the OpenTitan SoC and mapping findings to CWEs.They can also generate assertions and execute security policies, while hardware vulnerability repair is identified as an additional application area.Source: §3.4 · p. 18
- LLMs generate secure hardware code for 10 CWEs and can repair hardware security bugs when prompt engineering is combined with functional and formal validation, outperforming synthesis-based tools.LLMs also support hardware vulnerability analysis, mitigation advice, vulnerability generation, and security assertion generation, although assertion correctness depends heavily on prompt context.Source: §3.4 · p. 18
3.5 Application of LLMs in Blockchain Security
- LLMs support smart-contract vulnerability detection and real-time transaction-anomaly detection, but false positives, vulnerability-type variation, formal-property requirements, and context-length limits constrain performance.Generation-discrimination pipelines and static confirmation are used to reduce false positives, while unrestricted search spaces enable broader anomaly detection beyond predefined rules or patterns.Source: §3.5 · pp. 18–19
3.6 Application of LLM Agents in Security
- Autonomous LLM agents shift security applications from query-response tasks to systems that reason, plan, use tools, and coordinate across complex multi-step workflows.Multi-agent systems commonly divide responsibilities among planning, specialized execution, reporting, debate, or hierarchical collaboration agents.Source: §3.6 · p. 19
- The cited passages describe agentic automation spanning penetration testing, zero-day vulnerability exploitation, proof-of-vulnerability exploit generation, insecure-code repair, malicious-behavior detection, and end-to-end binary analysis.Vul-BinLLM [124] is cited for end-to-end analysis and recovery from decompiled code, outperforming general-purpose models.Source: §3.6 · pp. 19–20
- The most effective software-security agents orchestrate static analyzers, debuggers, and program slicers rather than replacing them, while debate-based agents reduce phishing false positives and outperform single-agent approaches.Agent autonomy also creates privilege-escalation risks, motivating least-privilege mechanisms such as Prompt Flow Integrity [143].Source: §3.6 · p. 20
- In blockchain security, agents improve exploit discovery and audit reliability by coupling LLM-generated hypotheses with deterministic execution feedback.A1 tests hypothesized exploits against a forked blockchain state and refines attacks using execution feedback, while SmartAuditFlow combines retrieval-augmented generation with adaptive planning.Source: §3.6 · p. 20
- LLM applications are organized into six cybersecurity domains covering 29 tasks, with specific applications summarized across these domains.The domains include software and system security, network security, information and content security, hardware security, and blockchain security; the supplied passage enumerates five names while stating six domains.Source: §3.6 · p. 21
- Software and system security is the most widely studied domain, with 119 papers covering 11 tasks.Source: §3.6 · p. 21
- LLM-based autonomous agents shift cybersecurity from isolated task execution toward orchestrating complex, multi-step workflows across major security domains.Source: §3.6 · p. 21
4 RQ2: WHAT LLMS HAVE BEEN EMPLOYED TO SUPPORT CYBERSECURITY TASKS?
This section examines the LLM architectures employed to support cybersecurity tasks, categorizing them as encoder-only, encoder-decoder, or decoder-only and tracking their adoption over time. It highlights the growing predominance of decoder-only models since 2023 while noting the continued relevance of other architectures for specialized tasks.
4.1 Architecture of LLMs in Cybersecurity
- The study classifies cybersecurity LLMs into encoder-only, encoder-decoder, and decoder-only architectures while also distinguishing open-source from closed-source models.Open-source models support task-specific fine-tuning, whereas closed-source models can be accessed through APIs with lower hardware costs.Source: §4.1 · p. 21
- Encoder-only models generate contextualized embeddings for code, network traffic, and logs, supporting classification and detection tasks across network, systems, and content security.BERT and its variants were used for system-log failure detection, phishing and spam detection, and harmful-content detection.Source: §4.1 · pp. 21–22
- Encoder-decoder models such as BART, T5, and CodeT5 support sequence-to-sequence security tasks including vulnerability repair, detection, fuzzing, and reverse engineering.Their effectiveness can vary by programming language, including in Java vulnerability repair using CodeT5 and PLBART.Source: §4.1 · pp. 22–23
- Decoder-only models support detailed security analyses, advisories, and code generation; GPT-3.5 and GPT-4 were the most frequently used models across cybersecurity applications [80] [255].Their few-shot learning and large context windows support rapid capability development and use of related vulnerabilities, reports, and code snippets.Source: §4.1 · p. 23
4.2 Trend Analysis
- In 2022, cybersecurity LLM usage reached 11 instances: encoder-only accounted for 5 (45%), decoder-only 4 (36%), and encoder-decoder 2 (18%).Usage rose from 1 instance in 2020 and 2 in 2021, when encoder-decoder and decoder-only models were used exclusively, respectively.Source: §4.2 · pp. 24–25
- In 2023, decoder-only models comprised 59 of 86 instances (69%), rising to 62 of 85 (73%) in 2024, while encoder-only and encoder-decoder models remained active.Early 2025 data contained 6 instances, all decoder-only, indicating continued prominence rather than complete replacement of other architectures.Source: §4.2 · p. 25
- Among open-source models, encoder-only systems comprise 13 of the 20 most downloaded models, while decoder-only systems comprise 16 of the 20 most liked.The contrasting lists suggest strong interest in decoder-only models for complex, open-ended tasks.Source: §4.2 · p. 25
- Decoder-only models’ larger parameter sizes may constrain adoption because computational resources are scarce [81].Their generation, knowledge, and few-shot learning abilities nevertheless make them well-suited to diverse cybersecurity challenges.Source: §4.2 · p. 25
- Decoder-only architectures are most prevalent, with over 15 models and 133 papers applying them to cybersecurity tasks.The analysis covers over 30 distinct LLMs categorized as encoder-only, encoder-decoder, or decoder-only.Source: §4.2 · p. 26
- Since 2023, decoder-only models have dominated because of their generative and reasoning capabilities, while all three architectures remain represented.This reflects a diverse rather than monolithic architectural landscape in LLM4Security.Source: §4.2 · pp. 25–26
- Encoder-only models are consistently selected for representation-heavy classification tasks, whereas encoder-decoder models often support structured sequence-to-sequence tasks such as program repair.These patterns indicate task-architecture alignment rather than a single architecture serving all cybersecurity applications.Source: §4.2 · p. 26
5 RQ3: WHAT DOMAIN SPECIFICATION TECHNIQUES ARE USED TO ADAPT LLMS TO SECURITY TASKS?
This section examines how LLMs are adapted to security tasks through prompt engineering, fine-tuning, external augmentation, and increasingly hybrid workflows. It also covers the data foundations of this adaptation, including dataset sources and composition, preprocessing, and synthetic augmentation.
5 RQ3: WHAT DOMAIN SPECIFICATION TECHNIQUES ARE USED TO ADAPT LLMS TO SECURITY TASKS?
- The survey classifies security-task adaptation techniques into prompt engineering, fine-tuning, and external augmentation to bridge pre-training and downstream-task differences.These techniques address challenges in leveraging knowledge encoded during pre-training for security tasks.Source: §5 · p. 26
5.1 Fine-tuning LLMs for Security Tasks
- Fine-tuning adapts models to task-relevant security data, including vulnerability classification, repair, harmful-content detection, and anomaly detection, with full updates or PEFT methods such as adapters, prompt-tuning, and LoRA.Full fine-tuning can provide high adaptability but is computationally expensive, whereas PEFT reduces computational and memory costs while enabling effective adaptation for large models or resource-constrained environments.Source: §5.1 · pp. 26–27
- Fine-tuning appeared in 57 of 185 surveyed studies (31%), most often in information and content security (50%) and software and system security (36%), and least often in network security (15%).No fine-tuning studies were identified for hardware security or blockchain security in the selected literature.Source: §5.1 · p. 26
- Fine-tuning remains constrained by scarce, noisy, imbalanced, or biased labeled data, resource demands, overfitting, catastrophic forgetting, and possible degradation of safety alignments.These issues can limit generalization to novel vulnerabilities, attack vectors, or code constructs and may increase the risk of insecure code or harmful content.Source: §5.1 · pp. 27–28
5.2 Prompting LLMs for Security Tasks
- Prompt engineering is involved in almost all security tasks listed in Table4, using task-specific knowledge, zero- or few-shot examples, and chain-of-thought prompting to guide targeted outputs and multistep reasoning.It is especially useful when datasets are limited or lack sufficient detail, supporting applications such as threat analysis, fuzzing, penetration testing, and hardware vulnerability verification.Source: §5.2 · p. 28
5.3 External Augmentation
- Directly applying pre-trained LLMs to complex security tasks faces challenges from diverse domain data and complex domain expertise, motivating external augmentation.Source: §5.3 · p. 28
- External augmentation comprises eight categories, including feature augmentation, retrieval, tools, task-adaptive training, inter-model interaction, rebroadcasting, post-processing, and workflow integration.These methods improve prompts, retrieve domain knowledge, correct outputs, coordinate models, reduce errors, validate results, and use workflow feedback to steer behavior.Source: §5.3 · pp. 28, 30
- Prompt engineering appeared in almost all 185 papers, while fine-tuning and task-specific external augmentation appeared in 31% and 36%, respectively.These techniques include internal adaptation and integration with external data and tools.Source: §5.3 · p. 31
- State-of-the-art LLM4Security applications increasingly use hybrid systems that integrate models into larger, more reliable security workflows.LLMs serve as core reasoning engines alongside fine-tuning, external data, tools, and interactive feedback rather than as standalone oracles.Source: §5.3 · p. 31
6.1 Data Collection
- 73 studies used open-source datasets, while researchers also collected, constructed, or obtained industrial datasets for security tasks.Constructed datasets modify or augment existing data through annotation, tailored test sets, or synthetic generation, whereas collected datasets target niche or newly defined problems.Source: §6.1 · pp. 31–33
- Only 2 of 185 studies used industrial datasets, revealing a gap between academic datasets and real-world settings and limiting applicability across domains.Network security studies preferred collected datasets over open-source datasets, indicating that obtaining suitable data remains inconvenient.Source: §6.1 · p. 33
6.2 Types of Datasets
- Code-based datasets dominated with 90 instances, including vulnerable code (34), source code (23), and bug-fix pairs (16), while combined datasets reached 23 instances.Combined code-and-text datasets provide semantic context that supports more accurate vulnerability detection, code repair, and code analysis than code alone.Source: §6.2 · pp. 33, 35
6.3 Data Pre-processing
- Code and text datasets are adapted through extraction, deduplication, quality filtering, representation or tokenization, and train-validation-test splitting tailored to task requirements.Text preprocessing additionally includes segmentation, standardization, removal of symbols or stop words, and tokenization.Source: §6.3 · p. 36
6.4 Data Augmentation using LLMs
- LLM-based augmentation addresses scarce, low-volume, and insufficiently diverse labeled security data by generating synthetic code, vulnerability pairs, debugging benchmarks, and malicious-package variants.The augmented data is typically used for fine-tuning to improve dataset size, diversity, balance, robustness, and generalization.Source: §6.4 · p. 37
- Industrial datasets appear in only 1% of papers, underscoring a disconnect from practice and raising questions about the real-world applicability of current models.The broader analysis finds persistent data scarcity and substantial reliance on open-source, collected, and constructed datasets.Source: §6.4 · p. 37
- Code-based datasets predominate, but combined datasets pairing code with natural-language descriptions are increasingly used to provide context and improve semantic understanding.Datasets are categorized as code-based, text-based, or combined.Source: §6.4 · p. 37
- LLMs increasingly generate synthetic code samples, malicious entities, and diverse textual data to expand and improve security training sets.They also synthesize fine-tuning data, few-shot examples, repair suggestions, vulnerability explanations, and richer textual features.Source: §6.4 · p. 37
- A common preprocessing pipeline extracts, cleans, deduplicates, represents, and segments data into training, validation, and testing sets.LLMs also help construct security knowledge bases, such as vulnerability databases built from CVEs and commits for downstream detection tools.Source: §6.4 · p. 37
7 THREATS TO VALIDITY
The review faces risks from omitted papers and biased study selection, despite layered search, validation, and review procedures. A replication package enables further examination of these processes.
Paper retrieval omissions
- Paper retrieval may omit studies with incomplete abstracts or without cybersecurity-task or LLM keywords, mitigated through manual, automated, and snowballing searches.The searches used keyword strings across seven publishing platforms, alongside forward and backward snowballing and searches of three top security conferences.Source: §7 · p. 38
Bias of research selection
- Study selection may be affected by ambiguous BibTeX records, automated mislabeling, and subjective manual judgments, although secondary review by two experienced researchers reduces omission and misclassification risks.Papers that cannot be conclusively excluded undergo manual validation, and the selection results are reviewed by researchers with cybersecurity and LLM expertise.Source: §7 · p. 38
- The authors provide a replication package to support further examination of the review.This package complements the selection safeguards intended to improve the review’s accuracy, integrity, and reliability.Source: §7 · p. 38
8 CHALLENGES AND OPPORTUNITIES · 8.1 Challenges
The review identifies major barriers to deploying LLMs in cybersecurity, including resource demands, limited and risky data, weak cross-domain generalization, interpretability concerns, and fundamental cryptanalysis limitations. It also describes mitigation strategies such as distillation, fine-tuning, validation, feedback, explainability tools, and uncertainty assessment.
8.1.1 Challenges in LLM Applicability.
- LLM deployment is constrained by substantial storage, memory, computational, energy, and real-time resource demands, especially in resource-constrained environments.Training GPT-Neox-20B requires 825GB of raw text, eight NVIDIA A100-SXM4-40GB GPUs, and approximately 1,830 hours.Source: §8.1.1 · p. 38
- Cybersecurity LLMs face data scarcity, limited or biased datasets, benchmark contamination, privacy risks, and quality-dependent performance and generalization.Distillation and online APIs are explored to reduce model-scale and usage costs, while data limitations can inflate metrics or cause privacy breaches.Source: §8.1.1 · p. 39
8.1.2 Challenges in LLM Generalization Ability.
- LLMs generalize poorly across cybersecurity domains because code, document semantics, and task specifications vary substantially beyond pre-training expertise.Robust generalization requires meticulous fine-tuning, validation, and continuous feedback across security-task datasets to reduce overfitting.Source: §8.1.2 · p. 39
8.1.3 Challenges in LLM Interpretability, Trustworthiness, and Ethical Usage.
- Black-box decisions, unreliable self-explanations, and opaque reasoning hinder interpretability and trust in sensitive security applications.Proposed remedies include Chain-of-Thought, RAG or citation grounding, attention visualization, structured criteria, LIME, SHAP, uncertainty estimates, and response-consistency checks.Source: §8.1.3 · p. 39
- AIGC and opaque or proprietary training practices introduce privacy breaches, forged information, vulnerable code, ownership disputes, and adversarial risks.These concerns can create user reluctance, while improving interpretability and trustworthiness may support broader cybersecurity automation [298].Source: §8.1.3 · p. 40
8.1.4 Limitations in Modern Cryptanalysis.
- Modern cryptanalysis exposes a fundamental mismatch between probabilistic language modeling and the deterministic, mathematically rigorous reasoning required for cryptographic algorithms [98].LLMs struggle with multi-step computation, formal deduction, abstract concepts, and irrelevant context, producing errors in exacting cryptanalytic tasks [11] [106].Source: §8.1.4 · p. 40
- LLMs are poorly suited to discovering novel attacks on modern ciphers because successful exploit datasets are unavailable, while hallucinations undermine applications requiring exactitude [352].Their language-processing architecture therefore conflicts with the stringent requirements of breaking contemporary cryptographic systems.Source: §8.1.4 · p. 40
8.2 Opportunities
The opportunities center on choosing between rapid, low-cost adaptation and resource-intensive customization, while improving LLM4Security through collaboration, retrieval, tools, domain data, multimodal inputs, and broader security coverage. These directions aim to make LLMs more specialized, robust, context-aware, and effective across underdeveloped cybersecurity domains.
8.2.1 Improvement of LLM4Security.
- Open-source frameworks such as T5 [241] enable highly specialized models through source-code modification and retraining, whereas GPT-4 supports faster adaptation with limited data and lower computational overhead.The central trade-off is rapid, user-friendly deployment versus extensive customization with higher resource demands.Source: §8.2.1 · p. 40
- Interacting LLMs with other LLMs or specialized machine-learning models [276] could simplify complex security tasks and improve precision and outcome quality.Collaborative model interaction is proposed as a response to increasingly complex security challenges.Source: §8.2.1 · p. 41
- ChatGPT appeared in over half of the 185 analyzed papers, reflecting growing academic adoption attributed to computational efficiency, versatility, and potential cost-effectiveness [150].Its use also signals efforts to integrate natural-language understanding into traditional cybersecurity practices [234].Source: §8.2.1 · p. 41
8.2.2 Enhancing LLM’s Performance in Existing Security Tasks.
- External retrieval and specialized tools can address LLM limitations by supplying task-relevant knowledge and real-time feedback, making them a competitive choice for improving LLM4Security [70] [92] [14].These mechanisms aim to improve factualness, rationality, robustness, and consistency in generated security solutions.Source: §8.2.2 · p. 41
- Developing domain-specific datasets with experts and practitioners, followed by fine-tuning, can improve LLM effectiveness and alignment in specialized fields lacking open-source data [31].This collaborative approach targets distinctive domain requirements and real-world cybersecurity challenges.Source: §8.2.2 · p. 41
8.2.3 Expanding LLM’s Capabilities in More Security Domains.
- Adding voice, images, and multimodal video inputs can provide richer context and more natural interaction, while extending LLMs to underdeveloped areas such as hardware and blockchain security remains an opportunity [335].Multimodal inputs may improve contextual relevance, and broader domain coverage could support automated security solutions.Source: §8.2.3 · pp. 41–42
8.3 Roadmap
The roadmap highlights future directions for LLM4Security, including automation, domain-knowledge integration, externally augmented security agents, and multimodal processing. It also emphasizes reciprocal Security4LLM research to protect LLMs while using them for cybersecurity.
Security for Large Language Models (Security4LLM)
- Security4LLM must protect LLMs from intrinsic, instruction-level, infrastructure, misuse, and data-leakage threats while pursuing autonomous vulnerability detection and patch generation.The roadmap calls for balanced defenses across architecture, training, inference, and user interaction, alongside cost-effective cybersecurity automation.Source: §8.3 · pp. 42–43
Automating cybersecurity solutions
- Automating cybersecurity solutions should support context-aware, adaptable assistance for security operatives, cost-effective solution development, faster responses, and tailored workflows.The roadmap spans specific-scenario analysis, multi-scenario situational awareness, system optimization, and intuitive security-aware tools.Source: §8.3 · p. 42
Incorporating security knowledge into LLMs
- Integrating specialized security knowledge, task solutions, rules, and best practices into LLMs should reduce hallucinations and errors while producing more robust, consistent security solutions [3] [171].The direction targets expertise-intensive tasks such as penetration testing [278], hardware vulnerability detection, and log analysis [141] [174].Source: §8.3 · p. 42
Security agent: integrating external augmentation and LLMs
- Externally augmented LLMs can become continuously interactive security agents that address domain-knowledge and hallucination limits through input-, model-, and output-level enhancement strategies [47] [231] [352].Agents perceive environments, make decisions, and take actions, while operators specify enhancement strategies for automated security workflows.Source: §8.3 · p. 42
Multimodal LLMs for security
- Future LLM4Security research should expand beyond text and code to multimodal video, audio, and image inputs and outputs for richer security-task understanding.Examples include network-topology diagrams, screenshots of testing steps, and recordings of security incidents or discussions.Source: §8.3 · p. 43
9 CONCLUSION
This systematic review of 185 seminal papers maps LLM4Security and identifies a shift toward generation and repair, generative data augmentation, hybrid tool-integrated workflows, and autonomous security agents.
- The review analyzed 185 seminal papers and synthesized findings across security tasks, LLM models, adaptation techniques, and data-handling practices.It also outlines critical challenges and a roadmap for future work at the intersection of LLMs and cybersecurity.Source: §9 · pp. 43–44
- LLMs are shifting software engineering from defect detection toward automated vulnerability and bug generation and repair, with decoder-only models creating and validating patches.This trend points toward self-healing software.Source: §9 · p. 44
- LLMs address security-data scarcity by generating synthetic vulnerable code snippets and textual repair suggestions for richer, more diverse training datasets.The review identifies generative augmentation as a prominent trend for building robust security tools.Source: §9 · p. 44
- Reliable LLM-powered security applications increasingly use hybrid workflows in which LLMs orchestrate static analyzers, fuzzers, and verifiers through external augmentation and tool integration.The review characterizes this neuro-symbolic approach as becoming the de facto standard.Source: §9 · p. 44
- Autonomous LLM-based agents are emerging beyond single-task automation to plan, use tools, and learn through interactions across vulnerability lifecycles and penetration testing.This trend points toward autonomous security operations and complex, multi-step security workflows.Source: §9 · p. 44
Related papers
This paper cites
- Attention Is All You Need2017
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding2018
- Language Models are Few-Shot Learners2020
- Training language models to follow instructions with human feedback2022
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning2025
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer2019
Cited by
- From Billion-Scale to Million-Scale Language Models: Operational Capabilities for Embedded Post-Exploitation2026
- MARS: Malware Analysis with Rule-Based Scoring of LLM Claims2026
- BlueSTAR: Tiered Agentic Architecture for Autonomous Cyber Defense2026
- Ensembling LLMs for AI-Augmented Cybersecurity Software Requirements Generation2026
- LLM-Based Agents for Software and Systems Security: Approaches, Applications, and Assessment2026
- Large Language Models at the Intersection of Software Engineering and Software Security:An Evidence-Centered Structured Survey and Research Agenda2026