NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Robustness, Security, Privacy, Explainability, Efficiency, and Usability of Large Language Models for Code

Zhou Yang, Zhensu Sun, Terry Yue Zhuo, Premkumar T. Devanbu, David LoarXiv 2024 · DOI

TL;DR

Large Language Models for Code (LLM4Code) are revolutionizing software engineering, but their functional accuracy often overshadows critical non-functional properties. This paper provides the first systematic literature review, analyzing 146 studies to define and evaluate seven key non-functional properties: robustness, security, privacy, explainability, efficiency, and usability, offering a comprehensive overview of the current landscape and future research directions.

What Problem Does This Paper Address?

LLM4Code, like GitHub Copilot, are rapidly becoming integral tools for software developers, excelling at tasks like code generation and bug detection. While their accuracy is impressive, their reliability and trustworthiness in real-world applications are often compromised by issues related to non-functional properties. These properties, such as robustness (how models handle slight input changes), security (vulnerability to attacks), privacy (data leakage), explainability (understanding decisions), efficiency (resource usage), and usability (ease of use), are crucial for safe and effective deployment but have been studied in isolation. This paper addresses the lack of a systematic overview, aiming to consolidate research on these vital aspects and highlight current challenges and future opportunities.

Methods

The authors conducted a systematic literature review, meticulously defining inclusion and exclusion criteria to identify 146 relevant papers. Their methodology involved:

  • Paper Collection: A comprehensive search was performed on the DBLP database, supplemented by multiple rounds of snowballing (backward and forward citation chasing) to ensure a broad and up-to-date corpus.
  • Scope Definition: The review focused on LLM4Code (models trained on source code, including commercial tools like GitHub Copilot) and specifically excluded papers solely focused on accuracy or non-LLM-based code models.
  • Property Identification: Seven key non-functional properties beyond accuracy were identified: robustness, security, privacy, explainability, efficiency, and usability.
  • Analysis: The collected papers were analyzed to understand how these properties are evaluated and enhanced, identifying current trends, gaps, and future research directions.

Datasets

The paper does not explicitly list specific datasets used for training or evaluation within the reviewed studies. However, it mentions that LLM4Code are trained on large corpora of source code, often derived from open-source projects. The paper also notes that some studies investigate the impact of training data quality and the potential for sensitive information to be present in these datasets.

Key Insights and Ideas

  • Beyond Accuracy: The paper strongly emphasizes that high functional accuracy is insufficient for LLM4Code. Non-functional properties are critical for real-world adoption and trustworthiness.
  • Interconnectedness of Properties: While studied separately, properties like robustness and security are closely linked. For instance, a lack of robustness can be exploited for security vulnerabilities.
  • Data is Pivotal: Many issues with LLM4Code stem from the training data itself, including memorization of sensitive information, license codes, and vulnerabilities. This highlights the need for a "data-centric view" in LLM4Code development.
  • Stealthy Attacks are Emerging: In security, there's a growing trend towards developing stealthy attacks that are harder to detect, posing a significant challenge for existing defense mechanisms.
  • Explainability Conflicts: Different explainability techniques can yield conflicting results, underscoring the need for more reliable and consistent explanation methods.
  • PEFT is Gaining Traction: Parameter-Efficient Fine-Tuning (PEFT) is becoming a popular and effective strategy for improving LLM4Code efficiency, especially in low-resource scenarios.
  • Usability is Divergent: The impact of LLM4Code on developer productivity is mixed, with both positive and negative effects observed, indicating a need for better design and integration strategies.

Key Results

  • Property Distribution: Robustness (27 papers) and efficiency (21 papers) attracted the most research attention among the non-functional properties.
  • LLM4Code vs. Non-LLM4Code: The study found that LLM4Code open new research demands in security, privacy, usability, and efficiency, with significantly more papers focusing on these aspects for LLM4Code compared to older code models. For example, only 2 papers on security for non-LLM4Code versus 16 for LLM4Code.
  • Robustness Evaluation: Studies on robustness cover a wide range of tasks, but there's an imbalance, with fewer evaluations on recent large code generation models. Most defensive methods involve expensive retraining.
  • Security Threats: LLM4Code are vulnerable to data poisoning, with researchers increasingly focusing on stealthy attacks. Existing detection methods are often ineffective.
  • Privacy Concerns: LLM4Code can memorize training data, leading to potential leakage of sensitive information like API keys and personal data. Membership inference attacks are a key tool for evaluating these risks.
  • Explainability Focus: Early explainability research focused on classification tasks like defect prediction. There's a need to explain generative LLM4Code tasks.
  • Efficiency Enhancements: PEFT methods are widely used for efficiency. Model compression techniques have shown significant reductions in model size and improvements in inference speed.
  • Usability Findings: Studies show LLM4Code can increase productivity but also introduce negative impacts like increased debugging time and code deletion.

Limitations and Future Work

  • Selection Bias: The authors acknowledge selection bias as a threat and mitigated it through clear criteria and comprehensive searching.
  • Imbalanced Model Evaluation: The literature shows an imbalance in evaluating LLM4Code, with fewer studies on recent large code generation models.
  • Scalability of Defenses: Many defensive methods for LLM4Code are computationally expensive and not scalable for large models.
  • Effectiveness of Privacy Measures: While methods exist to remove sensitive information, their effectiveness and impact on other properties are not empirically shown.
  • Explainability Conflicts: The need for more reliable explanation methods is highlighted due to conflicting results from different techniques.
  • Generative Task Explainability: More research is needed to explain generative LLM4Code tasks, which are increasingly popular.
  • Usability Design: While design suggestions for improving usability exist, only a few studies have evaluated their effectiveness in practice.

Future Work Opportunities:

The paper proposes three views for developing LLM4Code:

  1. Data-Centric View: Focus on identifying high-quality training data, auditing/filtering datasets, data augmentation, and ensuring data transparency.
  2. Human-Centric View: Understand factors affecting usability, enhance trust through explainability, personalize tools, and develop automated usability benchmarking.
  3. System-Centric View: Build attack-resistant systems, apply AIOps for LLM4Code, enhance efficiency and scalability, and address legal and ethical considerations.

The authors also plan to revisit and update the review and develop benchmarks and tools for evaluating and enhancing LLM4Code properties.

Summary updated

BibTeX
@misc{yang2024robustness,
  author = {Zhou Yang and Zhensu Sun and Terry Yue Zhuo and Premkumar T. Devanbu and David Lo},
  title = {{Robustness, Security, Privacy, Explainability, Efficiency, and Usability of Large Language Models for Code}},
  year = {2024},
  eprint = {2403.07506},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.07506},
}
Figure