arXiv:2610.09337cs.CROct 2026

Manuscript Offprint

arXiv:2610.09337

Ask the Expert: LLM-Guided Reinforcement Learning for Autonomous Cyber Defense

Fernando Martinez, Abhishek Satyam, Tao Li, Junaid Farooq, Ying Wang, Juntao Chen

Fernando Martinez†, Abhishek Satyam†, Tao Li, Junaid Farooq, Ying Wang, and Juntao Chen

Abstract—Policy-based reinforcement learning (RL) approaches have produced promising results for autonomous cyber defense; however, they are sample-inefficient in settings where defenders must respond under delayed, partial observations with actions from large action spaces. While large language models (LLMs) may reason semantically about security state space, high latency and trust assumptions prevent attractive in-line deployment models. We introduce Ask the Expert, a training-time guidance framework which first summarizes hard cyber-defense states, then intermittently queries an LLM for host-level defensive recommendations via a constrained action interface, and finally transforms those recommendations into tiered reward shaping for use with PPO. Because the LLM is discarded after training, deployment is a pure RL policy. Across TTCP CAGE CC1 and CC2 and both attacker types, this asymmetric design improves sample efficiency over PPO and outperforms the evaluated potential-based reward shaping (PBRS) baselines, while retaining the strongest terminal mean and requiring no LLM dependency at deployment time.

Index Terms—Autonomous cyber defense, large language models, reinforcement learning, reward shaping.

I. INTRODUCTION

Enterprise networks are subject to continual risk from post-compromise lateral movement campaigns that slowly infiltrate their networks by reusing credentials and pivoting across hosts [1]. Embedded autonomous agents intended to respond to these intrusions must act under tight time constraints and with incomplete network observability. Successfully responding requires agents to reason over local alerts and choose from a large, semantically dense action space (e.g., conducting host forensics, terminating sessions, and deploying remediation), while being predominantly guided by dense but tactically weak reward signals.

Reinforcement learning (RL), and policy gradient methods like PPO [2] in particular, scale to learning policies over large structured discrete action spaces [3], [4]. Unfortunately, applying RL solutions directly to the response problem can behave destructively during early exploration: unfettered RL agents will drive significant service degradation for normal users until eventually stumbling onto reasonable behavior [5]. Moreover, the scalar reward emitted by the environment represents global network health, but does not provide meaningful, tactically valid feedback for granular actions an agent takes [6]. The bulk of early agent training time is spent performing no-knowledge exploration until converging on a reasonable policy, if at all. Classical potential-based reward shaping (PBRS) provides the theoretical backdrop for altering rewards while preserving optimal policies under restricted transformations [7], but practical cyber defense still relies heavily on heuristic shaping rules. We address this gap by using an empirically inspired, training-time shaping scheme derived from LLM advice rather than claiming policy invariance.

Separately, Large Language Models (LLMs) have been applied to qualitative cybersecurity reasoning tasks [8]–[10] as well as reward generation for automated RL problems [11], [12]. But interacting with an LLM directly as an online runtime agent would incur unacceptable inference latency and present dangerous trust-boundary risks. Fortunately, we can leverage similar asymmetric training regimes from SCORER [13] and CORAL [14] that allow us to inject enriched auxiliary knowledge during training-time. This leaves us with the question: how can we harness the zero-shot reasoning power of a pre-trained LLM as an asymmetric teacher?

We present Ask the Expert, an LLM-guided RL framework that intermittently samples hard states in which the defender first observes a newly spreading compromise. These states are passed to a zero-shot LLM, which returns host-focused remediation advice. The advice is distilled into a persistent tiered reward-shaping policy used only during training. After training, the LLM is discarded, leaving a fast and fully autonomous deployment policy.

Our contributions are as follows:

• We introduce Ask the Expert, a training-time-only LLM-guided reward-shaping framework for autonomous cyber defense that improves RL learning without requiring any deployment-time LLM calls or added inference latency.

• We design a recent-frontier prompting mechanism that stores hard states involving newly spreading compromises, prioritizes recent severe failures, caps prompt concentration on any one spreading host, and distills host-level LLM guidance into persistent tiered priors over remediation actions.

†^{\dagger}Equal contribution.

F. Martinez, A. Satyam, and J. Chen are with the Department of Computer and Information Sciences, Fordham University, New York, USA. {fmartinezlopez, as526, jchen504}@fordham.edu

• We conduct a multi-seed evaluation on CAGE CC1 and CC2 against two attacker types, showing improved sample efficiency over PPO and observation-based PBRS baselines.

T. Li is with the Department of Systems Engineering, City University of Hong Kong, Hong Kong SAR, China. T. Li is supported by a CityU internal grant No. 9610792.

J. Farooq is with the Department of Electrical and Computer Engineering, University of Michigan-Dearborn, Dearborn, MI, USA.

Y. Wang is with the Department of Systems Engineering, Stevens Institute of Technology, New Jersey, USA.

Accepted for publication at IEEE GLOBECOM. Proceedings forthcoming.

© 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.

References (27)