Comparing Large Language Models at Writing Requirements Documents: A Reproducible Evaluation Framework

    This article presents a neutral, reproducible framework for comparing how different large language models write software requirements documents. It breaks evaluation into six scored dimensions—structural completeness, constraint adherence, semantic consistency, testability, engineering feasibility, and traceability—and shows how to turn vague expectations into enforceable prompt contracts. It also covers common failure patterns under long, stacked constraints, a reusable regression workflow with a sample validation script, and a three-stage "generation + validation + human review" approach for enterprise adoption. Readers will learn how to select models based on data rather than impressions, using constraint adherence, testability, and engineering feasibility as core metrics.

    1. Why Writing Requirements Documents Is a Litmus Test for LLMs

    In the software development lifecycle, the requirements document is the bridge between business intent and engineering implementation. It must be readable as natural language while also following near-strict structural constraints: background, goals, scope, non-goals, roles and permissions, data model, API contracts, exception branches, acceptance criteria, milestones, and risks. In practice, many teams find that general-purpose chat models can produce fluent-looking paragraphs but often lose points on boundary conditions, terminology consistency, and testability.

    So instead of asking the vague question of “which model is stronger,” it is more useful to narrow the task to a verifiable scenario: given a piece of business description, produce a requirements document that engineering, QA, and product can review together. This article uses that scenario as the main thread and proposes a neutral, reproducible evaluation framework.

    2. Evaluation Dimensions: Turning “Feel” into Metrics

    Subjective impressions are easily distorted by UI, response speed, and other factors. To make conclusions reliable, the evaluation must be decomposed into scorable dimensions:

    • Structural completeness: whether necessary sections are present, such as background, goals, scope, non-goals, user stories, constraints, and acceptance criteria.
    • Constraint adherence: how well the model obeys hard requirements such as word count, format, field naming, forbidden words, and output hierarchy.
    • Semantic consistency: whether terminology is unified, definitions conflict, and references are clear.
    • Testability: whether acceptance criteria are measurable and include inputs, expected outputs, and failure paths.
    • Engineering feasibility: whether idempotency, concurrency, permissions, auditing, degradation, and rollback are considered.
    • Traceability: whether requirement items carry unique IDs so they can be mapped to test cases and task cards.

    Assign each dimension a score from 1 to 5, and keep the raw outputs for review. In multi-round evaluations, fix the prompts and random seeds to reduce randomness.

    3. Prompt Engineering: Constraining Model Output with a “Contract”

    High-quality output usually comes from high-quality constraints. Treat the prompt as an “API contract” that specifies inputs, outputs, and validation rules. For example:

    1. Role: Senior requirements analyst
    2. Input: A colloquial description provided by the business side
    3. Task: Output a structured requirements document
    4. Hard constraints:
    5. 1. Use Markdown, with the top-level heading fixed as "Requirements Document";
    6. 2. Each requirement starts with REQ-number and must include "Description / Priority / Acceptance Criteria";
    7. 3. Acceptance criteria use the Given-When-Then pattern;
    8. 4. Uncertain implementation details are marked as "TBD"; fabricating APIs or parameters is forbidden;
    9. 5. The whole document must not exceed 1200 words.

    The value of such prompts is converting “vague expectations” into “decidable conditions.” Differences among models under long or stacked constraints are exactly what the evaluation focuses on.

    4. Typical Differences: Stability Under Long-Chain Constraints

    When multiple groups of constraints are submitted at once (fixed sections, numbering rules, sentence templates, word limits, no fabrication), a common pattern emerges: some models maintain all constraints stably and their output can go straight to review; others show broken numbering, drifting sentence patterns, or add technical details that were never provided once the document gets longer. The latter is not necessarily “incapable”—it reflects different strategies for constraint retention and context management.

    From an engineering perspective, the value of a requirements document lies not in wording but in being “unambiguous.” Therefore, evaluation should spot-check three types of content: whether boundary conditions are missed, whether exception flows are closed loops, and whether acceptance criteria are executable. Models that output stably on these three points are more suitable for formal processes.

    5. A Reusable Evaluation Workflow: From Samples to Regression

    Teams are advised to build a small regression set covering typical business types: order-related (state machines and idempotency), permission-related (roles and data scope), content-related (review and versioning), and data-related (definitions and consistency). The workflow:

    1. Prepare 10–20 anonymized business descriptions and annotate key constraints;
    2. Fix the prompt template and generate documents in batch;
    3. Have two people blindly score against the dimensions in Section 2, and review disagreements;
    4. Distill high-scoring samples into prompt fragments and checklists;
    5. Run regression after every model or template change and watch score fluctuations.

    Sample validation script (pseudocode):

    1. def check(doc):
    2. assert doc.startswith("# Requirements Document")
    3. reqs = parse_requirements(doc) # extract REQ- items
    4. assert len(reqs) > 0
    5. for r in reqs:
    6. assert r.priority in {"P0","P1","P2"}
    7. assert is_given_when_then(r.acceptance)
    8. assert "TBD" in doc or no_speculation(doc)

    6. Enterprise Adoption: Systems Engineering Beyond Model Capability

    Even after choosing the more stable model, quality should not be bet entirely on a single generation. A safer approach is a three-stage pipeline of “generation + validation + human review”: the model handles the first draft and structural completion, a rules engine validates format and numbering, and humans focus on business trade-offs and risks. If sensitive data is involved, private or dedicated cloud deployment can be used, together with logging, monitoring alerts, and permission auditing to keep the process traceable.

    For cloud implementation, common building blocks can be combined: object storage for samples and artifacts, a message queue to decouple generation from validation, a container platform to host inference and rules services, and logging plus monitoring for a quality dashboard. Baidu AI Cloud offers corresponding product forms in these general categories, and teams can combine them flexibly according to compliance and cost requirements.

    7. Conclusion: From “Which Is Stronger” to “Which Fits Better”

    Back to the original question: models do differ in the requirements-document scenario, but the conclusion should serve the process. Use constraint adherence, testability, and engineering feasibility as core metrics, build a regression set and a validation pipeline, and make selection with data rather than impressions. Once the evaluation system is in place, the gains from model iterations can be captured reliably, and the requirements document truly becomes a dependable baseline for engineering collaboration.