Proceedings

ProCURE: Addressing the Programming Concept Understanding Gap for Code Generation in LLMs via Concept-Aware Consistency Learning

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 4750-4758.

https://doi.org/10.24963/ijcai.2026/529

Abstract

Although Large Language Models (LLMs) excel at code generation, recent research reveals that they exhibit an insufficient grasp of core programming concepts, such as data flow and control flow. This limitation undermines their robustness when encountering variations in these concepts in practice; however, effective solutions that explicitly target this gap remain limited.

To address this challenge, we propose ProCURE, a concept-aware consistency learning framework designed to enhance LLMs’ understanding of programming concepts. Specifically, ProCURE first performs automated concept-oriented code augmentation to construct a concept-aligned dataset covering representative programming concepts. It then conducts concept-aware fine-tuning, encouraging the model to capture fine-grained concept variations and learn appropriate generation behaviors under such variations via a novel concept-sensitive consistency loss.

To quantify programming concept understanding, we introduce the Concept Consistency Score (CCScore), defined as the proportion of correct generations preserved under concept variations. A higher CCScore indicates a more profound understanding of programming concepts.

We evaluate ProCURE on four open-source LLMs across three widely used code generation benchmarks. Experimental results show that ProCURE improves CCScore by an average of 17.9 points, demonstrating its effectiveness in addressing the programming concept understanding gap.

  1. [Abdin et al., 2024] Marah Abdin, Jyoti Aneja, Hany Awadalla, Ahmed Awadallah, Ammar Ahmad Awan, Nguyen Bach, Amit Bahree, Arash Bakhtiari, Jianmin Bao, Harkirat Behl, et al. Phi-3 technical report: A highly ca- pable language model locally on your phone, 2024. URL https://arxiv. org/abs/2404.14219, 2024. Link
  2. [Allamanis et al., 2020] Miltiadis Allamanis, Earl T Barr, So- line Ducousso, and Zheng Gao. Typilus: Neural type hints. In Proceedings of the 41st acm sigplan conference on pro- gramming language design and implementation, pages 91- 105, 2020.
  3. [Allen, 1970] Frances E Allen. Control flow analysis. ACM Sigplan Notices, 5(7):1-19, 1970.
  4. [Austin et al., 2021] Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, et al. Program synthesis with large language models. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
  5. [Bielik and Vechev, 2020] Pavol Bielik and Martin Vechev. Adversarial robustness for code. In International Confer- ence on Machine Learning, pages 896-907. PMLR, 2020.
  6. [Chen et al., 2021] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
  7. [Chen et al., 2023] Nuo Chen, Qiushi Sun, Jianing Wang, Ming Gao, Xiaoli Li, and Xiang Li. Evaluating and en- hancing the robustness of code pre-trained models through structure-aware adversarial samples generation. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 14857-14873, 2023.
  8. [Dart and Zobel, 1992] Philip W Dart and Justin Zobel. Effi- cient run-time type checking of typed logic programs. The Journal of Logic Programming, 14(1-2):31-69, 1992.
  9. [Fosdick and Osterweil, 1976] Lloyd D Fosdick and Leon J Osterweil. Data flow analysis in software reliability. ACM Computing Surveys (CSUR), 8(3):305-330, 1976.
  10. [He et al., 2024] Jingxuan He, Mark Vero, Gabriela Krasnopolska, and Martin Vechev. Instruction tuning for secure code generation. In International Conference on Machine Learning, pages 18043-18062. PMLR, 2024.
  11. [Hoare, 1969] Charles Antony Richard Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576-580, 1969.
  12. [Hooda et al., 2024] Ashish Hooda, Mihai Christodorescu, Miltiadis Allamanis, Aaron Wilson, Kassem Fawaz, and Somesh Jha. Do large code models understand program- ming concepts? counterfactual analysis for code predicates. ICML'24. JMLR.org, 2024.
  13. [Jha and Reddy, 2023] Akshita Jha and Chandan K Reddy. Codeattack: Code-based adversarial attacks for pre-trained programming language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 14892-14900, 2023.
  14. [Jiang et al., 2023] Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, et al. Mistral 7b. arXiv preprint arXiv:2310.06825, 2023.
  15. [Jiang et al., 2025] Juyong Jiang, Fan Wang, Jiasi Shen, Sungju Kim, and Sunghun Kim. A survey on large lan- guage models for code generation. ACM Trans. Softw. Eng. Methodol., July 2025.
  16. [Kocetkov et al., 2022] Denis Kocetkov, Raymond Li, Loubna Ben Allal, Jia Li, Chenghao Mou, Carlos Muñoz Ferrandis, Yacine Jernite, Margaret Mitchell, Sean Hughes, Thomas Wolf, et al. The stack: 3 tb of permissively licensed source code. arXiv preprint arXiv:2211.15533, 2022.
  17. [Li et al., 2022] Yujia Li, David Choi, Junyoung Chung, Sha- ran Narang, et al. Competition-level code generation with alphacode. In International Conference on Learning Rep- resentations (ICLR), 2022.
  18. [Li et al., 2023] Raymond Li, Loubna Ben Allal, Yangtian Zi, Niklas Muennighoff, Denis Kocetkov, Chenghao Mou, Marc Marone, Christopher Akiki, Jia Li, Jenny Chim, et al. Starcoder: may the source be with you! arXiv preprint arXiv:2305.06161, 2023.
  19. [Lin and Wu, 2008] Jin-Cherng Lin and Kuo-Chiang Wu. Evaluation of software understandability based on fuzzy matrix. In 2008 IEEE International Conference on Fuzzy Systems (IEEE World Congress on Computational Intelli- gence), pages 887-892. IEEE, 2008.
  20. [Luo et al., 2023] Ziyang Luo, Can Xu, Pu Zhao, Qingfeng Sun, Xiubo Geng, Wenxiang Hu, Chongyang Tao, Jing Ma, Qingwei Lin, and Daxin Jiang. Wizardcoder: Empower- ing code large language models with evol-instruct. arXiv preprint arXiv:2306.08568, 2023.
  21. [Luo et al., 2025] Xianzhen Luo, Qingfu Zhu, Zhiming Zhang, Mingzheng Xu, Tianhao Cheng, Yixuan Wang, Zheng Chu, Shijie Xuyang, Zhiyuan Ma, YuanTao Fan, et al. Success is in the details: Evaluate and enhance de- tails sensitivity of code llms through counterfactuals. arXiv preprint arXiv:2505.14597, 2025.
  22. [Ma et al., 2023] Wei Ma, Shangqing Liu, Zhihao Lin, Wen- han Wang, Qiang Hu, Ye Liu, Cen Zhang, Liming Nie, Li Li, and Yang Liu. Lms: Understanding code syn- tax and semantics for code analysis. arXiv preprint arXiv:2305.12138, 2023.
  23. [Ma et al., 2024] Lezhi Ma, Shangqing Liu, Lei Bu, Shangru Li, Yida Wang, and Yang Liu. Speceval: Evaluating code comprehension in large language models via program spec- ifications. arXiv preprint arXiv:2409.12866, 2024.
  24. [Nijkamp et al., 2022] Erik Nijkamp, Nora Kassner, Richard Pang, Lifu Tu, Caiming Xiong, Weijia Shi, Tommaso Soru, Livio Baldini Soares, Alexander Ratner, et al. A conver- sational paradigm for program synthesis. arXiv preprint arXiv:2203.13474, 2022.
  25. [Nilsson-Nyman et al., 2009] Emma Nilsson-Nyman, Görel Hedin, Eva Magnusson, and Torbjörn Ekman. Declarative intraprocedural flow analysis of java source code. Elec- tronic Notes in Theoretical Computer Science, 238(5):155- 171, 2009.
  26. [Orvalho and Kwiatkowska, 2025] Pedro Orvalho and Marta Kwiatkowska. Are large language models robust in un- derstanding code against semantics-preserving mutations? arXiv preprint arXiv:2505.10443, 2025.
  27. [Roziere et al., 2023] Baptiste Roziere, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoqing Ellen Tan, Yossi Adi, Jingyu Liu, Romain Sauvestre, Tal Remez, et al. Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950, 2023.
  28. [Schäfer et al., 2023] Max Schäfer, Sarah Nadi, Aryaz Egh- bali, and Frank Tip. An empirical evaluation of using large language models for automated unit test generation. IEEE Transactions on Software Engineering, 50(1):85-105, 2023.
  29. [Tian et al., 2021] Junfeng Tian, Chenxin Wang, Zhen Li, and Yu Wen. Generating adversarial examples of source code classification models via q-learning-based markov decision process. In 2021 IEEE 21st International Conference on Software Quality, Reliability and Security (QRS), pages 807-818. IEEE, 2021.
  30. [Touvron et al., 2024] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, et al. LLaMA 3: Open foundation and instruction models, 2024.
  31. [Wang et al., 2023] Shiqi Wang, Zheng Li, Haifeng Qian, Chenghao Yang, Zijian Wang, Mingyue Shang, Varun Kumar, Samson Tan, Baishakhi Ray, Parminder Bhatia, Ramesh Nallapati, Murali Krishna Ramanathan, Dan Roth, and Bing Xiang. ReCode: Robustness evaluation of code generation models. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki, editors, Proceedings of the 61st An- nual Meeting of the Association for Computational Linguis- tics (Volume 1: Long Papers), pages 13818-13843, Toronto, Canada, July 2023. Association for Computational Linguis- tics.
  32. [Wei et al., 2024] Yuxiang Wei, Zhe Wang, Jiawei Liu, Yifeng Ding, and Lingming Zhang. Magicoder: empow- ering code generation with oss-instruct. In Proceedings of the 41st International Conference on Machine Learning, ICML'24. JMLR.org, 2024.
  33. [Yang et al., 2015] Shengqian Yang, Dacong Yan, Haowei Wu, Yan Wang, and Atanas Rountev. Static control-flow analysis of user-driven callbacks in android applications. In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, volume 1, pages 89-99. IEEE, 2015.
  34. [Yefet et al., 2020] Noam Yefet, Uri Alon, and Eran Yahav. Adversarial examples for models of code. Proceedings of the ACM on Programming Languages, 4(OOPSLA):1-30, 2020.
  35. [Zhang et al., 2020] Huangzhao Zhang, Zhuo Li, Ge Li, Lei Ma, Yang Liu, and Zhi Jin. Generating adversarial ex- amples for holding robustness of source code processing models. In Proceedings of the AAAI Conference on Artifi- cial Intelligence, volume 34, pages 1169-1176, 2020.
  36. [Zhang et al., 2023] Fengji Zhang, Bei Chen, Yue Zhang, Jacky Keung, Jin Liu, Daoguang Zan, Yi Mao, Jian-Guang Lou, and Weizhu Chen. Repocoder: Repository-level code completion through iterative retrieval and generation. arXiv preprint arXiv:2303.12570, 2023.
  37. [Zhang et al., 2024] Yuhao Zhang, Shiqi Wang, Haifeng Qian, Zijian Wang, Mingyue Shang, Linbo Liu, Sanjay Kr- ishna Gouda, Baishakhi Ray, Murali Krishna Ramanathan, Xiaofei Ma, and Anoop Deoras. CodeFort: Robust training for code generation models. In Yaser Al-Onaizan, Mohit Bansal, and Yun-Nung Chen, editors, Findings of the As- sociation for Computational Linguistics: EMNLP 2024, pages 5262-5277, Miami, Florida, USA, November 2024. Association for Computational Linguistics.
  38. [Zhou et al., 2022] Yu Zhou, Xiaoqing Zhang, Juanjuan Shen, Tingting Han, Taolue Chen, and Harald Gall. Adversar- ial robustness of deep code comment generation. ACM Transactions on Software Engineering and Methodology (TOSEM), 31(4):1-30, 2022.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards