The Constraint Tax: Measuring Validity-Correctness Tradeoffs in Structured Outputs for Small Language Models

arXiv cs.LG Papers

Summary

This paper introduces the concept of 'constraint tax'—the accuracy loss caused by structured output constraints in small language models—and presents a measurement protocol to quantify the tradeoff between validity and correctness.

arXiv:2605.26128v1 Announce Type: new Abstract: Production LLM systems increasingly require machine-readable outputs: JSON objects, typed traces, regex-constrained fields, and tool-call schemas. This paper targets on-device and low-cost small language model (SLM) deployments, where sub-3B models are attractive for privacy, latency, and commodity hardware but have limited capacity to satisfy schemas while solving tasks. The usual engineering assumption is that hard output constraints improve reliability without changing the underlying answer. We show that this assumption is unsafe for small models. We introduce \emph{constraint tax}, a measurement protocol for isolating the answer and executable-accuracy loss caused by structured-output constraints at fixed model, fixed task distribution, and fixed problem instances. Across 15,000 commodity-GPU generations with Qwen2.5-0.5B, Qwen2.5-1.5B, and SmolLM2-1.7B, hard answer-only schema decoding raises schema validity from 61.5\% to 100.0\%, but lowers answer accuracy from 19.7\% to 11.0\% and increases wrong-valid-schema outputs from 49.5\% to 88.9\%. The strongest industry analogue is a deterministic calendar tool-call task: Qwen2.5-1.5B achieves 91.5\% executable accuracy with prompt-only JSON but only 48.0\% under the same hard tool-call schema, while both modes are 100.0\% schema-valid. The error is semantic, not structural. We also show that the 3B boundary still pays a direct-schema tax and that delayed packaging supports a constructive design pattern: reason free, constrain late. The practical conclusion is direct: production systems should report schema validity, answer accuracy, executable accuracy, and wrong-valid-schema rate separately.
Original Article
View Cached Full Text

Cached at: 05/27/26, 09:03 AM

# The Constraint Tax: Measuring Validity-Correctness Tradeoffs in Structured Outputs for Small Language Models
Source: [https://arxiv.org/html/2605.26128](https://arxiv.org/html/2605.26128)
###### Abstract

Many deployed LLM applications pass model completions directly into software: JSON envelopes, typed traces, regex\-limited fields, and tool\-call arguments\. We study that interface in on\-device and low\-cost small language model \(SLM\) deployments, where sub\-3B checkpoints are attractive for privacy, latency, and commodity hardware but have little spare capacity for solving and formatting at the same time\. The usual assumption is that hard output constraints only improve the wrapper around an answer\. Our measurements show that, for small models, the wrapper can change the answer\. We define*constraint tax*, a paired protocol for measuring answer and executable\-accuracy loss caused by structured\-output constraints at fixed model, task distribution, and problem instances\. We report five result settings: the main commodity\-GPU suite, a calendar tool\-call analogue, a 3B boundary check, backend replication, and a local expanded\-interface study\. In the 15,000\-generation main suite, hard answer\-only schema decoding raises schema validity from 61\.5% to 100\.0%, but lowers answer accuracy from 19\.7% to 11\.0% and increases wrong\-valid\-schema outputs from 49\.5% to 88\.9%\. In the calendar analogue, prompt\-only JSON achieves 91\.5% executable accuracy; the same hard tool\-call schema reaches only 48\.0%, even though both directly generated modes are 100\.0% schema\-valid\. The error is semantic, not structural\. We also find a direct\-schema tax at the 3B boundary and use delayed packaging as evidence for a practical pattern: reason free, constrain late\. Production reports should separate schema validity, answer accuracy, executable accuracy, and wrong\-valid\-schema rate\.

## 1Introduction

Structured outputs are now a serving contract\. Agents pass JSON to tools, gateways validate schemas, routers expect typed fields, and product code often treats parseability as the gate before execution\. That contract is useful, but it is not neutral\. A sub\-3B local model has less decoding capacity and weaker instruction following than a large hosted model, so the same schema can compete with the task it is meant to package\.

The target setting is on\-device SLM deployment: private assistants, offline app agents, local enterprise workflows, and edge tools that need executable outputs without routing every request to a hosted model\. These systems still need schemas for tool calls, UI actions, and local APIs\. They also operate under tighter memory, latency, and model\-capacity budgets\. Under those constraints, reasoning and output control become part of the same systems problem\.

Structured output is not merely post\-processing\. During constrained decoding it changes which tokens are legal, which intermediate representations can appear, and how much of the completion budget is spent on syntax rather than problem solving\. A valid JSON object can still encode the wrong decision, so a dashboard that tracks parse success alone can improve while downstream execution gets worse\.

We treat this as a measurement problem rather than a decoder\-design problem\. The question is: when a small model is forced into a schema, how much semantic correctness is lost relative to comparable unconstrained or prompt\-only baselines?

The paper contributes the following pieces\.

1. 1\.We define*constraint tax*, an accuracy delta between a baseline interface and a structured\-output mode under the same model and task distribution\.
2. 2\.We separate the metrics that are often collapsed in deployment logs: schema validity, answer accuracy, executable accuracy, trace correctness, latency, token count, structural overhead, and wrong\-valid\-schema rate\.
3. 3\.We provide a low\-compute harness that runs MLX inference for unconstrained modes and vLLM/SGLang constrained decoding on commodity GPUs\.
4. 4\.We measure a silent executable\-correctness regression: in a calendar tool\-call analogue, both interfaces are 100\.0% schema\-valid, but hard schema decoding loses 43\.5 points of executable accuracy\.
5. 5\.We identify the constructive design pattern*reason free, constrain late*: use the least intrusive constraint that satisfies the downstream contract, and package answers only after the model has solved the task\.

## 2Background and Motivation

### 2\.1Output Constraints as a Reasoning Intervention

Constrained decoding masks tokens that would violate a grammar, regular expression, or JSON schema\. That is appropriate when syntax is the main objective\. It is less benign when the model needs a scratchpad\. A small model may have to externalize partial arithmetic, symbolic state, or intermediate decisions\. A rigid schema can push those states through field names, quoted strings, arrays, object delimiters, and type constraints that were chosen for software consumption rather than reasoning\.

The interaction can be summarized as:

Q=f​\(Rreason,Rformat,Bdecode\),Q=f\(R\_\{\\mathrm\{reason\}\},R\_\{\\mathrm\{format\}\},B\_\{\\mathrm\{decode\}\}\),\(1\)
where quality depends on reasoning resources, formatting resources, and decoding budget\. For a large model, format fidelity may consume a small fraction of effective capacity\. For a sub\-3B model, the same schema can be a material part of the generation problem\. The concerning case is not merely invalid JSON; it is*wrong answer, valid schema*\.

### 2\.2Structured Decoding as a Serving\-System Interface

The failure mode crosses the model\-serving boundary\. A product system may use one backend for freeform generation, another for grammar\-constrained decoding, and a third layer for parsing and validation\. The measured behavior is a property of the model, prompt, decoding algorithm, schema, and validation stack together\. Model accuracy alone or parser success alone misses the interaction\.

For that reason, we treat the structured\-output path as a full system\. Each record stores the prompt, schema or regex, backend, raw generation, parse outcome, executable checker result, trace checker result, latency, and output\-token count\. This supports comparisons across prompt\-only JSON, regex\-constrained answers, direct JSON schema modes, vLLM, SGLang, and MLX execution under a common logging format\.

## 3Measurement Design

Deterministictask generatorPrompt \+ modefreeform, regex, schemaBackend routerMLX, HF, vLLM, SGLangGenerationconstrained or freeParser \+ validatorexecutor \+ trace checkRecordstax, validity, latencyOutput\-control interventionMeasurement layer

Figure 1:Constraint\-tax harness\. The benchmark keeps problem instances fixed while varying the output\-control intervention\. The measurement layer records syntax outcomes and semantic correctness separately\.Figure[1](https://arxiv.org/html/2605.26128#S3.F1)summarizes the harness used throughout the experiments\.

### 3\.1Tasks

The benchmark uses deterministic synthetic tasks with exact answer normalization\. Synthetic tasks are deliberate\. They do not claim to cover broad user utility, but they provide controlled ground truth, reproducible task generation, and executable answer checking\. This makes them appropriate for isolating the effect of output constraints without using another language model as a judge\.

The benchmark reports five result settings\. The main run covers five deterministic task families across a small\-model suite\. A separate production analogue uses an executable calendar\-object task in which outputs are checked as tool\-call arguments\. For tasks that expose intermediate reasoning, the harness also supports trace checking\. The trace checker verifies expected step count and normalized final intermediate outputs\. Table[1](https://arxiv.org/html/2605.26128#S3.T1)lists the generator\-backed family names, prompt templates, and ground\-truth formats\.

Table 1:StructReason\-Small task families as implemented by the deterministic generator\. Ground truth is stored per instance as a final answer string plus typed trace steps\.
### 3\.2Output Modes

The harness compares interfaces that differ in how much structure is imposed during reasoning; Table[2](https://arxiv.org/html/2605.26128#S3.T2)lists the evaluated modes\.

Table 2:Output modes used by the benchmark\. The modes separate prompt\-only formatting, regex constraints, direct schemas, structured rationales, typed traces, and delayed packaging\.prompt\_jsonmeasures whether natural\-language formatting instructions are enough\.final\_only\_regexmeasures whether a narrow final\-answer constraint avoids most reasoning interference\. Direct schema modes measure hard grammar pressure\.typed\_trace\_schematests whether making reasoning itself structured helps or hurts small models\.delayed\_constrainttests whether structured packaging should happen after the model has solved the problem\.

### 3\.3Backends

The benchmark is designed for low\-cost execution\. Mac\-local experiments use MLX or Hugging Face Transformers, depending on model support\. Constrained decoding is routed to commodity GPU runs using vLLM or SGLang OpenAI\-compatible servers\. A 3B checkpoint is used as a boundary check rather than a default sub\-3B model\.

This split creates an interpretation rule: latency comparisons are most meaningful within backend families unless the deployment environment is normalized\. Accuracy and validity comparisons are still replicated across decoding engines where possible\.

## 4Metrics

### 4\.1Syntax and Semantic Metrics

For each generation, the harness records:

- •Schema validity:whether the output parses and satisfies the required schema or regex\.
- •Answer correctness:whether the normalized answer matches deterministic ground truth\.
- •Executable accuracy:whether a task\-specific checker accepts the produced object or answer\.
- •Trace correctness:whether expected trace properties match\.
- •Wrong\-valid\-schema rate:the fraction of examples that are schema\-valid but fail the task\-relevant answer or executable checker\.
- •Structural overhead, latency, and tokens:serving and interface\-cost indicators\.

These metrics intentionally distinguish validity from correctness\. A production parser only sees whether the object is consumable\. The benchmark additionally checks whether the consumable object is right\.

### 4\.2Constraint Tax

Letmmbe a model,tta task family,cca constrained output mode, andbba baseline interface for the same problem instances\. We define absolute constraint tax as:

Tax​\(m,t,c;b\)=max⁡\(0,Acc​\(m,t,b\)−Acc​\(m,t,c\)\)\.\\mathrm\{Tax\}\(m,t,c;b\)=\\max\\left\(0,\\mathrm\{Acc\}\(m,t,b\)\-\\mathrm\{Acc\}\(m,t,c\)\\right\)\.\(2\)
The normalized form is:

Taxn​o​r​m​\(m,t,c;b\)=Tax​\(m,t,c;b\)max⁡\(ϵ,Acc​\(m,t,b\)\)\.\\mathrm\{Tax\}\_\{norm\}\(m,t,c;b\)=\\frac\{\\mathrm\{Tax\}\(m,t,c;b\)\}\{\\max\(\\epsilon,\\mathrm\{Acc\}\(m,t,b\)\)\}\.\(3\)
HereAcc\\mathrm\{Acc\}is the task\-relevant semantic metric, either answer accuracy or executable accuracy\. The clipping at zero is intentional\. The metric asks how much accuracy is lost relative to a baseline\. If a constraint improves accuracy, it is reported as an accuracy gain, not as negative tax\. When available, we report 95% bootstrap confidence intervals over problem instances\.

### 4\.3Statistical Reporting

For paired comparisons, deltas are computed on the same generated problem instances whenever the experiment design supports pairing\. Confidence intervals reported in the tables are nonparametric bootstrap intervals over problem instances\. We report intervals only for runs where they are present in the generated result artifacts\. For that reason, the MLX expanded\-interface study is design evidence rather than the primary significance claim\.

### 4\.4Error Taxonomy

Outputs are assigned to interpretable error classes:correct\_valid,invalid\_json,parse\_failure\_freeform,schema\_validation\_error,trace\_answer\_contradiction, orwrong\_answer\_valid\_schema\. This taxonomy is more actionable than a pass/fail bit\. Parser retries help invalid JSON; they do not fix wrong valid answers\.

## 5Experimental Protocol

All reported numbers come from generated JSONL or CSV artifacts in the experiment directories\. We do not infer numbers from model expectations or hand\-labeled outputs\.

Main GPU run\.We run vLLM on a commodity GPU with the main small\-model suite\. Each checkpoint is evaluated on 1,000 problem instances across five deterministic task families under each of five modes:freeform,freeform\_direct,freeform\_brief\_reasoning,prompt\_json, andanswer\_only\_schema\. This yields 15,000 generations\.

Production analogue\.We run one main\-suite checkpoint on a deterministic calendar tool\-call argument task\. The model must produce an object with tool name and arguments: title, date, start time, duration, attendee, and topic\. We compare prompt\-only JSON against the same required object enforced as a hard schema over 200 examples per directly generated mode, and include a derived delayed\-packaging control that deterministically re\-serializes the prompt\-only JSON first\-stage records\.

Backend replication and 3B boundary\.We replicateanswer\_only\_schemaacross vLLM and SGLang for the main\-suite checkpoints\. We also run the 3B boundary checkpoint withprompt\_jsonandanswer\_only\_schemato test whether the direct\-schema tax disappears near the 3B boundary\.

Local expanded\-interface study\.We run an MLX\-local study over four public small models, 20 examples per task family, and the full interface set, including rationale schemas, typed traces, delayed constraints, and regex modes\. This study has fewer examples per task family than the main direct\-comparison study, so we use it primarily for interface\-design insight\.

## 6Empirical Results

The results start with the broad main\-run aggregate and then move to the calendar tool\-call analogue\. The calendar task is the sharper test: validity is already saturated, so the execution drop cannot be explained away as a parse failure\.

### 6\.1Validity Improves While Correctness Falls

Table 3:Main\-suite aggregate over the small\-model checkpoints\. Hard schema decoding buys validity but shifts errors into wrong\-valid\-schema outputs\. Brackets denote 95% bootstrap confidence intervals\.![Refer to caption](https://arxiv.org/html/2605.26128v1/x1.png)Figure 2:Main GPU experiment\. Hard answer\-only schema decoding reaches 100% validity, but answer accuracy falls and the wrong\-valid\-schema rate rises sharply\.Table[3](https://arxiv.org/html/2605.26128#S6.T3)and Figure[2](https://arxiv.org/html/2605.26128#S6.F2)show the basic tradeoff\. Hard answer\-only constrained decoding fixes format: validity rises by 38\.5 points, from 61\.5% to 100\.0%\. It also makes the answers worse: answer accuracy falls by 8\.7 points, from 19\.7% to 11\.0%\. Executable accuracy nearly ties because the prompt\-only mode loses many otherwise correct answers to malformed or schema\-incompatible JSON\. The important shift is in the error type\. Wrong\-valid\-schema outputs rise from 49\.5% to 88\.9%\.

That is the systems risk\. The parser sees a cleaner stream; the executor sees more well\-formed objects carrying wrong content\.

Table 4:Per\-task\-family metrics for the main deterministic suite, aggregated across the main\-suite sub\-3B checkpoints\. Each row uses 600 generations per mode\. Thetool\_call\_argumentrow here is the answer\-wrapper version from the main suite, not the executable calendar\-object analogue in Table[6](https://arxiv.org/html/2605.26128#S6.T6)\.Table[4](https://arxiv.org/html/2605.26128#S6.T4)breaks the aggregate apart\. Arithmetic and object tracking account for the clearest answer\-accuracy losses\. Symbolic strings are near floor in both interfaces\. Boolean logic is the counterpattern: validity improves without an executable\-accuracy loss because prompt\-only JSON often contains the right value in a malformed object\. The main\-suite tool\-call row is only an answer\-wrapper task, so the executable calendar\-object experiment is reported separately\.

### 6\.2Constraint Tax by Model and Task Suite

Table 5:Constraint tax by model and evaluated task suite\. Tax is the clipped accuracy loss of the hard constrained interface relative to the corresponding prompt\-only baseline\. The main deterministic suite rows remain model\-level aggregates; task\-family aggregates appear in Table[4](https://arxiv.org/html/2605.26128#S6.T4)\.Table[5](https://arxiv.org/html/2605.26128#S6.T5)uses the paper’s sign convention: positive values are losses induced by the hard constrained interface\. The deterministic\-suite wrong\-valid deltas come from per\-instance error\-taxonomy labels in the main result JSONL, and the Qwen2\.5\-3B executable tax is reported because executable accuracy was logged for both boundary modes\. The two Qwen sub\-3B models pay a direct\-schema tax on the deterministic suite\. SmolLM2 is the counterexample: its prompt\-only JSON baseline is weak enough that hard constraints improve accuracy, so the clipped tax is zero\. The calendar tool\-call row is the cleanest executable task result because both directly generated modes are 100\.0% schema\-valid; the 43\.5 point loss is semantic rather than parsing\-related\. The derived delayed\-packaging calendar control has 0\.0 executable tax because it preserves the first\-stage prompt\-only answer and only validates/re\-serializes the object\.

### 6\.3Executable Tool Calls: Valid Objects Can Encode Wrong Decisions

Table 6:Calendar tool\-call analogue with Qwen2\.5\-1\.5B\-Instruct on a commodity GPU\. Both directly generated modes are 100% schema\-valid, so the hard\-schema loss is semantic\. The delayed\-packaging row is a deterministic re\-serialization of the prompt\-json first\-stage records\. Brackets denote 95% bootstrap confidence intervals\.![Refer to caption](https://arxiv.org/html/2605.26128v1/x2.png)Figure 3:Main industry result\. Prompt\-only JSON and hard tool schema are both 100% valid, but hard schema decoding loses 43\.5 points of executable accuracy and increases wrong\-valid\-schema failures by 43\.5 points\.Table[6](https://arxiv.org/html/2605.26128#S6.T6)and Figure[3](https://arxiv.org/html/2605.26128#S6.F3)are the most production\-like result\. The required calendar object is identical in the two directly generated modes\. Prompt\-only JSON is already 100\.0% schema\-valid and reaches 91\.5% executable accuracy\. A deterministic delayed\-packaging control keeps that semantic result while re\-serializing the answer into the executable object\. Hard tool\-call schema decoding is also 100\.0% valid, but executable accuracy falls to 48\.0%\. The paired executable\-accuracy delta is \-43\.5 points, with a 95% interval of \[\-51\.0, \-36\.0\]\.

One failure makes the point\. The request asks for a 30 minute meeting with Leo\. The constrained decoder emits a valid calendar object with the correct date, time, attendee, and topic, but withduration\_minutes: 180\. A calendar API would accept the object and schedule the wrong meeting\.

Table 7:Primary calendar failure taxonomy counts\. Classes sum to 200 per mode; multi\-field failures are not double\-counted in the primary taxonomy\. Delayed packaging is derived from prompt\-json first\-stage records\.Table[7](https://arxiv.org/html/2605.26128#S6.T7)localizes the semantic regression: 102 of 104 hard\-schema failures are single\-field duration errors\. In field\-occurrence counts, every hard\-schema failure includes a wrongduration\_minutesvalue, while only two also include a wrong topic\.

User request30 min with LeoHard schemadecoderValid JSONduration = 180Calendar toolexecutes wrong event

Figure 4:Wrong\-valid\-schema failure path\. The object is executable, but the decision encoded inside it is wrong\.Figure[4](https://arxiv.org/html/2605.26128#S6.F4)shows the failure path: the parser has nothing to reject, but the tool receives the wrong arguments\.

### 6\.4Backend Replication and Serving\-Stack Effects

Table 8:Backend replication foranswer\_only\_schema\. Qwen results replicate across vLLM and SGLang\. SmolLM2 is backend\-sensitive\.Table[8](https://arxiv.org/html/2605.26128#S6.T8)shows that the Qwen result is backend\-stable across vLLM and SGLang foranswer\_only\_schema\. SmolLM2 differs by backend\. For MLSys\-style reporting, that distinction matters: constrained decoding can depend on serving\-engine details, tokenizer handling, grammar implementation, and kernel maturity\.

The SGLang replication also required a compatibility patch routing RMSNorm through SGLang’s native implementation rather than the current FlashInfer/CUTLASS path\. That patch is part of the result: structured\-output evaluation on commodity GPUs depends on serving\-stack maturity\.

### 6\.5Direct\-Schema Tax at the 3B Boundary

Table 9:Qwen2\.5\-3B\-Instruct boundary check on a commodity GPU\. Direct answer\-only schema improves validity but loses answer accuracy and increases wrong\-valid\-schema outputs\.Table[9](https://arxiv.org/html/2605.26128#S6.T9)shows that the direct answer\-only schema tax does not disappear at the 3B boundary\. Qwen2\.5\-3B improves prompt\-only JSON accuracy compared with smaller models, but hard answer schema decoding still loses 15\.3 answer\-accuracy points while increasing wrong\-valid\-schema outputs by 31\.6 points\. The evidence does not support the claim that this issue is limited to the smallest models\.

### 6\.6Reason Free, Constrain Late

Table 10:Local expanded\-interface study over four public small models\. Delayed constraints and rationale\-bearing schemas preserve more semantic accuracy than direct answer\-only schemas\.![Refer to caption](https://arxiv.org/html/2605.26128v1/x3.png)

Figure 5:Expanded\-interface study\. Delayed constraint reaches 100% validity while preserving the highest executable accuracy among the reported modes\.The expanded\-interface study is smaller than the main GPU run, but it helps identify where the interference enters\. Table[10](https://arxiv.org/html/2605.26128#S6.T10)and Figure[5](https://arxiv.org/html/2605.26128#S6.F5)show thatanswer\_only\_schemaimproves validity overprompt\_json, but it is not the best executable interface\. Short rationales and post\-solution packaging do better\.delayed\_constraintreaches 40\.7% answer and executable accuracy at 100\.0% schema validity\.

The engineering pattern is to constrain as late as the product contract allows: let the model solve the task, then project the result into the executable object\.

## 7Discussion

### 7\.1Parseability vs\. Execution Correctness

Parseability is a transport property, not a task\-success metric\. In the tool\-call analogue, the directly generated prompt\-JSON and hard\-schema modes are both 100\.0% valid\. The hard\-schema mode still loses 43\.5 points of executable accuracy\. A production system that reports only schema validity would miss the regression\.

A structured\-output dashboard needs at least four numbers: schema validity, answer accuracy, executable accuracy, and wrong\-valid\-schema rate\. The last one matters most for operations because it counts failures that pass parsers and validators\.

### 7\.2When Constraints Help Versus Hurt

The result is not “schemas are bad”\. SmolLM2 improves under direct schema decoding in the main run because its prompt\-only JSON baseline is weak\. The expanded\-interface study also shows gains from rationale\-bearing schemas and delayed constraints\. The operational boundary is narrower: constraints help when they remove syntax failures without disrupting the task search; they hurt when they convert visible format failures into valid wrong decisions\.

### 7\.3Serving Engine Effects

Constrained decoding is also a serving\-stack result\. Qwen results replicate across vLLM and SGLang, but SmolLM2 is backend\-sensitive\. The SGLang compatibility patch reinforces the point: the constrained decoder is part of the model interface\. Benchmark reports should pin the checkpoint, tokenizer, decoding engine, schema, hardware, and relevant serving\-engine patches\.

Negative results\.Not every constraint behaved like a tax\. SmolLM2 improved under direct answer\-only schema decoding in the main run because its prompt\-only JSON baseline was weak\. The expanded\-interface study found that rationale\-bearing schemas and delayed constraints improved executable accuracy\. Some constrained\-serving attempts also failed on the tested commodity\-GPU path until the SGLang RMSNorm compatibility patch above, and SmolLM2 changed accuracy across vLLM and SGLang\. These cases are why the paper treats constraints as a serving\-path property, not a model\-only property\.

### 7\.4What the Result Establishes

For small models, an output schema is part of inference\. If it turns invalid outputs into correct executable objects, it is a reliability gain\. If it turns visible failures into valid wrong objects, it is a reliability regression\. The benchmark keeps those cases separate instead of folding them into a single parse\-success number\.

### 7\.5Deployment Recommendations

For small\-model production systems, the policy implication is concrete\.

1. 1\.Measure prompt\-only JSON before hard\-constraining the same object\.
2. 2\.Track wrong\-valid\-schema rate as a first\-class reliability metric\.
3. 3\.Prefer final\-answer or delayed constraints when reasoning is needed\.
4. 4\.Replicate constrained modes across the intended serving backend\.
5. 5\.Treat schema validity as an interface SLO, not as a task\-success metric\.

## 8Related Work

Chain\-of\-thought prompting and GSM8K\-style verifier work established two assumptions that this benchmark relies on: intermediate reasoning can matter, and deterministic or executable checks are preferable to judging only surface form\[[1](https://arxiv.org/html/2605.26128#bib.bib1),[2](https://arxiv.org/html/2605.26128#bib.bib2)\]\. Rather than improving prompts, this paper holds problem instances fixed and changes the output interface\.

ReAct and Toolformer showed that model outputs can be used as actions and tool calls\[[3](https://arxiv.org/html/2605.26128#bib.bib3),[4](https://arxiv.org/html/2605.26128#bib.bib4)\]\. The calendar experiment fixes the tool and required argument object, then compares prompt\-only JSON against hard schema decoding for the same call\. This isolates a lower\-level deployment issue: enforcing known tool arguments can still change executable correctness\.

Outlines, LMQL, vLLM structured outputs, and SGLang provide practical mechanisms for regex constraints, grammars, JSON schemas, and structured language\-model programs\[[5](https://arxiv.org/html/2605.26128#bib.bib5),[6](https://arxiv.org/html/2605.26128#bib.bib6),[7](https://arxiv.org/html/2605.26128#bib.bib7),[10](https://arxiv.org/html/2605.26128#bib.bib10),[8](https://arxiv.org/html/2605.26128#bib.bib8),[11](https://arxiv.org/html/2605.26128#bib.bib11)\]\. We treat those mechanisms as part of the measured serving path rather than neutral formatting utilities; the vLLM/SGLang replication is included because constrained decoding behavior is not only a property of the weights\.

JSON Schema standardizes structured validation\[[9](https://arxiv.org/html/2605.26128#bib.bib9)\]\. This work keeps that contract but separates validation from task success: a valid object is still checked against the answer normalizer, executor, or trace checker\.

## 9Generalization and Reproducibility

The deterministic setup is a strength for measurement and a limit for generalization\. The synthetic families are stress tests for reasoning under output control, not a replacement for broad user workloads\. The calendar task is closer to a production tool\-call path, but it is still a controlled analogue rather than logged agent traffic\.

The expanded\-interface study uses fewer examples per task family than the main comparison\. Its rationale\-schema and delayed\-constraint results are design evidence, not a claim that those interfaces always fix the tax\. Delayed constraints should be replicated on the serving engines used in deployment before being treated as the default\.

The study also does not establish a scaling law\. The Qwen2\.5\-3B boundary still pays a direct\-schema tax, but larger models and additional model families are needed to determine when, or whether, this effect disappears\. Model coverage is intentionally limited to low\-compute, locally accessible, or commodity\-GPU\-feasible checkpoints\.

Structured\-output implementations change quickly\. Reproducible reports should pin the checkpoint, tokenizer, decoding engine, schema, hardware, and relevant serving patches\. The backend\-sensitive SmolLM2 result is another example of the same point: constrained decoding belongs to the full serving path, not only to the model weights\.

## 10Conclusion

Structured outputs are an interface contract, but for small language models they are also a decoding intervention\. Constraint tax measures the semantic accuracy lost when schemas, regexes, and typed outputs are applied during generation\. In the main GPU aggregate, hard schemas improve syntax while reducing answer accuracy\. In the calendar tool\-call analogue, hard schema decoding keeps validity at 100\.0% but loses 43\.5 points of executable accuracy\.

For small\-model production systems, the evaluation should be paired and interface\-aware: report validity and correctness separately, track wrong\-valid\-schema rate, and test whether the model should solve before the answer is constrained into an executable object\.

## Appendix ACalendar Tool\-Call Specification

This appendix gives the exact interface contract used for the calendar tool\-call analogue\. Each generated instance fills the bracketed slots with deterministic values\.

### A\.1Prompt Template

```
You are a calendar assistant. Return only JSON.
Schedule a {duration_minutes} minute meeting
with {attendee} about {topic} on {date} at {start_time}.
Use tool name "create_calendar_event".
```

For the inspected duration failure discussed in the main text, the natural\-language request was:

```
Schedule a 30 minute meeting with Leo.
```

### A\.2Required JSON Schema

```
{
  "type": "object",
  "additionalProperties": false,
  "required": ["tool", "arguments"],
  "properties": {
    "tool": {"const": "create_calendar_event"},
    "arguments": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title", "date", "start_time", "duration_minutes",
        "attendee", "topic"
      ],
      "properties": {
        "title": {"type": "string"},
        "date": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "start_time": {
          "type": "string",
          "pattern": "^\\d{2}:\\d{2}$"
        },
        "duration_minutes": {
          "type": "integer",
          "minimum": 1
        },
        "attendee": {"type": "string"},
        "topic": {"type": "string"}
      }
    }
  }
}
```

### A\.3Executable Checker

The executable checker scores the semantic arguments used by the downstream calendar action\. Thetitlefield is required for schema validity but is not treated as an independent semantic target\.

```
def normalize(x):
    return str(x).strip().lower()

def calendar_exec_ok(obj, expected):
    if obj["tool"] != "create_calendar_event":
        return False
    args = obj["arguments"]
    return (
        normalize(args["date"]) == expected["date"] and
        normalize(args["start_time"]) ==
        expected["start_time"] and
        int(args["duration_minutes"]) ==
        expected["duration_minutes"] and
        normalize(args["attendee"]) ==
        expected["attendee"] and
        normalize(args["topic"]) == expected["topic"]
    )
```

## References

- \[1\]Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou\.Chain\-of\-thought prompting elicits reasoning in large language models\.*NeurIPS*, 2022\.[https://arxiv\.org/abs/2201\.11903](https://arxiv.org/abs/2201.11903)
- \[2\]Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman\.Training verifiers to solve math word problems\.arXiv:2110\.14168, 2021\.[https://arxiv\.org/abs/2110\.14168](https://arxiv.org/abs/2110.14168)
- \[3\]Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao\.ReAct: Synergizing reasoning and acting in language models\.*ICLR*, 2023\.[https://arxiv\.org/abs/2210\.03629](https://arxiv.org/abs/2210.03629)
- \[4\]Timo Schick, Jane Dwivedi\-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom\.Toolformer: Language models can teach themselves to use tools\.*NeurIPS*, 2023\.[https://arxiv\.org/abs/2302\.04761](https://arxiv.org/abs/2302.04761)
- \[5\]Brandon T\. Willard and Rémi Louf\.Efficient guided generation for large language models\.arXiv:2307\.09702, 2023\.[https://arxiv\.org/abs/2307\.09702](https://arxiv.org/abs/2307.09702)
- \[6\]Luca Beurer\-Kellner, Marc Fischer, and Martin Vechev\.Prompting is programming: A query language for large language models\.arXiv:2212\.06094, 2022\.[https://arxiv\.org/abs/2212\.06094](https://arxiv.org/abs/2212.06094)
- \[7\]Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E\. Gonzalez, Hao Zhang, and Ion Stoica\.Efficient memory management for large language model serving with PagedAttention\.*SOSP*, 2023\.[https://arxiv\.org/abs/2309\.06180](https://arxiv.org/abs/2309.06180)
- \[8\]Lianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun, Jeff Huang, Cody Hao Yu, Shiyi Cao, Christos Kozyrakis, Ion Stoica, Joseph E\. Gonzalez, Clark Barrett, and Ying Sheng\.SGLang: Efficient execution of structured language model programs\.*NeurIPS*, 2024\.[https://arxiv\.org/abs/2312\.07104](https://arxiv.org/abs/2312.07104)
- \[9\]JSON Schema\.[https://json\-schema\.org/](https://json-schema.org/)
- \[10\]vLLM Project\.Structured outputs documentation\.[https://docs\.vllm\.ai/en/latest/features/structured\_outputs/](https://docs.vllm.ai/en/latest/features/structured_outputs/)
- \[11\]SGLang Project\.Structured outputs documentation\.[https://docs\.sglang\.io/docs/advanced\_features/structured\_outputs](https://docs.sglang.io/docs/advanced_features/structured_outputs)

Similar Articles

Do Language Models Know Their Own Constraints?

arXiv cs.CL

The paper explores if language models can articulate constraints they've learned through fine-tuning. It discovers that behavioral compliance improves but explicit reporting diminishes.