Instruction Following Evaluation for LLMs and Practical Prompt Engineering
This article explains why stronger models do not always follow instructions reliably, outlines four common causes of controllability problems, and shows how to build a reproducible instruction-following evaluation set. It also covers structuring prompts into layered constraints, defining clear output contracts, and using an iterative workflow with regression tests and programmatic post-processing to turn barely usable outputs into stable ones. Readers will find practical guidance on model selection based on controllability alongside general capability.
1. Background: Why “More Capable” Does Not Mean “More Obedient”
In real model application development, a recurring pattern appears: some models perform well on general benchmarks but consistently fail on tasks loaded with business constraints. Developers keep adding explanations and stacking restrictions, yet the output still drifts from expectations, as if the model’s default behavioral tendencies structurally conflict with the task requirements. These issues are usually not a lack of capability, but deviations in instruction following and constraint satisfaction.
This article does not draw evaluation conclusions about any specific vendor or model. Instead, it abstracts these phenomena into a general engineering problem: how to assess model controllability within a reproducible evaluation framework, and how to use prompt and workflow design to move from “barely usable” to “reliably usable.”
2. Four Typical Causes of Controllability Problems
- Prior behavioral inertia. Output styles and structural habits learned during pretraining take effect automatically when there is no explicit suppression signal, showing up as fixed formatting, redundant phrasing, and unrequested additions.
- Conflicting constraints. When style, length, structure, and value ranges are specified at the same time, the constraints may pull against each other. The model compromises, so it “looks compliant but actually misses the target.”
- Unclear instruction hierarchy. System-level requirements, task-level requirements, and implicit requirements from examples get mixed together. The model struggles to determine priority and is easily led astray by fragments that are closer or more specific.
- No verifiable acceptance criteria. Requirements are described in natural language as “must be acceptable,” but no checkable pass conditions are given. The model and the evaluator interpret them differently, creating a subjective tug-of-war.
3. Building a Reproducible Instruction-Following Evaluation Set
Improvement starts with quantification. Build a small but focused internal evaluation set that covers the real business distribution rather than relying on generalized leaderboards.
- Task tiers: single-constraint tasks, multi-constraint combination tasks, long-context constraint tasks, and conflicting-constraint tasks.
- Judgment method: automate with programs wherever possible, such as checking whether fields are complete, whether enum values are valid, whether length is out of bounds, and whether JSON is parseable.
- Scoring structure: break “completion” into four parts—constraint pass rate, format compliance rate, factual consistency, and human readability—so a single overall score does not hide weaknesses.
A sample validation skeleton:
def evaluate(output: str, spec: dict) -> dict:checks = {}checks["json_valid"] = try_parse_json(output)checks["required_fields"] = all(k in spec["fields"] for k in spec["fields"])checks["enum_ok"] = extract_enum(output) in spec["allowed"]checks["length_ok"] = len(output) <= spec["max_chars"]pass_rate = sum(checks.values()) / len(checks)return {"checks": checks, "pass_rate": pass_rate}
The key point is to turn “I think it fails” into “which specific constraint failed,” which gives discussions a basis for convergence.
4. Structuring Prompts: From Stacked Restrictions to Layered Expression
The most common inefficient practice is continually appending “do not… absolutely do not…,” which makes instructions interfere with each other. A more robust approach is layering and structuring.
- Role and goal: state the purpose of the deliverable and its audience in one sentence.
- Hard constraints section: list verifiable items in a numbered list, with each item expressing only one requirement.
- Output contract: specify structure, fields, order, and examples, fixing the shape with a schema or template.
- Conflict resolution rules: explicitly declare priority, for example “format takes precedence over length” or “fill null when a field is missing rather than omitting it.”
- A few examples: one positive example is enough; too many examples introduce implicit constraints.
[Goal] Generate a structured task list for consumption by downstream programs[Hard constraints]1. Output JSON only, with no explanatory text2. Fields are fixed as id/title/priority/owner3. priority values are limited to P0/P1/P24. No more than 5 items[Conflict rule] Field completeness takes precedence over description richness[Example] {...}
This style front-loads the acceptance criteria that the model would otherwise struggle to infer, significantly reducing the number of back-and-forth correction rounds.
5. Iteration Workflow: Small-Step Validation and Regression Protection
- Single-variable adjustment: change only one constraint or one example at a time and record the pass rate change, avoiding mixed changes that cannot be attributed.
- Failure sample archiving: turn failed cases into regression test cases to prevent later optimizations from introducing regressions.
- Segmented generation: for long-output tasks, produce the skeleton first and then fill in details, reducing the chance of constraint forgetting in long contexts.
- Programmatic post-processing: hand deterministic work to code, such as field completion, format conversion, sensitive-word filtering, and length trimming, leaving only the semantic part to the model.
- Cost and latency trade-offs: complex constraint tasks can use a tiered approach of “small model batch pre-screening + large model refinement.” Handle concurrency and queuing on container platforms and message queues, and track pass rate and timeout distributions with logging services and monitoring alerts.
6. Selection Advice: Treat Controllability as Equal to Intelligence
When evaluating candidate models, treat controllability as an independent dimension alongside general capability: constraint pass rate under the same prompt, the number of prompt rounds needed to reach the goal, how conflicting instructions are handled, structured output stability, and constraint retention in long contexts. What is more worth investing in engineering-wise is the infrastructure of “verifiable acceptance criteria + structured contracts + regression test sets.” It keeps evaluation standards consistent when models are swapped, so upgrades bring stable gains rather than renewed trial and error.
In summary, a model “not listening” is mostly a problem that can be converged with engineering means: quantify first, then express in layers, and finally use workflow and code to cover the deterministic parts. To support large-scale evaluation and invocation, you can rely on general cloud capabilities (such as object storage for samples, container platforms for inference services, and logging and monitoring systems for tracking metrics) to build a sustainable evaluation pipeline.
