Technical deep-dive: design decisions, generation methodology, and what's next

#2
by SalutefaceAAC - opened

structured-output-generation v1.0 β€” Design Notes & Open Questions

I wanted to share some behind-the-scenes context on how this dataset was built and where I'd like to take it, and invite community feedback.


Why we built this

Most instruction-tuning datasets treat "generate JSON" as a single task. In practice, it covers enormously different contexts:

  • A developer specifying an OpenAPI 3.0 schema (concrete, typed, nested)
  • A clinician asking for a FHIR resource (domain vocabulary + regulatory structure)
  • A support engineer requesting RFC 7807 problem details (specific standard constraints)

Naming the standard in the prompt dramatically reduces ambiguity. Compare:

  • ❌ "Generate JSON for a user profile" β†’ output could be anything valid
  • βœ… "Generate a JSON object following the schema: { name: string, email: string (RFC 5322), created_at: ISO 8601 }" β†’ output is verifiable

All 107 examples in v1.0 follow this philosophy: the prompt names exactly what format is expected.


Format distribution

Format Count Notes
JSON 36 Largest β€” most common real-world use
YAML 20 Config files, CI pipelines, k8s manifests
Markdown table 19 Reporting, summaries, comparisons
CSV 18 Data export, spreadsheet interchange
XML 14 SOAP, FHIR, legacy enterprise formats

XML is intentionally the smallest set β€” it's the least ambiguous to verify (well-formed + schema-validated) but the rarest in modern LLM applications.


Known limitations (v1.0)

  1. Domain skew: ~39% of examples are software/DevOps contexts. Legal, science, sports, and media are underrepresented.
  2. No negative examples: Every prompt has a correct completion. A "here's what the model got wrong and why" split would be valuable for fine-tuning critique models.
  3. No length variation signal: Short JSON objects and deeply nested 50-field structures are treated the same. Worth adding a complexity field in v2.

Questions for the community

  1. What domains are missing? If you're fine-tuning for a specific vertical (legal contracts, FHIR records, financial reports), I'd love to add examples matching your actual use case.
  2. Evaluation approach: How are you evaluating structured output quality β€” exact match, schema validation, LLM-as-judge? What's working?
  3. Format requests: Any structured formats not covered here that you need? (TOML, HCL/Terraform, Avro schema, Protocol Buffers, EDI X12?)

Happy to answer questions about methodology, add requested examples, or accept PRs for new examples that meet the quality bar!

Design decisions, known limitations, and the expansion plan

Following up on the release with a more detailed look at what we built and where we want to go.

The format distribution

Format Count Notes
JSON 36 Heaviest coverage β€” most downstream use cases
YAML 20 Focused on config-style + OpenAPI schemas
Markdown table 19 Under-explored in other datasets; rich in edge cases
CSV 18 Simple headers-only AND embedded-metadata variants
XML 14 SOAP 1.1, RSS, SVG-adjacent

The JSON-heaviness reflects real demand but introduces bias. A model fine-tuned only on this dataset will be better at JSON than XML by ~2.5Γ—.

What made examples "hard" in practice

The biggest predictor of example difficulty wasn't format complexity β€” it was ambiguity of intent in the prompt. "Generate a configuration file for a REST API" has many valid completions. Hard examples resolve ambiguity by naming a specific standard:

  • ❌ "Generate a config for rate limiting" β†’ underspecified
  • βœ… "Generate an NGINX limit_req_zone block for 10 req/s with a 10MB zone" β†’ unambiguous correct answer

This is the pattern we want to replicate more in v1.5.

Planned v1.5 expansions

  1. Legal/contracts domain (currently 0 examples): JSON representations of contract clauses, YAML for jurisdiction-specific configurations
  2. Scientific data (3 examples currently): CSV for experimental results, JSON-LD for linked data
  3. More XML depth: XSLT, WSDL, Maven pom.xml β€” each has highly opinionated structure
  4. Nested references: examples that require understanding $ref in JSON Schema or YAML anchors

If you have domain expertise in any of these, we'd welcome contributions β€” just open a PR against the dataset or drop an example in this thread.

A note on evaluation

These prompt+completion pairs work best as few-shot demonstrations, not as a benchmark. For benchmarking structured output, you want a parser-validated eval set (check that the completion is valid JSON/YAML/etc. before scoring semantics). We'll ship a small eval script with v1.5.

Sign up or log in to comment