--- pretty_name: "Code vs Tools: How LLM Agents Author Large Visualization Specs" license: cc-by-4.0 language: - en size_categories: - 1K/analysis.json` (`contrasts`, plan `json-vs-code:complete`, scope `pooled`, side `fixed`) | | R1: code first seemed to win on GenomeSpy (+0.084) | `main`, GenomeSpy (sealed docs) | same | same file, side `sealed`; printer bugs in `analysis/docs-fix/type-check/` | | R2: JSON constructors 1.5M tokens, $0.25, 65 s; whole spec 22–87k, $0.03–0.04, 20–33 s | `main` + `docs_fix`, `in_interface_map` | `total_tokens`, `cost_usd`, `run_seconds` | `analysis/interface-map/map.json` (`defaults`) | | R2: constructors from code cut tokens 89–94%, quality +0.03 / −0.10 / +0.01 | `main` | `interface` `json-functions` vs `code-functions` | `analysis/main/analysis.json` (`comparisons`, plan `json-vs-code:functions`) | | R2 / Table 1: one `build` call | `turns` (`json-batch`) with `main` DeepSeek Vega-Lite `json-functions` and `code-functions` | `final_quality`, `steps`, `charged_usd`, `run_seconds` | `analysis/turns/report.md` | | R3: constructors within code, Gosling −0.07, GenomeSpy +0.03, 1.6–3.6× cost | `constructors` | `variant`, `final_quality`, `cost_usd` | `analysis/constructors/report.md`, `analysis.json` | | R3: GPT on GenomeSpy best with JSON constructors (+0.12 to +0.14) | `main` + `docs_fix`, `in_interface_map` | per-cell means | `analysis/interface-map/report.md` | | R4: index cuts tokens 2.3–2.4× against full docs | `main` (index groups) and `docs_fix` (full docs), `in_interface_map` | `docs`, `total_tokens` | `analysis/interface-map/map.json` (`defaults`: `*-complete` vs `*-complete-index`) | | R4: on GenomeSpy the index alone loses (−0.14 JSON, −0.16 code) | `docs_fix` (full docs) vs `main` (index), `in_cohort` | `final_quality` | `analysis/docs-fix/genomespy/analysis.json` (`contrasts`, plan `documentation-2x2:literal`, side `fixed`) | | R4: hints (GenomeSpy +0.13 JSON, +0.17 code; Gosling JSON −0.05) | `main` | `interface` `*-complete-index` vs `*-complete-index-hints` | `analysis/main/analysis.json` (plan `error-hints:compact`) | | R4: collecting every validation error (+9.8 points, 2.4× fewer tokens) | `pilot/runs.parquet`, `arm` `code-stop-at-first-error` vs `code-collect-errors`, `measures_the_cell` | `reproduced`, `total_tokens` | `analysis/pilot-collect-errors/report.txt` | | R5: no-docs first-try quality 0.87 / 0.61 / 0.23 (six models) | `familiarity` | `first_quality` | `analysis/familiarity/report.md` | | R5: ρ −0.81 between no-docs quality and best − worst spread; \|ρ\| ≤ 0.27 for which interface wins | `familiarity` and `in_interface_map` rows | per-cell means | `analysis/interface-map/map.json` (`map`, `correlations`) | | R6 / Table 2: shortfall from each pair's best, tokens, cost, time | `main` + `docs_fix`, `in_interface_map` (18 grammar × model pairs, 10 interfaces) | per-cell `final_quality`, `total_tokens`, `cost_usd`, `run_seconds` | `analysis/interface-map/map.json` (`defaults`), `report.md`, `map.html` | | Figure 3: easiest and hardest task per grammar | `tasks` | `mean_final_quality_main` | | | DeepSeek code − JSON per grammar | `main`, DeepSeek | | `analysis/main/deepseek/report.md` | ### Recomputed from the released tables `analyze/build-hf-release.ts` recomputes these numbers from the files in this release after writing them, and stores them in `analysis/verification.json`. "Paper" values are rounded as printed. A cell mean is the mean of `final_quality` over rows without an infrastructure failure; token and cost means also leave out `usage_censored` rows. | Number | From the released tables | Paper or source analysis | Match | |---|---:|---:|---| | Largest difference over all 192 cohort cells: mean final quality | 0 | 0 | yes | | Largest relative difference over all cohort cells: mean total tokens | 0 | 0 | yes | | Main study, vega-lite: mean final quality over groups (cohort) | 0.9661 | 0.9661 | yes | | Main study, gosling: mean final quality over groups (cohort) | 0.7345 | 0.7345 | yes | | Main study, genomespy: mean final quality over groups (cohort) | 0.8332 | 0.8332 | yes | | Table 2, code-complete-index-hints: mean shortfall | 0.0433 | 0.0433 | yes | | Table 2, code-complete-index-hints: max shortfall | 0.1693 | 0.1693 | yes | | Table 2, code-complete-index-hints: mean total tokens | 21748 | 21748 | yes | | Table 2, code-complete-index-hints: mean cost (USD) | 0.0292 | 0.0292 | yes | | Table 2, code-complete-index-hints: mean time (s) | 20.15 | 20.15 | yes | | Table 2, json-complete: mean shortfall | 0.0462 | 0.0462 | yes | | Table 2, json-complete: max shortfall | 0.1456 | 0.1456 | yes | | Table 2, json-complete: mean total tokens | 82426 | 82426 | yes | | Table 2, json-complete: mean cost (USD) | 0.0395 | 0.0395 | yes | | Table 2, json-complete: mean time (s) | 32.65 | 32.65 | yes | | Table 2, code-complete: mean shortfall | 0.0517 | 0.0517 | yes | | Table 2, code-complete: max shortfall | 0.1597 | 0.1597 | yes | | Table 2, code-complete: mean total tokens | 87495 | 87495 | yes | | Table 2, code-complete: mean cost (USD) | 0.0369 | 0.0369 | yes | | Table 2, code-complete: mean time (s) | 26.61 | 26.61 | yes | | Table 2, json-functions: mean shortfall | 0.0737 | 0.0737 | yes | | Table 2, json-functions: max shortfall | 0.2530 | 0.2530 | yes | | Table 2, json-functions: mean total tokens | 1508263 | 1508263 | yes | | Table 2, json-functions: mean cost (USD) | 0.2467 | 0.2467 | yes | | Table 2, json-functions: mean time (s) | 65.10 | 65.10 | yes | | R5, vega-lite: no-docs first-try quality | 0.8710 | 0.8700 | yes | | R5, gosling: no-docs first-try quality | 0.6071 | 0.6100 | yes | | R5, genomespy: no-docs first-try quality | 0.2336 | 0.2300 | yes | | R5: Spearman ρ, no-docs quality vs best − worst spread | -0.8147 | -0.8100 | yes | | R1, vega-lite: code − JSON, corrected full docs (cohort) | -0.0071 | -0.0070 | yes | | R1, gosling: code − JSON, corrected full docs (cohort) | -0.0038 | -0.0040 | yes | | R1, genomespy: code − JSON, corrected full docs (cohort) | -0.0049 | -0.0050 | yes | | R2, vega-lite: code-functions / json-functions total tokens (cohort) | 0.0610 | 0.0600 | yes | | R2, gosling: code-functions / json-functions total tokens (cohort) | 0.1124 | 0.1100 | yes | | R2, genomespy: code-functions / json-functions total tokens (cohort) | 0.0767 | 0.0800 | yes | | R3, gosling: constructors − whole spec within code (Phase 7, pooled) | -0.0699 | -0.0700 | yes | | R3, genomespy: constructors − whole spec within code (Phase 7, pooled) | 0.0275 | 0.0300 | yes | | Table 1: pairs | 24 | 24 | yes | | Table 1, One build call: quality | 0.9381 | 0.9380 | yes | | Table 1, One build call: steps | 3.46 | 3.50 | yes | | Table 1, One build call: cost (USD) | 0.0431 | 0.0430 | yes | | Table 1, One build call: time (s) | 47.27 | 47 | yes | | Table 1, A turn per constructor: quality | 0.7723 | 0.7720 | yes | | Table 1, A turn per constructor: steps | 17.17 | 17.20 | yes | | Table 1, A turn per constructor: cost (USD) | 0.0473 | 0.0470 | yes | | Table 1, A turn per constructor: time (s) | 93.36 | 93 | yes | | Table 1, Code over constructors: quality | 0.8971 | 0.8970 | yes | | Table 1, Code over constructors: steps | 2.63 | 2.60 | yes | | Table 1, Code over constructors: cost (USD) | 0.0468 | 0.0470 | yes | | Table 1, Code over constructors: time (s) | 30.57 | 31 | yes | | Second judge: exact agreement on 6548 judged stages | 0.9369 | 0.9370 | yes | | R4 pilot: collect every error − stop at first, reproduced (153 pairs) | 0.0980 | 0.0980 | yes | | R4 pilot: token ratio, stop at first / collect every error | 2.41 | 2.40 | yes | The second judge's agreement here leaves out the 41 judged stages whose scores the analysis later corrected (`substitutions`), so it covers 6,548 stages; the published 93.7% counts all 6,589. ### `pilot/` An earlier pilot on Vega-Lite with 11 models (none of them the five cohort settings) and its own tasks and scoring. It is the source of one claim in R4: returning every validation error of a program at once, instead of stopping at the first, raised visual reproduction by 9.8 points and used 2.4× fewer tokens. The pilot asked the agent to edit a chart to match a target, on five tasks of increasing size (`rung` 1–5, `pilot/tasks.parquet`), 3 repetitions per model, task, and arm. - `runs.parquet`: one row per run (660). `arm` is `code-stop-at-first-error`, `code-collect-errors` (both with factory constructors), `code-collect-errors-literal` (literal objects), or `tools-stop-at-first-error` (one tool per edit). `reproduced` is the outcome: the judge rated the final render 3 of 3 against the reference (`visual_rating`; no artifact, a failed render, or no marks count as 1, an exact match as 3). `measures_the_cell` is false for provider failures, stalls, and output-cap truncation; the analysis drops pairs with such a run. `spec_score` is a secondary spec-distance score. `final_state` is the final spec. - `records.jsonl.gz`: the harness's full record of each run, keyed by `id`. - `tasks.parquet` and `references/`: prompts, starting and reference specs, and reference renders. ## How quality is scored Each generation has two stages: `first` (the first submitted spec) and `final` (the last submitted spec; the agent is told to stop once a spec is accepted). For each stage: - `valid`: the host accepted the spec (schema validation, data binding, and, for Gosling and GenomeSpy, a native render). - `nonblank`: the render shows data marks. - `task_score`: share of the task's scripted checks passed (`tasks.scripted_checks`). - `judge_rating`: 1–3 from the primary judge (Claude Opus 5), comparing the candidate render with the task's reference render; rubric and prompt in `judging/rubric.md`. Invalid and blank stages get 1 by rule. - `quality` = 0 if not valid or blank, else `(task_score + (judge_rating − 1) / 2) / 2`, in [0, 1]. Rows are scored as the analyses score them. In `main`, three corrections apply, recorded per row in `substitutions` and described in `analysis/main/analysis.json` (`substitutions`): - `spend-cap-rerun`: 20 GenomeSpy runs that hit the $15 per-run spend cap because of unbilled dropped uploads were rerun; the reruns replace them (`source_dir` names the rerun directory). - `blank-supplement`: GenomeSpy stages scored blank because their marks set `fillOpacity`, which the blank test did not hide; the same judge rated them as visible charts. - `flipped-blank`: Gosling stages whose blank recheck flipped to visible but whose rerender shows no real ink; scored blank (quality 0). All other studies are scored as judged. A separate, unapplied sensitivity analysis of Gosling scoring bugs is in `analysis/sensitivity/`. ## Column dictionaries ### `generations/*.parquet` | Column | Meaning | |---|---| | `id` | Run id, `--------r`; keys `transcripts/` and `judging/` | | `study` | `main`, `docs_fix`, `familiarity`, `constructors`, `turns` | | `source_dir` | Results directory in the authors' archive the row came from | | `grammar` | `vega-lite`, `gosling`, `genomespy` | | `task_id` | Task, see `tasks/tasks.parquet` | | `model`, `provider` | Model setting and API provider | | `in_cohort` | One of the five cohort settings (not DeepSeek) | | `interface` | Interface (group) name as the analyses use it, e.g. `code-complete-index-hints` | | `variant` | The follow-up study's arm (`json-complete-fixed-docs`, `json-contract-only`, `whole-spec`, `constructors`, `json-batch`, `json-functions-strict`); null in `main` | | `format` | `json` or `code` | | `granularity` | `whole-spec`, `constructors`, or `flint` | | `docs` | `full`, `index`, `none`, or `flint` | | `docs_version` | For full docs: `sealed` (original) or `fixed` (corrected printer) | | `hints` | Error hints in the docs and appended to matching errors | | `repetition` | 1–3 | | `in_interface_map` | Feeds the interface map and Table 2 (the ten shared interfaces, full-docs cells from `docs_fix`) | | `infrastructure_failure` | Run says nothing about the interface (provider or harness failure); analyses drop it and its pairs | | `failure_class` | Harness outcome class (`none`, `invalid`, `step-cap`, `infrastructure`, …) | | `first_valid`, `final_valid` | Spec accepted by the host | | `first_nonblank`, `final_nonblank` | Render shows data marks (null if not valid) | | `final_cropped` | Render crop check fired | | `first_task_score`, `final_task_score` | Share of scripted checks passed | | `first_judge_rating`, `final_judge_rating` | Primary judge rating 1–3 | | `first_quality`, `final_quality` | Stage quality in [0, 1] (null when unevaluable) | | `first_second_judge_rating`, `final_second_judge_rating` | GPT-6.1 Sol rating of the same render, `main` cohort stages whose primary rating came from a judge call; null otherwise | | `substitutions` | Scoring corrections applied, see above | | `usage_censored` | A request's usage never came back; token and cost means leave the row out | | `input_tokens`, `output_tokens`, `total_tokens` | Summed over the run's model requests (input includes cache reads and writes) | | `reasoning_tokens`, `cache_read_tokens` | Parts of the above | | `cost_usd` | Cost from reported usage at the registered prices | | `charged_usd` | Metered spend plus reservations for requests of unknown outcome (Phase 8 tables use this) | | `run_seconds` | Wall time, without the host's native render time | | `run_seconds_with_render` | Wall time including it | | `model_seconds` | Time in model requests | | `steps` | Model turns; `step_cap_reached` if it hit the 30-step cap | | `submissions`, `rejected_submissions`, `repairs` | Spec submissions, those rejected, and resubmissions after a rejection | | `validator_messages` | Validation errors returned to the model | | `malformed_tool_calls` | Tool calls with unparseable arguments | | `constructor_calls`, `constructor_failures` | Constructor groups only | | `lookups` | Docs lookups (`functions-index` groups) | | `final_spec` | The final stage's spec as validated and rendered, JSON string | | `final_code` | The final program, for code interfaces | ### `transcripts//.jsonl.gz` One line per generation: `{id, source_dir, record}`, where `record` is the harness's own row. `record.result.details.attempts` lists every submission (program or spec, host response, hints, materialized spec), `record.result.usage.requests` and `record.result.timing.requests` every model request, and for Gosling and GenomeSpy `record.result.details.scored` each check's outcome. The harness did not store the models' free text. `interfaces//example-requests.jsonl.gz` has the complete first request body (system prompt, task message, tools) for each interface and model on the first task; `interfaces//documents/` has each interface's docs. ### `tasks/tasks.parquet` `grammar`, `task_id`, `position`, `prompt`, `data_json` (rows the model received), `field_semantics_json`, `requirements`, `visual_checks` (shown to the judge), `scripted_checks` (what `task_score` checks), `reference_spec_json` (never shown to the model), `reference_image`, `difficulty_tier` and `difficulty_rationale` (as designed), `coverage`, `source` (origin and license), `mean_final_quality_main` (cohort, all `main` runs). The tasks adapt MIT-licensed examples from flint-chart, Gosling, and GenomeSpy (`tasks/licenses/`); Gosling and GenomeSpy data rows are CC0. ### `judging/` - `rubric.md`: judge system prompt, response schema, user message template, and the quality formula. - `judge-ratings.parquet`: per `id` and `stage`: `judge_rating`, `source` (`judge`, `reused` for an identical render judged once, `rule` for invalid or blank, `supplement`), `reused_from`, `differences`, `rationale`. - `second-judge/`: GPT-6.1 Sol (medium) on every judged `main` cohort stage. - `human/sample.parquet`: 180 stages sampled by grammar × primary rating (`stratum_weight` reweights to all judged stages), with the judge's text and both images in `human/images/`. `rater-1.parquet` and `rater-2.parquet`: two raters' blind ratings (`item_id`, `rating`, `notes`). Raters are anonymous. Human–judge and human–human agreement are in `agreement.{md,json}`. ## License CC BY 4.0. The tasks adapt MIT-licensed examples; their licenses are in `tasks/licenses/`. Model outputs are included for research use under each provider's terms.