Evaluating Complex Instruction Following in Large Language Models: Methods and Engineering Practices
As large language models iterate, benchmarks, knowledge coverage, and code generation often get the most attention. In real-world engineering, however, the more critical shift happens in prompt adherence: whether a model can understand spatial relationships, physical constraints, technical terminology, implicit assumptions, and ambiguous semantics in complex instructions, and faithfully reproduce the user's intent in its output. This article breaks instruction following into four levels, uses a geometric construction task as a case study, presents a checklist-based evaluation method, and offers practical engineering recommendations for making instruction adherence a measurable, operable capability.
Evaluating Complex Instruction Following in Large Language Models: Methods and Engineering Practices
During large language model version upgrades, benchmark scores, knowledge coverage, and code generation capability tend to receive the most attention. But in real engineering scenarios, a more critical change often occurs in “prompt adherence”: the model no longer merely produces plausible-looking answers, but understands the spatial relationships, physical constraints, technical terms, implicit premises, and ambiguous semantics within complex instructions, and reproduces the user’s true intent in the final deliverable. For long-chain-of-thought, high-parameter models, this capability is not simply “obedience” — it is a systematic capability spanning semantic understanding, constraint execution, and verifiable results.
1. Shifting the Evaluation Focus: From “What It Knows” to “Whether It Executes Under Constraints”
Traditional model evaluation often relies on QA accuracy, code pass rates, or text quality. Yet in complex tasks, failures are usually not “the model doesn’t know how,” but “the model didn’t strictly follow instructions.” For example, when asked to generate an interactive page, a step-by-step calculation workflow, or an automation script, a model may complete the core functionality while omitting units, boundary conditions, intermediate steps, output formats, or requirements to show construction traces. Such issues seem minor in demos but放大 into rework costs in production.
Prompt adherence can be decomposed into four levels:
- Literal adherence: whether requirements on output format, field names, counts, ordering, and language are met;
- Structural adherence: whether dependencies between steps, phase divisions, and state changes are correct;
- Semantic adherence: whether the model understands technical terms, ambiguous expressions, and implicit constraints;
- Intent reproduction: whether the final result actually solves the user’s problem, with both process and outcome verifiable and reproducible.
Many models perform reasonably on the first two levels but expose weaknesses at the third and fourth. Especially when a task combines obscure terminology, multiple object references, and implicit defaults, the model needs the ability to “formalize natural language” in order to execute reliably.
2. Case Study: Why a Geometric Construction Task Tests Adherence
A representative test asks the model to generate a browser-based web page that constructs a regular heptagon using a “marked ruler” (a two-mark ruler), fills in the omitted compass-and-straightedge construction steps, and supports animated GIF export. It looks like a math drawing task, but it simultaneously examines terminology understanding, spatial operations, multi-object references, process control, and output consistency.
The main difficulties include:
- Understanding an uncommon tool: the marked ruler is not a standard drafting instrument. The model must understand its two marks, the fixed distance between them, and the constraint of “sliding along edges until a condition is met,” rather than treating it as an ordinary straightedge.
- Simultaneous references to multiple objects: nearly every step involves a square, its base edge, a perpendicular bisector, vertices, diagonals, circles, and ruler marks. The model must keep object identities and relationships unconfused.
- Inferring implicit constraints: the instruction does not specify the square’s side length, but given the heptagon goal, the model must infer a unit side length; the ruler’s mark spacing is likewise assumed to be the unit length; “necessary traces” must be interpreted as keeping only the construction-relevant paths, not drawing everything.
- Process–result consistency: the model must not only draw the final figure but also fill in omitted steps, ensuring the animation matches the final static result.
- Verifiability requirements: the output needs checks on whether points land in the correct positions, whether circles and lines are tangent or intersect as expected, whether perpendicular bisectors are accurate, and whether the final polygon approximates a regular heptagon.
So this task is far from “just drawing a figure” — it is a comprehensive test of natural-language specification understanding and execution consistency.
3. Evaluation Method: Turning Subjective Impressions into Checkable Items
Evaluating prompt adherence should not rely on a final screenshot alone. Instead, decompose the task into a constraint checklist and combine automated checks with manual sampling. Pseudocode:
evaluate(task, output):checks = []checks.append(check_output_format(output)) # Output format and entry pointchecks.append(check_square(task, output)) # Square and unit side lengthchecks.append(check_bisector(task, output)) # Perpendicular bisector constructionchecks.append(check_circle(task, output)) # Center, radius, intersectionschecks.append(check_marked_ruler(task, output)) # Marked ruler constraintschecks.append(check_construction_steps(output)) # Omitted steps filled inchecks.append(check_trace_policy(output)) # Necessary-trace policychecks.append(check_animation_consistency(output)) # Animation matches final resultchecks.append(check_final_heptagon(output)) # Final figure correctnessreturn aggregate(checks)
In engineering practice, failure modes can be categorized as: format failures, terminology misunderstandings, misaligned object references, missing implicit constraints, missing process steps, animation–result inconsistency, and unverifiable final results. Each category should enter a regression suite rather than being summarized into a single total score. For geometric tasks, coordinate assertions, angle errors, intersection distances, and step coverage rates can aid judgment; for code generation tasks, unit tests, static checks, and runtime logs can be used for validation.
4. Engineering Recommendations: Making Adherence an Operable Capability
First, move prompt engineering from “stacking descriptions” toward “writing specifications.” Express goals, inputs, constraints, outputs, and acceptance criteria separately, and explicitly list units, boundaries, prohibited items, and intermediate artifacts that must be preserved. Second, introduce intermediate representations. For complex tasks, have the model first output a step plan or constraint checklist before executing generation, reducing omissions from one-shot completion. Third, build layered validation: format checks, structural checks, semantic checks, and result checks pass in sequence. Fourth, maintain a regression evaluation set —固化 historical failure cases into test tasks to continuously track capability changes across version upgrades. Fifth, when orchestrating evaluation tasks on Baidu AI Cloud, treat the evaluation set, constraint checkers, and regression reports as part of your infrastructure, aligning model capability assessment with business acceptance criteria.
5. Conclusion
When evaluating a model version upgrade, don’t just ask whether it “answers more convincingly” — ask whether it can reliably “do it right” under complex natural-language instructions. The essence of prompt adherence is the model’s ability to transform vague requirements into executable constraints while keeping semantics, process, and acceptance criteria consistent in the result. For developers and enterprise users, building an evaluation system oriented toward complex instructions reflects real-world production usability far better than one-off impressions.
