Classifier or Prompt: A Case Study on Legal Requirements Traceability
New regulations are continuously introduced to ensure that software development complies with ethical standards and prioritizes public safety. Demonstrating compliance requires tracing software requirements to legal provisions. Requirements traceability is a fundamental task in which requirements engineers analyze technical requirements against target artifacts, often under strict time constraints. Performing this analysis manually for complex systems containing hundreds of requirements is infeasible, and the legal dimension further increases the effort required.
In this paper, we investigate two automated solutions based on language models, including large language models (LLMs). The first solution, Kashif, is a classifier that leverages sentence transformers and semantic similarity. The second solution, Rice LRT, prompts a recent LLM using Rice, a prompt-engineering framework. Using a publicly available benchmark dataset, we empirically evaluate Kashif and compare it against seven baseline classifiers from the literature (LSI, LDA, GloVe, TraceBERT, RoBERTa, and LLaMA).
Kashif identifies trace links with an F2 score of approximately 63%, outperforming the best baseline by a substantial margin of 21 percentage points (pp). On a newly created and more complex requirements document traced to the European General Data Protection Regulation (GDPR), Rice LRT outperforms both Kashif and baseline prompting approaches, achieving an average recall of 84% and an F2 score of 61%, improving the F2 score by 34 pp compared to the best baseline prompt.
Our results indicate that requirements traceability in legal contexts cannot be adequately addressed by existing techniques that are not specifically designed for legal artifacts. Furthermore, we demonstrate that our engineered prompt outperforms both classifier-based approaches and baseline prompting methods.
Tue 7 JulDisplayed time zone: Eastern Time (US & Canada) change
14:00 - 15:30 | Requirement and designResearch Papers / Journal-First Paper / Tool Demonstrations / Ideas, Visions and Reflections at MB 5.215 Chair(s): Mehrdad Sabetzadeh University of Ottawa | ||
14:00 10mTalk | Round-trip Engineering for Tactical DDD: A Constraint-Based Vision for the Masses Ideas, Visions and Reflections Weixing Zhang Karlsruhe Institute of Technology (KIT), Mario Herb esentri AG, Martin Armbruster Karlsruhe Institute of Technology (KIT), Bowen Jiang Karlsruhe Institute of Technology, Marcel Vielsack esentri AG, Anne Koziolek Karlsruhe Institute of Technology | ||
14:10 20mTalk | Classifier or Prompt: A Case Study on Legal Requirements Traceability Journal-First Paper Romina Etezadi University of Ottawa, Sallam Abualhaija University of Luxembourg, Chetan Arora Monash University, Lionel Briand University of Ottawa, Canada; Lero centre, University of Limerick, Ireland | ||
14:30 10mTalk | SpecPylot: Python Specification Generation with Large Language Models Tool Demonstrations | ||
14:40 20mTalk | Multi-LLM Persona Generation for Virtual Focus Groups in Software Engineering: A Controlled, Multi-Domain Study of Emotional Requirements Elicitation Research Papers Guangrui Fan Taiyuan University of Science and Technology, Dandan Liu Universiti Malaya, Lihu Pan Taiyuan University of Science and Technology, Rui Zhang Taiyuan University of Science and Technology, Qian Guo Taiyuan University of Science and Technology | ||
15:00 20mTalk | On the Utility of Domain Modeling Assistance with Large Language Models Journal-First Paper Meriem Ben Chaaben Université de Montréal, Lola Burgueño University of Malaga, Istvan David McMaster University / McMaster Centre for Software Certification (McSCert), Houari Sahraoui DIRO, Université de Montréal | ||
15:20 10mTalk | ADATracer - Towards A Software Traceability Pipeline for ADA Systems Tool Demonstrations Nithin Chepuri Indian Institute of Technology Tirupati, Rajeev Thota Indian Institute of Technology Tirupati, Venkat Kaushal Thippisetty Indian Institute of Technology Tirupati, Sridhar Chimalakonda Indian Institute of Technology Tirupati, Sumith Shankar U. R. Rao Satellite Centre, ISRO | ||