cs.AIAug 26, 2026

Right Values, Wrong Places: Diagnosing and Fixing Record Misplacement in LLM-Generated JSON

Authors: Yiwei Zhang, Chengke Wu, Jiahao Li, Li Wang, Yao Yao, Jianqiang Li

Organizations: Shenzhen University · Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences

Abstract

Large language models can generate valid JSON that preserves field values yet binds them to the wrong records or hierarchy levels. We introduce JSONPlacement, a controlled task supplying all values and assignment rules for transforming flat records into hierarchical JSON. Across six open-weight models, we identify two error types: record-assignment errors and hierarchy-realization errors. Whole-record moves account for 98.6% of strictly traceable synthetic misplacements. We predict that aligning input with target traversal should reduce assignment errors, while replacing nested output with record-level paths should reduce hierarchy errors. With predictions fixed before generating new instances, we test both interventions separately and together. On synthetic instances, each nearly eliminates its targeted error while leaving the other. Combined, they achieve exact matches for three 8-12B models on all new synthetic instances and a real-data validation set. These findings motivate evaluating record placement explicitly and jointly designing input organization and output representation to preserve value-path bindings.

Figures & tables

Appendix figures & tables18 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Oct 8, 2026

Structure Tax: How Structured Output affects LLMs Performance

Deploying large language models in production often requires constraining outputs to structured formats such as JSON or XML, and prior work treats the resulting accuracy loss as an inherent structure tax'. We re-examine this claim by evaluating a battery of models, datasets and schemas, measuring task accuracy, confidence calibration, and hidden-state geometry. The tax turns out to depend on schema design rather than on structure per se: reasoning-first field ordering matches or exceeds free-form accuracy, while answer-first ordering causes steep drops, particularly in smaller models. Format sensitivity scales inversely with a task's own structural constraints, and schemas that preserve reasoning order also improve calibration with CKA showing greater separability between correct and incorrect representations in middle transformer layers. Our findings indicate that properly designed structured formats can match or exceed free-form performance, reframing the critical question from whether to structure' to `how to structure' for optimal reasoning preservation.
Sep 20, 2026

Constrained Decoding Eliminates Structural Failures in Small LLMs but Reveals a Scale-Dependent Semantic Gap

Small open-source large language models (LLMs) in the 0.6B-4B parameter range are increasingly deployed for structured output generation (JSON, function calling, data extraction), yet little is known about how constrained decoding (CD) interacts with model scale in this regime. We benchmark five models from three families across 14 structured-output tasks under three decoding conditions (native, Outlines, XGrammar). We introduce a two-axis evaluation that separates structural correctness (schema validity) from semantic correctness (content accuracy). We find that CD eliminates all structural failures across all models (schema validity: 78.6-92.9% to 100%), but content accuracy reveals a persistent semantic gap that is scale-dependent: type coercion failures are fully CD-rescuable, while instruction-semantic failures (e.g., multi-step function calling) remain CD-resistant. Schema conformance is necessary but not sufficient for semantic correctness; CD's reach ends exactly where schema conformance ends.
Feb 24, 2026

Real-Time Trustworthiness Scoring for LLM Structured Outputs and Data Extraction

Structured Outputs from current LLMs exhibit sporadic errors, hindering enterprise AI deployment. We present CONSTRUCT, a real-time uncertainty estimator that scores the trustworthiness of LLM Structured Outputs. Lower-scoring outputs are more likely to contain errors, enabling automatic prioritization of limited human review bandwidth. CONSTRUCT additionally scores the trustworthiness of each field within a Structured Output, helping reviewers quickly identify which parts of the output are incorrect. Our method is suitable for any LLM (including black-box LLM APIs without logprobs), does not require labeled training data or custom model deployment, and supports complex Structured Outputs with heterogeneous fields and nested JSON schemas. We also introduce one of the first public LLM Structured Output benchmarks with reliable ground-truth values. Over this four-dataset benchmark, CONSTRUCT detects errors in outputs from various LLMs (including Gemini 3 and GPT-5) with significantly higher precision/recall than existing techniques.