Evaluation framework · pre-results

Evaluating an LLM Agent Pair for
Environmental Data Harmonization

A curator + harmonizer agent pair, benchmarked against an expert on DOE ESS-DIVE soil-moisture data.

Watershed Function SFA · Berkeley Lab  ·  authors TBD

SCAFFOLD — results pending

Press / Space to advance · Esc for overview

Motivation

Harmonization is the bottleneck in data reuse

  • The same quantity arrives in incompatible forms — and reconciling it is expert, manual work.
  • The field's canonical effort (ISMN) still ingests provider data "manually, mostly by email." [Dorigo 2021]
  • Practitioners report 50–80% of time on data preparation. [Lohr 2014; CrowdFlower 2016 — provenance weak]
  • The heterogeneous "long tail" of small datasets is the costliest to integrate and the likeliest to be lost. [Heidorn 2008]

Why it matters here

ESS-DIVE hosts diverse Watershed Function SFA datasets but has no dedicated soil-moisture reporting format — every dataset is harmonized by hand into a project schema.

If an agent pair can draft that work reliably, it unlocks scalable, FAIR-aligned reuse.

The task

One quantity, many encodings

Soil moisture must be reconciled across:

  • Units — VWC % vs m³ m⁻³; GWC g g⁻¹; potential kPa / MPa / bar
  • Coordinates — UTM vs lat/lon, differing datums
  • Depth conventions; time zones → UTC
  • Wide ↔ long ("tidy") table layouts [Wickham 2014]
  • Observational vs manipulated (warming/irrigation) — can flip a result's sign [Yue 2017]

Target schema — 9 columns, fixed units:

datetime_UTC ISO-8601 UTC
site_id string
depth_m m
replicate int / NaN
is_timeseries bool
interval_min float / NaN
volumetric_water… m³ m⁻³
gravimetric_water… g g⁻¹
water_potential_kPa kPa (neg.)

qc_flag vocab: d1 (depth approx.) · g1 (coords from registry) · g2 (coords unresolved)

The system under test

A curator → harmonizer agent pair

Skill 1  Curator

From a DOI/package ID: retrieves & classifies files, resolves location, infers time-series vs discrete, detects manipulations, picks the nearest exemplar.

→ a structured bundle with an INCLUDE / EXCLUDE / FLAG decision.

Skill 2  Harmonizer

From the bundle: maps variables, converts units, and emits executable Python plus a documented change-mapping JSON.

→ auditable code & provenance, not an opaque table.

Implemented as Anthropic Agent Skills — versioned instruction+tool bundles; the 19 expert harmonizations act as retrievable in-context exemplars. [Agent Skills 2025]

The intermediate artifact

The change-mapping JSON

Between "decide" and "executed table," the harmonizer emits a machine-readable change-mapping: one entry per dataset, with a rule for every target variable. It is the auditable record of what maps to what, and how — decoupled from the Python that implements it.

Top level (7 fields):

  • index, dataset_identifier, doi, archive_repository
  • data_payload_files, location_metadata_files, sensor_metadata_files
  • harmonization_mappings — the per-variable rules

Each rule (one per target variable):

{
  "depth": {
    "pattern_1": {
      "source_pattern": "Depth (cm)",
      "source_files": ["BM_…VWC….csv"],
      "destination_variable": "depth_m",
      "transformation": "Rename 'Depth (cm)'…",
      "unit_conversion": "Divide by 1e2: cm → m."
    }
  }
}

Excluded datasets collapse to "harmonization_mappings": "EXCLUDED: <reason>".

Real rules leave-one-out fold · dataset 7 · "Bradley Meadow"

What the agent actually wrote

// timezone-aware parse → UTC
"datetime": { "source_pattern": "date.time",
  "transformation": "Parse '%m/%d/%y %H:%M' in
  America/Denver; convert to UTC ISO-8601." }

// unit reasoning, not just a rename
"volumetric_water_content": {
  "source_pattern": "Volumetric Water Content",
  "unit_conversion": "None; values are
  fractional m³/m³, not percent." }
// not reported → explicit NA
"water_potential": {
  "source_pattern": null,
  "destination_variable": "water_potential_kPa",
  "transformation": "Not reported; populate NA." }

// coordinate lookup + a caught gotcha
"longitude": { "source_files": ["BM_EGM_Well_CO2.csv"],
  "transformation": "…source value is negative
  longitude despite the header text." }

Verbatim from an agent run that never saw dataset 7's gold. Source: open evaluation PRs (evaluations/fold-05-holdout-7/).

Scoring the mapping same fold · machine-readable metrics

Why we score the output, not the prose

The change-mapping is compared to the expert's, field by field:

FieldExact match vs gold
destination_variable8 / 8
unit_conversion7 / 8
source_files7 / 8
source_pattern3 / 8
transformation (free text)0 / 8
mapping categories covered8 / 8

The prose never matches — yet the data does. The agent and expert describe transformations in different words (transformation 0/8), but executing both programs on the same raw files gives:

56,861/56,861

rows recovered (P=R=1.0)

100%

VWC & potential cells match

6

interval_min cells differ (ordering)

This is the whole argument for an output-equivalence endpoint: stylistic divergence in the mapping/code is irrelevant when the harmonized table is identical. The mapping JSON gives auditable semantics; the executed output gives the verdict.

Figure 1

Workflow & evaluation design

%%{init: {"theme":"base","themeVariables":{"fontFamily":"ui-sans-serif, system-ui, Inter, sans-serif","fontSize":"15px","lineColor":"#8a8a8a","clusterBkg":"#ffffff","clusterBorder":"#e0d8c4"}}}%%
flowchart LR
    classDef agent fill:#0e7c7b,stroke:#0a5a59,color:#fff,stroke-width:1.5px;
    classDef artifact fill:#f3efe6,stroke:#c9bfa6,color:#2b2b2b;
    classDef gold fill:#c9962f,stroke:#9c7421,color:#fff;
    classDef score fill:#3b5b8c,stroke:#28406a,color:#fff;
    classDef io fill:#fff,stroke:#8a8a8a,color:#2b2b2b,stroke-dasharray:3 3;
    ID["dataset identifier"]:::io
    EX["19 expert exemplars"]:::gold
    subgraph PIPE["agent pair"]
      direction LR
      C["Curator
Skill 1"]:::agent --> B["bundle"]:::artifact --> H["Harmonizer
Skill 2"]:::agent --> OUT["code +
change-mapping"]:::artifact end RAW[("raw files")]:::io AGT["agent table"]:::artifact GLD["expert table
(gold)"]:::gold CMP{{"output equivalence
cell-by-cell"}}:::score ID --> C EX -. exemplars .-> C EX -. exemplars .-> H OUT -- execute --> AGT RAW --> AGT RAW --> GLD AGT --> CMP GLD --> CMP

Modes: Skill-1 isolated · Skill-2 oracle (gold bundle) · end-to-end. Gap = oracle − end-to-end.

Evaluation design

Two phases · three modes · one primary endpoint

Honest generalization, decomposable error, output-grounded scoring.

Phases

Retrospective, then prospective

Phase A · cross-validation

Grouped leave-one-out over 19 expert datasets. Whole source/instrument clusters held out together, so a near-duplicate sibling can't leak into the exemplar pool.

Also validates automated metrics against expert judgment.

Phase B · prospective blind

All 19 as exemplars; agent harmonizes new ESS-DIVE datasets. Expert harmonizes the same data blind → reference.

Estimates real deployment performance.

A similarity covariate (distance to nearest exemplar) turns leakage risk into a measured generalization curve.

Modes

Where does the error come from?

1 · Skill-1 isolated

Curator bundle scored field-by-field vs expert labels.

2 · Skill-2 oracle

Harmonizer fed the gold bundle — transform quality, independent of curator error.

3 · End-to-end

Full pipeline; errors propagate.

Error-propagation gap = Mode 2 − Mode 3 isolates how much curator error degrades the final output.

Failures attributed as:

  • Skill-1 error propagated
  • Skill-2 error (given correct input)
  • interface inconsistency
  • genuinely ambiguous (expert unsure too)

Metrics

Output-data equivalence is the primary endpoint

Execute both the agent's and expert's code on the same raw data; compare tables cell-by-cell on the natural key. Two correct programs score the same regardless of style — and we avoid unreliable LLM-as-judge scoring. [Judge reliability 2026]

Harmonizer composite weighting:

output equivalence0.50
schema conformance0.15
semantic mapping F10.12
code executability0.10
documentation0.08
ontology validity0.05

Curator metrics

Decision P/R/F1 · file-set F1 · time-series accuracy & interval error · location-source & qc_flag accuracy · manipulation detection · exemplar match · deferral calibration.

Statistics

Nested data → cluster bootstrap CIs & mixed-effects models; effect sizes over p-values (N≈19); variance & pass@k across stochastic repeats.

Controls

What the agent pair is measured against

Single-call LLM

No skill structure or tool loop — isolates the value of agentic decomposition.

No-exemplars

Agent with the 19 references removed — isolates the value of the exemplars.

Naïve heuristic

String-matching floor.

Reproducibility pinned per run: model + version, both skill versions, sampling params, seeds.

Positioning

How this differs from prior work

WorkWhat it doesWe add
Harmonia Santos 2025LLM-agent harmonization to a schema; interactive; clinicalautonomous pair · environmental · CV + blind eval
CleanAgent Qi 2024single-agent data standardizationtwo-stage curate→harmonize, scored separately
MAST Cemri 2025taxonomy of multi-agent failuresoperationalized cross-agent error attribution
KramaBench 2025data pipelines benchmark (best ~55% E2E)real expert ground truth + output equivalence
"FMs wrangle data?" Narayan 2022FM beats task-specific cleanerscomposed, end-to-end, executed against expert

Lineage: Wrangler/Trifacta · HoloClean · FlashFill · schema-matching surveys (Rahm 2001). Domain anchors: ISMN, ESS-DIVE reporting formats, Maelstrom, OMOP.

Deliverables

What the results section will report

ResultValue
End-to-end output equivalence[[ • ]]
Skill-2 (oracle) equivalence[[ • ]]
Error-propagation gap[[ • ]]
Curator decision F1[[ • ]]
vs single-call / no-exemplar[[ • ]]
Similarity threshold[[ • ]]

Plus:

  • error-attribution taxonomy (stacked / Sankey)
  • similarity → performance regression
  • automated-vs-expert metric agreement
  • Phase B agent-vs-expert on novel data

Every number traces to experiments/results/; placeholders are filled by the analysis pipeline, never by hand.

Caveats

Limitations we hold ourselves to

  • N ≈ 19 gold datasets — uncertain estimates; effect sizes, not p-values.
  • Single domain — WFSFA soil moisture on one repository.
  • One expert as gold — some cases genuinely ambiguous.
  • Model/skill drift — pinned versions; results are snapshots.
  • Stochasticity — report variance & pass@k.
  • Automated metrics — credible only as far as Phase A validation shows.

Intended operating point: agent drafts, expert reviews, with automatic deferral above the similarity threshold and on low-confidence curator decisions.

Takeaways

A rigorous yardstick for agentic harmonization

  • Output-equivalence scoring — measures what the code does, not how it reads.
  • Decomposed across two agents — error is attributable, not opaque.
  • Honest generalization — grouped CV + similarity covariate + blind prospective test.

First such evaluation in the environmental-data-harmonization setting. Results to follow.

Thank you

Evaluating an LLM Agent Pair for
Environmental Data Harmonization

Manuscript drafts: docs/manuscript/ · Figure source: figures/figure1_workflow.mmd

Framework: config/ · src/ · skills/ · gold standard: data/gold/

Key references — Dorigo 2021 (ISMN) · Crystal-Ornelas 2022 (ESS-DIVE formats) · Santos 2025 (Harmonia) · Cemri 2025 (MAST) · Narayan 2022 (FMs wrangle data) · Wickham 2014 (tidy data) · Wilkinson 2016 (FAIR). Full list in references.md.