Enterprise knowledge · Research feature

TVR: Automotive System Requirement Traceability Validation and Recovery Through Retrieval-Augmented Generation

The study evaluates TVR, a method using retrieval-augmented generation in large language models to validate and recover traceability links between stakeholder and system requirements in automotive systems.

Adapted from research by Feifei Niu, Rongqi Pan, Lionel C. Briand and colleagues.

arXiv preprint revision · 2026-07-01 · Attribution & reuse
In this article
Editorial illustration of linked workflow.

Editor’s introduction

The study evaluates TVR, a method using retrieval-augmented generation in large language models to validate and recover traceability links between stakeholder and system requirements in automotive systems. It measures accuracy in detecting valid links, identifying missing ones, and handling variations in requirement expressions. It correctly identifies missing links with 85.50% accuracy. The evidence is based on industrial data where traceability is manually established, and the approach is specifically tested in automotive contexts where requirement expressions vary.

Introduction

Automotive systems have become increasingly complex, comprising a wide range of integrated components and features, including powertrain, chassis, infotainment, advanced driver assistance, and electric and autonomous driving systems. These components collaborate through electronic control units (ECUs), sensors, actuators, and software, working seamlessly to deliver performance, safety, and user experience. To ensure high-quality software development, the automotive industry adheres to the Automotive Software Process Improvement and Capability dEtermination (ASPICE) standard, which is based on the ISO 3300x norm group. A fundamental aspect of ASPICE-compliant software development is requirements engineering, in which requirements are defined at multiple levels, including stakeholder and system requirements. System requirements are derived from stakeholder requirements, with traceability links established to ensure consistency and correctness, especially amid frequent changes.

Maintaining accurate and high-quality traceability links between stakeholder and system requirements is indeed crucial for multiple reasons: 1) Improving system consistency: Consistent traceability ensures that system requirements accurately reflect stakeholder needs, thus minimizing functional errors and inconsistencies. 2) Preventing error propagation: Detecting incorrect requirement mappings early reduces maintenance cost overheads and avoids large-scale rework. 3) Ensuring regulatory compliance, thus complying with ASPICE and functional-safety standards, including ISO 26262, to help improve the safety, reliability, and auditability of automotive software.

However, system engineers have reported challenges regarding traceability between requirements. One specific, particularly critical type of requirement we focus on here concerns Diagnostic Trouble Codes (DTCs), which are standardized vehicle error codes indicating malfunctions detected by the diagnostic system. While automotive diagnostic tools—with the market valued at USD 38.45 billion in 2023 and projected to reach USD 56.07 billion by 2031—play a crucial role in early issue detection, maintaining correct traceability of DTC requirements remains largely manual and labor-intensive. This limits the overall efficiency of the diagnostic process due to the time and effort required to manually verify the consistency between requirements and trace the system faults to requirements.

Unlike similarity-based approaches that reconstruct links between requirements from scratch, industrial settings must manage preexisting traceability links, which, due to labeling errors or version changes, can incorrectly tie together unrelated or diverged requirements. Hence, it is essential to validate these links to ensure the connected requirements remain semantically and content-wise consistent.

The goal of this paper is to provide automated, effective ways to address the challenges above and thus identify invalid and missing traceability links between DTC requirements. Because requirements are not always expressed consistently within or across projects, we leverage large language models (LLMs), for their demonstrated robustness to linguistic variation. Although prompt‐based LLM approaches have been recently applied to traceability recovery, they either rely solely on simple Zero-Shot or Chain-of-Thought (CoT) prompts (e.g., “Is there a traceability link?”) for validating traceability links, which are inadequate for precisely validating the links between DTC system and stakeholder requirements that tend to slightly differ in the character strings of messages and signals.

To address the traceability challenges described above in the DTC requirements, we propose TVR, a Retrieval-Augmented Generation (RAG) approach that leverages generative LLMs to support traceability validation and recovery. Unlike existing RAG-based traceability recovery approaches (e.g., ), which primarily rely on retrieval to compute similarity scores between software artifacts to determine whether a traceability link exists, TVR adopts a fundamentally different approach to RAG. Specifically, TVR retrieves similar requirement pairs, including both positive (valid) and negative (invalid) traceability examples, and incorporates them into the prompt to explicitly guide and “teach” the LLM how to reason about traceability correctness. While traditional RAG systems are primarily designed for knowledge-intensive tasks, where external information must be retrieved from documents, knowledge bases, or repositories to provide necessary domain knowledge in the language model, requirements traceability validation differs fundamentally from such tasks. The challenge is not the absence of domain knowledge, but rather determining whether a stakeholder requirement and a system requirement exhibit a valid traceability relationship despite differences in terminology, abstraction level, and specification style. In our industrial context, traceability validation primarily relies on identifying recurring correspondence patterns between stakeholder and system requirements, rather than on retrieving additional information from external documentation. Therefore, instead of retrieving external knowledge, TVR retrieves previously labeled requirement pairs and uses them as in-context demonstrations. These examples provide concrete decision patterns that help the LLM understand how traceability correctness is assessed in practice. Consequently, TVR can be viewed as a retrieval-augmented in-context learning framework, in which retrieval augments reasoning with representative examples rather than augmenting knowledge with external documents.

DTC Types

Although different DTC categories correspond to different fault scenarios, their associated system requirements share a common structure, typically including elements such as Name, Number, Description, Priority, Enable Condition, Mature, Mature Time, Demature, and Demature Time, and others. Among these elements, Mature and Demature are the most relevant for traceability. A stakeholder requirement is traced to either a Mature condition or a Demature condition of the corresponding system requirement. Specifically, a stakeholder requirement whose mitigation action is “Set the DTC to Present” corresponds to a Mature condition, whereas a stakeholder requirement whose mitigation action is “Set the DTC to Not Present” corresponds to a Demature condition.

VARIATION 1 (Lost Communication). This variation corresponds to requirements describing “Lost Communication”. The diagnostic condition is expressed in terms of whether a communication message is received, typically formulated as “the module receives (or does not receive) MESSAGE for a certain number of message cycles”. In this variation, receiving the message corresponds to a Demature condition, whereas not receiving the message corresponds to a Mature condition.

VARIATION 2 (Implausible Data). This variation corresponds to requirements describing “Implausible Data”. The diagnostic condition is expressed as a comparison between an internal signal and a predefined failure state. Typical formulations include expressions such as “MODULE_MODE = SIGNAL_1_Fail” or “MODULE_MODE!= SIGNAL_1_Fail”. In this variation, equality with the failure state corresponds to a Mature condition, whereas inequality corresponds to a Demature condition.

VARIATION 3 (Implausible Data). This variation corresponds to requirements describing “Implausible Data”. The diagnostic condition is expressed in terms of whether a plausibility fault is detected. Typical formulations include expressions such as “the module detects (or does not detect) a plausibility fault on a signal within MESSAGE_2”. In this variation, detecting a plausibility fault corresponds to a Mature condition, whereas not detecting a plausibility fault corresponds to a Demature condition.

VARIATION 4 (Implausible Data). This variation corresponds to requirements describing “Implausible Data”. The diagnostic condition is expressed through an explicit determination of signal failure. Typical formulations include expressions such as “the module determines there is (or is not) a failure in SIGNAL_2”. In this variation, determining the existence of a failure corresponds to a Mature condition, whereas determining the absence of a failure corresponds to a Demature condition.

These four variations cover all stakeholder requirement formulations observed in the industrial dataset used in this study. The variations were identified through an iterative manual analysis of all stakeholder requirements by two annotators, who grouped them according to how their diagnostic conditions are formulated. Although additional variations may appear in other projects or larger datasets, all stakeholder requirements in our studied dataset can be assigned to one of these four variation categories.

Dataset

To evaluate the performance of LLMs for automotive requirements traceability validation and recovery, we used a dataset of DTC requirements from our industry partner. The dataset was collected from a single industrial automotive project and contains stakeholder requirements together with their corresponding system requirements and traceability links established by system engineers. The dataset includes the “Lost Communication” and “Implausible Data” DTC system requirements, which are among the most common and critical DTC categories. Each system requirement is linked to the corresponding stakeholder requirements through traceability links established by system engineers. Over time, system evolution across versions and the error-prone nature of manual traceability construction lead to a considerable number of invalid or missing traceability links. In total, the dataset comprises 1,320 stakeholder requirements connected to 48 system requirements through 2,132 existing traceability links.

To establish the ground truth, we followed a structured annotation protocol in collaboration with system engineers from our industry partner. First, two co-authors studied the industrial traceability guidelines, which define traceability relationships and validation criteria in the automotive DTC domain. They then conducted a calibration phase by independently annotating 100 randomly selected traceability links. Disagreements and ambiguous cases were discussed with system engineers to clarify the interpretations of the guidelines and identify recurring traceability variations observed in practice.

After calibration, the two annotators independently reviewed all 2,132 traceability links. Following the industrial guidelines, each stakeholder–system requirement pair was labeled as valid if the system requirement correctly covered the message, signal, fault condition, or diagnostic behavior specified in the stakeholder requirement, and as invalid otherwise. After this independent annotation phase, all conflicting annotations were jointly reviewed. For each disagreement, the annotators revisited the corresponding requirements and the industrial guidelines before reaching a final decision. The resulting labels were used as the ground truth for the experiments.

We acknowledge that, in practice, companies can obtain a larger volume of high-quality labeled data to enhance the retriever’s database. As more traceability links are validated over time, the retrieval database can be continuously expanded, thereby providing richer, more representative in-context examples and potentially further improving the effectiveness of TVR.

In this study, the original dataset cannot be publicly disclosed due to data privacy constraints imposed by our industry partner. However, we provide fictitious, representative examples in the replication package to illustrate the dataset structure and facilitate understanding.

Performance of SOTA LLMs on Requirements Traceability Validation (RQ1)

Approach. This RQ examines the performance of LLMs with Zero-Shot prompting for requirements traceability validation, focusing on models available to our industry partner, including Claude, Llama, Mistral, and Amazon Titan. Specifically, the Zero-Shot prompting strategy involves including the task description in the prompt without providing the model with any examples.

For valid pairs, most models exhibit high precision (above 90%). Still, recall shows noticeable variation: Mistral Large 2402 achieves the highest precision (100%) but has a recall of only 0.73%, resulting in an F1 score of 1.44%. This suggests the model is highly conservative, prioritizing precision over recall, but missing many valid pairs. Claude 2 achieves the best F1 score (95.04%), with well-balanced precision (90.64%) and recall (99.90%), demonstrating strong predictive stability. Llama 3 70B and Mistral Large 2402 exhibit poor recall (0.95% and 0.73%, respectively), indicating difficulty capturing valid cases. Their F1 scores (1.88% and 1.44%) further confirm their limitations. Within the Claude series, Claude 2 outperforms other models, achieving the highest F1 score (95.04%), while Claude Instant follows with 91.51%.

However, detecting invalid pairs proves more challenging, as evidenced by the lower F1 scores across all models. Claude 2 has the highest invalid precision (71.43%) but suffers from extremely low recall (2.45%), resulting in an F1 score of only 4.74%, indicating it misses most invalid pairs. Mistral Large 2402 achieves the highest recall for invalid cases (100.00%) but at the cost of low precision (9.63%), resulting in an F1 score of 17.57%. This suggests it identifies all invalid pairs, but at the expense of many false positives. Among weaker performers, Claude Instant has an invalid recall of only 4.90% and an F1 score of 5.68%. Llama 3 70B achieves high recall (96.53%) but low precision (9.44%), resulting in an F1 score of 17.20%.

The reasons for the models’ poor performance include: (1) Even when explicitly instructed to focus on determining whether a message or signal from the stakeholder requirement is covered by the linked system requirement, without domain knowledge, LLMs still struggle to accurately understand and identify the key relevant message or signal in the requirements, but rather focus on the wrong aspects, leading to incorrect predictions. (2) LLMs tend to check for content consistency between requirements and often misjudge the two requirement descriptions as inconsistent due to differences in wording or structure. Since invalid pairs are few, the small denominators in score calculations, such as precision and recall, can lead to unreliable scores. The Macro-F1 scores are also low across all LLMs (below 60%).

Best Prompt Strategy for Requirements Traceability Validation (RQ2)

For Few-Shot prompting, we consider all four distinct variations of stakeholder requirements presented in our context, each corresponding to either mature or demature conditions of the linked system requirements. Additionally, the traceability link between each stakeholder requirement and its corresponding system requirement can be valid or invalid. Given these factors, our dataset contains 16 possible combinations. To maximize the effectiveness of LLMs, we randomly selected one example from each combination, resulting in a total of 16 examples for the prompt. However, the available Llama series models (Llama 3 8B and Llama 3 70B) and Amazon Titan series models (Text Premier, Text Express, and Text Lite) have a limited token capacity (8K), which is insufficient for a 16-shot prompt. Consequently, we excluded these five models from our Few-Shot prompt experiments, leaving eight models for requirements traceability validation. For these models, we include all 16 examples in the prompt.

The experimental results indicate that incorporating CoT reasoning enhances recall across most models, both for valid and invalid cases. Claude 3.5 Sonnet, Claude 2, and Claude 3 Haiku exhibit substantial improvements in invalid recall, leading to higher F1 scores. Meanwhile, Llama 3 8B, Llama 3 70B, Mistral 7B, and Amazon Titan Text Premier show notable gains in valid F1 scores. However, for Claude 3 Sonnet, Llama 3 8B, and Amazon Titan Text Lite, invalid F1 scores decreased due to a drop in precision when detecting invalid pairs.

Comparing the results of Few-Shot prompting with CoT prompting, we can observe that adding examples to the prompt effectively improves the F1 score for most models in both categories (valid and invalid pairs), except for Claude 2 and Mistral 7B. Apart from Claude 2, all models show improved precision in the invalid category. This demonstrates that including examples in the prompt helps models better distinguish valid from invalid requirement pairs, achieving higher precision for invalid pairs. However, the downside of adding too many examples is that it increases the prompt length, which may exceed the token limit of some models.

For Few-Shot prompting, the best-performing model is Claude 3.5 Sonnet. It outperforms all other models in terms of average performance across both categories. It achieves over 98% in precision, recall, and F1 score for the valid category, and over 86% for the invalid category. The macro-F1 score of 92.75% still surpasses all other models. However, applying the self-consistency approach to Claude 3.5 Sonnet does not improve its overall performance, as the Macro-F1 scores are almost identical (92.75% for Few-Shot and 92.92% for Self-Consistency).

To further investigate the relationship between TVR and retrieval-based approaches, we analyzed the misclassified cases of TVR and the strongest retrieval baseline (SentenceBERT). Interestingly, we found that the two approaches exhibited completely disjoint error sets. Specifically, all 24 samples misclassified by TVR were correctly classified by SentenceBERT, whereas all 292 samples misclassified by SentenceBERT were correctly classified by TVR 22 2 Notably, the SentenceBERT results correspond to an optimistic upper bound obtained by exhaustively selecting the optimal similarity threshold over the entire dataset. Therefore, the practical performance of retrieval-based approaches is expected to be lower than reported here.. This observation indicates that the two approaches rely on fundamentally different decision mechanisms and therefore exhibit orthogonal error patterns. Although retrieval-based methods achieve substantially lower overall performance, they can provide complementary evidence in rare cases where TVR fails. These findings suggest that retrieval-based similarity and LLM-based reasoning capture different aspects of traceability evidence, motivating future hybrid approaches that combine the strengths of both techniques.

To better understand the limitations of TVR, we manually analyzed the misclassified cases and observed two dominant error patterns. Most false negatives occurred because the LLM occasionally considered stakeholder requirement components beyond the target message or signal, such as trigger conditions, mitigation actions, validation rules, or reference documents. Although our prompt explicitly instructs the model to focus only on the input message or signal, the model sometimes judged a traceability link as invalid because these additional components were not explicitly covered by the system requirement. Most false positives occurred when messages appearing in trigger conditions were mistakenly treated as the target message for traceability validation. In such cases, the LLM incorrectly inferred that the system requirement covered the stakeholder requirement because the trigger-condition message appeared in both requirements. These findings suggest that the primary limitation of TVR is the occasional inability of LLMs to consistently adhere to the intended validation criterion. Future work could explore more constrained prompting strategies or explicitly identifying different requirement components (e.g., trigger condition, input message, and mitigation actions) before validation to further reduce such errors. Another interesting direction is to integrate retrieval-based similarity with LLM-based reasoning. Although retrieval alone performs substantially worse than TVR, our analysis shows that the two approaches exhibit complementary error patterns, suggesting that hybrid approaches may further improve traceability validation performance.

Conclusion

In this paper, we propose TVR, an approach leveraging RAG-based LLMs to verify the validity of traceability between high-level stakeholder requirements and system requirements in automotive systems. TVR achieves 98.87% accuracy in detecting whether a traceability link is valid. Furthermore, experimental results demonstrate the robustness of TVR in effectively handling unseen variations in requirements templates, retaining 97.13% accuracy. Additionally, TVR can identify missing links between requirements with 85.50% correctness. These findings indicate that TVR is effective not only for traceability validation but also for recovering missing links. TVR can thus be applied to automotive systems, helping the industry to save both time and cost. In the future, the basic principles of TVR can be adapted to other types of requirements and domains where such traceability is important. Looking ahead, we aim to further enhance TVR’s generalizability, making it applicable to a broader range of industrial scenarios.