arXiv:2610.29996cs.SEOct 2026

Manuscript Offprint

arXiv:2610.29996

HiddenLens: A Multi-Layer LLM Framework for Detecting and Resolving Hidden Assumptions in Software Requirements

Tanu Singh, Aashna Suman, Vinod Patidar

ABSTRACT

Software requirements written in natural language often omit important assumptions about expected performance, operating conditions, user behaviour, and domain-specific constraints. This gap between explicitly stated requirements and stakeholders' implicit assumptions can influence architectural choices, testing approaches, and deployment configurations. If these assumptions are not identified until implementation, correcting the resulting problems can be far more costly than addressing them at the early stages of requirements engineering. Although ambiguity and vagueness in requirements have been widely studied, less attention has been given to uncovering assumptions embedded in requirements that otherwise appear clear and reasonable. To address this gap, this paper proposes HiddenLens, a novel six-layer BERT-LLM pipeline and the first framework engineered specifically to detect, classify, question, and resolve hidden assumptions in software requirements, rather than merely flagging the existence of ambiguity. Layer 1 applies BERT attention entropy to localise the specific spans of a requirement carrying the most unresolved linguistic weight. Layer 2 passes these spans to an LLM using CoT prompting, which reasons step-by-step to articulate the precise hidden assumption each span conceals and the failure risk if that assumption is wrong. Layer 3 classifies each detected assumption with a fine-tuned BERT classifier across six non-functional requirement categories: performance, security, scalability, usability, reliability, and domain. Layer 4 generates context-aware, ranked clarification options for the analyst via FS LLM prompting, turning each assumption into concrete, answerable choices. Layer 5 is a human-in-the-loop validation step, where the analyst confirms, edits or requests a layman-mode rephrasing of each clarification before anything is finalised. Layer 6 closes the loop by rewriting the original requirement, substituting the analyst-confirmed resolution in place of the ambiguous term, and producing a requirement that is explicit, testable, and traceable back to the assumption it resolves. This paper also introduces the HiddenLens Corpus (HLC), a dedicated dataset comprising 312 requirements annotated with 847 hidden assumptions across six NFR categories. Inspired by the PROMISE and PURE datasets, HLC addresses the lack of annotated instances for hidden-assumption detection in the existing corpora. To the best of our knowledge, it is the first dataset specifically developed for this task. HiddenLens outperforms the keyword-based baseline by 71% and the QuARS-Adapted baseline by 61%, achieving an end-to-end F1-score of 0.79, while its BERT-based NFR classifier achieves an F1-score of 0.847. These findings indicate that HiddenLens can help analysts identify and resolve hidden assumptions during requirements engineering before they propagate to later stages of software development.

Keywords: Requirements Engineering, Hidden Assumptions, Large Language Models, BERT, Prompt Engineering, NFR Classification, Chain-of-Thought, Requirements Quality

A version (09_Sept_2026) of this manuscript has been submitted to the journal for publication and is presently under review

1. Introduction

Requirements Engineering (RE) is the process of capturing, documenting, and agreeing on what a system must do before a single line of code is written, and it is widely recognized as the most consequential stage of the software development lifecycle (SDLC). The single highest-leverage activity in software development is ensuring that the requirements are correct. Previous studies show that defects identified during the requirements stage can cost up to 100 times less to fix than those discovered at later stages (Boehm, 1984; Femmer et al., 2017). RE shapes every downstream decision, system architecture, test coverage, resource allocation, and ultimately whether the delivered product matches stakeholder requirements. Basically, RE is the blueprint stage of the SDLC. If software is built on poorly stated requirements, the project will have issues at every layer and lead to software failures. RE has long been recognised for its importance but still proves to be a very underserved and error-prone stage in practice. Such issues lead to constant defects that eventually turn into project failures.

The consequences of such failures have been examined extensively in previous studies. One such work has identified requirements defect in the top three root causes of systemic failures. The rest two include poor project management and inadequate testing (Johnson, 2020; Leffingwell & Widrig, 2003). There are three major types of requirements problems that can lead to failures. First, incompleteness, wherein required behaviours are not captured. Second, inconsistency, where requirements contradict each other across documents. Third, ambiguity, where the language used allows multiple interpretations. Ambiguity is one of the most pervasive and difficult-to-detect requirements problems.

Ambiguity does not appear out of nowhere; it sneaks in through the way requirements are written, and almost always, that means the use of natural language. Stakeholders use plain language because it is easy for everyone involved to understand, whether they are developers, managers, or clients. It is a genuine strength of natural language, but it comes with a hidden cost. When stakeholders agree that "the system shall respond quickly" or "data shall be stored securely" everyone appears in agreement but having different interpretations of these statements. To one person, "quickly" may mean under two seconds; however, for another person it may mean instantly. Similarly, "securely" might mean full encryption to a developer, but for a business manager it might mean that the system does not get hacked.

Table 1: Examples: Requirements and Vague Words

RequirementsVague Words
The system shall process user requests quickly.Quickly
Patient data shall be stored securely.Securely
Nurses can update patient status in real time.real time
The system should respond immediately in emergencies.Immediately
User data shall be backed up regularly.regularly
The interface shall be intuitive for new users.intuitive
The application shall be user-friendly.user-friendly
The system shall support a large number of concurrent users.large number
Reports shall be generated efficiently.efficiently
The system shall be highly available.highly available
Administrators shall be able to easily configure system settings.easily
The system shall handle errors gracefully.gracefully

A version (09_Sept_2026) of this manuscript has been submitted to the journal for publication and is presently under review

Additional examples of requirements and vague words are listed in Table 1. In such a scenario, no one is wrong exactly, but stakeholders are not sharing the same understanding of requirements. These are not spelling mistakes or formatting issues; rather, they are gaps in meaning hidden behind words that look perfectly reasonable on paper. The real problem is that these gaps remain unnoticed during requirements review, because the requirement appears to be complete and well written. The intended meaning of the word “quickly” might not be questioned until the system is built and the client finds that the delivered system does not meet their expectations.

As these vague words are rarely stated explicitly or questioned during the requirements review process, stakeholders often have to fill in these gaps with their own interpretations that become hidden assumptions. Such assumptions may appear harmless at the early stages of development; however, they can lead to different expectations among stakeholders and consequently the deviations between the specified and expected system behaviour. Identifying these hidden assumptions is therefore important for detecting potential requirements failure at an early stage. Figure 1 illustrates how such hidden assumptions can remain unnoticed during requirements specification and eventually contribute to project failure.

Figure

Figure 1. Hidden Assumptions Leading to Project Failure

The research community has not overlooked the problem of hidden assumptions; however, it has largely addressed a different manifestation of the issue. Existing studies on the detection of syntactic and semantic ambiguities (Ferrari et al., 2024; Gervasi et al., 2019), the classification of requirements smells (Femmer et al., 2017), and automated quality assessment against standards such as ISO/IEC/IEEE 29148 (2018); Lubos et al., 2024 mainly focus on poorly specified or incorrectly written requirements. Similarly, tools such as RETA (Bajceta et al., 2022) and QuARS (Lami et al. 2005) can identify ambiguous terms and implicit pronoun references, while rule-based keyword detectors can flag hedging or imprecise language. However, these approaches cannot explicitly identify the underlying assumption obscured by vague terms. Consequently, they detect symptoms of incompleteness or ambiguity but cannot identify the specific information missing.

To bridge this gap, this paper presents HiddenLens: a novel six-layer Bidirectional Encoder Representations from Transformers- Large Language Model (BERT–LLM) pipeline for detecting, classifying and resolving hidden assumptions in software requirements. Rather than being another ambiguity detector, HiddenLens addresses a fundamentally different question: what does a requirement silently depend on? Instead of merely identifying what is ambiguous in a requirement, HiddenLens seeks to uncover the underlying assumptions, determine their nature, facilitate their validation and resolve them by formulating requirements that are clearer and more explicit.

The proposed framework follows an end-to-end process that combines automated linguistic analysis, LLM-based assumption identification & clarification generation, requirement classification, and human-in-the-loop

A version (09_Sept_2026) of this manuscript has been submitted to the journal for publication and is presently under review

(analyst) validation, culminating in the rewriting of the original requirement. This design enables HiddenLens to move beyond detecting surface-level vagueness to identifying and resolving assumptions that may remain implicit in otherwise seemingly acceptable requirements. The framework is evaluated using requirements drawn from the publicly available PROMISE (Cleland-Huang et al., 2007) and PURE (Ferrari et al., 2017) datasets, supplemented by industrial documents from healthcare partners and synthetically generated examples, with the resulting dataset manually annotated for hidden assumptions across six non-functional requirement (NFR) categories. We refer to this dataset as the HiddenLens Corpus (HLC) and to support reproducibility, we publicly release its synthetic portion: 312 requirements with 847 annotated hidden assumptions as a companion resource to PROMISE and PURE. Through this integrated approach, HiddenLens aims to support requirements analysts and software developers in improving the clarity, completeness, and interpretability of requirements at an early stage of software development.

The major contributions of this paper are as follows:

  • Novel End-to-End Framework: HiddenLens is a six-layer pipeline that integrates BERT-based attention entropy, LLM-based chain-of-thought reasoning, fine-tuned NFR classification, context-aware suggestion generation, analyst validation through a human-in-the-loop mechanism, and automated requirement rewriting. It is the first end-to-end framework designed to detect and resolve hidden assumptions in software requirements.

  • Prompt Engineering Strategy: The study provides an in-depth comparison of zero-shot (ZS), few-shot (FS) (Brown et al., 2020), and chain-of-thought (CoT) prompting (Wei et al., 2022) for hidden-assumption detection and clarification generation. Based on this comparison, an appropriate prompting strategy is selected for each task.

• Annotated Dataset: The HiddenLens Corpus (HLC) comprises 312 requirements containing 847 annotated assumptions across six NFR categories and is made available to the research community.

• Empirical Evaluation: The BERT classifier obtains an F1-Score = 0.847 and the human evaluation of hidden assumption resolution yields precision = 0.81, recall = 0.78 and F1-score = 0.79. Therefore, the proposed approach achieves substantive improvements over rule-based (Fabbrini et al. (2001)) and keyword-based (Wilson et al. (1997)) baselines. It is further supported by a detailed error analysis and an ablation study of various prompt strategies.

The rest of the paper is organized as follows. Section 2 reviews related work on requirements ambiguity detection, NFR classification, and LLM applications in requirements engineering, along with prior approaches that flag ambiguity but do not resolve it. Section 3 formally defines a hidden assumption and introduces the six-category taxonomy used throughout the paper. Section 4 presents the six-layer HiddenLens framework in detail, from BERT attention entropy localisation and chain-of-thought assumption detection through NFR classification, clarification generation, analyst validation, and automated requirement rewriting. Section 5 describes the construction of the HiddenLens Corpus (HLC) and the annotation process behind it. Section 6 details the experimental setup, including model configuration, baseline methods, and both automated and human evaluation metrics. Section 7 presents the quantitative results, a comparative analysis against prior work, and sample outputs. Section 8 walks through a case study on a Hospital Patient Management System to illustrate the framework end-to-end. Section 9 discusses threats to validity, and Section 10 concludes with a summary of contributions and directions for future work.

References (34)