CRAIMay 15, 2025

Analysing Safety Risks in LLMs Fine-Tuned with Pseudo-Malicious Cyber Security Data

arXiv:2505.09974v22 citationsh-index: 3Has Code
Originality Incremental advance
AI Analysis

Addresses critical safety risks for cybersecurity applications of LLMs, though the validation is incremental on previous findings.

This paper validates that fine-tuning LLMs with pseudo-malicious cybersecurity data significantly reduces their safety resilience, showing failure rates increase dramatically (e.g., Mistral 7B's prompt injection failure rises from 9.1% to 68.7%), and proposes a novel safety alignment method that rewrites instruction-response pairs to mitigate these risks while preserving utility.

Large language models (LLMs) have been used in many application domains, including cyber security. The application of LLMs in the cyber security domain presents significant opportunities, such as for enhancing threat analysis and malware detection, but it can also introduce critical risks and safety concerns, including potential personal data leakage and automated generation of new malware. Building on recent findings that fine-tuning LLMs with pseudo-malicious cyber security data significantly compromises their safety, this paper presents a comprehensive validation and extension of these safety risks using a different evaluation framework. We employ the garak red teaming framework with the OWASP Top 10 for LLM Applications to assess four open-source LLMs: Mistral 7B, Llama 3 8B, Gemma 2 9B, and DeepSeek R1 8B. Our evaluation confirms and extends previous findings, showing that fine-tuning reduces safety resilience across all tested LLMs (e.g., the failure rate of Mistral 7B against prompt injection increases from 9.1% to 68.7%). We further propose and evaluate a novel safety alignment approach that carefully rewords instruction-response pairs to include explicit safety precautions and ethical considerations. This work validates previous safety concerns through independent evaluation and introduces new methods for mitigating these risks, contributing towards the development of secure, trustworthy, and ethically aligned LLMs. This approach demonstrates that it is possible to maintain or even improve model safety while preserving technical utility, offering a practical path towards developing safer fine-tuning methodologies.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes