Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:The task_categories "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

StructFix-Bench

A benchmark for schema-aware structured output recovery — repairing broken outputs from agents, tool calls, and LLM workflows.

What it tests

Unlike JSON syntax repair benchmarks, StructFix-Bench focuses on semantic and schema-level recovery:

  • Replacing invalid enum values with valid ones
  • Adding missing required fields
  • Correcting type mismatches
  • Recovering tool call arguments from Python syntax
  • Reconstructing outputs from truncated agent chains
  • Extracting JSON from markdown/text wrappers

Dataset splits

Split Examples Field names Enums
train 200,000 Mixed (semantic + shuffled) Mixed (realistic + synthetic)
validation 20,000 Semantic Realistic
test_seen 10,000 Semantic Realistic
test_unseen 10,000 Semantic Realistic
test_random_fields 10,000 Random hex (f_8f31a7) Synthetic

Corruption types (28 total)

Syntactic (10)

single_quotes, unquoted_keys, trailing_comma, markdown_fences, extra_text_before, extra_text_after, truncated_object, truncated_array, missing_bracket, missing_brace

Semantic (9)

wrong_type, invalid_enum, missing_required, null_required, extra_field, boolean_as_string, number_with_unit, synonym_enum, date_format_error

LLM-like (3)

markdown_explanation, partial_structure, thought_process

Tool/Agent (6)

tool_call_bad_format, tool_call_text_mix, tool_call_python_syntax, tool_call_partial_args, tool_call_wrong_param, agent_chain

Input format

Each example uses ConstraintDSL to represent the schema:

TASK repair_structured_output

SPEC
FIELD priority TYPE string VALUES low|medium|high REQUIRED yes
FIELD description TYPE string REQUIRED yes

BROKEN_OUTPUT
{"priority":"urgent"}

Target: {"priority":"high","description":""}

Key results

Method Schema Success (unseen) Schema Success (random fields)
json-repair 65.2% 64.0%
CodeT5+ + JSON Schema 55.0%
CodeT5+ + ConstraintDSL 96.3% 91.9%

Schema ablation study

Full ablation results are included in results/all_results.json:

DSL variant Schema Success
Full ConstraintDSL 96.3%
No DSL at all 78.4%
Dummy DSL 75.0%
Conflicting DSL 88.3%
Shuffled field names 73.4%
Shuffled enum values 89.8%
Shuffled required flags 93.2%
Minimal DSL 82.5%
Field names only 72.2%

Known limitations

The benchmark uses synthetically generated schemas and corruptions. A showcase validation with 25 hand-crafted real-world examples revealed that model performance degrades when field names overlap with training vocabulary — the model may substitute field names (e.g., actionactive, contract_idconsign_id). See the model card for details.

Files

  • train.jsonl / validation.jsonl / test_seen.jsonl / test_unseen.jsonl / test_random_fields.jsonl
  • results/all_results.json — all experiment results including ablations

Each example contains

{
  "input": "TASK repair_structured_output\n\nSPEC\n...",
  "target": "{\"priority\":\"high\",\"description\":\"\"}",
  "corruption_type": "invalid_enum",
  "schema": {"type": "object", "properties": {...}, "required": [...]},
  "invalid_json": "{\"priority\":\"urgent\"}",
  "error": "Field 'priority' has invalid enum value 'urgent'",
  "target_json": "{\"priority\":\"high\",\"description\":\"\"}"
}

Citation

@software{structfix_bench,
  title = {StructFix-Bench: A Benchmark for Schema-Aware Structured Output Recovery},
  author = {Ottema},
  year = {2026},
  url = {https://huggingface.co/datasets/ottema/structfix-bench}
}

License

Apache-2.0

Downloads last month
19

Space using ottema/structfix-bench 1

Collection including ottema/structfix-bench