Skip to content
Back to skills

Jsonschemabench Coverage Eval

ASecurity

Evaluates whether language models can generate JSON objects that strictly comply with a given JSON Schema under constrained decoding. It measures the empirical coverage of schema features supported by the model and decoding framework. Use when the user wants to benchmark on JSONSchemaBench, or asks about evaluating this task. Reports Top 1 Empirical Coverage.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
researchpythongogit

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill jsonschemabench-coverage-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jsonschemabench Coverage Eval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jsonschemabench Coverage Eval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-jsonschemabench-coverage-eval/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-jsonschemabench-coverage-eval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jsonschemabench-coverage-eval
description: Evaluates whether language models can generate JSON objects that strictly comply with a given JSON Schema under constrained decoding. It measures the empirical coverage of schema features supported by the model and decoding framework. Use when the user wants to benchmark on JSONSchemaBench, or asks about evaluating this task. Reports Top 1 Empirical Coverage.
metadata:
  skill_kind: dataset_eval
  source_arxiv: 2501.10868
  bibtex_key: [REDACTED]
  confidence: high
---

# jsonschemabench-coverage-eval

> JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Models — Geng et al. (2025) (arXiv:2501.10868, 2025)

## What this evaluates

Evaluates whether language models can generate JSON objects that strictly comply with a given JSON Schema under constrained decoding. It measures the empirical coverage of schema features supported by the model and decoding framework.

## Datasets

- **JSONSchemaBench** — total 10000; splits: test (10000); repo https://github.com/guidance-ai/jsonschemabench

## Metrics

- `Top 1 Empirical Coverage` **(primary)** — range: percent
  - The proportion of schemas for which the single top-1 generated JSON object passes validation against the provided JSON Schema (Draft-2020-12 with format checks enabled).

## Input / output format

**Input**: A JSON Schema (Draft-2020-12) embedded in a prompt template.

**Output**: A single JSON object generated via greedy decoding.

## Scoring recipe

```python
compliant = 0
for schema, gen_json in zip(schemas, outputs):
    try:
        jsonschema.validate(gen_json, schema, format_checker=jsonschema.FormatChecker())
        compliant += 1
    except jsonschema.ValidationError:
        pass
coverage = compliant / len(schemas)
```

## Common pitfalls

- Only generating a single top-1 output may underestimate true model coverage, as sampling multiple outputs could reveal compliance on harder schemas.
- The `jsonschema` library does not guarantee validation of all schema constraints, even with format checks enabled, potentially leading to a slight overestimation of compliance.

## Evidence (verbatim from paper)

> We use greedy decoding with no top P or top K sampling for all the experiments. We only get one output from the model, which we will use to validate the schema compliance. It’s totally plausible to sample more outputs and validate them all, and it might detect more schema violations. The fact that we only sample the top 1 output may quantify our empirical coverage as Top 1 Empirical Coverage. We use the jsonschema library with the Draft-2020-12 version of the JSON Schema standard to validate the generated JSON object. We turn on the ‘format’ checks, which are not enabled by default in Python. Strictly speaking, the jsonschema library doesn’t guarantee the validation of all the schema constraints, even with the ‘format’ checks enabled. It is possible, though very rare, for a schema-noncompliant output to be validated as compliant by the jsonschema library, leading to a slight overestimation of empirical coverage. However, such occurrences are corner cases and happen infrequently.

## Citation

```bibtex
@misc{geng2025jsonschemabench,
  title={JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Models},
  author={Geng et al. (2025)},
  year={2025},
  note={arXiv:2501.10868}
}
```

- arXiv: 2501.10868

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.