[Paper Review] The ALCHEmist: Automated Labeling 500x CHEaper Than LLM Data Annotators
The ALCHEmist system replaces costly LLM-based data labeling by prompting large language models to generate reusable, executable programs that label data locally, reducing costs by 500× while improving or matching performance across eight datasets, with an average 12.9% accuracy gain and enhanced auditability and extensibility.
Large pretrained models can be used as annotators, helping replace or augment crowdworkers and enabling distilling generalist models into smaller specialist models. Unfortunately, this comes at a cost: employing top-of-the-line models often requires paying thousands of dollars for API calls, while the resulting datasets are static and challenging to audit. To address these challenges, we propose a simple alternative: rather than directly querying labels from pretrained models, we task models to generate programs that can produce labels. These programs can be stored and applied locally, re-used and extended, and cost orders of magnitude less. Our system, Alchemist, obtains comparable to or better performance than large language model-based annotation in a range of tasks for a fraction of the cost: on average, improvements amount to a 12.9% enhancement while the total labeling costs across all datasets are reduced by a factor of approximately 500x.
Motivation & Objective
- Address the high cost, lack of auditability, and inflexibility of using LLMs directly for data annotation via expensive API calls.
- Overcome the limitations of static, non-extensible labels produced by direct LLM prompting in data labeling pipelines.
- Enable local, reusable, and inspectable labeling logic through program synthesis, improving auditability and adaptability.
- Reduce reliance on human-annotated data or repetitive prompting by distilling labeling logic into executable code.
- Extend the approach to non-text modalities through a two-step concept extraction and feature-based program generation pipeline.
Proposed method
- Use large language models (e.g., GPT-4, Claude 3) to generate deterministic, executable programs (e.g., regex, keyword matching) that encode labeling logic instead of directly generating labels.
- Store and execute these programs locally to eliminate recurring API costs, reducing the number of required LLM calls from data point count to program count.
- Apply weak supervision to aggregate outputs from multiple synthesized programs, improving robustness and reducing noise from individual flawed programs.
- Use a two-step pipeline for non-text modalities: first extract high-level concepts from input data, then combine them with local feature extractors to guide program generation.
- Increase program diversity by sampling multiple programs per task and using ensemble modeling to improve label quality and coverage.
- Compare synthesized programs against human-crafted labeling functions in WRENCH, validating performance and coverage advantages.

Experimental results
Research questions
- RQ1Can LLMs be prompted to generate reusable, executable programs that serve as accurate and cost-effective data annotators instead of direct label generation?
- RQ2To what extent does program-based labeling reduce labeling costs while maintaining or improving model performance compared to direct LLM prompting?
- RQ3How does program diversity and weak supervision improve the robustness and accuracy of pseudolabels in weak supervision frameworks?
- RQ4Can the approach be extended to non-text modalities such as tabular or image data through concept extraction and feature-based program synthesis?
- RQ5How does the performance and coverage of LLM-generated programs compare to human-crafted labeling functions in established benchmarks like WRENCH?
Key findings
- ALCHEmist reduces total labeling costs by a factor of approximately 500× compared to direct LLM prompting, with a $1,200 GPT-4 cost reduced to $0.70 for a 7,569-sample dataset.
- The system improves performance on five out of eight evaluated datasets, achieving an average 12.9% accuracy gain over zero-shot LLM prompting.
- Synthesized programs achieve higher label model coverage than human-crafted functions—e.g., 10 generated programs in Alchemist matched or exceeded the performance of 73 manually crafted functions in WRENCH for the SMS dataset.
- Increasing program diversity through sampling from multiple LLMs and strategies improves label quality and reduces bias, with coverage and performance gains observed in SMS, Yelp, and IMDb datasets.
- Generated programs enable full auditability, extensibility, and local execution, overcoming the opacity and static nature of direct LLM API-based labeling.
- The approach generalizes to non-text modalities via a two-step pipeline that extracts high-level concepts and integrates them with local feature extractors to guide program generation.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.