Evaluating Large Language Model Application Impacts on Evasive Spectre Attack Detection
Abstract
:1. Introduction
- (1)
- A novel dataset that incorporates LLMs is constructed to provide a realistic test for evaluating the attack detector.
- (2)
- Clustering algorithms are employed to reduce data dimensionality and select representative samples, which improve the efficiency of the attack detector.
- (3)
- Integrating the LLMs with the detection of evasive Spectre attacks, providing new directions for future research.
- (4)
- A comprehensive evaluation across different hardware architectures, showing that architectural differences significantly influence HPCs, leading to varying attack detection success rates for LLMs-based evasive Spectre attacks on text, image, and code tasks.
2. Background
2.1. Large Language Models
2.2. Evasive Spectre Attacks
2.3. Hardware Performance Counters
2.4. Density-Based Spatial Clustering of Applications with Noise
3. Proposed Scheme
3.1. Data Collection
3.2. Data Cleaning Based on DBSCAN and Cluster Analysis
3.2.1. DBSCAN Algorithm
Algorithm 1 DBSCAN Algorithm |
Require: Dataset D, neighborhood radius Eps, minimum points MinPts |
Ensure: Cluster labels for each point in D |
|
3.2.2. Data Cleaning
3.2.3. Cluster Analysis
3.3. Attack Detection
3.3.1. Details of Various Models
3.3.2. Details of Each Metric
4. Results and Analysis
4.1. Experiment Configuration
4.2. Comparative Analysis with Alternative Machine-Learning Models
4.3. The Effectiveness of Random Forest in Detecting Evasive Spectre Attacks
4.4. Broader Evaluations Across Different Hardware Architectures
4.5. Comparison with State-of-the-Art Researches
4.6. Discussion and Limitation
5. Conclusions
- Adaptive Cache Management: Since evasive Spectre attacks rely on abnormal cache behavior, dynamically adjusting cache management strategies can help mitigate the impact of such attacks.
- Hardware-Based Solutions: Implementing cache partitioning or randomized cache indexing can reduce the likelihood of attackers exploiting cache side channels to infer sensitive data.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Chang, Y.; Wang, X.; Wang, J.; Wu, Y.; Yang, L.; Zhu, K.; Chen, H.; Yi, X.; Wang, C.; Wang, Y.; et al. A Survey on Evaluation of Large Language Models. Assoc. Comput. Mach. 2024, 15, 39. [Google Scholar] [CrossRef]
- Brown, T.B.; Mann, B.; Ryder, N.; Subbiah, M.; Kaplan, J.; Dhariwal, P.; Neelakantan, A.; Shyam, P.; Sastry, G.; Askell, A.; et al. Language Models Are Few-Shot Learners. In Proceedings of the 34th International Conference on Neural Information Processing Systems (NIPS 2020), Vancouver, BC, Canada, 6–12 December 2020; Curran Associates Inc.: Red Hook, NY, USA, 2020. Article No. 159. pp. 1–25, ISBN 9781713829546. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention Is All You Need. In Proceedings of the 31st International Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; Curran Associates Inc.: Red Hook, NY, USA, 2017; pp. 6000–6010, ISBN 9781510860964. [Google Scholar]
- Kocher, P.; Horn, J.; Fogh, A.; Genkin, D.; Gruss, D.; Haas, W.; Hamburg, M.; Lipp, M.; Mangard, S.; Prescher, T.; et al. Spectre Attacks: Exploiting Speculative Execution. In Proceedings of the 2019 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 20–22 May 2019; IEEE: New York, NY, USA, 2019; pp. 1–19. [Google Scholar] [CrossRef]
- Li, C.; Gaudiot, J.-L. Detecting Spectre Attacks Using Hardware Performance Counters. IEEE Trans. Comput. 2022, 71, 1320–1331. [Google Scholar] [CrossRef]
- Li, C.; Gaudiot, J.-L. Challenges in Detecting an “Evasive Spectre”. IEEE Comput. Archit. Lett. 2020, 19, 18–21. [Google Scholar] [CrossRef]
- Polychronou, N.F.; Thevenon, P.-H.; Puys, M.; Beroulle, V. MaDMAN: Detection of Software Attacks Targeting Hardware Vulnerabilities. In Proceedings of the 2021 24th Euromicro Conference on Digital System Design (DSD), Palermo, Spain, 1–3 September 2021; pp. 355–362. [Google Scholar] [CrossRef]
- Pashrashid, A.; Hajiabadi, A.; Carlson, T.E. Fast, Robust and Accurate Detection of Cache-based Spectre Attack Phases. In Proceedings of the 2022 IEEE/ACM International Conference on Computer Aided Design (ICCAD), San Diego, CA, USA, 30 October–3 November 2022; pp. 1–9. [Google Scholar]
- Jiao, J.; Wen, R.; Li, Y. T-Smade: A Two-Stage Smart Detector for Evasive Spectre Attacks Under Various Workloads. Electronics 2024, 13, 4090. [Google Scholar] [CrossRef]
- Kosasih, W.; Feng, Y.; Chuengsatiansup, C.; Yarom, Y.; Zhu, Z. SoK: Can We Really Detect Cache Side-Channel Attacks by Monitoring Performance Counters? In Proceedings of the 19th ACM Asia Conference on Computer and Communications Security, Singapore, 1–5 July 2024; Association for Computing Machinery: New York, NY, USA, 2024; pp. 172–185. [Google Scholar] [CrossRef]
- He, Z.; Hu, G.; Lee, R.B. CloudShield: Real-time Anomaly Detection in the Cloud. In Proceedings of the Thirteenth ACM Conference on Data and Application Security and Privacy, Charlotte, NC, USA, 24–26 April 2023; Association for Computing Machinery: New York, NY, USA, 2023; pp. 91–102. [Google Scholar] [CrossRef]
- Guide, P. Volume 3B: System Programming Guide Part. Intel®64 and IA-32 Architectures Software Developer’s Manual; Intel: Santa Clara, CA, USA, 2011; pp. 1–40. Available online: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html (accessed on 26 September 2024).
- Advanced Micro Devices. AMD64 Architecture Programmer’s Manual Volume 2: System Programming; Advanced Micro Devices: Santa Clara, CA, USA, 2006. [Google Scholar]
- Mandal, U.; Shukla, S.; Rastogi, A.; Bhattacharya, S.; Mukhopadhyay, D. μLAM: A LLM-Powered Assistant for Real-Time Micro-architectural Attack Detection and Mitigation. In Proceedings of the ICCAD ’24 IEEE International Conference on Computer-Aided Design, New York, NY, USA, 27–31 October 2024; Cryptology ePrint Archive, Paper 2024/1978. 2024. [Google Scholar] [CrossRef]
- Yu, Y.; Chen, X. Multi-Tenant Deep Learning Acceleration with Competitive GPU Resource Sharing. In Proceedings of the 2023 IEEE Cloud Summit, Baltimore, MD, USA, 6–7 July 2023; pp. 49–51. [Google Scholar]
- Raiaan, M.A.K.; Hossain, M.S.; Kaniz, F.; Mohammad, N.F.; Sadman, S.; Jannat, M.M.; Ahmad, J.; Eunus, M.A.; Azam, S. A Review on Large Language Models: Architectures, Applications, Taxonomies, Open Issues and Challenges. IEEE Access 2024, 12, 26839–26874. [Google Scholar] [CrossRef]
- Radford, A.; Narasimhan, K. Improving Language Understanding by Generative Pre-Training. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), Brussels, Belgium, 31 October–4 November 2018. [Google Scholar]
- Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv 2019, arXiv:1810.04805. [Google Scholar]
- Chen, T.; Li, L.; Zhu, L.; Li, Z.; Liu, X.; Liang, G.; Wang, Q.; Xie, T. VulLibGen: Generating Names of Vulnerability-Affected Packages via a Large Language Model. arXiv 2024, arXiv:2308.04662. [Google Scholar]
- Chow, Y.W.; Schäfer, M.; Pradel, M. Beware of the Unexpected: Bimodal Taint Analysis. In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis, Seattle, WA, USA, 17–21 July 2023; Association for Computing Machinery: New York, NY, USA, 2023; pp. 211–222. [Google Scholar] [CrossRef]
- Alkhatib, N.; Mushtaq, M.; Ghauch, H.; Danger, J.-L. CAN-BERT do it? Controller Area Network Intrusion Detection System based on BERT Language Model. In Proceedings of the 2022 IEEE/ACS 19th International Conference on Computer Systems and Applications (AICCSA), Abu Dhabi, United Arab Emirates, 5–8 December 2022; IEEE: New York, NY, USA, 2022; pp. 1–8. [Google Scholar] [CrossRef]
- Mechri, A.; Ferrag, M.A.; Debbah, M. SecureQwen: Leveraging LLMs for Vulnerability Detection in Python Codebases. Comput. Secur. 2025, 148, 104151. [Google Scholar] [CrossRef]
- Gonçalves, J.; Dias, T.; Maia, E.; Praça, I. SCoPE: Evaluating LLMs for Software Vulnerability Detection. arXiv 2024, arXiv:2407.14372. [Google Scholar]
- Zhao, X.; Leng, X.; Wang, L.; Wang, N.; Liu, Y. Efficient Anomaly Detection in Tabular Cybersecurity Data Using Large Language Models. Sci. Rep. 2025, 15, 3344. [Google Scholar] [CrossRef]
- DeepSeek-AI; Liu, A.; Feng, B.; Xue, B.; Wang, B.; Wu, B.; Lu, C.; Zhao, C.; Deng, C.; Zhang, C.; et al. DeepSeek-V3 Technical Report. arXiv 2025, arXiv:2412.19437. [Google Scholar]
- DeepSeek-AI; Guo, D.; Yang, D.; Zhang, H.; Song, J.; Zhang, R.; Xu, R.; Zhu, Q.; Ma, S.; Wang, P.; et al. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv 2025, arXiv:2501.12948. [Google Scholar]
- Zhang, J.; Chen, C.; Cui, J.; Li, K. Timing Side-channel Attacks and Countermeasures in CPU Microarchitectures. ACM Comput. Surv. 2024, 56, 178. [Google Scholar] [CrossRef]
- Khan, K.; Rehman, S.U.; Aziz, K.; Fong, S.J.; Sarasvady, S.; Vishwa, A. DBSCAN: Past, Present and Future. Proc. Int. Conf. Appl. Digit. Inf. Web Technol. (ICADIWT) 2014, 5, 232–238. [Google Scholar]
- Ester, M.; Kriegel, H.-P.; Sander, J.; Xu, X. A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. In Proceedings of the Second International Conference on Knowledge Discovery and Data Mining, Portland, OR, USA, 2–4 August 1996; AAAI Press: Portland, OR, USA, 1996; pp. 226–231. [Google Scholar]
- Rosenblatt, F. The perceptron: A probabilistic model for information storage and organization in the brain. Psychol. Rev. 1958, 65, 386–408. [Google Scholar] [CrossRef]
- Lipp, M.; Schwarz, M.; Gruss, D.; Prescher, T.; Haas, W.; Horn, J.; Mangard, S.; Kocher, P.; Genkin, D.; Yarom, Y.; et al. Meltdown: Reading Kernel Memory from User Space. Commun. ACM 2020, 63, 46–56. [Google Scholar] [CrossRef]
- Van Bulck, J.; Minkin, M.; Weisse, O.; Genkin, D.; Kasikci, B.; Piessens, F.; Silberstein, M.; Wenisch, T.F.; Yarom, Y.; Strackx, R. Foreshadow: Extracting the Keys to the Intel SGX Kingdom with Transient Out-of-Order Execution. In Proceedings of the 27th USENIX Conference on Security Symposium, Baltimore, MD, USA, 15–17 August 2018; USENIX Association: Baltimore, MD, USA, 2018; pp. 991–1008. [Google Scholar]
HPC Events (Hardware Performance Counter Events) | Description |
---|---|
branches | Branch instructions retired |
branch misses | Branch misprediction retired |
LLC references | Last-level cache reference |
LLC misses | Last-level cache missed |
Item | Configuration |
---|---|
operation system | Linux 5.4.0-146-generic |
mirror | Ubuntu 18.04.6 LTS |
memory | 125.5GiB |
processor | Intel Xeon® Silver 4210 CPU @ 2.2GHz × 20 |
graphics | llvmpipe (LLVM 10.0.0, 256 bits) |
GNOME | 3.28.2 |
OS type | 64 bit |
disk | 502.9 GB |
software | Pycharm professional 2022.1.3 |
Python | Python 3.10 |
Perf (HPCs) | Perf version 5.4.233 |
Attack Type | MLP | RF | RNN |
---|---|---|---|
Evasive Spectre Memory | 0.33% | 1.67% | 0.84% |
Evasive Spectre Nop | 0.17% | 0.67% | 0.00% |
DeepSeek Code Nop | 4.32% | 25.79% | 6.37% |
DeepSeek Code Memory | 0.19% | 30.35% | 54.17% |
DeepSeek Image Nop | 0.13% | 2.37% | 1.20% |
DeepSeek Image Memory | 0.00% | 7.32% | 29.58% |
DeepSeek Text Nop | 0.49% | 12.70% | 2.12% |
DeepSeek Text Memory | 0.06% | 27.38% | 47.70% |
Attack Type | RTX 2080 Ti (%) | RTX 3060 (%) |
---|---|---|
DeepSeek Code Nop | 25.79 | 20.22 |
DeepSeek Code Memory | 30.35 | 23.91 |
DeepSeek Image Nop | 2.37 | 42.47 |
DeepSeek Image Memory | 7.32 | 41.64 |
DeepSeek Text Nop | 12.70 | 34.45 |
DeepSeek Text Memory | 27.38 | 42.56 |
Method | HPC Events | ML Models | Workload Variety | Attack Detection Success Rate |
---|---|---|---|---|
[5] 2022 | 4 | LR, SVM, MLP | 1 | evasive Spectre nop: 70% |
[7] 2021 | 6 | LR | 2 | evasive Spectre: 100% |
[10] 2024 | 4 | NN | 1 | evasive Spectre: 100% |
[9] 2024 | 4 | MLP | 3 | evasive Spectre nop: 95.42%; |
evasive Spectre memory: 100% | ||||
Ours | 4 | MLP, RF, RNN | 3 | DeepSeek Code Nop: 25.79% DeepSeek Image Nop: 2.37% DeepSeek Text Nop: 12.70% DeepSeek Code Memory: 30.35% DeepSeek Image Memory: 7.32% DeepSeek Text Memory: 27.38% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Jiao, J.; Jiang, L.; Zhou, Q.; Wen, R. Evaluating Large Language Model Application Impacts on Evasive Spectre Attack Detection. Electronics 2025, 14, 1384. https://doi.org/10.3390/electronics14071384
Jiao J, Jiang L, Zhou Q, Wen R. Evaluating Large Language Model Application Impacts on Evasive Spectre Attack Detection. Electronics. 2025; 14(7):1384. https://doi.org/10.3390/electronics14071384
Chicago/Turabian StyleJiao, Jiajia, Ling Jiang, Quan Zhou, and Ran Wen. 2025. "Evaluating Large Language Model Application Impacts on Evasive Spectre Attack Detection" Electronics 14, no. 7: 1384. https://doi.org/10.3390/electronics14071384
APA StyleJiao, J., Jiang, L., Zhou, Q., & Wen, R. (2025). Evaluating Large Language Model Application Impacts on Evasive Spectre Attack Detection. Electronics, 14(7), 1384. https://doi.org/10.3390/electronics14071384