Comparing LLMs for Structured Requirement Completion: A Practical Evaluation Framework

    This article compares general-purpose large language models on structured requirement completion, moving beyond subjective "which is smarter" debates toward reproducible engineering metrics. It breaks the evaluation into three dimensions—instruction following, structure preservation, and visual grounding—and examines two scenarios: checklist-based expansion under a minimal-intervention principle, and screenshot-to-Markdown table transcription with anti-hallucination safeguards. It also outlines a small regression test set, metric definitions, and model selection guidance for reliable deployment.

    1. Why “Which Model Is Stronger” Is the Wrong Question

    In real development workflows, requirement documents are never written in a single pass. They evolve iteratively: first a skeleton, then details, then repeated feedback into the document. Developers typically list features, ask a model to expand sub-items, and manually consolidate the output back into the document. This workflow does not demand creativity from the model; it demands strict instruction following and structure preservation.

    Given that, comparing two general-purpose LLMs is more meaningful when the question is abstracted into three verifiable technical dimensions:

    1. Instruction Following: Does the model do only what was asked?
    2. Structure Preservation: Does it keep the input hierarchy and numbering intact, without deleting or adding items?
    3. Visual Grounding: When converting a screenshot into structured text, does it output only what actually exists in the image?

    Shifting the evaluation goal from “who is smarter” to “who is more controllable” moves the conclusion from subjective impressions to reproducible engineering metrics.

    2. Scenario 1: Checklist Completion and the Minimal-Intervention Principle

    Suppose the input feature list is A, B, C, D. The expected output expands sub-items under each node rather than reordering or replacing them.

    Expected shape:

    1. A
    2. A1
    3. A2
    4. B
    5. B1
    6. C
    7. C1
    8. D
    9. D1

    Unacceptable behavior in engineering terms includes deleting B, merging B and C, inventing an E out of nowhere, and providing a derivation such as “E = B + C”. Such output pollutes the requirement baseline and shifts all downstream task breakdown, test cases, and acceptance criteria.

    Reusable constraint prompt (illustrative):

    1. You only complete; you do not rewrite:
    2. 1) Top-level nodes must match the input exactly; count, naming, and order must not change;
    3. 2) Adding, deleting, merging, or renaming any top-level node is forbidden;
    4. 3) Add 2-4 sub-items under each top-level node;
    5. 4) If information is insufficient, output "TODO: needs clarification" instead of making assumptions;
    6. 5) Output only a Markdown list, with no explanations.

    Automated validation (pseudocode):

    1. def validate(original, generated):
    2. assert top_level(original) == top_level(generated), "Top-level structure was modified"
    3. assert set(original) - set(generated) == set(), "Deleted nodes exist"
    4. assert set(generated) - set(original) == set(), "Added nodes exist"
    5. return True

    Placing validation after generation and before ingestion blocks most “acting on its own” output. The engineering lesson is that structure-oriented tasks must be paired with machine validation rather than relying on the model’s self-discipline.

    3. Scenario 2: Screenshot Table to Markdown, Testing Visual Grounding and Hallucination Resistance

    Converting a table in an interface screenshot into Markdown and then feeding it to an AI coding tool to generate code is a common pipeline. The core risk here is “visual hallucination”: the model outputs feature items that do not exist in the image, or sticks to its original judgment even after being told it is wrong.

    A robust approach has four steps:

    1. Preprocessing: Enlarge the screenshot, crop to the target module, and apply binarization when necessary to reduce small-text recognition errors.
    2. Constrained output: Make it explicit that the model should “transcribe only visible content, fill missing cells with N/A, and not infer”.
    3. Cross-validation: Run two independent recognitions on the same image, compare the differing items, and route those items to a manual review queue.
    4. Traceability and rollback: Keep the mapping between the original image and the output so the source of errors can be located.

    Illustrative prompt:

    1. Transcribe only the text visible in the image, outputting a Markdown table row by row and column by column.
    2. If a cell is unreadable, fill in N/A; if the entire table does not exist, output EMPTY.
    3. Inferring features from context is forbidden.

    It is important to stress that recognition accuracy is significantly affected by image quality, font size, and contrast, and any promise of “100% correctness” is untrustworthy. Engineering goals should be measurable, reviewable, and rollback-capable, rather than pursuing a perfect single output.

    4. Evaluation Method: A Small Regression Set Instead of Subjective Impressions

    Build a regression set of 30-50 cases covering three task types: structure completion, table transcription, and long-text summarization. Metrics are defined as follows:

    • Structure fidelity rate = number of samples with consistent top-level structure / total samples
    • Hallucination rate = number of samples containing added fictional items / total samples
    • Parseability rate = proportion of samples whose output can be directly consumed by a parser
    • Manual rework time (minutes per sample)

    Illustrative evaluation loop:

    1. for case in regression_set:
    2. out = call_model(case.prompt, case.image)
    3. metrics += score(case.expected, out)
    4. report(metrics)

    Low-costly trying multiple models side by side through a third-party aggregation interface is a viable path, but conclusions must rest on your own regression set, because prompts, language, and domain terminology can significantly change the ranking. There is no universally optimal prompt paradigm; there is only the optimal configuration for your data distribution.

    5. Selection and Implementation Recommendations

    • For requirement completion, prefer the model with more stable “minimal intervention” behavior and enforce machine validation.
    • For visual transcription, prefer models with stronger hallucination resistance and reproducibility, and keep a manual review step.
    • For long-chain AI Agent scenarios, introduce role separation: one model handles expansion and another handles review, reducing single-point risk.
    • On Baidu AI Cloud, you can combine object storage to keep original materials, a message queue to decouple tasks, a container platform to host inference services, and logging plus monitoring and alerting for quality tracking, forming a closed loop.
    • Commercial sustainability affects the pace and direction of model iteration, so “long-term availability” should be included in selection rather than judging only by a single demo.

    6. Conclusion

    Rewriting “which is stronger” into “which is more controllable on my task distribution” is the first step toward engineering rigor. Structure completion is judged by structure fidelity, and visual transcription by grounding and hallucination resistance; both should be backed by automated validation plus manual review. Build the regression set first, then discuss selection—that is the reproducible path to a technical decision.