The integration of large language models (LLMs) into cyber security applications presents significant opportunities, such as enhancing threat analysis and malware detection, but can also introduce critical risks and safety concerns, including personal data leakage and automated generation of new malware. We present a systematic evaluation of safety risks in fine-tuned LLMs for cyber security applications. Using the OWASP Top 10 for LLM Applications framework, we assessed seven open-source LLMs: Phi 3 Mini 3.8B, Mistral 7B, Qwen 2.5 7B, Llama 3 8B, Llama 3.1 8B, Gemma 2 9B, and Llama 2 70B. Our evaluation shows that fine-tuning reduces safety resilience across all tested LLMs (e.g., the safety score of Llama 3.1 8B against prompt injection drops from 0.95 to 0.15). We propose and evaluate a safety alignment approach that carefully rewords instruction-response pairs to include explicit safety precautions and ethical considerations. This approach demonstrates that it is possible to maintain or even improve model safety while preserving technical utility, offering a practical path forward for developing safer fine-tuning methodologies. This work offers a systematic evaluation for safety risks in LLMs, enabling safer adoption of generative AI in sensitive domains, and contributing towards the development of secure, trustworthy, and ethically aligned LLMs.
@misc{analysing_llm_risks,title={Analysing Safety Risks in LLMs Fine-Tuned with Pseudo-Malicious Cyber Security Data},author={ElZemity, Adel and Arief, Budi and Li, Shujun},year={2025},eprint={2505.09974},archiveprefix={arXiv},primaryclass={cs.CR},}
Dataset
CyberLLMInstruct: A New Dataset for Analysing Safety of Fine-Tuned LLMs Using Cyber Security Data
@misc{elzemity2025cyberllminstructnewdatasetanalysing,title={CyberLLMInstruct: A New Dataset for Analysing Safety of Fine-Tuned LLMs Using Cyber Security Data},author={ElZemity, Adel and Arief, Budi and Li, Shujun},year={2025},eprint={2503.09334},archiveprefix={arXiv},primaryclass={cs.CR},}
2024
IEEE Xplore
Privacy Threats and Countermeasures in Federated Learning for Internet of Things: A Systematic Review
Adel ElZemity, and Budi Arief
In 2024 IEEE International Conferences on Internet of Things (iThings) and IEEE Green Computing & Communications (GreenCom) and IEEE Cyber, Physical & Social Computing (CPSCom) and IEEE Smart Data (SmartData) and IEEE Congress on Cybermatics , 2024
@inproceedings{10731741,author={ElZemity, Adel and Arief, Budi},booktitle={2024 IEEE International Conferences on Internet of Things (iThings) and IEEE Green Computing & Communications (GreenCom) and IEEE Cyber, Physical & Social Computing (CPSCom) and IEEE Smart Data (SmartData) and IEEE Congress on Cybermatics},title={Privacy Threats and Countermeasures in Federated Learning for Internet of Things: A Systematic Review},year={2024},pages={331-338},keywords={Privacy;Differential privacy;Social computing;Computational modeling;Multi-party computation;Robustness;Blockchains;Internet of Things;Time factors;Security;Federated Learning;Internet of Things;Privacy Threats;Defensive Measures;Systematic Literature Review},doi={10.1109/iThings-GreenCom-CPSCom-SmartData-Cybermatics62450.2024.00072}}
2023
Springer
A Comparative Analysis of Time Series Transformers and Alternative Deep Learning Models for SSVEP Classification
Heba Ali , Adel ElZemity, Amir E Oghostinos , and 1 more author
In International Conference on Model and Data Engineering , 2023
Steady State Visually Evoked Potentials (SSVEPs) are intrinsic responses to specific visual stimulus frequencies. When the retina is activated by a frequency ranging from 3.5 to 75 Hz, the brain produces electrical activity at the same frequency as the visual signal, or its multiples. Identifying the preferred frequencies of neurocortical dynamic processes is a benefit of SSVEPs. However, the time consumed during calibration sessions limits the number of training trials and gives rise to visual fatigue since there is significant human variation across and within individuals over time, which weakens the effectiveness of the individual training data. To address this issue, we propose a novel cross-subject-based classification method to enhance the robustness of SSVEP classification by employing cross-subject similarity and variability. Through an efficient time-series transformer, we compared Time Series Transformers (TST) with different deep learning approaches in the literature. We utilized the TST to speed up calibration processes and improve classification precision for new users. Then we compare this technique to other techniques: EEGNet, FBtCNN, and C-CNN. Our suggested framework’s outcomes are validated using two datasets with two different time window lengths. The experimental results suggest that cross-subject time-series transformers and EEGNet achieve better performance with specific subjects than state-of-the-art techniques when compared to other techniques that have high potential for building high-speed BCIs.
@inproceedings{ali2023comparative,title={A Comparative Analysis of Time Series Transformers and Alternative Deep Learning Models for SSVEP Classification},author={Ali, Heba and ElZemity, Adel and Oghostinos, Amir E and Selim, Sahar},booktitle={International Conference on Model and Data Engineering},pages={3--16},year={2023},organization={Springer},isbn={978-3-031-55729-3},publisher={Springer Nature Switzerland},doi={10.1007/978-3-031-55729-3_2}}
IEEE Xplore
A Transformer-Based Deep Learning Architecture for Accurate Intracranial Hemorrhage Detection and Classification
Adel ElZemity, Maryam ElFdaly , Shorouk Abdelfattah , and 6 more authors
In 2023 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT) , 2023
@inproceedings{10391388,author={ElZemity, Adel and ElFdaly, Maryam and Abdelfattah, Shorouk and Abdelwahab, Ahmed and Ramadan, Mohamed and Zakzouk, Salma and Ameen, Ahmed and Elkhishen, Rawan and Darweesh, M. Saeed},booktitle={2023 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT)},title={A Transformer-Based Deep Learning Architecture for Accurate Intracranial Hemorrhage Detection and Classification},year={2023},volume={},number={},pages={215-220},keywords={Technological innovation;Deep architecture;Computer architecture;Streaming media;Transformers;Convolutional neural networks;Hemorrhaging;Intracranial Hemorrhage;Transformer;Swin Transformer},doi={10.1109/3ICT60104.2023.10391388},}
2020
IEEE Xplore
Wastewater treatment model with smart irrigation utilizing PID control
Adel ElZemity, Ahmed Ali Gaafar , Ahmed Khaled Ahmed , and 4 more authors
In 2020 2nd Novel Intelligent and Leading Emerging Sciences Conference (NILES) , 2020
@inproceedings{el2020wastewater,title={Wastewater treatment model with smart irrigation utilizing PID control},author={ElZemity, Adel and Gaafar, Ahmed Ali and Ahmed, Ahmed Khaled and Abdelwahab, Ahmed Sayed and Saad, Hatim Mohamed and Elboushi, Mostafa Khaled and Ibraheem, Amira Mofreh},booktitle={2020 2nd Novel Intelligent and Leading Emerging Sciences Conference (NILES)},pages={374--379},year={2020},organization={IEEE},doi={10.1109/NILES50944.2020.9257882},}
2019
IEEE Xplore
Interfacial Modification of Perovskite Solar Cell Using ZnO Electron Injection Layer with PDMS as Antireflective Coating
Mohamed K. Othman , Adel ElZemity, Mohamed K. Rawash , and 4 more authors
In 2019 Novel Intelligent and Leading Emerging Sciences Conference (NILES) , 2019
@inproceedings{8909336,author={Othman, Mohamed K. and ElZemity, Adel and Rawash, Mohamed K. and Taha, Hazem A. and Alalem, Shorouk and El-Fdaly, Maryam and El-Batawy, Yasser M.},booktitle={2019 Novel Intelligent and Leading Emerging Sciences Conference (NILES)},title={Interfacial Modification of Perovskite Solar Cell Using ZnO Electron Injection Layer with PDMS as Antireflective Coating},year={2019},volume={1},number={},pages={209-213},keywords={Conferences;Perovskite solar cell;photovoltaics;Polydimethylsiloxane (PDMS);Pyramids Structure;Electron Injection;Multipathing},doi={10.1109/NILES.2019.8909336},}