Alfred: A System for Prompted Weak Supervision

Peilin Yu, Stephen H. Bach
5/29/2023
cs.LGcs.CL

Official code: BatsResearch/alfred (58 stars, BSD-3-Clause, last commit 2025-04-03).

Abstract

Alfred is the first system for programmatic weak supervision (PWS) that creates training data for machine learning by prompting. In contrast to typical PWS systems where weak supervision sources are programs coded by experts, Alfred enables users to encode their subject matter expertise via natural language prompts for language and vision-language models. Alfred provides a simple Python interface for the key steps of this emerging paradigm, with a high-throughput backend for large-scale data labeling. Users can quickly create, evaluate, and refine their prompt-based weak supervision sources; map the results to weak labels; and resolve their disagreements with a label model. Alfred enables a seamless local development experience backed by models served from self-managed computing clusters. It automatically optimizes the execution of prompts with optimized batching mechanisms. We find that this optimization improves query throughput by 2.9x versus a naive approach. We present two example use cases demonstrating Alfred on YouTube comment spam detection and pet breeds classification. Alfred is open source, available at https://github.com/BatsResearch/alfred.

View on arXivView PDF

Code Implementations(1)

BSD-3-Clause

A system for prompted weak supervision. Alfred is a powerful tool that leverages large language models to accelerate data annotation.

589Python, Jupyter NotebookDec 20, 20221 years agoBSD-3-Clause
annotation-tooldatadata-annotationllmprogrammatic-weak-supervision+3 more

Similar Papers

Cite this paper

@article{yu2023alfred,
  title  = {Alfred: A System for Prompted Weak Supervision},
  author = {Peilin Yu and Stephen H. Bach},
  year   = {2023},
  eprint = {2305.18623},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.18623v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.18623.svg)](https://codeofpaper.com/paper/2305.18623)

Discussion