arXiv:2610.09489cs.CLOct 2026

Manuscript Offprint

arXiv:2610.09489

Goldsmith: Gold-Loss-Guided Definition Optimization with an Agentic Annotation Harness

Yihan Li, Hanyi Zhang, Xiaoxi Jiang, Man Guo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Many annotation projects begin before experts have a stable guideline or enough labels to train a task-specific model. We present Goldsmith, an agentic pipeline that turns a small gold set—expert-annotated calibration examples representing the intended task boundaries—into a reusable structured annotation definition. Goldsmith treats this definition as a trainable textual object. Candidate definitions are run on the same gold examples and scored with an executable structured loss, while the output schema, formatting, retrieval, repair, judging, and human review remain in an external harness. A large language model (LLM) editor converts the highest-loss failures into textual-gradient revisions, which are accepted only when the measured loss decreases. In prompt-optimization comparisons, Goldsmith improves over direct rewriting, OPRO, APE, and PromptBreeder under matched evaluation protocols. The resulting definition also improves downstream annotation when combined with retrieval, score-based routing, and human review across typed span, pair-level relation, and fixed-trigger event-argument tasks. These results show that scarce expert supervision can support both task-definition learning and scalable annotation.

1 Introduction

Many annotation projects begin before the task is fully defined: experts may recognize the phenomenon to annotate, yet lack a stable boundary policy, a complete manual, or enough labels for a task-specific model (Settles, 2009; Tomanek and Olsson, 2009). Pre-trained language model (PLM)-first systems remain strong once this target is stable. BERT-style and XLM-R token classifiers are natural span-labeling baselines (Devlin et al., 2019; Conneau et al., 2020), while typed-marker relation classifiers can use stronger encoders such as RoBERTa or DeBERTa (Liu et al., 2019; He et al.,

From dataset-first annotation to Goldsmith

Figure

Figure 1: Conceptual comparison between a dataset-first annotation workflow and Goldsmith's definition-first workflow.

2023). Even parameter-efficient updates such as Low-Rank Adaptation (LoRA) reduce training cost, not the cost of deciding what the task means (Hu et al., 2022). The bottleneck is therefore earlier: converting a partially articulated concept into an operational annotation procedure, a problem also discussed in LLM annotation and guideline-following IE (Tan et al., 2024; Sainz et al., 2024).

Long-context in-context learning changes this early-stage design space. Few-shot prompting showed that examples can condition a model without weight updates (Brown et al., 2020); many-shot and long-context studies show that expert examples, failures, and revision history can now fit inside the working context (Abbas et al., 2024; Bertsch et al., 2025). However, unselected or unvalidated examples can dilute the expert signal (Zou et al., 2025; Zhang et al., 2025b). In this setting, carefully chosen gold examples can define the task boundary more concretely than an initial prose guideline.

We introduce Goldsmith, an annotation harness built around this premise. Gold examples are the scarce material experts can provide early; the system repeatedly tests, reshapes, and polishes that material into a durable operational definition. Given a short concept description and a 15-example gold calibration set, Goldsmith treats each gold example as a test case for the current definition, using prediction errors to decide whether a revised definition has captured the expert's intended boundary. The definition then runs inside a model-external harness that connects model calls to retrieval tools, context construction, format repair, judges, review queues, and feedback loops; these tool-calling capabilities turn a revised definition into a stable workflow rather than a one-off LLM response (Liu et al., 2025; Qin et al., 2025).

The methodological core is prompt-as-parameter training: Goldsmith optimizes only the operational definition, while the schema, format reference, retrieved references, and harness controls remain outside the trainable definition. Candidate definitions come from OPRO, LLM-derived textual gradients, or Goldsmith's own gold-loss-guided editor. This design is related to instruction-level optimizers such as APE and PromptBreeder, which generate or evolve candidate prompts (Zhou et al., 2023; Fernando et al., 2024), but acceptance is decided by the same gold loss rather than by the LLM's self-assessment (Yang et al., 2024; Pryzant et al., 2023; Yuksekgonul et al., 2025). The claim is bounded: Goldsmith targets the early, evolving setting before PLM-first pipelines have enough stable labels, and asks whether the same 15 gold examples can outperform zero-shot prompting, static ICL, retrieval-only prompting, OPRO, and low-budget fine-tuning.

The contribution of this work can be summarized as follows:

• We introduce a gold-loss-guided prompt optimization method that treats the operational definition as the trainable textual parameter and accepts LLM-proposed revisions only when they improve structured loss on expert gold examples.

• We build this optimizer into an annotation pipeline whose harness keeps schema, formatting, retrieval, repair, judge routing, and human review outside the trainable prompt while making the optimized definition usable for batch annotation.

• We empirically validate the approach across three structured annotation settings—OpenNER for typed multilingual named entity recognition (NER), CrossRE for pair-level relation classification, and PHEE V2 for controlled event-argument extraction—against LLM-only, prompt-optimization, and PLM baselines (Palen-Michel et al., 2025; Bassignana and Plank, 2022; Sun et al., 2024).