Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Muzsai, Lajos, Imolai, David, Lukács, András
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909739131076608
author Muzsai, Lajos
Imolai, David
Lukács, András
author_facet Muzsai, Lajos
Imolai, David
Lukács, András
contents We present 'Random-Crypto', a procedurally generated cryptographic Capture The Flag (CTF) dataset designed to unlock the potential of Reinforcement Learning (RL) for LLM-based agents in security-sensitive domains. Cryptographic reasoning offers an ideal RL testbed: it combines precise validation, structured multi-step inference, and reliance on reliable computational tool use. Leveraging these properties, we fine-tune a Python tool-augmented Llama-3.1-8B via Group Relative Policy Optimization (GRPO) in a secure execution environment. The resulting agent achieves a significant improvement in Pass@8 on previously unseen challenges. Moreover, the improvements generalize to two external benchmarks: 'picoCTF', spanning both crypto and non-crypto tasks, and 'AICrypto MCQ', a multiple-choice benchmark of 135 cryptography questions. Ablation studies attribute the gains to enhanced tool usage and procedural reasoning. These findings position 'Random-Crypto' as a rich training ground for building intelligent, adaptable LLM agents capable of handling complex cybersecurity tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2506_02048
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges
Muzsai, Lajos
Imolai, David
Lukács, András
Cryptography and Security
Artificial Intelligence
68M25
I.2.1; K.6.5
We present 'Random-Crypto', a procedurally generated cryptographic Capture The Flag (CTF) dataset designed to unlock the potential of Reinforcement Learning (RL) for LLM-based agents in security-sensitive domains. Cryptographic reasoning offers an ideal RL testbed: it combines precise validation, structured multi-step inference, and reliance on reliable computational tool use. Leveraging these properties, we fine-tune a Python tool-augmented Llama-3.1-8B via Group Relative Policy Optimization (GRPO) in a secure execution environment. The resulting agent achieves a significant improvement in Pass@8 on previously unseen challenges. Moreover, the improvements generalize to two external benchmarks: 'picoCTF', spanning both crypto and non-crypto tasks, and 'AICrypto MCQ', a multiple-choice benchmark of 135 cryptography questions. Ablation studies attribute the gains to enhanced tool usage and procedural reasoning. These findings position 'Random-Crypto' as a rich training ground for building intelligent, adaptable LLM agents capable of handling complex cybersecurity tasks.
title Improving LLM Agents with Reinforcement Learning on Cryptographic CTF Challenges
topic Cryptography and Security
Artificial Intelligence
68M25
I.2.1; K.6.5
url https://arxiv.org/abs/2506.02048