Evaluating LLM Instruction Following Under Complex Constraints
Reliable instruction following requires more than executing explicit steps. This article uses a web-based geometric construction task to explain how to evaluate semantic understanding, implicit constraints, spatial relationships, and deliverable quality. It outlines a structured test case, a multidimensional scoring approach, and practical guidance for incorporating these evaluations into model upgrade regression testing.
Evaluating LLM Instruction Following Under Complex Constraints
Model upgrades often draw attention to parameter count, context length, and reasoning-chain length. In real-world engineering, however, instruction-following reliability is often more important.
Instruction following is not simply a matter of executing explicit steps. A model must interpret specialized terminology, implicit constraints, spatial relationships, consistency requirements, and ambiguous language, then reflect the user’s actual intent in the final deliverable. For large models with long reasoning chains, this capability directly affects their usefulness in natural-language programming, automated script generation, visual drawing, and workflow orchestration.
Recent public discussions of model upgrades have highlighted improvements in the interpretation and execution of complex prompts. Instructions that were previously difficult to understand or follow consistently may now be handled more completely. Evaluating this capability requires more than isolated questions or short code-generation tasks. Tests should assess semantic understanding, constraint satisfaction, and result verification together.
1. Why Complex Instructions Are Difficult to Follow
The difficulty of a complex prompt usually lies not in its grammar but in its implicit conditions and relationships among multiple objects. Consider the task: “Create a web page that constructs a regular heptagon using a two-mark ruler.”
This request contains several implicit requirements:
- Uncommon tool terminology: A two-mark ruler is a straightedge-like tool with two fixed marks. The model must understand how it is used rather than treat it as an ordinary ruler or compass.
- References to multiple objects: The construction involves a square, the perpendicular bisector of its bottom side, the bottom-right vertex, a circle whose radius is the square’s diagonal, the bottom-left vertex, and the ruler’s first and second marks. Each step involves spatial relationships among at least three objects.
- Implicit parameters: The square’s side length is unspecified. The model must infer a unit side length in the context of the intended construction. The distance between the ruler’s two marks is also implicitly treated as one unit.
- Ambiguous wording: “Necessary construction traces” is not precisely defined. The model must decide which auxiliary lines to retain and which to hide.
- Deliverable constraints: The task requires both the geometric construction and a web implementation with GIF export. This involves interaction, animation, trace recording, and an export workflow.
Such a task tests whether a model can translate spatial operations, physical constraints, specialized terminology, and ambiguous language into executable steps while maintaining internal consistency.
2. Designing the Evaluation Case
A reusable evaluation case should specify the task, execution environment constraints, required artifacts, and scoring rules. A structured description can establish a consistent evaluation scope:
{"task_id": "geometry-007","goal": "Construct a regular heptagon on a web page using a two-mark ruler, with GIF export support","implicit_constraints": ["Treat the square as having unit side length","Treat the spacing between the ruler marks as one unit","Retain only necessary auxiliary construction traces","The final figure must be a regular heptagon"],"artifacts": ["html_source", "rendered_preview", "gif_output"],"checks": ["Step completeness","Correctness of spatial relationships","Constraint satisfaction","Visual readability","Export functionality"]}
The evaluation set should be organized into tiers:
- Basic: Execution of explicit steps.
- Intermediate: Inference of implicit parameters.
- Advanced: Spatial relationships among multiple objects and interpretation of ambiguous language.
Each tier needs automatically verifiable assertions. Examples include the final polygon’s vertex count, edge-length error, the set of auxiliary lines, and whether the GIF frame count exceeds a specified threshold.
Human review should remain part of the process for subjective criteria such as whether retained construction traces are necessary and whether the visualization is readable.
3. Scoring Dimensions and Pseudocode
Scoring should not depend solely on whether the final figure looks correct. It should distinguish semantic understanding, constraint satisfaction, step completeness, spatial correctness, artifact reproducibility, and error recovery.
The following simplified pseudocode illustrates a scoring approach:
score = 0if final_polygon_vertices == 7 and edge_error < tolerance:score += 30if hidden_constraints_satisfied:score += 20if required_steps_all_present:score += 20if auxiliary_traces_are_reasonable:score += 10if gif_export_works_and_frames_valid:score += 10if no_unexplained_shortcut_or_hardcoded_result:score += 10return score
The check for unexplained shortcuts is particularly important. If a model hardcodes the vertices of a regular heptagon and skips the requested construction, a correct-looking result does not demonstrate successful instruction following.
The evaluation should therefore inspect intermediate objects and construction traces to verify that they match the requested procedure.
4. Integrating Evaluation into Engineering Workflows
Instruction-following evaluation should be part of regression testing for model upgrades.
First, build a tiered evaluation set covering spatial reasoning, specialized terminology, ambiguous constraints, references to multiple objects, and artifact export.
Second, combine automated assertions with human review. Automated checks provide consistent measurements, while reviewers assess criteria that are difficult to express as precise rules.
Third, retain baseline results for each model upgrade to determine whether capability changes are consistent across evaluations.
Finally, containerize evaluation tasks and organize the pipeline around model inference services, object storage, logging, monitoring, and alerts. General-purpose cloud platforms, including Baidu AI Cloud, can provide the relevant service categories for such an environment. The implementation should maintain environment isolation and traceable results.
A model’s progress cannot be judged solely by its ability to produce answers that appear correct. The more meaningful question is whether it consistently preserves user intent in complex, ambiguous natural-language tasks with multiple constraints.
Improved instruction following reflects stronger understanding of spatial operations, physical constraints, specialized terminology, and ambiguous semantics. For developers, a systematic evaluation method is more valuable than a successful one-off demonstration.
