PreprintCited by 3Software Engineering ResearchSoftware Testing and Debugging TechniquesTopic Modeling

On the Impacts of Contexts on Repository-Level Code Generation

Open access
Hai, Nam Le, Nguyen, Dung Manh, Bui, Nghi D. Q.·2024·arXiv

Abstract

CodeLLMs have gained widespread adoption for code generation tasks, yet their capacity to handle repository-level code generation with complex contextual dependencies remains underexplored. Our work underscores the critical importance of leveraging repository-level contexts to generate executable and functionally correct code. We present RepoExec, a novel benchmark designed to evaluate repository-level code generation, with a focus on three key aspects: executability, functional correctness through comprehensive test case generation, and accurate utilization of cross-file contexts. Our study examines a controlled scenario where developers specify essential code dependencies (contexts), challenging models to integrate them effectively. Additionally, we introduce an instruction-tuned dataset that enhances CodeLLMs' ability to leverage dependencies, along with a new metric, Dependency Invocation Rate (DIR), to quantify context utilization. Experimental results reveal that while pretrained LLMs demonstrate superior performance in terms of correctness, instruction-tuned models excel in context utilization and debugging capabilities. RepoExec offers a comprehensive evaluation framework for assessing code functionality and alignment with developer intent, thereby advancing the development of more reliable CodeLLMs for real-world applications. The dataset and source code are available at https://github.com/FSoft-AI4Code/RepoExec.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.2406.11927

Cites

40 of 40 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Constraint-reconciliation decay occurs: as sessions lengthen and dependencies accumulate, success rates fall.

    “This results in constraintreconciliation decay : as sessions lengthen and dependencies accumulate, success rates fall.”

    From Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verification (2025) · cites this paper as [10]

    Table 5 in §6.1 reports that Pass@1 rose across three debugging rounds for GPT-3.5 and WizardCoder and remained unchanged for CodeLlama-13b-Python; it did not fall as rounds accumulated. The multi-round debugging discussion also reports improved dependency use. The paper does not establish a separate trend for sessions in which dependencies accumulate. (LLM, conf=0.84)

    Checked by a reasoning model — may be wrong.

    Experimental — accuracy not yet measured
  • Repository-level evaluations reveal cross-file integration and dependency breaks.

    “Repository-level evaluations reveal similar cross-file integration and dependency breaks [10, 22].”

    From Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verification (2025) · cites this paper as [10]

    The Introduction and Section 3 describe repository-level evaluation of functional correctness and dependency use; the dependency-extraction section explicitly includes cross-file dependencies. The Additional information section gives examples of models failing to use available dependencies, but our copy does not establish distinct cross-file integration breaks. (LLM, conf=0.82)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 31

  1. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Ka- plan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. · arXiv
  2. Yangruibo Ding, Zijian Wang, Wasi U. Ahmad, Mu- rali Krishna Ramanathan, Ramesh Nallapati, Par- minder Bhatia, Dan Roth, and Bing Xiang. 2024. CoCoMIC: Code completion by jointly modeling in-file and cross-file context. In Proceedings of the 2024 Joint International Conference on Computa- tional Linguistics, Language Resources and Evalua- tion (LREC-COLING 2024).
  3. Yangruibo Ding, Zijian Wang, Wasi Uddin Ahmad, Han- tian Ding, Ming Tan, Nihal Jain, Murali Krishna Ra- manathan, Ramesh Nallapati, Parminder Bhatia, Dan Roth, and Bing Xiang. 2023. Crosscodeeval: A di- verse and multilingual benchmark for cross-file code completion. In Advances in Neural Information Pro- cessing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 -16, 2023.
  4. Nam Le Hai, Anh MT Bui, Phuong T Nguyen, Davide Di Ruscio, and Rick Kazman. 2024a. Improving the detection of technical debt in java source code with an enriched dataset. arXiv preprint arXiv:2411.05457. · arXiv
  5. Nam Le Hai, Trang Nguyen, Linh Ngo Van, Thien Huu Nguyen, and Khoat Than. 2024b. Continual varia- tional dropout: a view of auxiliary local variables in continual learning. Machine Learning, 113(1):281- 323.
  6. Dan Hendrycks, Steven Basart, Saurav Kadavath, Man- tas Mazeika, Akul Arora, Ethan Guo, Collin Burns, Samir Puranik, Horace He, Dawn Song, and Jacob Steinhardt. 2021. Measuring coding challenge com- petence with apps. NeurIPS.
  7. Maor Ivgi, Uri Shaham, and Jonathan Berant. 2023. Ef- ficient long-text understanding with short-text mod- els. Transactions of the Association for Computa- tional Linguistics, 11:284-299.
  8. Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, and Luke Zettlemoyer. 2018. Mapping language to code in programmatic context. In Proceedings of the 2018 Conference on Empirical Methods in Natural Lan- guage Processing, pages 1643-1652.
  9. Naman Jain, Manish Shetty, Tianjun Zhang, King Han, Koushik Sen, and Ion Stoica. 2024. R2e: Turning any github repository into a programming agent envi- ronment. In Forty-first International Conference on Machine Learning.
  10. Caroline Lemieux, Jeevana Priya Inala, Shuvendu K Lahiri, and Siddhartha Sen. 2023. Codamosa: Es- caping coverage plateaus in test generation with pre- trained large language models. In 2023 IEEE/ACM 45th International Conference on Software Engineer- ing (ICSE), pages 919-931. IEEE.
  11. Dianshu Liao, Shidong Pan, Qing Huang, Xiaoxue Ren, Zhenchang Xing, Huan Jin, and Qinying Li. 2023. Context-aware code generation framework for code repositories: Local, global, and third-party library awareness. arXiv preprint arXiv:2312.05772. · arXiv
  12. Jiawei Liu, Chunqiu Steven Xia, Yuyao Wang, and LINGMING ZHANG. 2023a. Is your code gen- erated by chatGPT really correct? rigorous evalu- ation of large language models for code generation. In Thirty-seventh Conference on Neural Information Processing Systems.
  13. Nelson F Liu, Kevin Lin, John Hewitt, Ashwin Paran- jape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024b. Lost in the middle: How language models use long contexts. Transactions of the Asso- ciation for Computational Linguistics, 12:157-173.
  14. Zhijie Liu, Yutian Tang, Xiapu Luo, Yuming Zhou, and Liang Feng Zhang. 2024c. No need to lift a finger anymore? assessing the quality of code generation by chatgpt. IEEE Transactions on Software Engineer- ing.
  15. Anton Lozhkov, Raymond Li, Loubna Ben Allal, Fed- erico Cassano, Joel Lamy-Poirier, Nouamane Tazi, Ao Tang, Dmytro Pykhtar, Jiawei Liu, Yuxiang Wei, et al. 2024. Starcoder 2 and the stack v2: The next generation. arXiv preprint arXiv:2402.19173. · arXiv
  16. Stephan Lukasczyk, Florian Kroiß, and Gordon Fraser. 2023. An empirical study of automated unit test gen- eration for python. Empirical Software Engineering, 28(2):36.
  17. Everton da S Maldonado and Emad Shihab. 2015. Detecting and quantifying different types of self- admitted technical debt. In 2015 IEEE 7Th interna- tional workshop on managing technical debt (MTD), pages 9-15. IEEE.
  18. Debanjan Mondal, Abhilasha Lodha, Ankita Sahoo, and Beena Kumari. 2023. Robust code summarization. In Proceedings of the 1st GenBench Workshop on (Benchmarking) Generalisation in NLP, pages 65-75, Singapore. Association for Computational Linguis- tics.
  19. Dung Nguyen, Le Nam, Anh Dau, Anh Nguyen, Khanh Nghiem, Jin Guo, and Nghi Bui. 2023. The vault: A comprehensive multilingual dataset for advanc- ing code understanding and generation. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 4763-4788, Singapore. Associ- ation for Computational Linguistics.
  20. Huy N Phan, Hoang N Phan, Tien N Nguyen, and Nghi DQ Bui. 2024a. Repohyper: Better context retrieval is all you need for repository-level code completion. arXiv preprint arXiv:2403.06095. · arXiv
  21. José Amancio M Santos, João B Rocha-Junior, Luciana Carla Lins Prates, Rogeres Santos Do Nascimento, Mydiã Falcão Freitas, and Manoel Gomes De Men- donça. 2018. A systematic review on the code smell effect. Journal of Systems and Software, 144:450- 477.
  22. Max Schäfer, Sarah Nadi, Aryaz Eghbali, and Frank Tip. 2023. Adaptive test generation using a large language model. arXiv e-prints, pages arXiv-2302.
  23. Disha Shrivastava, Hugo Larochelle, and Daniel Tar- low. 2023. Repository-level prompt generation for large language models of code. In International Con- ference on Machine Learning, ICML 2023, 23-29 July 2023, Honolulu, Hawaii, USA, volume 202 of Proceedings of Machine Learning Research, pages 31693-31715.
  24. PMLR.
  25. Ankita Nandkishor Sontakke, Manasi Patwardhan, Lovekesh Vig, Raveendra Kumar Medicherla, Ravin- dra Naik, and Gautam Shroff. 2022. Code summa- rization: Do transformers really understand code? In Deep Learning for Code Workshop.
  26. Hugo Touvron, Louis Martin, Kevin Stone, Peter Al- bert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023. Llama 2: Open founda- tion and fine-tuned chat models. arXiv preprint arXiv:2307.09288. · arXiv
  27. Quyen Tran, Nguyen Thanh, Nguyen Anh, Nam Hai, Trung Le, Linh Ngo, and Thien Nguyen. 2024. Pre- serving generalization of language models in few- shot continual relation extraction. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 13771-13784.
  28. Frank F Xu, Uri Alon, Graham Neubig, and Vincent Jo- sua Hellendoorn. 2022. A systematic evaluation of large language models of code. In Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming, pages 1-10.
  29. Prateek Yadav, Qing Sun, Hantian Ding, Xiaopeng Li, Dejiao Zhang, Ming Tan, Parminder Bhatia, Xiaofei Ma, Ramesh Nallapati, Murali Krishna Ramanathan, Mohit Bansal, and Bing Xiang. 2023. Exploring continual learning for code generation models. In Proceedings of the 61st Annual Meeting of the As- sociation for Computational Linguistics (Volume 2: Short Papers), pages 782-792, Toronto, Canada. As- sociation for Computational Linguistics. · DOI
  30. Pengcheng Yin, Bowen Deng, Edgar Chen, Bogdan Vasilescu, and Graham Neubig. 2018. Learning to mine aligned code and natural language pairs from stack overflow. In Proceedings of the 15th interna- tional conference on mining software repositories, pages 476-486.
  31. Fengji Zhang, Bei Chen, Yue Zhang, Jacky Keung, Jin Liu, Daoguang Zan, Yi Mao, Jian-Guang Lou, and Weizhu Chen. 2023b. Repocoder: Repository-level code completion through iterative retrieval and gen- eration. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Process- ing, EMNLP 2023, Singapore, December 6-10, 2023, pages 2471-2484. Association for Computational Linguistics.

Cited by

Sorted by citations

Authors
Hai, N. L., Nguyen, D. M., & Bui, N. D. Q.
Affiliations
FPT University (VN)
Venue
arXiv
Publisher
arXiv
Published
2024
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4399836661
Cited by
3
References
40
Citations by year
2026: 1 · 2025: 2
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion, public-domain)
  • arXiv (Cornell University) (public-domain)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
repository-level code generation, test case generation, functional correctness, instruction-tuned LLMs, debugging

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review