How field names, descriptions, ordering, and enums act as implicit instructions that steer LLM behavior — and why treating schema design as prompt engineering is the most underrated skill in production AI.


Here's a mistake I've seen more times than I can count: an engineering team spends weeks crafting the perfect system prompt, iterating on tone and precision, A/B testing instruction phrasing — and then hands the model a schema with fields named field1, val, and cat.

The system prompt says "extract the customer's sentiment and product category." The schema says nothing. The model gets two conflicting signals, and one of them is the one it follows when it actually generates tokens.

This isn't theoretical. AWS just published a structured output guide for Bedrock that makes this explicit: your JSON Schema field names, descriptions, ordering, and enum values directly control model behavior. They're not metadata. They're not documentation. They are prompt engineering, embedded in the schema, operating at the token level during generation.

The guide calls this out plainly. Clear names like customer_email outperform generic names like field1. The PARSE research system (from Amazon's own researchers) demonstrated that optimizing field descriptions alongside other schema improvements achieved up to 64.7% improvement in extraction accuracy. Dylan Castillo showed with statistical significance (p < 0.01) that placing reasoning fields before answer fields produces substantially better outputs.

This is the schema-as-prompt thesis: when you use structured outputs, the schema is part of the prompt. Designing it is designing instructions. And most teams are designing those instructions by accident.

The Token-Level Reality

To understand why this matters, you need to understand what happens during constrained decoding.

When you send a JSON Schema to Bedrock (or OpenAI, or Anthropic, or any provider with structured outputs), it doesn't generate text and then validate it. The schema gets compiled into a grammar — a finite-state machine that constrains which tokens the model can emit at each position. Invalid tokens are masked out. The model literally cannot produce output that violates the schema.

This is a marvel of engineering. It also means every token the model can produce is shaped by two forces: the schema grammar and the model's internal weights. Your system prompt influences the weights. The schema controls the grammar. They're both active during generation, and they interact.

Here's the critical insight: the schema doesn't just constrain what values are possible. It shapes what the model thinks about while generating. When the model writes "customerfullname":, that string becomes context that primes subsequent tokens. The model has seen billions of examples of "customerfullname" in its training data. It knows what belongs there. It has no such priors for cn.

This is why schema design matters. It's not a formatting concern. It's a prompt engineering concern that operates at the generation level, where the model is actually making decisions.

Signal One: Field Names Are Implicit Instructions

The AWS guide is blunt: "clear names like customer_email outperform generic names like field1." Let me show you what that looks like in practice.

Consider two schemas that are structurally identical — same types, same required fields, same everything — but with different naming:

Bad naming:

{
  "type": "object",
  "properties": {
    "nm": {"type": "string"},
    "val": {"type": "number"},
    "cat": {"type": "string"}
  },
  "required": ["nm", "val", "cat"],
  "additionalProperties": false
}

Feed this to a model and you get: {"nm": "Widget A", "val": 3, "cat": "B"}. What does val mean? What's cat? The model doesn't know either. It's guessing based on minimal semantic signal.

Good naming:

{
  "type": "object",
  "properties": {
    "product_name": {"type": "string"},
    "rating_out_of_five": {"type": "number"},
    "product_category": {
      "type": "string",
      "enum": ["electronics", "clothing", "food", "home", "other"]
    }
  },
  "required": ["product_name", "rating_out_of_five", "product_category"],
  "additionalProperties": false
}

Output: {"productname": "Widget A", "ratingoutoffive": 4.2, "product_category": "electronics"}. Every field is self-explanatory. The model knows what to produce because the field names activate relevant priors from training data.

Same token budget. Same API call cost. Dramatically different quality. This isn't a marginal improvement — it's the difference between data you can use and data you need to clean.

The principle: write field names as if you're writing instructions, because you are. ratingoutoffive isn't just a name; it tells the model the scale and range. isfraudulent isn't just a label; it frames the field as a binary classification task. Every name you choose either helps the model or leaves it guessing.

Signal Two: Descriptions Are Micro-Prompts

If field names are implicit instructions, descriptions are explicit ones — inline, scoped, and shockingly underused.

The AWS guide shows this with a support ticket extraction schema. Here's the key field:

"severity": {
  "type": "string",
  "enum": ["low", "medium", "high", "critical"],
  "description": "low=cosmetic, medium=degraded, high=broken, critical=data loss or outage"
}

Without that description, "high severity" means whatever the model thinks it means. With it, "high" specifically means "something is broken." The description encodes your business logic directly into the schema. The model reads it at generation time and uses it to classify correctly.

This goes beyond enums. Consider:

"issue_summary": {
  "type": "string",
  "description": "One-sentence summary of the problem, max 20 words"
}

Bedrock's grammar engine can't enforce word counts — there's no maxLength that works at the word level. But the model will follow the instruction embedded in the description. It's a soft constraint that works because the model reads descriptions as part of its input context.

The PARSE research paper (Shrimal et al., EMNLP 2025 Industry Track) formalized this. They showed that optimizing field descriptions — making them precise, task-relevant, and unambiguous — contributed to a 64.7% improvement in extraction accuracy when combined with other schema optimizations. That's not a rounding error. That's the difference between a prototype and a production system.

The practical takeaway: treat every description field as a one-line prompt. Be specific about format, meaning, and edge cases. Include definitions for your categories. State constraints explicitly even if they can't be mechanically enforced. The description is the cheapest quality lever you have — it costs nothing to write well, but neglecting it costs you accuracy on every single inference call.

And here's the pro tip the AWS guide quietly drops: changing descriptions doesn't invalidate Bedrock's grammar cache. You can iterate on your descriptions — A/B test them, refine wording, add clarity — without waiting for the schema to recompile. Field names, types, and enums require recompilation. Descriptions are free to change. That makes them your primary iteration surface.

Signal Three: Field Order Controls Reasoning Quality

This is the most underappreciated insight in the entire structured output space.

LLMs generate tokens sequentially, left to right. When producing a JSON object, they generate fields in the order you define them. This means the order of your properties determines the order in which the model thinks about the problem.

Put the answer field first, and the model commits to an answer before it reasons. The reasoning that follows isn't reasoning — it's post-hoc justification. The model is explaining a decision it already made.

This was demonstrated rigorously by Dylan Castillo, who ran controlled experiments showing that placing reasoning fields before answer fields produces statistically significant improvements (p < 0.01). The effect is consistent across models and tasks.

Bad order — answer first:

{
  "type": "object",
  "properties": {
    "is_fraudulent": {"type": "boolean"},
    "confidence": {"type": "number"},
    "reasoning": {"type": "string"}
  },
  "required": ["is_fraudulent", "confidence", "reasoning"],
  "additionalProperties": false
}

The model writes true for is_fraudulent, then 0.85 for confidence, then fabricates reasoning to match. You've built a confidence-manufacturing machine.

Good order — reasoning first:

{
  "type": "object",
  "properties": {
    "risk_indicators": {
      "type": "array",
      "items": {"type": "string"},
      "description": "Suspicious patterns observed in the transaction"
    },
    "analysis": {
      "type": "string",
      "description": "Step-by-step reasoning about whether this is fraudulent"
    },
    "is_fraudulent": {
      "type": "boolean",
      "description": "Final determination based on the analysis above"
    },
    "confidence": {
      "type": "number",
      "description": "Confidence between 0.0 and 1.0"
    }
  },
  "required": ["risk_indicators", "analysis", "is_fraudulent", "confidence"],
  "additionalProperties": false
}

Now the model identifies indicators, reasons through them, then decides. The reasoning shapes the answer, not the other way around. This is chain-of-thought prompting, but embedded in the schema structure rather than the system prompt.

This pattern applies everywhere:

  • Classification: evidence fields before the label
  • Summarization: key points before the summary
  • Evaluation: criteria before the score
  • Extraction: observations before the entity

The principle is universal: let the model observe before it concludes. Structure your schema so that supporting evidence, reasoning steps, and intermediate observations come before the final answer. It's the single biggest quality lever in schema design, and almost nobody is using it deliberately.

Signal Four: Enums Do Two Jobs at Once

Enums are the only schema feature that constrains mechanically and semantically at the same time.

Mechanically, the grammar engine prevents the model from producing any token outside the enum set. If you define sentiment as ["positive", "negative", "neutral"], the model physically cannot output "good" or "mostly positive" or a thumbs-up emoji. Every downstream system receives exactly one of those three strings.

Semantically, the enum values tell the model what categories exist. The model has to choose from your list, so it maps its understanding onto your taxonomy. The values themselves become context — "positive", "negative", "neutral" activate different priors than "happy", "sad", "meh".

Three rules for designing enums:

1. Use human-readable values. "positive" not "pos". The model understands full words better, and so will every human who reads your data.

2. Always include a fallback. "other" or "unknown" or "not_specified". Without a fallback, the model will shoehorn ambiguous inputs into the closest available category, distorting your data. The fallback is an escape valve that keeps your categories honest.

3. Define meanings in descriptions. The enum constrains the values, but the description constrains the semantics. What does "critical" mean in your system? The model doesn't know unless you tell it.

"severity": {
  "type": "string",
  "enum": ["critical", "warning", "suggestion", "nitpick"],
  "description": "critical=bugs/security, warning=likely problems, suggestion=improvements, nitpick=style only"
}

Without the description, "warning" and "suggestion" blur together. With it, the model classifies precisely because it knows exactly what you mean.

Signal Five: Nullable Types Prevent Hallucination

There's a subtle failure mode in structured outputs: when a field is required but the source data doesn't contain the information, the model will make something up rather than leave the field empty. It has to — the schema demands it.

"company_name": {"type": "string"}

If the input text says "a startup based in Berlin" without naming the company, the model will hallucinate one. Not because it wants to, but because the schema says string is required and null isn't allowed.

The fix is nullable types:

"company_name": {
  "type": ["string", "null"],
  "description": "Company name if mentioned in the text, null otherwise"
}

Now the model has an out. When it doesn't know, it says it doesn't know. The description reinforces when null is appropriate, preventing the model from nulling out fields it actually has information for.

This pattern is particularly important for extraction tasks where input data is messy and incomplete — which is to say, for every real-world extraction task.

The Schema-as-Prompt Design Checklist

If you're building production systems with structured outputs, here's a practical checklist that treats schema design as prompt engineering:

  1. Audit every field name. Could a stranger understand what this field contains from the name alone? If not, rename it. customer_email > email > eml > e.
  1. Write descriptions for every field. Treat them as one-line prompts. Include format expectations, edge case handling, and definitions for any domain-specific terms. This is free to iterate on (no grammar recompilation) and has measurable impact on accuracy.
  1. Order fields observation → reasoning → conclusion. Put evidence before labels. Put intermediate steps before final answers. Let the model think before it commits.
  1. Use enums aggressively. They're the only feature that constrains mechanically and semantically. Define clear, human-readable values. Always include a fallback category. Document what each value means in the description.
  1. Make uncertain fields nullable. Don't force the model to hallucinate when it doesn't have information. Use ["string", "null"] type unions and explain when null is appropriate in the description.
  1. Iterate on descriptions first. Since description changes don't trigger grammar recompilation on Bedrock (and likely on other providers too), they're your fastest iteration loop. Get the structure right once, then refine descriptions until quality plateaus.
  1. Test with adversarial inputs. Feed your schema inputs that are ambiguous, incomplete, or edge cases. Check whether the model falls back correctly, reasons before concluding, and classifies precisely. If it doesn't, the schema needs work — not the system prompt.

Why This Matters Now

Structured outputs are no longer optional for production AI systems. Every major provider supports them. Every framework assumes them. They're the backbone of agentic workflows — tool calls, extraction pipelines, classification systems, evaluation harnesses.

But the industry has been so focused on getting valid JSON that it's largely ignored getting good JSON. The AWS guide is one of the first from a major provider to explicitly state what practitioners have been discovering empirically: schema design is prompt design. The schema isn't just a contract. It's a control surface.

This has practical implications that go beyond individual schemas:

Schema reviews should be prompt reviews. When you review a schema, you're reviewing instructions the model will follow. Apply the same rigor you'd apply to a system prompt. Every ambiguous field name is an ambiguous instruction. Every missing description is a missing instruction.

Schema iteration is prompt iteration. The field ordering experiment, the description refinement, the enum design — these are prompt engineering techniques that happen to live in a JSON Schema. If you have a prompt engineering workflow, it should include schema optimization.

Schema quality is output quality. The PARSE paper showed 64.7% improvement from schema optimization. That's not a rounding error. That's the gap between a system that works and a system that works well. And most of that improvement comes from treating the schema as what it actually is: a prompt.

The next time you write a JSON Schema for a structured output, ask yourself: if this were a system prompt, would I be satisfied with it? Because to the model generating your data, it already is.


Sources: AWS Bedrock Structured Output Guide (dev.to/aws-builders, Jun 2026); PARSE: LLM Driven Schema Optimization for Reliable Entity Extraction (Shrimal et al., EMNLP 2025); Dylan Castillo on field ordering; AWS Bedrock Structured Outputs announcement; Instructor prompting guide.