Skip to main content
QUICK REVIEW

[Paper Review] Breaking the Silence: the Threats of Using LLMs in Software Engineering

June Sallou, Thomas Durieux|arXiv (Cornell University)|Dec 13, 2023
Software Engineering ResearchComputer Science39 references5 citations
TL;DR

This paper identifies critical threats to validity in LLM-based software engineering research—particularly closed-source model dependency, data leakage, and irreproducibility—and proposes actionable guidelines for SE researchers and LM providers to enhance reproducibility, transparency, and rigor. Using test case generation on Defects4J as a case study, it demonstrates how code obfuscation and multi-source evaluation can reduce hallucination and data leakage, improving research reliability.

ABSTRACT

Large Language Models (LLMs) have gained considerable traction within the Software Engineering (SE) community, impacting various SE tasks from code completion to test generation, from program repair to code summarization. Despite their promise, researchers must still be careful as numerous intricate factors can influence the outcomes of experiments involving LLMs. This paper initiates an open discussion on potential threats to the validity of LLM-based research including issues such as closed-source models, possible data leakage between LLM training data and research evaluation, and the reproducibility of LLM-based findings. In response, this paper proposes a set of guidelines tailored for SE researchers and Language Model (LM) providers to mitigate these concerns. The implications of the guidelines are illustrated using existing good practices followed by LLM providers and a practical example for SE researchers in the context of test case generation.

Motivation & Objective

  • To raise awareness of critical validity threats in LLM-based software engineering research, including data leakage, closed-source model unpredictability, and irreproducibility.
  • To address the risk of LLMs having prior knowledge of evaluation datasets due to training data overlap, especially in widely used benchmarks like Defects4J.
  • To promote methodological rigor by proposing practical, actionable guidelines for SE researchers and LM providers to ensure reliable and transparent LLM evaluations.
  • To demonstrate the impact of methodological choices—such as code obfuscation and multi-source data collection—on reducing hallucination and improving result validity.
  • To advocate for community-wide adoption of standardized evaluation practices to ensure long-term reproducibility and trust in LLM-based SE contributions.

Proposed method

  • Proposes a framework of guidelines targeting three core threats: closed-source model dependency, data leakage between training/validation/test sets, and irreproducibility due to model evolution.
  • Recommends code obfuscation (e.g., renaming methods and variables) to break implicit data leakage between LLM training data and evaluation projects.
  • Advocates for using multiple independent prompts or queries to reduce reliance on single, potentially biased LLM responses.
  • Encourages comparative evaluation using both open-source and closed-source LLMs to validate findings across model types.
  • Recommends leveraging frameworks like ONNX to streamline cross-model evaluation and ensure consistency.
  • Suggests using code clone detection and dependency analysis to identify potential data leakage between evaluation sets and LLM training data.

Experimental results

Research questions

  • RQ1To what extent do closed-source LLMs exhibit performance degradation or inconsistency due to uncontrolled model updates and versioning?
  • RQ2How does data leakage—explicit or implicit—between LLM training data and evaluation benchmarks like Defects4J affect the validity of reported results?
  • RQ3Can code obfuscation techniques effectively reduce LLM hallucination and improve the reliability of test case generation in SE tasks?
  • RQ4What role do multiple data sources (e.g., GitHub vs. SourceForge) play in reducing bias and improving the generalizability of LLM-based SE evaluations?
  • RQ5How can researchers ensure reproducibility of LLM-based findings when model outputs are non-stochastic and model versions evolve over time?

Key findings

  • ChatGPT 3.5 generated non-compiling test cases with clear hallucinations (e.g., calling non-existent methods) when prompted with obfuscated versions of Math-5, indicating a significant drop in reliability.
  • For Chart-11, obfuscation had minimal impact on branch coverage (p-value = 0.79), but a small negative effect size (A12 = 0.63) was observed, suggesting slightly worse performance on obfuscated code.
  • LLMs showed significantly worse performance on projects from SourceForge compared to GitHub, highlighting the risk of data leakage when using popular repositories as benchmarks.
  • Code clone detection revealed that generated test cases were often similar to existing code in public repositories, indicating potential data leakage from training data.
  • External dependency analysis across evaluation sets showed that similar API usages and dependencies were present across training, validation, and test projects, increasing the risk of data leakage.
  • Comparative evaluation using open-source models like Llama2 and Falcon 180B demonstrated that results vary significantly across models, underscoring the need for multi-model validation to ensure robustness.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.