[Paper Review] Studying LLM Performance on Closed- and Open-source Data
The paper compares OpenAI Codex-style LLMs on open-source vs. closed-source Microsoft code for code completion, summarization, and generation in C# and C++, finding little difference for C# but notable degradation for C++ on closed-source data; few-shot learning and BM25-retrieved exemplars can mitigate some gaps.
Large Language models (LLMs) are finding wide use in software engineering practice. These models are extremely data-hungry, and are largely trained on open-source (OSS) code distributed with permissive licenses. In terms of actual use however, a great deal of software development still occurs in the for-profit/proprietary sphere, where the code under development is not, and never has been, in the public domain; thus, many developers, do their work, and use LLMs, in settings where the models may not be as familiar with the code under development. In such settings, do LLMs work as well as they do for OSS code? If not, what are the differences? When performance differs, what are the possible causes, and are there work-arounds? In this paper, we examine this issue using proprietary, closed-source software data from Microsoft, where most proprietary code is in C# and C++. We find that performance for C# changes little from OSS --> proprietary code, but does significantly reduce for C++; we find that this difference is attributable to differences in identifiers. We also find that some performance degradation, in some cases, can be ameliorated efficiently by in-context learning.
Motivation & Objective
- Assess whether LLMs trained on open-source data perform similarly when applied to proprietary, closed-source code from a large software vendor (Microsoft).
- Evaluate language-specific differences by comparing C# and C++ across OSS and closed-source datasets.
- Investigate potential causes of performance gaps and whether few-shot in-context learning or retrieval-based exemplars can close them.
- Explore whether OSS exemplars can improve performance on closed-source code via in-context learning techniques.
Proposed method
- Use two off-the-shelf LLMs (Code-Davinci-002 and GPT-3.5-Turbo) without fine-tuning.
- Evaluate four tasks from the CodeXGLUE suite: token completion, line completion, code summarization, and code generation.
- Compare OSS vs closed-source performance for C# and C++.
- Apply few-shot learning with randomly chosen samples and with BM25-retrieved samples as exemplars for code summarization and code generation.
- Use exact-match, BLEU variants, ROUGE-L, METEOR, and edit similarity as evaluation metrics; report statistical tests where applicable.

Experimental results
Research questions
- RQ1RQ1: Do LLMs perform differently on open-source vs closed-source data across the studied languages and tasks?
- RQ2RQ2: Can few-shot learning with open-source exemplars improve performance on closed-source data?
- RQ3RQ3: What causes any observed performance variance between C# and C++ across OSS and closed-source data?
Key findings
- For token completion, C# shows no significant OSS vs closed-source difference with Code-Davinci-002 (71.32% OSS vs 71.59% closed; p=0.67).
- For token completion in C++, there is a significant drop from OSS (71.93%) to closed-source (64.42%) with Code-Davinci-002 (p<0.01).
- Line completion exhibits the same language disparity: C# shows no significant OSS vs closed-source difference; C++ shows a significant drop in closed-source performance.
- Code summarization with few-shot learning and BM25-retrieved samples tends to reduce OSS vs closed-source gaps for C#, with BM25 providing some gains; for C++, gaps persist and can be amplified when BM25 is used, depending on the model.
- Code generation generally underperforms relative to summarization, with larger gaps for C++ between OSS and closed-source, even with few-shot learning.
- Overall, C# shows consistent performance across OSS/closed-source; C++ displays meaningful degradation on closed-source data, and BM25-retrieved few-shot samples can mitigate some, but not all, gaps.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.