Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
110 tokens/sec
GPT-4o
56 tokens/sec
Gemini 2.5 Pro Pro
44 tokens/sec
o3 Pro
6 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Program Decomposition and Translation with Static Analysis (2401.12412v1)

Published 22 Jan 2024 in cs.SE

Abstract: The rising popularity of LLMs has motivated exploring their use in code-related tasks. Code LLMs with more than millions of parameters are trained on a massive amount of code in different Programming Languages (PLs). Such models are used for automating various Software Engineering (SE) tasks using prompt engineering. However, given the very large size of industry-scale project files, a major issue of these LLMs is their limited context window size, motivating the question of "Can these LLMs process very large files and can we effectively perform prompt engineering?". Code translation aims to convert source code from one PL to another. In this work, we assess the effect of method-level program decomposition on context window of LLMs and investigate how this approach can enable translation of very large files which originally could not be done due to out-of-context issue. Our observations from 20 well-known java projects and approximately 60K methods suggest that method-level program decomposition significantly improves the limited context window problem of LLMs by 99.5%. Furthermore, our empirical analysis indicate that with method-level decomposition, each input fragment on average only consumes 5% of the context window, leaving more context space for prompt engineering and the output. Finally, we investigate the effectiveness of a Call Graph (CG) approach for translating very large files when doing method-level program decomposition.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (30)
  1. Open AI. 2023. Open AI ChatGPT. https://openai.com/blog/chatgpt
  2. SantaCoder: don’t reach for the stars! arXiv preprint arXiv:2301.03988 (2023).
  3. Ranking LLM-Generated Loop Invariants for Program Verification. arXiv preprint arXiv:2310.09342 (2023).
  4. Cursor. 2023. Cursor Code Editor. https://cursor.sh/
  5. Toga: A neural method for test oracle generation. In Proceedings of the 44th International Conference on Software Engineering. 2130–2141.
  6. The Apache Software Foundation. 2023a. Apache. https://github.com/apache
  7. The Apache Software Foundation. 2023b. Apache Commons CLI. https://github.com/apache/commons-cli
  8. Incoder: A generative model for code infilling and synthesis. arXiv preprint arXiv:2204.05999 (2022).
  9. GitHub. 2023a. CodeQL. https://codeql.github.com/
  10. GitHub. 2023b. GitHub Copilot. https://github.com/features/copilot
  11. Google. 2023a. Google Bard. https://bard.google.com/
  12. Google. 2023b. Google PaLM. https://ai.googleblog.com/2022/04/pathways-language-model-palm-scaling-to.html
  13. Interprocedural Slicing Using Dependence Graphs. In Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation (Atlanta, Georgia, USA) (PLDI ’88). Association for Computing Machinery, New York, NY, USA, 35–46. https://doi.org/10.1145/53990.53994
  14. Automated Bug Generation in the era of Large Language Models. arXiv preprint arXiv:2310.02407 (2023).
  15. Perfect is the enemy of test oracle. In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 70–81.
  16. StarCoder: may the source be with you! arXiv preprint arXiv:2305.06161 (2023).
  17. Yang Liu. 2019. Fine-tune BERT for extractive summarization. arXiv preprint arXiv:1903.10318 (2019).
  18. Codegen: An open large language model for code with multi-turn program synthesis. arXiv preprint arXiv:2203.13474 (2022).
  19. Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code. arXiv preprint arXiv:2308.03109 (2024).
  20. Towards Causal Deep Learning for Vulnerability Detection. arXiv preprint arXiv:2310.07958 (2023).
  21. Sequence to sequence learning with neural networks. Advances in neural information processing systems 27 (2014).
  22. LeTI: Learning to Generate from Textual Interactions. arXiv preprint arXiv:2305.10314 (2023).
  23. Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repair. arXiv preprint arXiv:2309.00608 (2023).
  24. Mark Weiser. 1984. Program Slicing. IEEE Transactions on Software Engineering SE-10, 4 (1984), 352–357. https://doi.org/10.1109/TSE.1984.5010248
  25. A prompt pattern catalog to enhance prompt engineering with chatgpt. arXiv preprint arXiv:2302.11382 (2023).
  26. Universal fuzzing via large language models. arXiv preprint arXiv:2308.04748 (2023).
  27. Chunqiu Steven Xia and Lingming Zhang. 2022. Less training, more repairing please: revisiting automated program repair via zero-shot learning. In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 959–971.
  28. Chunqiu Steven Xia and Lingming Zhang. 2023. Conversational automated program repair. arXiv preprint arXiv:2301.13246 (2023).
  29. Xlnet: Generalized autoregressive pretraining for language understanding. Advances in neural information processing systems 32 (2019).
  30. Prompt Engineering a Prompt Engineer. arXiv:2311.05661 [cs.CL]
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (1)
Citations (3)

Summary

We haven't generated a summary for this paper yet.

X Twitter Logo Streamline Icon: https://streamlinehq.com