A Preliminary Evaluation of ChatGPT in Requirements Information Retrieval

Jianzhang Zhang, Yiyang Chen, Nan Niu, Chuang LiuarXiv 2023 · DOI

Abstract

This paper presents an empirical "stress test" of ChatGPT’s ability to handle Requirements Engineering (RE) tasks without any specific training or examples (zero-shot). The researchers found that while ChatGPT is surprisingly competitive with state-of-the-art specialized models—particularly in extracting features from text—it tends to prioritize finding every possible requirement (high recall) at the expense of accuracy (lower precision), especially when dealing with noisy user reviews.

Introduction

Requirements Engineering (RE) is the backbone of software development, but it is notoriously labor-intensive. Traditionally, researchers have built "NLP4RE" tools—specialized Natural Language Processing models designed for specific tasks like classifying a requirement as "Security-related" or extracting specific features from an App Store description.

The challenge is that these specialized models often require massive labeled datasets and complex pipelines (tokenization, lemmatization, etc.) to work. With the rise of Large Language Models (LLMs), the authors investigated whether a general-purpose model like ChatGPT could replace these bespoke tools, focusing on Information Retrieval (IR) tasks under a zero-shot setting to establish a baseline for the model's inherent domain knowledge.

Methodology

The authors developed an evaluation framework consisting of a $2 \times 2$ matrix of tasks categorized by IR techniques (Classification vs. Extraction) and artifact types (Specialized vs. General). The process involves four main stages: task selection, data preparation (testset selection and prompt construction), querying the LLM, and results analysis.

The four-stage evaluation framework for assessing ChatGPT's performance in Requirements Information Retrieval.

They used GPT-3.5-turbo via API with the temperature set to 0 to ensure results were as deterministic as possible. The prompts were handcrafted using a "peer-coding" procedure to ensure they were clear, imperative, and utilized terminology consistent with the original research papers of the datasets used.

Experimental Setup and Datasets

The study utilized four established benchmark datasets to compare ChatGPT against existing state-of-the-art (SOTA) baselines. These datasets cover a range of tasks from formal NFR classification to feature extraction from informal app descriptions.

Detailed characteristics of the four benchmark datasets used for classification and extraction tasks.
  • PROMISE NFR (S-C): 249 formal non-functional requirement statements (e.g., Usability, Security).
  • App Review NFR (G-C): 1,800 user reviews from Google Play and the App Store, labeled for multi-label classification.
  • Smarthome User Stories (S-E): 100 user stories used for extracting domain-specific terms.
  • App Descriptions (G-E): 50 descriptions (including Chinese) used for feature extraction, testing multi-lingual capabilities.

Key Insights and Results

Inherent Domain Knowledge

ChatGPT demonstrated a strong understanding of software engineering concepts like "Usability" or "Security" without explicit definitions. It achieved an $F_1$ score of 0.84 on formal requirements classification, matching a BERT-based model specifically fine-tuned for that task.

The Recall-Precision Trade-off

In RE, missing a requirement (a false negative) is often more costly than manually filtering out a few extra suggestions (a false positive). ChatGPT naturally aligns with this priority; it consistently showed high recall but lower precision. This was most evident in App review classification, where ChatGPT’s precision was 0.28 compared to the baseline's 0.64, while its recall was significantly higher (0.85 vs. 0.54).

Sensitivity to Noise and Artifact Type

ChatGPT performs significantly better on "specialized" text written by analysts than on "general" text written by users. User reviews are often ambiguous, leading to lower precision. However, in feature extraction from app descriptions, ChatGPT significantly outperformed the baseline, with an $F_1$ measure of 0.75 vs. 0.54, identifying fine-grained features that traditional tools missed.

Conclusion

While ChatGPT shows great promise in simplifying the development of RE tools by replacing complex NLP pipelines with single-step queries, challenges remain. Non-determinism and high sensitivity to prompt wording are hurdles for stable tool development. Future work should focus on prompt optimization and the development of RE-specific LLMs—fine-tuning models on software engineering data to improve precision while maintaining high recall.

Summary updated

BibTeX
@misc{zhang2023preliminary,
  author = {Jianzhang Zhang and Yiyang Chen and Nan Niu and Chuang Liu},
  title = {{A Preliminary Evaluation of ChatGPT in Requirements Information Retrieval}},
  year = {2023},
  eprint = {2304.12562},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.12562},
}
Figure