Manuscript Offprint
arXiv:2611.09162Rethinking Requirement-to-Code Traceability Through Single-Agent and Multi-Agent Approaches
Sarthak Banerjee®, Sallam Abualhaija®, Member, IEEE, Domenico Bianculli®, Member, IEEE, and Lionel Briand®, Fellow, IEEE
Abstract—Requirements-to-code traceability supports essential software engineering activities, including change impact analysis, maintenance, and regulatory compliance. Existing approaches typically rely on a retrieval-and-classification pipeline, which suffers from an inherent retrieval bottleneck: relevant source files that are not retrieved cannot be recovered during subsequent analysis. In this paper, we revisit requirements-to-code traceability in light of the substantially larger context windows offered by modern large language models, which make repository-scale analysis feasible without a separate retrieval step. We propose three approaches: a single-agent approach that analyzes the entire code repository in one pass, and two multi-agent approaches based on self-verification and multi-agent debate. Our evaluation shows that the single-agent approach substantially improves recall, achieving 80.9%, a gain of 38.6pp over the state-of-the-art retrieval-based baseline, albeit with a 25.8pp reduction in precision. By leveraging collaborative reasoning, the multi-agent debate-based approach achieves the best overall precision-recall balance, with 24.5% precision and 71.0% recall, yielding an F2 score of 49.5%. This represents an improvement of 7.5pp over the state of the art and 2.7pp over the single-agent approach. In addition, qualitative analysis provides key insights into highly variable quantitative results: the retrieval approach suits requirements that echo the code's vocabulary; single-agent, full-context reasoning suits well-documented, consistently named code; and multi-agent debate suits indirect, conflicting, or distributed evidence.
Index Terms—Traceability, Requirements, Code, Multi-agents, Large Language Models (LLMs).
I. INTRODUCTION
Establishing trace links between software requirements and source code has long been a persistent challenge in software engineering (SE) [1]. This challenge becomes even more critical as modern software development increasingly relies on artificial intelligence (AI) coding agents¹. Today's coding agents can generate entire software projects directly from natural-language (NL) requirements [2]. While these technologies offer substantial productivity benefits, they also introduce new traceability challenges.
AI-generated code typically lacks explicit trace links that connect the requirements or prompts to their corresponding implementation within the codebase. The literature has highlighted this gap and emphasized the need for tools to reconstruct these links [3], [4]. Furthermore, prior work suggests that AI coding agents cannot yet be relied upon to provide accurate traceability information. For instance, tracing issues to commits through pull requests may be unreliable, because pull request descriptions, often the primary communication channel between AI agents and human developers, do not always accurately reflect the implemented changes [5]. Together, these findings suggest that, although AI-assisted software development can accelerate implementation, it may further weaken the availability and reliability of software traceability information.
Creating and maintaining trace links manually is both time-intensive and error-prone, particularly as systems evolve. Whenever code is added, modified, or refactored, the corresponding trace links must also be updated. In practice, however, these updates are often postponed or omitted altogether. As a result, traceability information in industrial projects is frequently missing, incomplete, or outdated [6]. Recovering these links after development is equally demanding, as it requires examining each requirement against potentially thousands of code artifacts, a task that becomes increasingly costly as repository size grows.
Automated trace link recovery (TLR) is therefore essential, yet remains difficult for several reasons. First, a substantial semantic gap exists between NL requirements and source code, as implementation details are often expressed using terminology that significantly differs from that of the requirement. Second, requirements are frequently scattered across multiple files, meaning that no single file fully captures their implementation. Third, the search space is typically highly imbalanced. In existing requirement-to-code traceability benchmarks [7], [8], true trace links often represent only 1% to 5% of all possible requirement-code pairs, while the total number of candidate links ranges from roughly 6700 to 29600 (see Table I on page 6). An effective TLR approach must therefore identify a small number of correct links among thousands of plausible but incorrect candidates.
Recent advances in Large Language Models (LLMs) have led to promising progress in automated TLR. Most existing approaches follow a retrieval-and-classification pipeline that combines Retrieval-Augmented Generation (RAG) [9], [10] with LLM-based pairwise trace link prediction [11]. Given a requirement, these approaches first retrieve the top- semantically similar code files and then ask the LLM to determine whether a trace link exists for each requirement-file pair.
While this pipeline effectively reduces the search space, it has two important limitations. First, it introduces a retrieval bottleneck: any relevant file that is not included among the top- candidates is excluded from further consideration. This
¹The 2026 Stack Overflow survey of 30,000 developers across 169 countries reports that about 66% of developers use AI coding assistants or agents for software implementation, of whom 73% indicate daily use—Stack Overflow, 2026 Developer Survey, October 2026

Fig. 1: Motivating example: trace links from eTour.
limitation is particularly problematic given the semantic gap between requirements and source code, which can prevent relevant files from being ranked highly in the first place. Second, evaluating code files independently limits the ability to capture cross-file traceability, where a requirement is implemented collectively across multiple interacting files. Consequently, some trace links may be missed even when the relevant files are successfully retrieved.
To illustrate these challenges, consider the use case UC53 from eTour, a widely used requirements-to-code traceability benchmark [7], illustrated in Fig. 1. This use case describes how a tourist submits feedback for a visited site. The system checks that no feedback was issued before, validates the input, stores the feedback, and adds the site to the tourist's list of visited sites. In the benchmark, UC53 is traced to six Java code files: IDBVisitBC, DBVisitPR, IDBVisitPR, CulturalHeritageVisitChecker, ControlData, and SiteTableModel. Existing retrieval-and-classification approaches can identify only two of the six files: IDBVisitBC and DBVisitPR (marked as found in the figure), both of which contain vocabulary close to the use case. The remaining four files (marked as missed in the figure) are likely missed because the large terminology gap leads to very low textual similarity. Moreover, existing approaches assess each file against the use case in isolation and therefore cannot recover these four files through their code dependencies on the two found ones.
Recent work has attempted to mitigate these issues through multi-agent architectures that combine RAG with self-verification [12]. However, because self-verification operates on top of the same retrieval pipeline, it inherits the retrieval bottleneck: relevant files filtered out early cannot be recovered. Moreover, self-verification typically reassesses predicted links rather than revising them, allowing upstream errors to propagate to the final output. Finally, although these approaches employ multiple agents, they make limited use of capabilities commonly associated with effective multi-agent systems—such as collaboration, memory, and coordinated reasoning [13].
In this paper, we rethink requirements-to-code traceability by asking two questions: (1) Can repository-level reasoning recover trace links missed by retrieval-based and pairwise approaches? (2) Is a single reasoning pass sufficient? To answer the first question, we investigate whether giving an LLM access to the entire codebase improves trace recovery,
particularly for cross-file trace links. To answer the second, we examine the role of collaborative reasoning in traceability analysis. Unlike prior self-verification approaches, which primarily reassess predictions, we introduce a multi-agent approach in which agents iteratively critique, refine, and revise candidate trace links.
Contributions. This paper makes the following contributions: (1) We propose three LLM-based approaches: (i) TRACER, a single-agent approach that provides an LLM with the entire code repository (rather than a limited set of retrieved candidates), enabling repository-level reasoning across multiple interacting files to identify cross-file trace links; (ii) COR-RECTOR and (iii) DEBATER, two multi-agent approaches that build on established self-correction and multi-agent debate frameworks [14], [15]. We further evaluate two prompting strategies: a conservative prompt (), which instructs the model to return only highly confident trace links, and a comprehensive prompt (), which encourages the model to identify all plausible trace links supported by the available evidence, including links that require combining information across multiple artifacts.
(2) We conduct a comprehensive empirical evaluation on three benchmark datasets, namely eTour, iTrust, and Dronology. Our results show that TRACER with achieves the highest average recall of 80.9% with an average precision of 17.8%, and F2 of 46.3%. Compared to the RAG-based approach (P = 43.6%, R = 42.3%, F2 = 41.5%), TRACER improves recall by 38.6 and F2 by 4.8 percentage points (pp), at the cost of a 25.8 pp drop in precision. Among the multi-agent approaches, DEBATER with achieves an average precision of 24.5%, recall of 71.0%, and F2 of 49.5%. Compared to the single agent TRACER, DEBATER reduces the number of predicted links that an analyst must validate (i.e., confirm or reject) by about 30% on eTour and iTrust, losing 3.9 pp and 6.3 pp in recall, respectively. On Dronology, it halves the validation effort, but recall drops by 19.3 pp. On all three datasets, DEBATER also achieves higher precision (24.5% vs. 17.8%), i.e., fewer of the links the analyst validates are false positives. DEBATER therefore offers the best trade-off between the human validation effort and the coverage of true links.
(3) As the quantitative analysis of our experimental results offered limited insights and revealed significant variability across approaches, we complement it with a qualitative analysis of all requirements and use cases that have ground-truth links across all datasets. Specifically, we manually inspected 57 use cases in eTour, 105 use cases in iTrust, and 57 requirements in Dronology, together with their associated code files. Our analysis shows that TRACER excels when trace evidence is explicit, whereas DEBATER is particularly effective at recovering trace links supported by indirect, conflicting, or distributed implementation evidence. A RAG-based approach only works best when requirements echo the code's vocabulary. Our findings help practitioners select the most appropriate traceability approach based on the characteristics of their artifacts.
Structure. Section II presents the necessary background. Section III introduces our approaches. Section IV reports on our empirical evaluation, and Section V presents the qualitative analysis. Section VI discusses related work, and Section VII concludes the paper.
A single-agent system consists of a single LLM that is assigned a specific task and is solely responsible for generating, refining, and producing the final output. Such systems are generally suited to tasks with limited complexity and relatively short execution chains, where a single model can effectively perform all required reasoning steps [13].
LLMs are large-scale transformer-based foundation models trained on vast text corpora [16]. Since their emergence, these general-purpose models have enabled performing a wide variety of tasks through prompting, instead of building tools from scratch. For a comprehensive overview of prompt engineering, we refer the reader to [17]. A key characteristic of LLMs is their context window, which defines the maximum amount of information the model can process during inference [18]. Early generations were constrained by relatively small context windows, motivating the development of Retrieval-Augmented Generation (RAG), in which relevant information is first retrieved and then fed into the model's context [19]. Newer generations (from 2025 onward) have substantially larger context windows, enabling more input to be processed simultaneously and thereby improving their reasoning capabilities [20].
A multi-agent system (MAS) combines two or more LLMs that collaboratively perform a single task [13]. Each LLM is typically assigned a distinct role within the workflow, such as generation, refinement, or validation. This decomposition enables the system to address more complex, multi-step tasks and has been shown to mitigate issues such as hallucinations (when LLMs confidently generate false information) and enhance reasoning capabilities for complex, multi-step tasks [21].
III. SINGLE-AGENT AND MULTI-AGENT TRACEABILITY APPROACHES
We propose three LLM-based approaches for identifying trace links between requirements and code: a simple single agent approach (TRACER) which benefits from the large context window of modern LLMs, and two more complex multi-agent approaches (CORRECTOR and DEBATER) implemented based on the self-correction and MAD strategies explained in Section II. Addressing the requirements-to-code traceability task requires both identifying relevant candidate code files and validating the resulting trace links. A single-agent approach like TRACER performs only the identification part without careful validation. We therefore propose two multi-agent approaches that explicitly introduce the additional validation step. While CORRECTOR enables correcting the resulting trace links, its reasoning remains limited to the initial trace links. In contrast, DEBATER enables agents to reason about both selected and rejected trace links through iterative deliberation. Our proposed approaches are motivated by these alternative reasoning paradigms.
Fig. 2 shows an overview of both CORRECTOR (left-side) and DEBATER (right-side). We omit TRACER for simplicity. Given a requirements specification and a codebase as input, each approach processes a single requirement at a time alongside the complete set of code files. The output for each requirement is then the set of code file names that constitute its trace links. We describe the approaches next.
A. TRACER
In TRACER, a single LLM identifies trace links between a given requirement and all code files in a single pass. Using a customized prompt, the LLM reasons over the requirement and source code artifacts to determine the relevant trace links.
To keep the focus of this paper on comparing single-agent and multi-agent approaches, we limit the influence of prompt engineering by considering only two prompting strategies. Specifically, we employ two prompt variants designed for different traceability objectives. The first, , is a conservative Chain-of-Thought (CoT) prompt adapted from existing work [22] with adjusted input and output formatting. It guides the LLM to derive the trace links by classifying each code file as relevant or irrelevant to the input requirement. The second variant, , extends with explicit instructions that encourage the LLM to generate a broader set of candidate trace links, following existing research that favors identifying a comprehensive set of trace links [23]. The prompts and are shown in Fig. 3.
B. CORRECTOR
CORRECTOR incorporates self-correction through three distinct agents: a trace agent, treated as a black-box LLM responsible for initial trace generation; a critic agent, which analyzes the quality of the generated trace links; and an author agent, which refines the trace links based on feedback from the critic. By separating trace generation, critique, and refinement into distinct roles, the approach enables iterative improvement of traceability decisions.
As shown in Fig. 2, CORRECTOR consists of three steps, split across three stages.
In stage A (Initial Trace Links), similar to TRACER, a trace agent is instructed to generate an initial set of candidate trace links (step identify trace links in the figure). Compared to TRACER, this step exclusively uses to ensure the initial set is comprehensive. This choice aligns with the observation that self-correction frameworks are most effective when the initial generation phase prioritizes broad coverage of relevant artifacts [24]. By using , the trace agent is encouraged to identify an expansive set of candidate linked artifacts that may be related to the given requirement, even if some of the trace links are weakly supported. These weaker trace links are addressed by the other agents through the subsequent self-correction steps (elaborated below). In contrast, using a conservative prompt like during initial trace generation may prematurely exclude valid trace links that other agents cannot recover.
Stage B (Validate Trace Links) consists of a single step, Critic Suggestion, in which the initial set of trace links is

Fig. 2: Overview of CORRECTOR (left-side) and DEBATER (right-side).
: Conservative Tracing Prompt
Below are two artifacts from the same software system. Is there a traceability link between (1) and (2)?
Give your reasoning, answer with 'yes' or 'no' and provide a list of files.
Input
(1) Requirement: {source_content}
(2) Code_files: {target_content}
Output
"trace_link": "yes or no",
"traced_files": "if yes list all linked filenames",
"reasoning": "explain the evidence and rationale for these trace links"
: Comprehensive Tracing Prompt
Below are two artifacts from the same software system. Is there a traceability link between (1) and (2)?
Maximize recall with traceability links, prefer false positives over false negatives.
Give your reasoning, answer with 'yes' or 'no' and provide a list of files.
Input
same as
Output
same as
Fig. 3: Prompts used by TRACER: (top) and (bottom) with explicit exploration instructions to identify a broader set of candidate trace links.
passed to the critic agent. The critic examines the reasoning underlying each link and identifies potential weaknesses, such as weakly supported or questionable traceability relationships. The agent then produces a set of structured suggestions highlighting the identified issues.
Finally, stage C (Self-correction) consists of the last step, Author Refinement. Here, the author agent is provided with both the initial trace links and the suggestions generated by the critic agent. Using this information, it revises the trace links to improve the overall quality and consistency of the traceability results.
The prompts used by the critic and author agents are shown in Fig. 4. We adopt a simple persona-based prompting strategy for both the critic and author agents. Each agent is assigned
: Critic Prompt
You are a traceability critic whose job is to identify false positive trace links.
A requirement has a trace link only if there is evidence in the provided code that it implements or references the requirement.
Do NOT add new files; only evaluate the given code files.
Input
(1) Requirement: {requirement}
(2) Traced files: {traced_files}
(3) Traced code blocks: {code_blocks}
Output
"fp_files": "List of false positive files",
"reasoning": "Explain why the identified files do not implement/reference the requirement"
: Author Prompt
You are a traceability author whose job is to identify all files that implement or reference the requirement.
Add any file where the provided code offers reasonable support.
You are given a set of candidate files and also a list of files that are possibly incorrectly traced.
Input
(1) Requirement: {requirement}
(2) Source code: {code_blocks}
(3) Traced file names: {traced_files}
(4) Possibly false positive traced files: {fp_files}
(5) False positive reasoning: {fp_reasoning}
Output
"final_traced_files": "List of all files you determine to be valid"
Fig. 4: Prompts used by CORRECTOR: (top) flags potentially incorrect trace links and (bottom) reconsider the initial candidate links given the critic's flags and reasoning.
a clearly defined role, along with explicit specifications of its expected input and output formats. This design lets each agent focus on its specific responsibilities, reducing the need to optimize prompts to guide its actions.
C. DEBATER
DEBATER consists of three principal agents: a trace debater, a non-trace debater, and a judge. The trace debater is responsible for identifying code files that are likely to be traceable to the given requirement, whereas the non-trace debater focuses on identifying code files that should not be traced to the requirement. Both debaters are provided with the requirement and the complete code base in the prompt, similar to the other two approaches.
As shown in Fig. 2, DEBATER operates in three stages. In stage A, Initial Round, both the trace and non-trace debaters receive an initial prompt that provides a single requirement along with the complete set of code files. The difference is that the trace debater is instructed to identify a set of candidate trace links, while the non-trace debater is instructed to identify the code files that should not be traced to the requirement. Both agents are required to provide the reasoning underlying their decisions, either to support the proposed trace links or to justify their exclusion.
In the subsequent stage B, Debater Exchange, each debater exchanges its outputs from the previous stage. In this cycle, however, the trace debater re-examines the set of non-trace links identified by the non-trace debater and argues for any artifacts that may warrant inclusion as trace links. Conversely, the non-trace debater reviews the trace links proposed by the trace debater and identifies artifacts that should be excluded.
Finally, in stage C Judge Resolution, the outputs from both the initial round and the subsequent debate exchanges are provided to the judge agent, who then evaluates the competing arguments and resolves any conflicts to produce a final, consolidated set of trace links.
Fig. 5 shows the respective prompts. We adopt the prompting strategies and LLM configurations from the requirements engineering literature where MAD was first introduced [25]. The trace debater, non-trace debater, and judge agents are all prompted using a simple persona-based approach, in which each agent's role is explicitly defined along with clear specifications of the expected input and output formats. This design choice emphasizes each agent's responsibility to perform their assigned tasks without relying on complex prompts. Furthermore, we restrict the MAD process to a single cycle of debate. This decision allows us to analyze the impact of the MAD framework itself, rather than improvements arising from repeated debate passes.
IV. EMPIRICAL EVALUATION
A. Research Questions (RQs)
Our evaluation addresses the following RQs:
RQ1. How does an LLM-based single-agent approach compare to retrieval-based approaches for requirement-to-code traceability? Traditional state-of-the-art methods for TLR have utilized RAG specifically to address the context window size limitation of available LLMs at the time. This, however, restricts the identification of possible genuine trace links to what the RAG system retrieves or misses. Starting from GPT-5 in 2025 onward, LLMs typically support large context windows. Building on this, RQ1 compares LiSSA, a state-of-the-art RAG-based approach (introduced in Section IV-B) against TRACER, described in Section III-A.
RQ2. To what extent does a multi-agent LLM-based approach improve requirement-to-code traceability compared
: Trace DEBATER Prompt
You are a debater arguing that the provided files are traceable to the requirement. Return those files that have a trace link.
Input
(1) Requirement: {requirement}
(2) Files to evaluate: {non_trace_file_blocks}
Output
"trace_files": "The files that should be traced to the requirement", "reasoning": "The reason these files should be traced to the requirement"
: Non-Trace DEBATER Prompt
You are a debater arguing that the provided files DO NOT have a trace link to the requirement. Return those files that do not have a trace link.
Input
(1) Requirement: {requirement}
(2) Files to evaluate: {trace_file_blocks}
Output
"non_trace_files": "The files that should NOT be traced to the requirement", "reasoning": "The reason these files should NOT be traced to the requirement, give justification based on code"
: Judge Prompt
You are a moderator. There will be two debaters involved in a debate competition. They will present their answers and discuss their perspectives (reasonings) on whether a given requirement can be traced to some code files.
At the end of each round, you will evaluate their answers and decide which files should be traced to the requirement based on the reasoning provided.
Take into account all perspectives and choose the right answer.
Input
(1) Requirement: {requirement}
(2) Trace-files: {trace_files}
(3) Trace-file-reasoning: {trace_reason}
(4) Non-trace-files: {non_trace_files}
(5) Non-trace-reasoning: {non_trace_reasoning}
(6) Non-trace-debaters-perspective: {non_trace_debate}
(7) Trace-debaters-perspective: {trace_debate}
Output
"final_trace_files": "The files that should be traced to the requirement"
Fig. 5: Prompts used by DEBATER: (top) and (middle) argue for and against candidate trace links and (bottom) resolves the debate into a final set of trace links.
to a single-agent approach? While a single-agent approach benefits from access to a large context window, enabling it to analyze the entire codebase and identify candidate trace links in a single generation pass, it has no means of validating or revising the identified links. For instance, a single agent that is explicitly instructed to maximize trace link coverage is likely to emit a considerable number of incorrect links. By assigning complementary roles to different LLM agents, multi-agent approaches separate the generation of candidate links from their validation. As a result, links proposed by one agent can be challenged, revised, or rejected by another, iteratively refining the final set of trace links before it is returned. In
RQ2, we evaluate two multi-agent approaches: CORRECTOR (Section III-B) and DEBATER (Section III-C).
B. Baseline
As a baseline for our study, we consider LiSSA, a state-of-the-art RAG-based approach proposed by Fuchs et al. [22].
LiSSA adopts a two-stage retrieval-and-classification architecture. In the first stage, requirements and source code artifacts are encoded into a shared embedding space using an embedding model. Cosine similarity is then used to retrieve a set of candidate requirement–code pairs, substantially reducing the search space through semantic retrieval. This retrieval step serves as the RAG component, providing the LLM with a manageable set of potentially relevant candidates rather than the complete Cartesian product of artifacts. In the second stage, the LLM analyzes each retrieved requirement–code pair and classifies it as either a valid trace link or a non-trace link, guided by a conservative prompt ( in Fig. 3).
Besides evaluating the original LiSSA, we developed an independent Python re-implementation for two reasons.
First, the replication package released with the original LiSSA approach relies on GPT-4o as its classification model, which supports only a limited input context. As discussed earlier, our proposed approaches benefit from more recent models with larger context windows. Since the LiSSA replication package was designed to reproduce the original results rather than support customization, replacing the underlying LLM would require substantial re-engineering. Therefore, re-implementing the LiSSA proved to be a more practical option.
Second, the Dronology dataset used in the original LiSSA evaluation was not released with the replication package. The publicly available version used in our study (Section IV-C) differs from the one described in the original work in the number of requirements. Consequently, reproducing the original results cannot be fairly compared with those obtained in our study. To keep our experimental setting consistent, we re-evaluated our re-implementation of LiSSA on the same dataset used in our experiments.
Using this re-implementation, we evaluate two LiSSA-based configurations: (1) LiSSA (IR-only), executes only the retrieval stage of the LiSSA pipeline and returns the Top-K most similar source code files for each requirement, thus measuring the effectiveness of the embedding-based retrieval component in isolation. (2) LiSSA (GPT-5), replaces the original GPT-4o classifier with GPT-5 while using the same LiSSA pipeline. This variant enables us to assess if advances in LLM capabilities affect traceability recovery performance when the retrieval stage remains fixed. For both variants, we retain the embedding model, cosine-similarity retrieval strategy, and retrieval parameter (K = 20) reported by Fuchs et al. [22].
C. Datasets
To facilitate fair comparison with LiSSA [22], we adopt the same benchmark datasets: eTour, iTrust, and Dronology. These datasets are widely used in the traceability literature, making them a suitable basis for our empirical investigation.
TABLE I: Overview of the requirements-to-code datasets used in our study.
| Dataset | Domain | Type | # Req. | # Code | CAND | TL |
|---|---|---|---|---|---|---|
| eTour | Tourism | UC | 58 | 116 | 6,728 | 308 |
| iTrust | Healthcare | UC | 131 | 226 | 29,606 | 286 |
| Dronology | Aerospace | RE | 57 | 184 | 10,488 | 393 |
Req. = number of requirements; # Code = number of code files;
UC, RE: use cases and shall-style requirements.
CAND: all possible candidate trace links generated using the Cartesian product of requirements and source code files.
TL: number of ground-truth trace links.
The number of trace links differs from that reported in [22].
The eTour and iTrust datasets cover the tourism and healthcare domains, respectively, and were originally curated by the Center of Excellence for Software and System Traceability (CoEST) [7]. We obtained both datasets directly from the LiSSA replication package to ensure consistency with the original experimental setup, including the number of trace links used for evaluation. The Dronology dataset, originally introduced by Cleland-Huang et al. [26], covers the aerospace domain. Since Dronology is not included in the LiSSA replication package, we use the publicly available version released by Gao et al. [8] .
Table I summarizes the characteristics of the selected datasets. The requirements in eTour and iTrust are represented as use cases (UCs), whereas those in Dronology are specified as shall-style requirements (RE). All datasets contain Java source code files. The CAND column reports the size of the traceability search space, computed as the Cartesian product of requirements and code files. Ground-truth trace links connect a requirement to one or more code files.
D. Evaluation Metrics
We evaluate all approaches at the trace-link level. Given the ground-truth trace links provided in each dataset, a true positive (TP) denotes a correctly identified trace link. A false positive (FP) is a predicted trace link that is not present in the ground truth, while a false negative (FN) is a ground-truth trace link that the approach fails to recover.
Following this, we report precision (P), recall (R), and -score, computed as , , and respectively.
Precision measures the proportion of predicted trace links that are correct, while recall measures the proportion of ground-truth trace links successfully recovered by an approach. In RE tasks such as traceability, recall is generally considered more important than precision [27]. Missing valid trace links (i.e., FNs) may reduce the analysts' trust in the automated approach and often require a costly manual inspection of the entire candidate search space to recover the missed links. We therefore report F2-score (i.e., ), assigning greater weight to recall than precision.
In addition to the above, we report cost (C) following Etezadi et al. [28], computed as , where TL is the number of trace links returned by an approach and CAND
https://github.com/huiAlex/TRIAD/tree/main/dataset/dronology is the number of candidate links, i.e., all possible requirements-code pairs (see Table I). Cost estimates the percentage of cost saved by the analyst by reviewing only the trace links produced by the automated approach compared to reviewing all possible candidate links. Lower cost values indicate that fewer candidate links must be inspected and, consequently, more manual validation effort is saved.
E. Evaluation Procedure
To answer our RQs, we conduct two experiments (EXPI – EXPII). For each requirement, an approach generates a set of candidate trace links, which are subsequently compared against the ground-truth links. We assess performance using the metrics defined in Section IV-D. We run the experiments on the eTour, iTrust, and Dronology datasets (see Section IV-C). EXPI. This experiment addresses RQ1. Specifically, we evaluate three variants of the baseline, namely LiSSA (original), LiSSA (IR-only), and LiSSA (GPT-5), described in Section IV-B. All variants are tested with , the original prompt introduced in the baseline paper [22]. To assess the effectiveness of the single-agent approach using the large context window, we compare LiSSA with TRACER, both instantiated with GPT-5 and tested with . To further analyze the impact of a comprehensive prompt, we also evaluate TRACER using . Both prompts are defined in Section III-A.
EXPII. This experiment addresses RQ2. To assess the impact of incorporating a self-correction mechanism, we compare TRACER with against CORRECTOR with . CORRECTOR serves as an upgraded version of TRACER where we introduced another agent dedicated to correcting inherent the errors expected due to maximizing the candidate link coverage in the initial identification phase. We then also compare TRACER against a more complex multi-agent approach, DEBATER, where multiple agents with dedicated roles collaborate to generate the final set of trace links. TRACER and DEBATER are tested using both prompts. We run all approaches using the same underlying LLM, GPT-5 and input artifacts. Consequently, any observed differences can be attributed to the reasoning strategy employed by the agents rather than to differences in the candidate search space or model capabilities.
F. Implementation Details
All approaches were implemented in Python using LangGraph 1.2.2 [29], a framework for building graph-based LLM applications. LangGraph models workflows as directed graphs, enabling a unified implementation of both single-agent and multi-agent approaches and supporting iterative agent interactions. For all experiments, we used GPT-5-2025-08-07 via the OpenAI API [30]. To improve reproducibility, we set the temperature to 0 and left all other parameters at their default values. For retrieval-based approaches, we applied the same parameters as in the original baseline, namely OpenAI's textembedding-3-large as the embedding model, K = 20, and no chunking. All experiments were executed on Ubuntu Linux.
G. LLM-based Single-agent compared to retrieval-based traceability approaches (RQ1)
Retrieval-based Results. Table II compares LiSSA and its two variants. For each variant, the table reports P, R, and F2 across the evaluated datasets, together with the relative differences with respect to the original LiSSA approach.
The results show that a retrieval-based approach like LiSSA is strongly constrained by its retrieval stage, as evidenced by LiSSA (IR-only). On eTour, the retriever achieves recall of 80.5%, recovering 248 trace links out of a total of 308 ground-truth trace links (TL in Table I). The remaining 60 links are not included among the Top-20 retrieved candidates and therefore cannot be recovered by the downstream generator. This limitation is reflected in the comparably lower recall achieved by both LiSSA (original) (73.4%) and LiSSA (GPT-5) (54.9%). The effect is even more noticeable on iTrust and Dronology. On iTrust, the retriever recovers only 152 of 286 trace links (R = 53.1%), missing 134 valid links. On Dronology, it recovers 176 of 393 trace links (R = 44.8%), leaving 217 links unrecoverable. These results highlight that the retrieval stage establishes a hard upper bound on the maximum recall achievable by a retrieval-based traceability approach as a whole.
Replacing GPT-4o with GPT-5 consistently improves precision, although its effect on recall varies across datasets. On eTour, precision increases from 40.9% to 53.8% (+12.9 pp), while recall decreases from 73.4% to 54.9% (-18.5 pp), resulting in a drop in F2 of 8.6 pp. A similar trade-off is observed on Dronology, where precision improves from 22.6% to 46.1% (+23.5 pp) but recall decreases from 34.4% to 24.1% (-10.3 pp), reducing F2 by 4.4 pp. In contrast, iTrust benefits from GPT-5 in both cases: precision increases from 19.9% to 31.0% (+11.1 pp) and recall from 45.1% to 47.9% (+2.8 pp), yielding an F2 improvement of 7.2 pp.
Since both LiSSA variants operate on the same Top-20 retrieved candidates, these differences are attributed to the generator alone. Compared with GPT-4o, GPT-5 appears more conservative, returning fewer trace links and thus achieving substantially higher precision, often at the expense of recall.
Relative to the original LiSSA configuration, LiSSA with GPT-5 achieves an average precision of 43.6% (+15.8 pp), recall of 42.3% (-8.7 pp), and F2 score of 41.5% (-2.0 pp) across all datasets. Varying the prompt has little impact on overall performance. We tested LiSSA (GPT-5) with the more comprehensive prompt , which achieves an average precision of 30.2%, recall of 55.1%, and F2 of 46.6% across the datasets. While slightly better, retrieval remains the principal bottleneck of the LiSSA pipeline, limiting the recall to a maximum average of 59.5%.
As the representative baseline in the remainder of this section, we adopt LiSSA (GPT-5) with , referred to as LiSSA-5, because it combines the original retrieval architecture with the same underlying LLM used to evaluate our approaches.
Single-agent Results. Table III shows the results of TRACER compared to LiSSA-5. Using , the same prompt as LiSSA-5, TRACER consistently achieves higher recall across all datasets. Improvements in recall range from 1.6pp on Dronology to 16.4pp on iTrust. Unlike LiSSA-5, which is restricted to
TABLE II: Performance of the baseline LiSSA and its two variants (RQ1)
| Variant | eTour | iTrust | Dronology | Macro Average | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| P (Δ) | R (Δ) | F2 (Δ) | P (Δ) | R (Δ) | F2 (Δ) | P (Δ) | R (Δ) | F2 (Δ) | P | R | F2 | |
| Original | 40.9 | 73.4 | 63.3 | 19.9 | 45.1 | 36.0 | 22.6 | 34.4 | 31.1 | 27.8 | 51.0 | 43.5 |
| IR-only | 21.4 (+19.5↓) | 80.5 (+7.1↑) | 51.9 (-11.4↓) | 5.8 (-14.1↓) | 53.1 (+8.0↑) | 20.2 (-15.8↓) | 15.4 (-7.2↓) | 44.8 (+10.4↑) | 32.4 (-1.3↑) | 14.2 | 59.5 | 34.8 |
| GPT-5 | 53.8 (+12.9↑) | 54.9 (-18.5↓) | 54.7 (-8.6↓) | 31.0 (+11.1↑) | 47.9 (+2.8↑) | 43.2 (+7.2↑) | 46.1 (+23.5↑) | 24.1 (-10.3↓) | 26.7 (-4.4↓) | 43.6 | 42.3 | 41.5 |
Δ is the difference in percentage points (pp) with respect to the original LiSSA [22].
TABLE III: Performance of retrieval-based and single-agent (RQ1), and multi-agent (RQ2) approaches. Best results are highlighted in bold for each category.
| Approach | eTour | iTrust | Dronology | Macro Average | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TP | FP | FN | P | R | F2 | TP | FP | FN | P | R | F2 | TP | FP | FN | P | R | F2 | P | R | F2 | ||
| LiSSA-5 | 169 | 145 | 139 | 53.8 | 54.9 | 54.7 | 137 | 304 | 149 | 31.0 | 47.9 | 43.2 | 95 | 111 | 298 | 46.1 | 24.1 | 26.7 | 43.6 | 42.3 | 41.5 | |
| TRACER | 188 | 148 | 120 | 56.0 | 61.0 | 59.9 | 184 | 426 | 102 | 30.2 | 64.3 | 52.5 | 101 | 126 | 292 | 44.5 | 25.7 | 28.1 | 43.5 | 50.4 | 46.8 | |
| TRACER | 269 | 872 | 39 | 23.6 | 87.3 | 56.7 | 245 | 1874 | 41 | 11.6 | 85.7 | 37.5 | 274 | 1225 | 119 | 18.3 | 69.7 | 44.6 | 17.8 | 80.9 | 46.3 | |
| CORRECTOR | 239 | 420 | 69 | 36.3 | 77.6 | 63.2 | 209 | 1117 | 77 | 15.8 | 73.1 | 42.3 | 192 | 478 | 201 | 28.7 | 48.9 | 42.8 | 26.9 | 66.5 | 49.4 | |
| DEBATER | 217 | 240 | 91 | 47.5 | 70.5 | 64.2 | 213 | 681 | 73 | 23.8 | 74.4 | 52.3 | 141 | 249 | 252 | 36.1 | 35.9 | 35.9 | 35.8 | 60.2 | 50.8 | |
| DEBATER | 257 | 540 | 51 | 32.2 | 83.4 | 63.3 | 227 | 1286 | 59 | 15.0 | 79.4 | 42.7 | 198 | 554 | 195 | 26.3 | 50.4 | 42.6 | 24.5 | 71.0 | 49.5 | |
- and are the prompts in Fig. 3.
the retrieved candidates, TRACER reasons directly over the complete set of source-code files. This broader context appears to improve the recovery of valid trace links that would otherwise be discarded during retrieval. These gains suggest that eliminating retrieval-based filtering is particularly beneficial when valid trace links are weakly represented by lexical similarity alone, as we further elaborate in the qualitative analysis below. Precision remains comparable between the two approaches, likely because they rely on the same underlying model, i.e., GPT-5.
Compared to , the more comprehensive recall-oriented prompt gives TRACER the highest recall: 87.3% on eTour, 85.7% on iTrust, and 69.7% on Dronology. These results exceed the upper-bound recall obtained by the retriever alone (LiSSA-IR-only) by a large margin, mostly notable on iTrust (+32.6 pp) and Dronology (+24.9 pp), with a non-negligible improvement on eTour (+6.8 pp). These improvements indicate that the model is capable of identifying substantially more valid trace links when encouraged to prioritize recall. The gains, however, come at the expense of precision, as the broader exploration of candidate links also increases the number of FPs.
Table IV shows the increase in cost, i.e., the additional manual human effort required to validate the generated links, in the case of TRACER (), compared to . On eTour, cost increases from inspecting 314 trace links (corresponding to 4.99% of the total candidate links under ) to 1141 trace links (16.96% of the total candidates) in the case of , while ensuring that fewer genuine trace links are missed, increasing recall from 61.0% (missing 120 links) to 87.3% (missing only 39). A similar trend is observed on iTrust, where recall improves from 64.3% to 85.7% at the expense of a cost increase from 2.06% to 7.16%. The trade-off is most obvious on Dronology, where recall increases from 25.7% to 69.7% but cost grows from 2.16% to 14.29%. Nonetheless, the analyst can have considerably greater confidence in the completeness
of the recovered trace links.
Overall, the additional manual validation effort appears justified by the substantial reduction in missed trace links. Specifically, compared to TRACER (), TRACER () reduces the average proportion of unrecovered trace links from 49.7% to 19.1%, while increasing the average validation cost from 3.07% to 12.80%. Given the importance of recall in traceability tasks, this represents a favorable trade-off between trace-link completeness and manual inspection effort.
Consequently, TRACER with is preferred when maximizing trace-link recovery is the primary objective, whereas the more conservative approach TRACER with remains a good choice when minimizing validation effort is more important.
Answer to RQ1. Reasoning over the entire codebase enables TRACER to recover trace links that retrieval-based approaches do not consider, improving recall at comparable precision when both use the same prompt. The comprehensive prompt () further increases recall beyond the upper bound imposed by retrieval, by allowing the single agent to output a broader set of trace links. These gains, however, come at the cost of substantially more false positives and higher manual validation effort. We argue, however, that this effort is acceptably small in many contexts. Since recall is generally prioritized in traceability, and links initially missed may remain permanently undiscovered, TRACER () is considered the preferred configuration when completeness is the primary goal, whereas TRACER () is preferable when validation effort is constrained.
H. Multi-agent compared to single-agent traceability approaches (RQ2)
Self-correction Results. Table III shows that CORRECTOR, compared to TRACER, improves the average precision by 9.1 pp (26.9% vs. 17.8%) by substantially reducing FPs, from
TABLE IV: Trade-off between TLR and manual validation effort for LiSSA-5 and TRACER (RQ1), and DEBATER (RQ2)
| Approach | eTour | iTrust | Dronology | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Pred. / CAND | C | R | Missing | Pred. / CAND | C | R | Missing | Pred. / CAND | C | R | Missing | |
| LiSSA-5 | 314 / 6,728 | 4.67 | 54.9 | 45.1 | 441 / 29,606 | 1.49 | 47.9 | 52.1 | 206 / 10,488 | 1.96 | 24.1 | 75.9 |
| TRACER () | 336 / 6,728 | 4.99 | 61.0 | 39.0 | 610 / 29,606 | 2.06 | 64.3 | 35.7 | 227 / 10,488 | 2.16 | 25.7 | 74.3 |
| TRACER () | 1,141 / 6,728 | 16.96 | 87.3 | 12.7 | 2,119 / 29,606 | 7.16 | 85.7 | 14.3 | 1,499 / 10,488 | 14.29 | 69.7 | 30.3 |
| DEBATER () | 457 / 6,728 | 6.79 | 70.5 | 29.5 | 894 / 29,606 | 3.02 | 74.4 | 25.6 | 390 / 10,488 | 3.72 | 35.9 | 64.1 |
| DEBATER () | 797 / 6,728 | 11.85 | 83.4 | 16.6 | 1,513 / 29,606 | 5.11 | 79.0 | 21.0 | 752 / 10,488 | 7.17 | 50.4 | 49.6 |
Pred. = number of trace links predicted by the approach, CAND = all possible candidate trace links, C = validation cost (% of inspected candidate links), R = recall, and Missing = % of unrecovered ground-truth trace links.
872 to 420 on eTour, 1874 to 1117 on iTrust, and 1225 to 478 on Dronology. This reduction lowers manual validation costs. The results confirm that errors made by TRACER can indeed be mitigated after trace link generation through the self-correction mechanism. However, improving precision comes at the expense of recall, which drops from 80.9% to 66.5%, indicating that the mechanism can incorrectly filter out some correct trace links.
While CORRECTOR achieves a slightly higher average F2 score than TRACER (49.4% vs. 46.3%), it is still limited to only correcting errors in the generated trace links and not recovering valid links that TRACER () potentially failed to identify in the first place. This limitation makes CORRECTOR less attractive in practice than TRACER because it has a higher computational cost and yields only limited performance gains.
MAD Results. Table III further shows DEBATER's results. Among the evaluated approaches, DEBATER achieves the highest average F2 score overall, regardless of the prompt used: 50.8% with and 49.5% with . Compared to the single-agent TRACER with the same prompt, DEBATER with loses 7.7 pp in precision while improving recall by 9.8 pp. In contrast, with , it gains 6.7 pp in precision at the cost of an average loss of 9.9 pp in recall. Compared to CORRECTOR, DEBATER with achieves, on average, slightly lower precision (24.5% vs. 26.9%), but improves recall by 4.5 pp (71.0% vs. 66.5%).
From a validation-cost perspective, DEBATER substantially reduces the number of candidate links requiring manual review. As shown in Table IV, compared to TRACER with , DEBATER () predicts fewer links, but at the cost of missing a larger proportion of ground truth links, ranging from ≈26% on iTrust to 64% on Dronology. DEBATER () also substantially reduces the proportion of candidate links to review, from about 17% to 12% on eTour, from 7% to 5% on iTrust, and from 14% to 7% on Dronology, relative to TRACER. This reduction likewise leads to missing true links, although to a lesser extent than DEBATER (), ranging from ≈17% on eTour to 50% for Dronology.
Since our evaluation prioritizes recall, we select DEBATER () over DEBATER (), despite it achieving slightly lower macro-average F2 scores. DEBATER () improves macro-average recall by 10.8 pp (71.0% vs. 60.2%), whereas DEBATER () leads in macro-average F2 by only 1.3 pp (50.8% vs. 49.5%). In other words, DEBATER () delivers a substantial gain in recall at a marginal cost in F2.
Answer to RQ2. Explicit reasoning about both trace and non-trace links through multi-agent debate proves effective. Compared to TRACER, DEBATER increases precision and reduces the number of links to validate, at some loss in recall that is most pronounced on Dronology. DEBATER () yields the best trade-off between link coverage and validation effort, with a macro-average recall of 71% and validation costs ranging from 5.11% (iTrust) to 11.85% (eTour).
I. Threats to validity
In this section, we discuss the threats to validity of our study, following the guidelines for empirical studies in software engineering involving LLMs [31].
Internal Validity. A potential threat is the sensitivity of the approaches to the prompt formulation. To reduce this effect, we adopted existing prompts and applied them consistently across the different approaches.
External Validity. The main external threat concerns the generalizability of our findings across models and software projects. To partially mitigate this threat, we evaluate our approaches on different datasets spanning multiple domains and requirement types. However, all evaluated systems are implemented in Java. Further studies are therefore needed to improve the generalizability of our findings to other programming languages and larger software systems.
Construct Validity. Following prior work [22], we use precision, recall, and F2 at the trace-link level. We additionally report validation cost, measured as the percentage of candidate links requiring manual inspection, although this assumes equal inspection effort across all links and should therefore be interpreted as an approximation of reviewer workload.
Conclusion Validity. Our experiments rely primarily on GPT-5. As LLMs are inherently non-deterministic, repeated executions may yield slightly different outputs. To improve reproducibility, we set the temperature to 0, document all prompts and generated responses, and provide the exact model versions used in our work. Nevertheless, reproducibility remains limited by the availability of information about commercial LLMs, whose proprietary components and evolution are not fully disclosed.
V. QUALITATIVE ANALYSIS
Complementary to the quantitative results presented above, we conduct a qualitative analysis based on a manual inspection of 57 use cases in eTour, 105 use cases in iTrust, and 57 requirements in Dronology³, together with their corresponding code files connected through true trace links. We further manually inspect the ground-truth trace links and the trace links produced by the evaluated approaches to better understand their strengths, limitations, and underlying behaviors.
Our analysis is informed by a recent study on the relationship between requirements quality and TLR [32]. In brief, several requirement qualities that are often considered defects in the RE literature [33] can actually benefit traceability. These include inconsistent levels of abstraction, which expose implementation-oriented details; alternatives blended into the main flow; and tangled requirements, where a single use case is implemented across multiple code files. Such characteristics introduce implementation-level vocabulary into requirements, thereby narrowing the semantic gap between requirements and source code and making traceability links easier to recover.
The study further reports that certain requirements quality issues can hinder traceability recovery. These include requirements that start without a clear noun phrase, contain anaphoric references, as well as scattered requirements, where the implementation of a single functionality is spread across multiple use cases. These characteristics obscure or fragment information in the use case, increasing the semantic gap between requirements and source code.
While requirements quality is an important factor in traceability recovery, we argue that the characteristics of the codebase are equally important, as requirements-to-code traceability depends on both artifact types. Our qualitative analysis examines both requirements vis-à-vis their associated code files to better understand why some trace links are recovered while others are missed.
A. Qualitative Comparison of Retrieval-Based and Single-Agent Approaches
eTour Consistent with the positive traceability factors discussed above, the eTour use cases follow a structured template and frequently incorporate implementation-oriented vocabulary, including alternative flows. These characteristics reduce the semantic gap between requirements and source code by increasing lexical and behavioral overlap. This is reflected in the performance of LiSSA (IR-only), which achieves a recall of 80.5% (Table II). We therefore attribute the strong retrieval performance primarily to the close alignment between requirement descriptions and implementation artifacts.
eTour UC53: “InsertFeedback”
Use case name: InsertFeedback Description: Inserts a feedback for the selected site. Participating actor: initialized by Tourist Entry conditions: The tourist card is in a particular site. Flow of events User System:
- Activate the feature on the issue of feedback.
- Verify that the visitor has not already issued a feedback for the site and displays a form for entering the feedback for the selected site. In case the visitor has already issued a feedback for the site selected, activates the use case FeedbackAlreadyReleased.
| Ground Truth | Predicted |
|---|---|
| IDBVisitBC.java | TP IDBVisitBC.java |
| DBVisitPR.java | TP DBVisitPR.java |
| IDBVisitPR.java | TP IDBVisitPR.java |
| CulturalHeritageVisit Checker.java | TP CulturalHeritageVisit Checker.java |
| SiteTableModel.java | FN — |
| ControlData.java | FN — |
| — | FP TouristClient Manager.java |
| — | FP DBVisitBC.java |
| — | FP BeanVisitBC.java |
| — | FP BeanVisitPR.java |
Fig. 6: Trace links predicted by TRACER () for UC53.
- Fill out the form, selecting one vote and inserting a comment, then submit.
- Verify the data entered and confirm the cheide. Where the data is invalid or insufficient, the system activates the use case Errored.
- Confirming the issue of feedback.
- Remember feedback and inserts the selected site in the list of sites visited. Exit conditions: The system shall notify the successful combination of feedback to the site. The Tourist cancel the operation. Interruption of the connection to the server ETOUR.
To illustrate, consider the example use case (UC53), which describes the sequence of actions a tourist performs to submit feedback about a particular site. In Fig. 6, we show the trace links associated with UC53, including both the ground-truth links and those predicted by TRACER (). The prediction results contain four TPs, two FNs, and four FPs. Inspection of the code files associated with the true positives suggests that lexical similarity plays a key role in their recovery. Specifically, these files are relatively small and contain identifiers and Javadoc comments that closely reflect the terminology and actions described in UC53. For example, IDBVisitBC and IDBVisitPR are interfaces responsible for handling feedback and declare the methods insertVisitBC and insertVisitPR, respectively, which closely correspond to the feedback insertion described in step 6 of the use case. Likewise, DBVisitPR implements the insertion of the vote and comment provided by the user in step 3, while CulturalHeritageVisitChecker defines checkDataVisitCulturalHeritage, which performs the validation process described in step 4. Since these files are relatively small (15 lines of code on average) and focused on a single responsibility, the domain-specific terms dominate their vocabulary, making the trace link recovery easier.
In contrast, the two missed ground-truth links illustrate different failure modes. On the one hand, the code file SiteTableModel contains no references to concepts such as feedback, visit, rating, or comment, making it difficult to associate UC53 with the file through lexical similarity. ControlData, on the other hand, is relevant to the requirement but devotes only a small portion of its implementation (30 out of 281 lines of code) to the visit-validation function-
³Note that not all requirements reported in Table I had ground-truth links.
ality. As a result, the traceability signal is present but diluted by unrelated functionalities.
The eTour codebase poses two challenges that affect single-agent traceability approaches differently.
First, eTour was originally documented in Italian and later translated into English for release as a benchmark. The translation is both incomplete and, in some cases, inaccurate. Residual Italian text remains in source-code comments (e.g., Listing 1 below), while other comments contain translation errors that alter the intended meaning (e.g., Listing 2 below).
if (statusConvention) {
// Check the contents dell'ArrayList so as not to return
// Null values to the caller
if (active == null)
throw new
RemoteException(ErrorMessage.
ERROR_FORMAT_BEAN);
return active;
}
Listing 1: Example of a partially untranslated source code comment: "dell'ArrayList"
/**
* Method which returns a banner given its id
*
* @Param ID pIdBanner the banner to return
* @Return Banner found in the database, null if
there is'
match
*/
public BeanBanner getBannerDaID(int pIdBanner)
throws SQLException;
Listing 2: Example of an incorrectly translated comment: A null value is returned when a match exists rather than when no match is found
Overall, inaccurate documentation has a limited impact on retrieval-based approaches such as LiSSA, as long as the relevant terms remain present, because these approaches primarily depend on lexical similarity. For example, our analysis shows that 37 of 57 use cases (65%) share implementation-oriented vocabulary with the identifiers of its linked code files, providing an advantage for retrieval-based approaches. In contrast, a single-agent approach such as TRACER is vulnerable to documentation inaccuracies, since it relies on behavioral evidence often conveyed through comments. As a result, misleading or incorrect comments may bias the model's reasoning process and negatively affect the accuracy of its traceability predictions.
Second, the codebase exhibits inconsistent naming conventions. For example, BeanTourist, DBTourist, and TouristAgencyManager all use role-informative names that convey implementation responsibilities (i.e., Bean, DB, and Manager). In contrast, Tourist.java and News.java are user-interface classes whose names are not role-informative, as they refer to domain concepts rather than their actual implementation responsibilities.
Again, retrieval-based approaches like LiSSA are largely unaffected by naming inconsistencies because they rely primarily on the broader contents of source files rather than file names. In contrast, TRACER uses file names as evidence
| Ground Truth | Predicted | |
| ViewVisitedHCPsAction.java | TP | ViewVisitedHCPsAction.java |
| PatientDAO.java | FN | — |
| PersonnelDAO.java | FN | — |
| — | FP | HCPVisitBean.java |
| — | FP | OfficeVisitDAO.java |
Fig. 7: Trace links predicted by TRACER () for UC6S1
when identifying implementation candidates. As a result, the effectiveness of LLM-based traceability approaches depends, in part, on the quality and consistency of role-informative naming conventions. When names are inconsistent or fail to accurately reflect implementation responsibilities, they can bias the model's reasoning toward irrelevant artifacts. For instance, a requirement related to tourist data may incorrectly suggest Tourist.java, despite that the class merely implements a GUI form rather than the underlying business logic.
iTrust Compared to eTour, the iTrust use cases do not follow a consistent template. They often omit explicit references to the responsible actor and rely on anaphoric expressions that require contextual interpretations across requirements. As a result, the requirements provide less explicit lexical and semantic evidence for retrieval-based approaches, such as LiSSA. At the same time, iTrust has a well-documented codebase, with Javadoc comments describing the functionality of its classes. This enables LLM-based approaches such as TRACER to compensate for the lack of detail in the requirements by leveraging information from the source code to infer the missing context and establish trace links.
To illustrate this challenge, consider the example use case UC6S1. Fig. 7 presents the trace links, both the ground-truth links and those predicted by TRACER (). The results reveal limited accuracy, with only one TP, two FNs, and two FPs. The only recovered TP, ViewVisitedHCPsAction.java, appears to be largely explained by explicit lexical cues. The implementation in this file contains concepts directly referenced in UC6S1, e.g., the HCP name, specialty, address, office-visit date, HCP designation, and the generated list of visited HCPs.
iTrust UC6S1
The LHCP's name, specialty, address, date of office visit, and whether or not the LHCP is a DLHCP for this patient is indicated. The list is sorted by the date of the last office visit.
On the other hand, the two missed trace links exhibit substantially weaker lexical and semantic overlap with the use case. Although PersonnelDAO.java is responsible for retrieving the LHCP's name, specialty, and address, the use case does not explicitly identify the entity responsible for providing this information. Furthermore, the class refers to "HCP" as Personnel which cannot be directly inferred from the use case text, and it exposes the relevant attributes (e.g., address) through a bean-loading mechanism. Similarly, PatientDAO.java implements the DLHCP check through using the concept of a DeclaredHCP, a term that is only implicitly related to the use case through the anaphoric ref-erence this patient. This semantic gap weakens the connection between the use case and the source code. In addition, PatientDAO.java contains 765 lines, spanning multiple unrelated responsibilities, which further dilutes the relevant traceability evidence.
The vocabulary needed to identify both code files is present in other use cases, namely UC6S2 and UC6S3 shown below. UC6S2, for instance, describes the designation and undesignation of an LHCP as a DLHCP, corresponding to the methods declareHCP and undeclareHCP implemented in PatientDAO.java. UC6S3 describes searching by last name and zip code, functionality implemented by searchForPersonnelWithName in PersonnelDAO.java. Although these three use cases describe complementary aspects of the same functionality, they are traced independently. Consequently, the evidence supporting the correct links is dispersed across multiple requirements in the dataset rather than being concentrated in a single use case. This illustrates the challenge of scattered requirements, where information related to a feature is fragmented across several requirements. Following this pattern, we identified 97 scattered use cases out of the total 105 use cases considered in our analysis (92%). This weakens the lexical and semantic relatedness between individual requirements and the code files that implement the feature [32].
iTrust UC6S2
The patient can choose to toggle between designating/undesignating any LHCP as being a DLHCP for them.
iTrust UC6S3
The patient types a last name or partial last name, and/or providing the specialty. The patient may optionally enter a zip code (match on first three numbers of zip code), in addition to the name and/or specialty. The LHCP's name, specialty, and address are provided.
The iTrust codebase exhibits characteristics largely opposite to those of eTour. It is written entirely in English, and 216 of its 226 classes contain Javadoc comments that describe what a method does, what its parameters mean, and what it returns. Furthermore, informative naming conventions are applied consistently throughout the codebase, with suffixes such as Action, DAO, Bean, Loader, and Validator, clearly conveying architectural roles.
These characteristics benefit single-agent approaches like TRACER, which reason directly over the source code. Generally, accurate documentation and consistent naming conventions provide stronger traceability evidence. These cues reduce ambiguity, narrow the search space, and support more effective reasoning about how requirements are implemented in the code. Retrieval-based approaches like LiSSA, however, benefit far less from these code quality aspects because its primary limitation lies in the requirements themselves rather than the implementation artifacts. Consequently, the effectiveness of retrieval-based approaches is constrained by the amount of explicit lexical evidence available in the requirements. When relevant information is missing, implicit, or distributed
| Ground Truth | Predicted |
| PlanPool.java | TP PlanPool.java |
| PlanPoolManager.java | TP PlanPoolManager.java |
| — | FP FlightZoneManager2.java |
| — | FP FlightInfo.java |
Fig. 8: Trace links predicted by TRACER () for RE28.
across multiple requirements like is the case with iTrust use cases, even well-documented and consistently named code files provide limited additional benefit. This is reflected in LiSSA (IR-Only), which achieves 53.1% recall.
Dronology Dronology sits between eTour and iTrust in terms of requirements quality. Most requirements follow a concise “shall”-style format that explicitly specifies the responsible component and describes a single behavior, providing clear lexical and semantic cues for traceability.
To illustrate, consider requirement RE28, together with its ground-truth and predicted trace links presented in Fig. 8.
Dronology RE28
[SUMMARY] UAV Flight Plan Execution
[DESCRIPTION] The SingleUAVFlightPlanScheduler shall only execute one flight plan at a time for each UAV.
Here, once again, we consider the predictions generated by TRACER (). The results contain two TPs, no FNs, and two FPs. Both ground-truth links are recovered primarily through strong lexical and semantic alignment between the requirement and the implementation artifacts. Specifically, the requirement provides three traceability cues: (i) the component name SingleUAVFlightPlanScheduler, for which no corresponding class exists in the codebase; (ii) the constraint that only one flight plan may be executed at a time; and (iii) the quantifier each UAV.
Inspection of the implementation reveals strong correspondence between these cues and the associated code files. The PlanPool class is documented as managing “pending, executing, and completed plans for a single UAV”, and contains the only occurrence of the phrase single UAV in the codebase. Furthermore, it maintains a single currentPlan and provides methods such as addPlan and setNextPlanToCurrent, directly reflecting the requirement’s scheduling constraint. Similarly, PlanPoolManager maintains a PlanPool for “each active UAV” and organizes plans by UAV identifier. The requirement is therefore largely restated in the implementation vocabulary, making retrieval more straightforward without minimal reasoning over the code files. This example illustrates how explicit correspondence between requirement terminology and implementation concepts can substantially simplify traceability link recovery.
A small subset of the Dronology requirements (4 out of 56) omits the responsible component and specifies only a system-wide data constraint. As a result, these requirements are implemented across many classes, producing an unusually large number of trace links. This suggests that cross-cutting requirements are intrinsically more challenging to trace than
| Ground Truth | Predicted | |
|---|---|---|
| Waypoint.java | TP | Waypoint.java |
| LlaCoordinate.java | TP | LlaCoordinate.java |
| AbstractPosition.java,FlightRoute.java,FlightPlan.java,ManagedDrone.java,NvecInterpolator.java, FN —GoToCommand.java,DronologyConstants.java,DummyLockObject.java,... and 64 additional classes |
Fig. 9: Trace links predicted by TRACER () for RE77.
requirements describing localized behavior, since the relevant implementation evidence is scattered across multiple artifacts. Consequently, these requirements can have a disproportionate impact on aggregate performance metrics.
Dronology RE77
[SUMMARY] Waypoint definition [DESCRIPTION] Each waypoint shall be specified using coordinates that include longitude latitude and altitude.
To illustrate this challenge, consider the example requirement RE77 and the corresponding trace links in Fig. 9.
Unlike RE28, RE77 does not specify a responsible component; instead, it defines only a system-wide data constraint. Although relevant vocabulary is still present in the codebase, it is concentrated in only a small subset of the implementation artifacts. For example, LlaCoordinate is documented as “a terrestrial position defined by latitude, longitude, and altitude” and declares exactly those three fields. Likewise, Waypoint is documented as representing coordinates using LlaCoordinate. These explicit correspondences enable TRACER to correctly recover both code files as valid trace links. However, the remaining ground-truth links are associated with classes that realize the constraint only indirectly. As a result, requirement RE77 provides limited evidence for identifying the full implementation scope, yielding only two TPs and 74 FNs out of 184 code files. The presence of four similarly underspecified requirements in Dronology helps explain the lower overall performance observed on this dataset.
This example highlights that requirements specifying generic data constraints often provide only weak evidence for the numerous artifacts that collectively implement those constraints.
While is conservative, a more recall-oriented prompt like is particularly beneficial in these cases. As shown in Fig. 10, using a more recall-oriented prompt () recovers many additional links for RE77, including classes whose relevance is evident only from their implementation rather than by their file naming or documentation.
For example, GoToCommand.java never references a waypoint in its documentation, yet its constructor decomposes a coordinate into the required x, y, and z components. Similarly, VirtualDrone.java does not mention waypoints, but it manages UAV positions through methods such as setCoordinates(latitude, longitude,
| Ground Truth | Predicted | |
|---|---|---|
| Waypoint.java | TP | Waypoint.java |
| LlaCoordinate.java | TP | LlaCoordinate.java |
| AbstractPosition.java,FlightRoute.java,FlightPlan.java,ManagedDrone.java,VirtualDrone.java,GoToCommand.java,... and 20 additional classes | TP | AbstractPosition.java,NvecInterpolator.java,FlightRoute.java,FlightRouteInfo.java,IFlightRoute.java,FlightPlan.java,FlightPlanFactory.java,FlightPlanInfo.java,IFlightPlan.java,FlightInfoCreator.java,SoloDirector.java,ManagedDrone.java,VirtualDrone.java,PhysicalDrone.java,GoToCommand.java,... and 11 additional classes |
| DronologyConstants.java,DummyLockObject.java,... and 46 additional classes | FN | — |
| — | FP | FlightRouteInfo.java,IFlightRoute.java,FlightPlanFactory.java,FlightPlanInfo.java,IFlightPlan.java,FlightInfoCreator.java,SoloDirector.java,PhysicalDrone.java,FlightZoneManager2.java,DronologyPersistenceUtil.java... and 16 additional classes |
Fig. 10: Trace links predicted by TRACER () for RE77.
altitude). Recovering these links therefore requires reasoning about the functionality implemented by the code rather than relying on explicit terminology in class names or documentation. The more permissive prompt encourages such reasoning, enabling the recovery of links supported only by implicit evidence, whereas tends to discard such candidates because the requirement provides only limited lexical and semantic cues. The difference in recall supports this finding: R=25.7% for compared to R=69.7% for .
The Dronology codebase shares more characteristics with iTrust rather than eTour. It is written entirely in English and employs consistent naming conventions: 30 interfaces carry the prefix I, and suffixes such as Service, Manager and Command clearly indicate the architectural responsibilities, with 120 of its 184 classes adhering to these role-informative naming conventions. Although documentation is less comprehensive than in iTrust, with only 92 (out of 184) classes containing class-level comments, this limitation is partially mitigated by the descriptive nature of the identifiers used throughout the codebase. As a result, behavioral and architectural information is often conveyed directly through class, method, and field names rather than through documentation. Even undocumented classes, such as FlightInfo, remain largely self-descriptive through names such as currentFlight, pending, completed, and addPending, which provide strong cues about their responsibilities and behavior.
Dronology is therefore the only dataset in which the code artifacts consistently provide high-quality traceability evidence, while the requirements are comparatively less informative. In particular, requirements often refer to conceptual components, such as SingleUAVFlightPlanScheduler, that have no direct implementation artifact. As a result, the terminology used in the requirements does not always align with the vocabulary of the codebase, weakening the lexical correspondence on which retrieval-based approaches depend. This challenge is reflected in LiSSA's performance, with the IR-only variant achieving a recall of only 44.8%.
In Dronology, after excluding underspecified requirements, 53 requirements (93%) can be traced because of the explicit naming information provided in the requirements, while the remaining four requirements (7%) are underspecified and therefore associated with a large number of trace links.
Key takeaway: The qualitative analysis suggests that the effectiveness of traceability approaches depends largely on where the most informative traceability evidence resides.
Retrieval-based approaches perform best when requirements contain explicit implementation-oriented terminology that closely aligns with the vocabulary of the codebase. This explains LiSSA's strong performance on eTour, where requirements exhibit substantial lexical overlap with the corresponding implementation artifacts.
In contrast, single-agent approaches that reason over the entire codebase benefit most from high-quality implementation artifacts, including accurate documentation, consistent role-informative naming conventions, and descriptive identifiers. This explains TRACER's superior performance on iTrust and Dronology, where the codebase provides rich behavioral and architectural evidence. By reasoning directly over source code, TRACER can exploit information that is only implicitly related to the requirement and therefore remains inaccessible to purely retrieval-based methods.
Overall, the results indicate that retrieval-based approaches are primarily constrained by requirement quality, whereas code-centric LLM-based approaches are primarily influenced by code quality. Consequently, TRACER is more resilient to requirement quality issues such as anaphoric references, omitted actors, scattered requirements, and conceptual components that lack direct implementation counterparts, provided that the corresponding evidence is available in the codebase.
B. Qualitative Comparison of Single- and Multi-Agent Approaches
The choice between single-agent and multi-agent approaches ultimately depends on the analyst's validation budget and available computational resources. In the following, we qualitatively analyzed a subset of 55 use cases out of the total 105 from iTrust (42%) to better understand the impact of multi-agent reasoning by analyzing the output of TRACER () compared to DEBATER (), as well as the contribution of the selected prompt by comparing DEBATER () against DEBATER (). To illustrate this process, we consider use case UC26S2 from iTrust, shown below along with its six associated ground-truth code files.
| Ground Truth | Predicted | |
|---|---|---|
| LabProcedureDAO | TP | LabProcedureDAO |
| GetUserNameAction | FN | — |
| AuthDAO.java | FN | — |
| LabProcUAPAction | FN | — |
| EditPatientAction | FN | — |
| PatientDAO | FN | — |
| — | FP | EditOfficeVisitAction |
| — | FP | LabProcedureBean |
| — | FP | LabProcedureBeanLoader |
| — | FP | OfficeVisitDAO |
Fig. 11: TRACER () predicted files (.java) for UC26S2.
| iTrust UC26S2 |
|---|
| An HCP can view a previously created lab procedure for a given office visit. The HCP can view patient name, lab procedure code, current lab procedure status, timestamp, and Lab Technician name. |
Fig. 11 shows the trace links recovered by TRACER (). TRACER recovers only one correct link for UC26S2, namely LabProcedureDAO.java. This is also the only code file whose documentation restates the use case text. Consequently, establishing this link requires limited reasoning beyond straightforward lexical matching between the use case and the code documentation.
The five missed code files do not contain documentation that explicitly uses the same vocabulary as the use case. For instance, the attributes patient name and Lab Technician name are not stored by the lab procedure itself, which retains only the numeric identifiers pid and ovID; the corresponding names must therefore be obtained through a separate lookup. This functionality is implemented in GetUserNameAction.java and AuthDAO.java, whose documentation refers only to a person's name or a user name and never mentions lab procedures, office visits, or HCPs. Identifying these code files as candidate links requires reasoning about how the displayed attributes are retrieved rather than matching the terminology used in the use case. Moreover, this relationship can only be inferred by combining information across multiple code files.
A similar issue arises with LabProcUAPAction.java. Although its documentation mentions lab procedure, it is written for UAPs rather than the HCPs referenced in the use case. Thus, the file appears both relevant and irrelevant at the same time. TRACER cannot reconcile these conflicting cues in a single-pass decision.
Fig. 12 presents the trace links predicted by DEBATER (). In addition to recovering LabProcedureDAO.java (identified by TRACER), DEBATER correctly recovers two more ground-truth code files: LabProcUAPAction.java and AuthDAO.java. Neither file restates the use case as directly as LabProcedureDAO.java, and each is missed by TRACER for a different reason as explained earlier. In both cases, however, the necessary evidence is present in the code and documentation, albeit in a weaker and less explicit form.
| Ground Truth | Predicted |
|---|---|
| LabProcedureDAO | TP LabProcedureDAO |
| LabProcUAPAction | TP LabProcUAPAction |
| AuthDAO | TP AuthDAO |
| GetUserNameAction | FN — |
| PatientDAO | FN — |
| EditPatientAction | FN — |
| — | FP EditOfficeVisitAction |
| — | FP LabProcedureBean |
| — | FP LabProcedureBeanLoader |
| — | FP OfficeVisitBaseAction |
| — | FP PersonnelDAO |
Fig. 12: DEBATER () predicted files (. java) for UC26S2.
LabProcUAPAction.java shares several key concepts with the use case. It declares a LabProcedureDAO field, and its viewProcedures (id) method is documented as returning “a list of all the lab procedures for that UAP.” The main source of ambiguity is the role qualifier UAP, which differs from the HCP referenced in the use case. As a result, the file contains both supporting and conflicting signals. Unlike TRACER, DEBATER revisits the candidate after establishing the supporting evidence, allowing the role conflict to be interpreted in the broader implementation context.
AuthDAO.java presents the opposite challenge. Its documentation contains no vocabulary related to lab procedures and instead describes the class as being “for anything that has to do with authentication”, making it more unlikely to be selected by a single-pass tracing approach. Its relevance stems from a single method getUserName (mid), which is documented as returning “the user name of a user from just the MID”. This method becomes important when examining how the information required by the use case is obtained. Two of the five attributes listed in the use case, patient name and Lab Technician name, are not stored directly in the lab procedure record. Instead, the record stores only numeric identifiers, while the remaining attributes, namely the procedure code, status, and timestamp, are available directly. Consequently, displaying the two names requires resolving identifiers into user names, and getUserName (mid) provides exactly this functionality. Although the connection is indirect and not expressed through shared terminology, the method is necessary for implementing the behavior described by the use case.
DEBATER () applies the same debate-and-correction strategy as DEBATER with and recovers the same three links, LabProcedureDAO.java, LabProcUAPAction.java and AuthDAO.java, for essentially the same reasons. In addition, it identifies PatientDAO.java. This file exhibits no lexical overlap with the use case: its documentation states that it manages “all static information related to a patient” and contains no references to lab procedures, office visits or HCPs. Thus, neither its documentation nor its comments suggest the behavior required by its use case. However, the class provides the method getName (mid), which is documented to return “the patient’s first name and last name”
| Ground Truth | Predicted |
|---|---|
| LabProcedureDAO | TP LabProcedureDAO |
| LabProcUAPAction | TP LabProcUAPAction |
| AuthDAO | TP AuthDAO |
| PatientDAO | TP PatientDAO |
| GetUserNameAction | FN — |
| EditPatientAction | FN — |
| — | FP EditOfficeVisitAction |
| — | FP LabProcedureBean |
| — | FP LabProcedureBeanLoader |
| — | FP LOINCDAO |
| — | FP LOINCbean |
| — | FP LOINCBeanLoader |
| — | FP OfficeVisitBaseAction |
| — | FP OfficeVisitDAO |
| — | FP OfficeVisitBean |
| — | FP PersonnelDAO |
| — | FP DAOFactory |
| — | FP TransactionType |
Fig. 13: DEBATER () predicted files (. java) for UC26S2.
for a given MID. This method performs the actual name lookup that AuthDAO.getUserName(mid) delegates to after determining that the identifier belongs to a patient.
The additional link is recovered because the more recall-oriented prompt admits candidates whose relationship to the use case is indirect and observable only through the call dependencies rather than lexical evidence. Although this broader search space enables the discovery of PatientDAO.java, it also increases the number of files predicted for UC26S2 from eight to sixteen.
Out of the 55 iTrust use cases analyzed, DEBATER () recovered ground-truth links missed by TRACER () in 12 cases (21.8%), while DEBATER () recovered additional links missed by DEBATER () in eight cases (14.5%).
Key takeaway: In the cases we examined, the three configurations differ in the kind of code evidence they can exploit. Single-agents with a conservative prompt, like TRACER (), reliably recover links when the relevance of a code file is explicit, such as through documentation or identifiers that closely match the use case. However, they often miss files whose relevance must be inferred, e.g., when the supporting cues are contradictory or confined to a single method within an otherwise unrelated class. Using the same prompt, multi-agent DEBATER () recovers some of these links, because the trace debater agent revisits files rejected in the initial round, allowing weak or conflicting evidence to be reconsidered before the judge agent decides. With the recall-oriented prompt (), DEBATER additionally recovers links whose relevance is not documented but emerges from the implementation itself, e.g., through method-level dependencies and delegated calls that resolve identifiers across classes. Relaxing the prompt can partially enable this behavior in a single agent setting, as observed in the case of Dronology, where TRACER () recovered code files that do not mention the requirement's terminology. Each step toward weaker evidence, however, admits more false positives. For example, moving from DE-BATER ( ) to DEBATER ( ) recovers one additional true link for UC26S2 in iTrust, but also doubles the number of predicted files, from eight to sixteen. Some links remain unrecovered by all configurations, indicating cases where the available evidence is insufficient even under more permissive reasoning.
VI. RELATED WORK
Traditionally, TLR has been studied through two main paradigms: (i) information retrieval, which establishes trace links using semantic similarity metrics and lexical overlap [34]–[37]; and (ii) machine learning, where supervised models are trained on traceability datasets to predict trace links [38]–[43]. However, these approaches often struggle to capture rich relationships among heterogeneous software artifacts and typically rely on costly, manually labeled data. Recent advances in LLMs have reshaped TLR research by enabling more effective reasoning across heterogeneous software artifacts (e.g., natural-language requirements and source code). Beyond single-agent prompting, multi-agent approaches, in which several LLM-based agents with distinct roles collaborate on a task, have emerged as a promising way to address complex software engineering problems. In the following, we position our work with respect to emerging LLM-supported requirement-to-code traceability.
LLMs for Traceability. With the exception of a few studies on supervised fine-tuning of LLMs (e.g., [44]), most existing research relies on prompt engineering and retrieval-augmented generation (RAG). Prior work investigates both manual prompt engineering [45], [46] and automated prompt optimization [47], [48] for identifying trace links across software artifacts. Complementary studies leverage established prompting frameworks and templates to structure traceability analysis [23], [49]. The literature also emphasizes the sensitivity of prompt-based approaches: small wording changes can substantially alter the produced trace links, making performance depend not only on model capabilities but also on prompt quality, whose impact is difficult to assess without extensive empirical evaluation. [45], [48].
Because prompts must often include the artifacts under analysis along with task instructions, they can consume a large fraction of the available context window . To mitigate this limitation, existing work adopts RAG, which first retrieves a small set of relevant target artifacts and then applies LLM-based reasoning only to those candidates [50]. For instance, Huang et al. [9] retrieve and rerank candidate commits for issue-to-commit traceability; Ali et al. [10] combine retrieval, dependency information, and LLM reasoning for requirements-to-code traceability; and Fuchß et al. [22] propose LiSSA, a generic RAG-based approach applicable across artifact types (discussed in Section IV-B). In a follow-up study on inter-requirement TLR, Fuchß et al. [11] replace LiSSA's retrieval
step with an ensemble of small LLMs that incrementally filters out unrelated requirement pairs before passing the remaining candidates to an LLM classifier for final trace-link prediction.
Despite their differences, these approaches share a key limitation: they judge trace links pairwise. In the requirement-to-code traceability setting considered here, each code file is assessed largely in isolation from the rest of the codebase. This is evident in explicit classification pipelines, where an LLM predicts one requirement–code pair at a time [11]. The same limitation applies to RAG-based methods, where retrieval ranks each code file by its individual similarity to the requirement [9], [10]. Yet requirements are rarely realized by a single code file. Instead, their behavior emerges from collaborating classes, many of which resemble the requirement only weakly when inspected in isolation. Contextual information is required to better understand the contribution of a file to the overall implementation to identify trace links more accurately. Such contextual information is exactly what pairwise approaches discard.
Our work takes a different approach: we provide the LLM with both the requirement and the full codebase. Rather than reasoning over isolated files or a small set of retrieved candidates, the model can consider the repository as a whole and leverage structural and contextual relationships among files. To attribute any improvement to full-code context rather than prompt design, we use two zero-shot prompts from prior work and apply both to our approach and to the retrieval-based baseline, with the same model. The first is the chain-of-thought prompt of the baseline [22]. The second adds a single instruction to it: to prioritize recall over precision, following Etezadi et al. [23], who included this instruction in their engineered traceability prompt because rejecting false positives costs analysts less effort than finding missed links. Our approach and the baseline thus differ only in their input (Section IV).
LLM-based Multi-agent Approaches in Software Engineering. Multi-agent systems have a long history in software engineering research. Early work, e.g., [51]–[53] treated agents as the software systems being engineered. In contrast, recent LLM-based multi-agent approaches use agents as a mechanism for performing software engineering tasks. Building on this foundation, LLM-based multi-agent approaches have been applied to various tasks, including code generation [54]–[56], code review [57], and issue resolution [58], [59].
The use of multi-agents for traceability remains largely underexplored. A notable exception is TraceDev by Chen et al. [60], which integrates traceability into multi-agent code generation. TraceDev generates repository-level code from use cases using five agents: a requirement refiner, a designer producing Unified Modeling Language (UML) class and sequence diagrams; a developer; a tester; and a validator. The validator links requirements to design elements via an LLM, and links design elements to code by checking whether the specified classes and methods are defined or invoked in the generated code. Missing links are fed back to the designer and developer for refinement. Although TraceDev has been evaluated on the eTour and SMOS traceability datasets, its goal is to generate new code rather than recover trace links in
While recent LLMs support substantially larger context windows, this constraint was a significant limitation in earlier models and can still pose challenges for large software artifacts.
an existing codebase; accordingly, it assesses generated-code quality rather than trace-link accuracy.
Our work examines two multi-agent approaches for trace-link recovery. The first builds on self-correction, in which an LLM iteratively refines its output based on feedback [58], [61]. In particular, we draw on Reflexion by Shinn et al. [24], where an agent reflects on feedback from failed attempts and uses these reflections to guide subsequent attempts.
The closest related work is R2Code by Wang et al. [12], which adds self-verification to requirements-to-code trace-link recovery. An LLM first summarizes each code unit, then retrieves candidates for each requirement whose term overlap with the summary exceeds a threshold. Next, it decomposes the requirement and each candidate into semantic layers and scores their alignment pairwise. Finally, it explains each predicted link, and a second LLM call checks whether this explanation is consistent with the requirement, calibrating the link's confidence. Like our work, R2Code takes a requirement and the entire codebase as input. However, its filtering step resembles RAG-based approaches such as LiSSA: code files that are essential for understanding how a requirement is implemented may be discarded early. Moreover, errors introduced at each step propagate to the next without any opportunity for correction, and the final self-verification only adjusts confidence scores; it cannot revise predicted links.
In contrast, our first approach lets the LLM reason directly over code files rather than over intermediate summaries and semantic layers, and it does not filter out candidates in advance. Furthermore, we employ a self-correction loop in which a generator proposes trace links, a critic examines them, and an author revises them based on the critic's feedback. Errors in proposed links can thus be corrected before they reach the final output, although links missed by the generator cannot be recovered. Our second approach uses a multi-agent debate (MAD) framework [25], in which agents argue opposing viewpoints before a judge decides. The framework has been shown to effectively classify requirements as functional or non-functional, but it has not been applied to traceability. In our work, we adapt MAD to requirements-to-code traceability.
VII. CONCLUSION
In this paper, we have revisited requirements-to-code traceability in light of the large context windows offered by modern LLMs. Existing approaches rely on a retrieval-and-classification pipeline, so they cannot recover relevant code files that the retrieval step misses; on our benchmarks, retrieval alone caps achievable recall at 59.5% on average. To address this bottleneck, we have proposed three approaches: TRACER, a single-agent approach that reasons over the entire code repository in one pass, and two multi-agent approaches based on self-correction (CORRECTOR) and multi-agent debate (DEBATER).
Our evaluation on three benchmark datasets shows that repository-level reasoning substantially improves the coverage of true trace links. With a recall-oriented prompt, TRACER achieves the highest average recall (80.9%), 38.6pp above the retrieval-based state-of-the-art, and exceeds the retriever's
recall ceiling on every dataset. This gain comes at a significant cost in precision (17.8% vs. 43.6%), increasing the share of candidate links an analyst must inspect from 1.5–4.7% to 7.2–17.0%. Multi-agent validation recovers part of this precision. CORRECTOR removes many false positives but also discards true links and cannot recover links missed in the initial pass. DEBATER achieves the highest F2 scores among all approaches (50.8% with the conservative prompt and 49.5% with the recall-oriented prompt). The latter configuration offers the best balance between validation effort and coverage of true links: it reaches 71.0% recall, improves F2 by 8.0 and 3.2 percentage points over the state-of-the-art and TRACER, respectively, and reduces the number of links to validate by about 30% relative to TRACER on eTour and iTrust, though with a larger recall loss on Dronology. Across all approaches, the choice of prompt shifts the precision-recall balance as strongly as the choice of architecture.
Our qualitative analysis shows that the effectiveness of each approach depends on where traceability evidence resides. Retrieval-based approaches are primarily constrained by the quality of requirements, whereas approaches that reason over the full codebase are influenced by code quality, such as documentation and naming conventions. TRACER excels when trace evidence is explicit, whereas DEBATER is more effective when evidence is indirect, conflicting, or distributed across the implementation. These findings provide practical guidance on which approach to choose depending on the characteristics of the artifacts and the available validation budget.
In future work, we plan to evaluate our approaches on larger industrial repositories, including ones that exceed the context window, across multiple models and programming languages, and to investigate how they can be integrated into development workflows involving AI coding agents.
ACKNOWLEDGMENT
This research was funded in part by the Luxembourg National Research Fund (FNR), under grant number C23/IS/17958091/PLAITO. Lionel Briand was funded by the Discovery Grant program of the Natural Sciences and Engineering Research Council of Canada (NSERC) and the Research Ireland grant 13/RC/209.
REFERENCES
[1] J. Cleland-Huang, O. C. Gotel, J. Huffman Hayes, P. Mäder, and A. Zisman, "Software traceability: trends and future directions," in Future of software engineering proceedings, 2014, doi: 10.1145/2593882.2593891.
[2] C. Qian, W. Liu, H. Liu, N. Chen, Y. Dang, J. Li, C. Yang, W. Chen, Y. Su, X. Cong et al., "Chatdev: Communicative agents for software development," in Proceedings of the 62nd annual meeting of the association for computational linguistics (volume 1: Long papers), 2024, doi: 10.48550/arXiv.2307.07924.
[3] D. Leith, "Between the commits: Process, error, and claim reliability in a wholly ai-authored codebase," 2026, doi: 10.48550/arXiv.2609.29744.
[4] A. Velasco, N. Wintersgill, T. Stalnaker, O. Chaparro, and D. Poshy-vanyk, "On automated and explainable provenance of ai-generated code," 2026, doi: 10.48550/arXiv.2608.02329.
[5] J. Gong, G. Pinna, Y. Bian, and J. M. Zhang, "Analyzing message-code inconsistency in ai coding agent-authored pull requests," in Proceedings of the 23rd International Conference on Mining Software Repositories, 2026, doi: 10.1145/3793302.3793583.
[6] A. Veizaga, S. Y. Shin, and L. C. Briand, “Automated smell detection and recommendation in natural language requirements,” IEEE Trans. Softw. Eng., vol. 50, no. 4, 2024, doi: 10.1109/TSE.2024.3361033.
[7] Center of Excellence for Software & Systems Traceability (Co-EST), “Coest datasets,” http://sarec.nd.edu/coest/datasets.html, doi: 10.5281/zenodo.7867845.
[8] H. Gao, H. Kuang, W. K. G. Assunção, C. Mayr-Dorn, G. Rong, H. Zhang, X. Ma, and A. Egyed, “TRIAD: Automated traceability recovery based on bitern-enhanced deduction of transitive links among artifacts,” in Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, 2024, doi: 10.1145/3597503.3639164.
[9] H. Huang, R. Widyasari, T. Zhang, I. C. Irsan, J. Shi, H. W. Ang, F. Liaw, E. L. Ouh, L. K. Shar, H. J. Kang et al., “Back to the basics: Rethinking issue-commit linking with llm-assisted retrieval,” in Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering, 2026, doi: 10.1145/3744916.3764530.
[10] S. J. Ali, V. Naganathan, and D. Bork, “Establishing traceability between natural language requirements and software artifacts by combining rag and llms,” in International Conference on Conceptual Modeling, 2024, doi: 10.1007/978-3-031-75872-0_16.
[11] D. Fuchb, S. Schwedt, J. Keim, and T. Hey, “Beyond retrieval: A study of using llm ensembles for candidate filtering in requirements traceability,” in 2025 IEEE 33rd International Requirements Engineering Conference Workshops (REW), 2025, doi: 10.1109/REW66121.2025.00006.
[12] Y. Wang, J. Keung, X. Ma, Z. Mao, K. Chen, and Y. Li, “R2code: A self-reflective llm framework for requirements-to-code traceability,” in 2026 IEEE 50th Annual Computers, Software, and Applications Conference (COMPSAC), 2026, doi: 10.1109/COMPSAC69091.2026.00057.
[13] M. Gao, Y. Li, B. Liu, Y. Yu, P. Wang, C.-Y. Lin, and F. Lai, “Single-agent or multi-agent systems? why not both?” 2025, doi: 10.48550/arXiv.2505.18286.
[14] T. Liang, Z. He, W. Jiao, X. Wang, Y. Wang, R. Wang, Y. Yang, S. Shi, and Z. Tu, “Encouraging divergent thinking in large language models through multi-agent debate,” in Proceedings of the 2024 conference on empirical methods in natural language processing, 2024, doi: 10.18653/v1/2024.emnlp-main.992.
[15] Y. Du, S. Li, A. Torralba, J. B. Tenenbaum, and I. Mordatch, “Improving factuality and reasoning in language models through multiagent debate,” in Proceedings of the 41st International Conference on Machine Learning (ICML), 2024, doi: 10.48550/arXiv.2305.14325.
[16] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, E. Kaiser, and I. Polosukhin, “Attention is all you need,” in Proceedings of the 31st International Conference on Neural Information Processing Systems, 2017. [Online]. Available: https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c14ca485aa-Abstract.html
[17] S. Schulhoff, M. Ilie, N. Kalepur, K. Kahadze, A. Liu, C. Si, Y. Li, A. Gupta, H. Han, S. Schulhoff et al., “The prompt report: a systematic survey of prompt engineering techniques,” 2025, doi: 10.48550/arXiv.2406.06608.
[18] J. Alammar and M. Grootendorst, Hands-on large language models: language understanding and generation. "O'Reilly Media, Inc., 2024.
[19] W. Fan, Y. Ding, L. Ning, S. Wang, H. Li, D. Yin, T.-S. Chua, and Q. Li, “A survey on rag meeting llms: Towards retrieval-augmented large language models,” in Proceedings of the 30th ACM SIGKDD conference on knowledge discovery and data mining, 2024, doi: 10.1145/3637528.3671470.
[20] J. Liu, D. Zhu, Z. Bai, Y. He, H. Liao, H. Que, Z. Wang, C. Zhang, G. Zhang, J. Zhang et al., “A comprehensive survey on long context language modeling,” arXiv preprint arXiv:2503.17407, 2025, doi: 10.48550/arXiv.2503.17407.
[21] T. Guo, X. Chen, Y. Wang, R. Chang, S. Pei, N. V. Chawla, O. Wiest, and X. Zhang, “Large language model based multi-agents: A survey of progress and challenges,” in Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence (ICSE), 2025, doi: 10.24963/ijcai.2024/890.
[22] D. Fuchb, T. Hey, J. Keim, H. Liu, N. Ewald, T. Thirolf, and A. Koziolek, “Lissa: Toward generic traceability link recovery through retrieval-augmented generation,” in 47th IEEE/ACM International Conference on Software Engineering (ICSE), 2025, doi: 10.1109/ICSE55347.2025.00186.
[23] R. Etezadi, S. Abualhajia, C. Arora, and L. Briand, “Classifier or prompt: A case study on legal requirements traceability,” Empirical Software Engineering, vol. 31, no. 4, 2026, doi: https://doi.org/10.1007/s10664-026-10827-1.
[24] N. Shinn, F. Cassano, A. Gopinath, K. Narasimhan, and S. Yao, “Reflexion: Language agents with verbal reinforcement learning,” in
Proceedings of the 37th International Conference on Neural Information Processing Systems, 2023, doi: 10.52202/075280-0377.
[25] M. Oriol, Q. Motger, J. Marco, and X. Franch, “Multi-agent debate strategies to enhance requirements engineering with large language models,” in 2025 IEEE 33rd International Requirements Engineering Conference (RE), 2025, doi: 10.1109/RE63999.2025.00063.
[26] J. Cleland-Huang, M. Vierhauser, and S. Bayley, “Dronology: An incubator for cyber-physical systems research,” in 2018 IEEE/ACM 40th International Conference on Software Engineering: New Ideas and Emerging Technologies Results (ICSE-NIER), 2018, doi: 10.1145/3183399.3183408.
[27] D. M. Berry, “Empirical evaluation of tools for hairy requirements engineering tasks,” Empirical Software Engineering, vol. 26, no. 6, 2021, doi: 10.1007/s10664-021-09986-0.
[28] R. Etezadi, S. Abualhajia, C. Arora, and L. Briand, “Llm-driven cost-effective requirements change impact analysis,” ACM Trans. Softw. Eng. Methodol., 2026, doi: 10.1145/3844507.
[29] LangChain Team, “Langgraph overview,” https://docs.langchain.com/oss/python/langgraph/overview, 2024, version 1.2.2.
[30] OpenAI, “Openai api documentation,” https://platform.openai.com/docs, 2024, accessed:2026-11-01.
[31] S. Baltes, F. Angermeir, C. Arora, M. M. Barón, C. Chen, L. Böhme, F. Calefato, N. Ernst, D. Fallessi, B. Fitzgerald, D. Fucci, J. He, C. Treude, M. Kalinowski, S. Lambiase, D. Russo, M. Lungu, C. M. Montes, L. Prechelt, P. Ralph, R. van Tonder, and S. Wagner, “Guidelines for empirical studies in software engineering involving large language models,” Empirical software engineering, 2026, doi: 10.1007/s10664-026-10922-3.
[32] T. Hey and J. Frattini, “How requirements quality makes (or breaks) traceability link recovery,” in 2026 IEEE 34th International Requirements Engineering Conference (RE), 2026, doi: 10.1109/RE68928.2026.00014.
[33] J. Frattini, L. Montgomery, J. Fischbach, M. Unterkalmsteiner, D. Mendez, and D. Fucci, “A live extensible ontology of quality factors for textual requirements,” in 2022 IEEE 30th international requirements engineering conference (RE), 2022, doi: 10.1109/RE54965.2022.00041.
[34] G. Antoniol, G. Canfora, G. Casazza, A. De Lucia, and E. Merlo, “Recovering traceability links between code and documentation,” IEEE transactions on software engineering, 2002, doi: 10.1109/TSE.2002.1041053.
[35] J. Cleland-Huang, C. K. Chang, and M. Christensen, “Event-based traceability for managing evolutionary change,” IEEE Transactions on Software Engineering, vol. 29, no. 9, 2003, doi: 10.1109/TSE.2003.1232285.
[36] A. Marcus and J. I. Maletic, “Recovering documentation-to-source-code traceability links using latent semantic indexing,” in 25th International Conference on Software Engineering, 2003. Proceedings., 2003, doi: 10.1109/ICSE.2003.1201194.
[37] M. Borg, P. Runeson, and A. Ardö, “Recovering from a decade: a systematic mapping of information retrieval approaches to software traceability,” Empirical Software Engineering, vol. 19, no. 6, 2014, doi: 10.1007/s10664-013-9255-y.
[38] J. H. Hayes, A. Dekhtyar, and S. K. Sundaram, “Advancing candidate link generation for requirements tracing: The study of methods,” IEEE Transactions on Software Engineering, vol. 32, no. 1, 2006, doi: 10.1109/TSE.2006.3.
[39] M. Gethers, R. Oliveto, D. Poshyvanyk, and A. De Lucia, “On integrating orthogonal information retrieval methods to improve traceability recovery,” in 2011 27th IEEE International Conference on Software Maintenance (ICSM), 2011, doi: 10.1109/ICSM.2011.6080780.
[40] Z. Shaukat, R. Naseem, and M. Zubair, “A dataset for software requirements risk prediction,” in 2018 IEEE International Conference on Computational Science and Engineering (CSE), 2018, doi: 10.1109/CSE.2018.00022.
[41] C. Mills, J. Escobar-Avila, and S. Haiduc, “Automatic traceability maintenance via machine learning classification,” in 2018 IEEE international conference on software maintenance and evolution (ICSME), 2018, doi: 10.1109/ICSME.2018.00045.
[42] J. Guo, J. Cheng, and J. Cleland-Huang, “Semantically enhanced software traceability using deep learning techniques,” in 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE), 2017, doi: 10.1109/ICSE.2017.9.
[43] R. Rasiman, F. Dalpiaz, and S. España, “How effective is automated trace link recovery in model-driven development?” in Requirements Engineering: Foundation for Software Quality: 28th International Working Conference, REFSQ 2022, Birmingham, UK, March 21-24, 2022, Proceedings, 2022, doi: 10.1007/978-3-030-98464-9_4.
[44] C. Ge, T. Wang, X. Yang, and C. Treude, “Cross-level requirements tracing based on large language models,” IEEE Transactions on Software Engineering, vol. 51, no. 7, 2025, doi: 10.1109/TSE.2025.3572094.
[45] A. D. Rodriguez, K. R. Dearstyne, and J. Cleland-Huang, “Prompts matter: Insights and strategies for prompt engineering in automated software traceability,” in 2023 IEEE 31st International Requirements Engineering Conference Workshops (REW), 2023, doi: 10.1109/REW57809.2023.00087.
[46] J. Hassine, “An llm-based approach to recover traceability links between security requirements and goal models,” in Proceedings of the 28th international conference on evaluation and assessment in software engineering, 2024, doi: 10.1145/3661167.3661261.
[47] M. North, A. Atapour-Abarghouei, and N. Bencomo, “Code gradients: Towards automated traceability of llm-generated code,” in 2024 IEEE 32nd International Requirements Engineering Conference (RE), 2024, doi: 10.1109/RE59067.2024.00038.
[48] N. Alturayeif, I. Ahmad, and J. Hassine, “Tracellm: Leveraging large language models with prompt engineering for enhanced requirements traceability,” Reqir. Eng., vol. 31, no. 1, 2026, doi: 10.1007/s00766-026-00460-1.
[49] A. Vogelsang, A. Korn, G. Broccia, A. Ferrari, J. Fischbach, and C. Arora, “On the impact of requirements smells in prompts: The case of automated traceability,” in 2025 IEEE/ACM 47th International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER), 2025, doi: 10.1109/ICSE-NIER66352.2025.00016.
[50] F. Wang, X. Xi, Z. Cui, H. Dai, and X. Wang, “Embedding traceability in large language model code generation: Towards trustworthy ai-augmented software engineering,” in Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering, ser. FSE Companion '25, 2025, doi: 10.1145/3696630.3730569.
[51] M. Wooldridge, N. R. Jennings, and D. Kinny, “The gaia methodology for agent-oriented analysis and design,” Autonomous Agents and multi-agent systems, vol. 3, no. 3, 2000, doi: 10.1023/A:1010071910869.
[52] S. A. DeLoach, M. F. Wood, and C. H. Sparkman, “Multiagent systems engineering,” International Journal of Software Engineering and Knowledge Engineering, vol. 11, no. 03, 2001, doi: 10.1142/S0218194001000542.
[53] P. Bresciani, A. Perini, P. Giorgini, F. Giunchiglia, and J. Mylopoulos, “Tropos: An agent-oriented software development methodology,” Autonomous Agents and Multi-Agent Systems, vol. 8, no. 3, 2004, doi: 10.1023/B:AGNT.0000018806.20944.ef.
[54] D. Huang, J. M. Zhang, M. Luck, Q. Bu, Y. Qing, and H. Cui, “Agentcoder: Multi-agent-based code generation with iterative testing and optimisation,” 2024, doi: 10.48550/arXiv.2312.13010.
[55] Y. Ishibashi and Y. Nishimura, “Self-organized agents: A llm multi-agent framework toward ultra large-scale code generation and optimization,” 2024, doi: 10.48550/arXiv.2404.02183.
[56] S. Hong, M. Zhuge, J. Chen, X. Zheng, Y. Cheng, J. Wang, C. Zhang, S. Yau, Z. Lin, L. Zhou et al., “Metagpt: Meta programming for a multi-agent collaborative framework,” in International Conference on Learning Representations, 2024, doi: 10.48550/arXiv.2308.00352.
[57] X. Tang, K. Kim, Y. Song, C. Lothritz, B. Li, S. Ezzini, H. Tian, J. Klein, and T. F. Bissyandé, “Codeagent: Autonomous communicative agents for code review,” in Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, 2024, doi: 10.48550/arXiv.2402.02172.
[58] X. Chen, M. Lin, N. Schärli, and D. Zhou, “Teaching large language models to self-debug,” in International Conference on Learning Representations, 2024, doi: 10.48550/arXiv.2304.05128.
[59] W. Tao, Y. Zhou, Y. Wang, W. Zhang, H. Zhang, and Y. Cheng, “Magis: Llm-based multi-agent framework for github issue resolution,” in Proceedings of the 38th International Conference on Neural Information Processing Systems, 2024, doi: https://doi.org/10.52202/079017-1647.
[60] M. Chen, Y. Zhang, Z. Xie, Y. Luo, J. Xu, C. Gao, K. Zhao, and Y. Ye, “Tracedev: A traceability-driven multi-agent framework for requirement-to-code development,” Proc. ACM Softw. Eng., vol. 3, 2026, doi: 10.1145/3832171.
[61] A. Madaan, N. Tandon, P. Gupta, S. Hallinan, L. Gao, S. Wiegreffe, U. Alon, N. Dziri, S. Prabhumoye, Y. Yang et al., “Self-refine: Iterative refinement with self-feedback,” in Proceedings of the 37th International Conference on Neural Information Processing Systems, 2023, doi: 10.52202/075280-2019.