SoTaNa: The Open-Source Software Development Assistant

Ensheng Shi, Fengji Zhang, Yanlin Wang, Bei Chen, Lun Du, Hongyu Zhang, Shi Han, Dongmei Zhang, Hongbin SunarXiv 2023 · DOI

TL;DR

This paper introduces SoTaNa, an open-source AI assistant designed to help software developers. It leverages ChatGPT to create specialized instruction data for software engineering tasks and then fine-tunes the open-source LLaMA model using a parameter-efficient method. SoTaNa aims to make powerful AI development tools more accessible and effective, demonstrating strong performance in answering Stack Overflow questions and improving code summarization and generation.

What Problem Does This Paper Address?

Software development is a cornerstone of modern society, but it's a complex and rapidly evolving field. Developers constantly face challenges like learning new technologies, managing intricate projects, and debugging errors. While powerful AI assistants like ChatGPT show promise, they often have limited accessibility due to proprietary training data and model weights. Existing open-source models, while improving, still struggle to fully grasp the nuances of human intent within the software engineering domain. This creates a need for accessible, specialized AI tools that can genuinely assist developers in their day-to-day tasks.

Methods

The core of SoTaNa's approach involves two main steps:

  1. High-Quality Data Generation: The authors use ChatGPT to generate instruction-based data specifically for software engineering. They achieve this by crafting a detailed prompt that includes task descriptions, data generation requirements, and examples (demonstrations) drawn from a manually curated seed pool of 200 software engineering instances. This process ensures the generated data is relevant and high-quality.
  2. Parameter-Efficient Fine-Tuning: Instead of fine-tuning all parameters of a large language model (LLM), which is computationally expensive, SoTaNa employs LoRA (Low-Rank Adaptation). LoRA freezes the pre-trained LLM's weights and introduces trainable low-rank decomposition matrices, significantly reducing the number of parameters to update. This allows for efficient fine-tuning of the LLaMA model on the generated software engineering data, enabling it to better understand developer intent.

Datasets

  • Training Data: The authors generated a custom dataset of 100,000 instruction-based examples for software engineering. This data was created by prompting ChatGPT, with initial demonstrations sourced from the Alpaca dataset.
  • Evaluation Datasets:
    • Stack Overflow Question Answering: The SoSum dataset (420 questions after filtering) was used to evaluate the model's ability to answer programming questions.
  • Code Generation: The HumanEval dataset (164 Python programming problems) was used to assess code generation capabilities.
  • Code Summarization: The TL-CodeSum dataset (first 100 examples) was used to evaluate the model's ability to understand and summarize code.

Key Insights and Ideas

  • Specialized Data is Key: The research highlights that while general-purpose instruction tuning helps LLMs understand intent, domain-specific data (like software engineering tasks) is crucial for achieving high performance in specialized areas.
  • Parameter-Efficient Fine-Tuning is Viable: LoRA proves to be an effective method for adapting large foundation models like LLaMA for specific domains without requiring massive computational resources, making advanced AI more accessible.
  • Automatic Metrics Have Limitations: The study points out that standard automatic evaluation metrics (like BLEU, METEOR) often fail to capture the true quality of generated answers, especially in complex domains like software engineering. Human evaluation becomes essential for a comprehensive assessment.
  • Accessibility Matters: The ability to run SoTaNa on a single GPU is a significant advantage, democratizing access to powerful AI development tools for a wider range of researchers and developers.

Key Results

  • Stack Overflow QA: SoTaNa significantly outperforms LLaMA and Alpaca in human evaluations for answering Stack Overflow questions, demonstrating superior alignment, accuracy, and readability.
  • Code Summarization: SoTaNa shows substantial improvements over LLaMA in code summarization, indicating better understanding of code semantics.
  • Code Generation: SoTaNa also demonstrates an improvement in code generation capabilities compared to LLaMA, suggesting that domain-specific fine-tuning enhances this aspect.
  • Efficiency: SoTaNa can run on a single GPU, making it highly accessible.

Limitations and Future Work

  • Data Quality: The authors acknowledge that human checks for the correctness of the generated data were not performed, which could be a source of error. Future work could involve human verification of generated data or alternative methods for ensuring accuracy.
  • Evaluation Metrics: The study reiterates the limitations of automatic metrics and suggests exploring new metrics that better align with human perception.
  • Broader Evaluation: While widely-used datasets were employed, the authors suggest further experiments on a broader range of datasets to validate the generalizability of their findings.
  • Benchmark Development: The authors plan to introduce a benchmark to systematically evaluate LLMs as open-source software development assistants, enabling better comparison and progress tracking in the future.

Summary updated

BibTeX
@misc{shi2023sotana,
  author = {Ensheng Shi and Fengji Zhang and Yanlin Wang and Bei Chen and Lun Du and Hongyu Zhang and Shi Han and Dongmei Zhang and Hongbin Sun},
  title = {{SoTaNa: The Open-Source Software Development Assistant}},
  year = {2023},
  eprint = {2308.13416},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.13416},
}
Figure