Advancing LLM-Based Security Automation with Customized Group Relative Policy Optimization for Zero-Touch Networks

Xinye Cao, Yihan Lin, Guoshun Nan, Qinchuan Zhou, Yuhang Luo, Yurui Gao, Zeliang Zhang, Haolang Lu, Qimei Cui, Yanzhao Hou, Xiaofeng Tao, Tony Q. S. Quek

TL;DR

SecLoop introduces a fully automated, closed-loop security framework for 6G Zero-Touch Networks (ZTNs) by integrating Large Language Models (LLMs) into the entire threat-defense lifecycle. Paired with a novel Security-Aware Group Relative Policy Optimization (SA-GRPO) algorithm, it trains a lightweight 7B parameter model to outperform massive state-of-the-art LLMs by learning directly from parallel, real-world simulation feedback.

What Problem Does This Paper Address?

As we transition toward sixth-generation (6G) networks, the sheer scale, speed, and complexity of data demand Zero-Touch Networks (ZTNs)—environments that manage, configure, and heal themselves without human intervention. However, 6G ZTNs rely on highly open, distributed, and virtualized architectures, which drastically expands their attack surface to threats like DDoS, SQL injections, and man-in-the-middle attacks.

Current Security Orchestration, Automation, and Response (SOAR) platforms fall short in two major ways:

  1. Lack of End-to-End Automation: They can generate defense recommendations, but they cannot automatically execute, validate, and update those strategies in real-world environments.
  2. Static Learning: They rely on supervised learning from static datasets, which are expensive to label and fail to generalize against evolving zero-day exploits.

This paper bridges the gap by creating an autonomous system that not only decides how to defend a network but actually tests its own defenses in parallel virtual environments to continuously improve.

Methods

The authors introduce two core components: SecLoop and SA-GRPO.

1. SecLoop: The Closed-Loop Framework

SecLoop maps directly to the ETSI ZSM (Zero-touch network and Service Management) architecture, establishing an autonomous Observe-Orient-Decide-Act (OODA) loop:

Fig. 3. Illustration of our proposed SecLoop. The system inputs are attack alerts from the AutoAttack dataset, which is fed into the LLM-based agent. LLM agent generates a group of strategies, which are then input into the SOC for execution. The red team controller and blue team controller automatically generate parallel BATTLE-FIELD environments to carry out the corresponding tool invocations. The response of BATTLE-FIELD is processed by the policy execution validator to generate feedback values, which are passed to the SA-GRPO reward function. SA-GRPO iteratively optimizes and updates the model parameters.
  • Observe/Orient: An Intrusion Detection System (IDS) streams raw network alerts to a validator, which cleans and summarizes the threat.
  • Decide: A fine-tuned LLM agent (based on Qwen2.5-7B-Instruct) ingests the threat summary and outputs a structured security strategy (JSON tool calls).
  • Act: The Security Orchestration Center (SOC) automatically deploys these strategies across parallel, isolated virtual testing environments called BATTLE-FIELD (built using Vagrant and VMware).

2. SA-GRPO: Security-Aware Group Relative Policy Optimization

To train the LLM without expensive human labeling, the authors adapted DeepSeek's GRPO algorithm.

Fig. 4. Illustration of our proposed SA-GRPO algorithm. A group of outputs is sampled from the policy model, each assigned a reward computed with four customized reward functions. The group relative advantage is estimated for each output, and the policy model is updated by maximizing the objective function.

Instead of using a separate critic model to evaluate actions, SA-GRPO samples a group of distinct security strategies from the LLM for a single threat. It deploys them concurrently in the parallel BATTLE-FIELD environments and scores them relatively against each other using a multi-dimensional reward function:

  • Format Reward: Checks if the output is valid JSON.
  • Execution Reward: Verifies if the generated scripts run without errors.
  • Evaluation Reward: Measures how effectively the strategy mitigated the attack and preserved service availability.
  • Penalty: Uses an LLM-based expert to penalize "over-defense" (e.g., an agent trying to stop a minor attack by shutting down the entire network).

Datasets

The authors constructed the AutoAttack dataset by aggregating and replaying traffic from four widely recognized network security benchmarks: CIC-IDS2017, CIC-IDS2018, UNSW-NB15, and CCDC-2018.

Rather than using these for traditional supervised training, AutoAttack acts as an automated replay engine within the BATTLE-FIELD environment. It covers over 20 attack types mapped across 11 distinct tactical stages of the MITRE ATT&CK framework.

MITRE ATT&CK Mapping Table

Key Insights and Ideas

  • Domain-Specific RL Beats Brute-Force Scale: A specialized 7B parameter model optimized via SA-GRPO consistently outperformed massive, general-purpose models like GPT-4.1 and Gemini 2.5 Pro. High-quality, environment-driven feedback beats raw parameter count.
  • The Necessity of the Penalty Reward: In network security automation, an agent's easiest path to a "perfect defense" score is often to isolate the host entirely. The inclusion of a service availability check and an LLM-expert penalty successfully forced the model to find balanced, realistic mitigation strategies.
  • Parallelized Real-World Ground Truth: By leveraging Infrastructure-as-Code (Vagrant), the framework generates actual virtual machines to test code execution. This ensures the LLM learns from genuine system behavior rather than simplified text-based simulations.

Key Results

  • System Performance: SecLoop achieved average defense accuracy improvements of 41.6% over xNIDS and 50.0% over SAGE across the benchmark datasets.
  • LLM Comparisons: The fine-tuned 7B model achieved accuracy gains of 66.9% over Grok 3 Beta, 32.9% over Gemini 2.5 Pro Preview, and 1.2% over GPT-4.1.
  • Algorithm Superiority: SA-GRPO outperformed standard reinforcement learning baselines, yielding a 10.3% improvement over standard GRPO and an 18.6% improvement over PPO.
  • Edge Deployment: When deployed on physical hardware (NVIDIA Jetson AGX Orin/NX edge devices), the framework maintained an impressive defense accuracy of over 91%, proving its readiness for distributed edge computing architectures.

Limitations and Future Work

While promising, the authors highlight a few areas for improvement:

  • Edge Latency: Running the framework on resource-constrained edge devices increased the time cost per decision cycle from 0.74 seconds (in simulation) to 48.19 seconds. Future work will explore small-large model collaboration and knowledge distillation to reduce this latency.
  • Dynamic Tooling: As software versions update, the exact syntax for tool invocation changes. The system needs a more robust self-evolution mechanism to adapt its tool library autonomously.
  • Proactive Defense: The current loop is reactive (responding to alerts). The authors plan to integrate program analysis and fuzz testing to evolve SecLoop into a proactive threat discovery system.

Summary updated

BibTeX
@article{cao2026advancing,
  author = {Xinye Cao and Yihan Lin and Guoshun Nan and Qinchuan Zhou and Yuhang Luo and Yurui Gao and Zeliang Zhang and Haolang Lu and Qimei Cui and Yanzhao Hou and Xiaofeng Tao and Tony Q. S. Quek},
  title = {{Advancing LLM-Based Security Automation with Customized Group Relative Policy Optimization for Zero-Touch Networks}},
  journal = {IEEE J. Sel. Areas Commun.},
  year = {2026},
  doi = {10.1109/jsac.2025.3643844},
}
Figure