journal article·2026-07-06Open access

FocalVulNORM: Focal Attention for Normatively Conditioned Vulnerability Repair with Multi-Task Verification

Aldo Hernandez-Suarez, Gabriel Sanchez-Perez, Linda Karina Toscano-Medina, Hector Perez-Meana, Jose Portillo-Portillo, Jesus Olivares Mercado

Applied Sciences· Volume 16· Issue 13

Abstract

Vulnerable-code auditing is critical within the Software Development Life Cycle (SDLC) as timely remediation reduces exploitation risks from sensitive-data exposure to full system compromise. Although Automatic Program Repair (APR) has advanced through Machine Learning (ML), Deep Learning (DL), and Transformer-based generative models, current approaches remain limited by reduced language coverage, weak grounding in documented vulnerabilities, incomplete patch validation, and lack of explicit normative guidance for secure-coding compliance. This study introduces FocalVulNORM, a normatively conditioned Multi-Task repair model that generates a secure patch from vulnerable code while simultaneously verifying whether the vulnerable pattern is removed, the patch preserves observable behavior, and the repair aligns with the applicable security control. FocalVulNORM uses a shared Transformer encoder, a Focal Attention Layer, and four jointly optimized objectives: Repair, Detection, Normative Compliance, and Semantic Equivalence. The normative text is derived from CWE descriptions and SDLC secure-coding guides and standards, providing the security condition used to guide and evaluate each repair. Using this normative input, FocalVulNORM is trained on 11,503 vulnerability–patch pairs across seven programming languages and eight Common Weakness Enumeration (CWE) types. The model achieves CodeBLEU =0.8247 and Token-Level Accuracy (TLA) =0.8976 for Repair, F1=0.9926 for Detection, F1=0.9820 for Normative Compliance, and F1=0.9921 for Semantic Equivalence. The results indicate that FocalVulNORM extends APR beyond patch generation by attaching each repair to explicit evidence of vulnerability removal, behavioral preservation, and security-control alignment.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Software Engineering Research · Security and Verification in Computing · Software Testing and Debugging Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

ESIME Culhuacan, Instituto Politecnico Nacional, Mexico City 04440, Mexico

References (50)

Show source-provided references
1. Combining Academia and Industry Approach for Secure Coding and Requirements Checklist in S-SDLC: Systematic Literature Review10.21512/emacsjournal.v7i2.13429 ↗
2. MITRE Corporation (2026, April 10). Common Vulnerabilities and Exposures (CVE). Available online: https://www.cve.org/.
3. Large language model for vulnerability detection and repair: Literature review and the road ahead
4. Shokunbi, O., Uche, O., Akinwunmi, D., Akinwumi, H., Awodele, O., and Ayankoya, F. (2024). Emerging Security Threat in the SDLC and Mitigations. Proceedings of the 2024 IEEE SmartBlock4Africa, IEEE.10.1109/SmartBlock4Africa61928.2024.10779490 ↗
5. Fu, M., Tantithamthavorn, C.K., Nguyen, V., and Le, T. (2023). Chatgpt for vulnerability detection, classification, and repair: How far are we?. Proceedings of the 2023 30th Asia-Pacific Software Engineering Conference (APSEC), IEEE.10.1109/APSEC60848.2023.00085 ↗
6. A Systematic Review on Detection, Repair, and Explanation of Vulnerabilities in Source Code Using Large Language Models10.1109/ACCESS.2025.3631363 ↗
7. Large language models for software vulnerability detection: a guide for researchers on models, methods, techniques, datasets, and metrics10.1007/s10207-025-00992-7 ↗
8. Out of the bleu: How should we assess quality of the code generation models?10.1016/j.jss.2023.111741 ↗
9. A structured review of the validity of BLEU10.1162/coli_a_00322 ↗
10. Wang, D., Yu, J., Shu, H., Fu, M., Tantithamthavorn, C., Kamei, Y., and Chen, J. (2025). On the Evaluation of Large Language Models in Multilingual Vulnerability Repair. Acm Trans. Softw. Eng. Methodol.10.1145/3771930 ↗
11. A Survey on Deep Learning and Its Applications10.1016/j.cosrev.2021.100379 ↗
12. Android Zero-Day Guard: Zero-Shot Malware Detection Using Deep Learning and Generative Models10.1109/TNSM.2026.3671305 ↗
13. Dong, S., and Hou, R. (2026). Privacy-Preserving Task Offloading Scheme Based on Blockchain Federated Learning in End-Edge-Cloud Computing Environments. IEEE Internet Things J.10.1109/JIOT.2026.3684948 ↗
14. Jin, M., Shahriar, S., Tufano, M., Shi, X., Lu, S., Sundaresan, N., and Svyatkovskiy, A. (2023). Inferfix: End-to-end program repair with llms. Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ACM.10.1145/3611643.3613892 ↗
15. Nong, Y., Yang, H., Cheng, L., Hu, H., and Cai, H. (2025). {APPATCH}: Automated adaptive prompting large language models for {Real-World} software vulnerability patching. Proceedings of the 34th USENIX Security Symposium (USENIX Security 25), Curran Associates, Inc.10.1145/3821416 ↗
16. Fu, M., Tantithamthavorn, C., Le, T., Nguyen, V., and Phung, D. (2022). Vulrepair: A t5-based automated software vulnerability repair. Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ACM.10.1145/3540250.3549098 ↗
17. Bhandari, G., Naseer, A., and Moonen, L. (2021). CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Software. Proceedings of the 17th International Conference on Predictive Models and Data Analytics in Software Engineering (PROMISE ’21), ACM.10.1145/3475960.3475985 ↗
18. Fan, J., Li, Y., Wang, S., and Nguyen, T.N. (2020). A C/C++ code vulnerability dataset with code changes and CVE summaries. Proceedings of the 17th International Conference on Mining Software Repositories, ACM.10.1145/3379597.3387501 ↗
19. Zhou, X., Kim, K., Xu, B., Han, D., and Lo, D. (2024). Out of sight, out of mind: Better automatic vulnerability repair by broadening input ranges and sources. Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, ACM.10.1145/3597503.3639222 ↗
20. Enhanced automated code vulnerability repair using large language models10.1016/j.engappai.2024.109291 ↗
21. Lutellier, T., Pham, H.V., Pang, L., Li, Y., Wei, M., and Tan, L. (2020). Coconut: Combining context-aware neural translation models using ensemble for program repair. Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis, ACM.10.1145/3395363.3397369 ↗
22. T5APR: Empowering automated program repair across languages through checkpoint ensemble10.1016/j.jss.2024.112083 ↗
23. Generating vulnerability security fixes with Code Language Models10.1016/j.infsof.2025.107786 ↗
24. Khan, Z.A., Garg, A., Guo, Y., and Tang, Q. (2026). Evaluation of Multi-Language Vulnerability Patching with Pre-Trained Models. Proceedings of the 41st ACM/SIGAPP Symposium on Applied Computing (SAC ’26), ACM.10.1145/3748522.3779750 ↗
25. Sultana, S., Afreen, S., and Eisty, N.U. (2026). LLMs in Code Vulnerability Analysis: A Proof of Concept. Proceedings of the 4th International Workshop on Software Vulnerability Management (SVM ’26), ACM.10.1145/3786165.3788439 ↗
26. Islam, N.T., Khoury, J., Seong, A., Karkevandi, M.B., Parra, G.D.L.T., Bou-Harb, E., and Najafirad, P. (2024). Llm-powered code vulnerability repair with reinforcement learning and semantic reward. arXiv.
27. National Institute of Standards and Technology (2026, April 10). Software Assurance Reference Dataset (SARD), Available online: https://samate.nist.gov/SARD/.
28. OWASP Foundation (2026, April 10). OWASP Application Security Verification Standard (ASVS). Available online: https://owasp.org/www-project-application-security-verification-standard/.
29. National Institute of Standards and Technology (2026, April 10). Security and Privacy Controls for Information Systems and Organizations (NIST SP 800-53 Rev. 5), Available online: https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final.
30. Systematic literature review on software security vulnerability information extraction10.1145/3745026 ↗
31. MITRE Corporation (2026, April 10). 2025 CWE Top 10 KEV Weaknesses. Available online: https://cwe.mitre.org/top25/archive/2025/2025_kev_list.html.
32. National Institute of Standards and Technology (2026, April 10). National Vulnerability Database (NVD), Available online: https://nvd.nist.gov/.
33. Google LLC (2026, April 10). Google Dataset Search. Available online: https://datasetsearch.research.google.com/.
34. Kaggle Inc. (2026, April 10). Kaggle Datasets. Available online: https://www.kaggle.com/datasets.
35. Rethinking variable-length encoding: Exploiting bit sparsity for parallel decoding in LLM accelerators
36. (2026, April 10). CodeQL: Semantic Code Analysis Engine. Available online: https://codeql.github.com.
37. Feng, Z., Guo, D., Tang, D., Duan, N., Feng, X., Gong, M., Shou, L., Qin, B., Liu, T., and Jiang, D. (2020). Codebert: A pre-trained model for programming and natural languages. Proceedings of the Findings of the Association for Computational Linguistics: EMNLP 2020, Association for Computational Linguistics.10.18653/v1/2020.findings-emnlp.139 ↗
38. Static analysis at github: An experience report10.1145/3487019.3487022 ↗
39. Xia, Y., De Araujo, P.H.L., Zaporojets, K., and Roth, B. (2025). Influences on LLM calibration: A study of response agreement, loss functions, and prompt styles. Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Association for Computational Linguistics.10.18653/v1/2025.acl-long.188 ↗
40. Hadamard product in deep learning: Introduction, advances and challenges10.1109/TPAMI.2025.3560423 ↗
41. Xiong, R., Yang, Y., He, D., Zheng, K., Zheng, S., Xing, C., Zhang, H., Lan, Y., Wang, L., and Liu, T. (2020). On layer normalization in the transformer architecture. Proceedings of the International Conference on Machine Learning, PMLR.
42. Tian, Y., Han, Y., Chen, X., Wang, W., and Chawla, N.V. (2025). Beyond answers: Transferring reasoning capabilities to smaller llms using multi-teacher knowledge distillation. Proceedings of the Eighteenth ACM International Conference on Web Search and Data Mining, ACM.10.1145/3701551.3703577 ↗
43. Comparative analysis of sequence weighting approaches for mining time-interval weighted sequential patterns10.1016/j.eswa.2011.09.100 ↗
44. Supervised contrastive learning
45. Dei Cas, D., Longato, E., Tavazzi, E., Manera, U., Chiò, A., Gromicho, M., Alves, I., De Carvalho, M., and Di Camillo, B. (2025). Exploring the Use of Projecting Conflicting Gradients in Multi-task Neural Networks with an Application to Amyotrophic Lateral Sclerosis. Proceedings of the International Conference on Artificial Intelligence in Medicine, Springer.
46. Mishra, P., and Sarawadekar, K. (2019). Polynomial learning rate policy with warm restart for deep neural network. Proceedings of the TENCON 2019–2019 IEEE Region 10 Conference (TENCON), IEEE.10.1109/TENCON.2019.8929465 ↗
47. Grid search with a weighted error function: Hyper-parameter optimization for financial time series forecasting10.1016/j.asoc.2024.111362 ↗
48. Tldr: Token-level detective reward model for large vision language models
49. Du, X., Liu, M., Wang, K., Wang, H., Liu, J., Chen, Y., and Lou, Y. (2024). Evaluating large language models in class-level code generation. Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, ACM.10.1145/3597503.3639219 ↗
50. Bayesian inference and the parametric bootstrap10.1214/12-AOAS571 ↗