---
title: 'LEREDD: LLM-Enabled Requirement Dependency Detection'
url: https://www.emergentmind.com/topics/leredd
type: topic
---

# LEREDD: LLM-Enabled Requirement Dependency Detection

Searching arXiv for the LEREDD paper and closely related requirement dependency detection work.
LEREDD, abbreviated from “LLM-Enabled REquirement Dependency Detection,” is an LLM-based approach for automated detection of requirement dependencies that leverages Retrieval-Augmented Generation (RAG) and In-Context Learning (ICL) to identify diverse dependency types directly from natural-language requirements [2602.22456]. It was introduced to address a persistent requirements engineering problem: requirements are inherently interconnected through various types of dependencies, yet dependency detection is often overlooked or performed manually because modern software systems contain high volumes of complex, coupled, and ambiguous natural-language requirements [2602.22456]. In empirical evaluation, LEREDD was reported to provide highly accurate classification of dependent and non-dependent requirements, achieving an accuracy of 0.93 and an F1 score of 0.84, while particularly improving detection of fine-grained dependency types [2602.22456].

## 1. Problem setting and motivation

Requirement dependency detection concerns identifying how one requirement relates to another and whether the satisfaction, implementation, refinement, incompatibility, or redundancy of one requirement bears directly on another [2602.22456]. The underlying motivation is operational: such dependencies underpin critical decisions and influence a range of activities throughout software development, including impact analysis, consistency checking, release planning, and change management [2602.22456].

The difficulty of this task arises from several factors stated explicitly in the source description. Modern Software Requirements Specification documents can contain hundreds or thousands of natural-language statements; requirements are often coupled through shared components, trigger conditions, or behaviors; and the ambiguity of natural language, combined with constant change, makes exhaustive manual inspection both prohibitively time-consuming and error-prone [2602.22456]. This produces a setting in which the number of possible requirement pairs is large, while the proportion of truly dependent pairs is comparatively small.

The paper situates LEREDD against three broad families of prior automatic approaches. Retrieval-based methods such as TF-IDF plus LSA treat each requirement as a fixed vector and flag pairs whose cosine similarity exceeds a threshold, but they are described as brittle, lexically driven, and limited in supporting fine-grained dependency types [2602.22456]. Knowledge-based methods rely on ontologies or graphs and can deliver high precision when the ontology is well crafted, but ontology construction and maintenance are laborious [2602.22456]. Traditional ML methods such as Bi-LSTM or fine-tuned Transformer models learn from annotated pairs, yet the severe “no-dependency vs. dependency” class imbalance makes this setting difficult for standard learners [2602.22456].

Within this landscape, LEREDD is presented as a lightweight framework that exploits LLM strengths in natural-language understanding, reasoning, and generation, while avoiding hand-crafted ontologies and massive supervised datasets [2602.22456]. A plausible implication is that its methodological contribution is not merely substituting an LLM for a classifier, but structuring the prompt so that task-specific examples and domain-specific context are both available at inference time.

## 2. Architectural design

LEREDD comprises two main phases: knowledge retrieval and dependency inference [2602.22456]. The architecture is centered on a single GPT-4.1 prompt whose contents are assembled dynamically for each candidate pair of requirements.

In the knowledge retrieval phase, LEREDD applies contextual retrieval via RAG. The entire Software Requirements Specification document is split into overlapping text chunks, exemplified in the paper by 500 characters each with 200 characters of overlap [2602.22456]. For a requirement pair $(R_1, R_2)$, the concatenated text of the two requirements serves as a retrieval query against the chunk store. Each chunk is encoded by a pre-trained embedding model, and the system selects the top $k$ most semantically similar chunks, with $k=10$ in the reported experiments, to provide domain context such as subsystem names, component descriptions, and architectural notes [2602.22456].

The second retrieval component is dynamic example retrieval for ICL. LEREDD maintains a small annotated corpus of requirement pairs labeled with one of the supported dependency types or “No_dependency” [2602.22456]. For each target pair and for each dependency type $t$, the system retrieves the most similar labeled examples of type $t$ so that the prompt contains demonstrations spanning all classes rather than only the most likely one. This design is important because the target task is multiclass and includes rare dependency types.

The dependency inference phase is executed by GPT-4.1 using a prompt with three sections: contextual scope, inputs, and instructions [2602.22456]. The contextual scope positions the model as an expert requirements engineer in a specific domain. The input section contains Requirement A, Requirement B, formal definitions of the dependency types, retrieved examples, and the top 10 RAG chunks. The instruction section directs the model to decide which type applies or output No_dependency, and to provide both a rationale and a confidence score from 0 to 5 [2602.22456]. The response is constrained to the schema:

```text
Dependency_Status: [TYPE]
Rationale: [text]
Confidence Score: [0–5]
```

By combining RAG and ICL inside one prompt, LEREDD explicitly couples domain grounding with exemplar-based task conditioning [2602.22456]. This suggests that the method is designed to reduce hallucinated or weakly grounded judgments while preserving the few-shot adaptability characteristic of LLM prompting.

## 3. Retrieval and prompting methodology

The similarity computation used for example retrieval is one of the most specific technical elements of LEREDD. All four sentence-level embeddings $\{R_1, R_2, R_a, R_b\}$ are obtained from SBERT, after which Euclidean similarities $\operatorname{sim}(\cdot,\cdot)$ are computed between each target requirement and each example requirement [2602.22456]. These four scores are aggregated by the formula:

$$
\mathrm{Score}_{\max-\mathrm{avg}}(R_1,R_2;R_a,R_b)
=
\frac{
\max(\operatorname{sim}(R_1,R_a), \operatorname{sim}(R_1,R_b))
+
\max(\operatorname{sim}(R_2,R_a), \operatorname{sim}(R_2,R_b))
}{2}
$$

For each type $t$, LEREDD picks the top 4 examples by $\mathrm{Score}_{\max-\mathrm{avg}}$, and these four examples per type, across all dependency types and the no-dependency case, are inserted as demonstrations in the prompt [2602.22456]. This per-type balancing is a notable design decision because it ensures representation of rare classes in the demonstration set rather than allowing frequent classes to dominate by nearest-neighbor retrieval alone.

The prompt also includes formal definitions of the supported dependency types, not only examples. This matters because some distinctions are semantically close. For instance, “Conflicts” and “Contradicts” both encode incompatibility, while “Details,” “Is similar,” and “Is a variant” all involve forms of semantic overlap [2602.22456]. LEREDD therefore combines definitional supervision and exemplar supervision within a single inference call.

Prompt tuning experiments reported in the source indicate that SBERT combined with Euclidean similarity and the max_avg aggregation formula, with $k=4$ demonstrations per type, gave the best few-shot results [2602.22456]. Adding RAG with ten 500-character chunks further improved performance [2602.22456]. Since these settings emerged from a sweep over embedding model, similarity metric, aggregation formula, number of examples, chunk size, and number of chunks, the paper frames LEREDD not as a single prompt template but as a tuned prompting strategy.

## 4. Dependency taxonomy and formalization

LEREDD handles seven direct dependency types, drawn from a state-of-the-art taxonomy, plus the No_dependency class [2602.22456]. The definitions are as follows.

| Type | Definition |
|---|---|
| Requires | If the fulfillment of one requirement is a prerequisite to the fulfillment of the other |
| Implements | If one requirement is at a higher level and is fulfilled by the other, lower-level requirement |
| Conflicts | If the fulfillment of one requirement restricts the fulfillment of the other |
| Contradicts | If the two requirements are mutually exclusive—satisfying one violates the other |
| Details | If both requirements describe the same action under the same condition, and one provides additional detail of that action |
| Is similar | If one requirement replicates part or all of the content of another, resulting in redundancy |
| Is a variant | If one requirement serves as an alternative formulation to the other |

The paper also provides an intuitive logical reading for selected relations. Each requirement may be viewed as a predicate $R_i$ over system states [2602.22456]. A Requires relation $R_i \to_{\mathrm{requires}} R_j$ holds if $\forall$ state $s$, $R_j(s)=\mathrm{true} \Rightarrow R_i(s)=\mathrm{true}$ [2602.22456]. Conflicts is characterized by $\neg \exists s$ such that $R_i(s)=\mathrm{true} \wedge R_j(s)=\mathrm{true}$ [2602.22456]. The paper states that it does not supply a full logical calculus, and these definitions are therefore intended to disambiguate types in the prompt rather than define a complete formal semantics.

This taxonomy is important because LEREDD is not restricted to binary dependency detection. It targets fine-grained direct dependency types directly from natural-language specifications [2602.22456]. A plausible implication is that this distinguishes it from similarity-threshold methods, which may identify related pairs without reliably classifying the semantic nature of that relation.

## 5. Evaluation protocol, dataset, and metrics

The evaluation uses standard classification metrics. With $TP$, $FP$, $FN$, and $TN$ denoting true positives, false positives, false negatives, and true negatives, the paper reports:

$$
\mathrm{Precision} = \frac{TP}{TP+FP}
$$

$$
\mathrm{Recall} = \frac{TP}{TP+FN}
$$

$$
F_1 = 2 \cdot \frac{\mathrm{Precision}\cdot \mathrm{Recall}}{\mathrm{Precision}+\mathrm{Recall}}
$$

$$
\mathrm{Accuracy} = \frac{TP+TN}{TP+FP+TN+FN}
$$

For the multiclass setting, macro-averaged Precision, Recall, and $F_1$ are reported so that rare dependency types contribute equally; for the binary dependent-versus-non-dependent setting, the paper also reports the usual accuracy and $F_1$ [2602.22456].

The annotated dataset comprises three real automotive Software Requirements Specification documents: Adaptive Driving Beam (ADB), Traffic Jam Assist (TJA), and Automated Parking Assist (APA), containing 40, 25, and 50 requirements respectively [2602.22456]. From each document, all unique pairs were generated, ranked by semantic similarity, and annotated by two experts until new dependent cases fell below a threshold [2602.22456]. The resulting corpus contains 413 pairs for ADB, 200 for TJA, and 200 for APA, giving a total of 813 manually labeled pairs across all seven dependency types plus No_dependency [2602.22456]. Inter-annotator Cohen’s $\kappa$ was 0.43, described as moderate agreement [2602.22456].

The empirical study is organized around four research questions. First, a zero-shot baseline compares four LLMs—GPT-4.1, Llama 3.1, Gemma 20B, and Mistral 7B—under a prompt with no examples and no context [2602.22456]. Second, prompting strategy tuning explores embedding model, similarity metric, aggregation formula, number of demonstrations, chunk size, and chunk count [2602.22456]. Third, intra-dataset evaluation holds out 20% of each dataset and compares LEREDD against TF-IDF+LSA and a fine-tuned BERT classifier [2602.22456]. Fourth, cross-dataset evaluation tests transfer to a new system using demonstrations or training data from a different dataset [2602.22456].

## 6. Reported empirical performance

The reported results place LEREDD well above the tested baselines on both binary and multiclass variants of the task [2602.22456]. In the overall binary classification of dependent versus non-dependent pairs, LEREDD achieves an accuracy of 0.93 and an F1 score of 0.84, with the latter averaging 0.96 for non-dependent cases [2602.22456]. The emphasis on the No_dependency class is operationally significant because most requirement pairs are non-dependent, and effective filtering reduces the burden on human analysts.

In zero-shot evaluation, GPT-4.1 was the strongest among the four tested LLMs, but its macro $F_1$ was still only 0.39 overall, with about 0.87 $F_1$ on the dominant No_dependency class [2602.22456]. Fine-grained types performed much worse, which motivated the combined few-shot and RAG design. After prompt tuning, the configuration SBERT+Euclidean+max_avg with $k=4$ demonstrations per type increased overall $F_1$ from 0.39 zero-shot to 0.73 few-shot on average, and adding RAG with ten 500-character chunks improved average $F_1$ further to 0.78 [2602.22456]. For the “Requires” class, performance rose from 0.52 zero-shot to 0.70 with few-shot+RAG, described as a relative gain of 35% [2602.22456].

The intra-dataset comparison reports the following macro-$F_1$ values [2602.22456]:

| Dataset | TF-IDF & LSA | BERT | LEREDD |
|---|---:|---:|---:|
| ADB | 0.56 | 0.59 | 0.92 |
| TJA | 0.72 | 0.34 | 0.76 |
| APA | 0.62 | 0.63 | 0.85 |

The corresponding relative gains over the best baseline are reported as +55.9% for ADB, +5.6% for TJA, and +34.9% for APA [2602.22456]. On the No_dependency majority class, LEREDD averaged $F_1=0.96$ versus 0.87 for TF-IDF and 0.70 for BERT [2602.22456]. On the “Requires” class, it averaged 0.76 versus 0.39 and 0.46, which the paper describes as a relative gain near +95% [2602.22456]. The abstract additionally states average relative gains of 94.87% and 105.41% in F1 scores for the Requires dependency over the baselines [2602.22456].

The cross-dataset comparison is intended to simulate deployment on a new system with only historical labels. In this setting, TF-IDF+LSA is unchanged by training, BERT drops to approximately $F_1 \approx 0.30$ on “Requires,” while LEREDD’s overall $F_1$ declines only from 0.78 in-dataset to 0.76 cross-dataset, and its No_dependency $F_1$ remains above 0.95 [2602.22456]. This suggests relative robustness to distribution shift across systems within the automotive domain.

## 7. Significance, limitations, and future directions

The paper identifies several strengths of LEREDD. It harnesses LLM reasoning rather than pure vector similarity, few-shot example-driven learning plus selective RAG context consistently outperforms both traditional NLP and fine-tuned ML even under distribution shifts, and the self-reported rationale and confidence add transparency and allow human reviewers to triage low-confidence cases [2602.22456]. It also states that by filtering out No_dependency pairs with 0.95+ $F_1$, the method shrinks the manual workload dramatically [2602.22456]. Since the response schema explicitly includes a rationale and confidence score, LEREDD is designed not only as a classifier but also as a decision-support mechanism for expert review.

The principal limitations are also stated directly. The gold standard covers only three automotive systems, so generalization to other domains awaits further study [2602.22456]. Manual annotation is inherently subjective, and Cohen’s $\kappa = 0.43$ indicates only moderate agreement, although the paper notes that two experts and consensus-driven resolution mitigate bias [2602.22456]. LLM responses can vary, but the study sets temperature to 0 so that outputs are effectively deterministic [2602.22456]. Cost and runtime are higher than for lightweight baselines: in intra-dataset tests, LEREDD took approximately 110 s on average versus approximately 2 s for TF-IDF and approximately 240 s for BERT, which the authors characterize as a reasonable engineering trade-off for the accuracy gain [2602.22456].

The stated contributions are fourfold: LEREDD itself as a novel RAG+ICL framework built on LLMs to detect seven fine-grained requirement dependency types from natural language; a publicly released corpus of 813 annotated requirement pairs across three real automotive systems; a large empirical study comparing LEREDD to classical retrieval, ontology-style, and fine-tuned ML baselines in intra- and cross-dataset settings; and a detailed analysis of prompting strategies for future requirements engineering applications of LLMs [2602.22456]. Future directions include extending the framework to indirect or chain dependency paths such as $r_1 \to r_2 \to r_3$, integrating predicted dependencies into impact analysis tools for requirement evolution, applying the method in domains such as healthcare and avionics, and exploring ensemble strategies or smaller open-source LLMs to reduce cost while maintaining accuracy [2602.22456].

Taken together, LEREDD occupies a specific position in requirements engineering research: it is an LLM-centered framework for dependency detection that combines retrieval of domain context with retrieval of labeled exemplars, targets multiclass dependency typing rather than only pairwise relatedness, and is evaluated on a manually annotated automotive corpus with strong reported gains over zero-shot prompting, retrieval baselines, and fine-tuned BERT models [2602.22456].

Source: https://www.emergentmind.com/topics/leredd