Abstract
Large labeled training sets are the critical building blocks of supervised learning methods and are key enablers of deep learning techniques. For some applications, creating labeled training sets is the most time-consuming and expensive part of applying machine learning. We therefore propose a paradigm for the programmatic creation of training sets called data programming in which users express weak supervision strategies or domain heuristics as labeling functions, which are programs that label subsets of the data, but that are noisy and may conflict. We show that by explicitly representing this training set labeling process as a generative model, we can "denoise" the generated training set, and establish theoretically that we can recover the parameters of these generative models in a handful of settings. We then show how to modify a discriminative loss function to make it noise-aware, and demonstrate our method over a range of discriminative models including logistic regression and LSTMs. Experimentally, on the 2014 TAC-KBP Slot Filling challenge, we show that data programming would have led to a new winning score, and also show that applying data programming to an LSTM model leads to a TAC-KBP score almost 6 F1 points over a state-of-the-art LSTM baseline (and into second place in the competition). Additionally, in initial user studies we observed that data programming may be an easier way for non-experts to create machine learning models when training data is limited or unavailable.
Introduction
The primary bottleneck in modern supervised learning has shifted from algorithmic design to data acquisition. While deep learning models have demonstrated remarkable capabilities, their performance is strictly tied to the availability of massive labeled datasets. Manually labeling millions of examples is not only prohibitively expensive and slow but often requires specialized domain expertise, such as medical knowledge for clinical records.
Existing "weak supervision" techniques, like distant supervision or crowdsourcing, offer some relief but are often brittle and difficult to manage when heuristics conflict or overlap. This paper introduces Data Programming, a formal paradigm that transforms weak supervision into a programmatic science by using "labeling functions"—noisy, user-defined heuristics—instead of manual hand-labeling.
Methodology
Data programming follows a two-stage pipeline: a generative stage to denoise user-provided heuristics and a discriminative stage to train a high-capacity model.
The Generative Model
Instead of labeling individual data points, users write Labeling Functions (LFs)—small code snippets that express domain heuristics, patterns, or external knowledge. These LFs are inherently noisy and may conflict. The system models the labeling process as a generative process using a factor graph.
By observing the agreement and disagreement patterns of these LFs across a large unlabeled dataset, the generative model learns their accuracies and correlations without requiring any ground truth labels. This allows the system to "denoise" the resulting labels mathematically.
Handling Dependencies
A key innovation is the ability to explicitly model dependencies between LFs. Users can specify relationships such as "similar," "fixing," or "reinforcing" using a factor graph approach. This allows the system to account for redundant or complementary information provided by different heuristics, further refining the accuracy of the generated labels.
The Discriminative Model
The output of the generative model is a set of probabilistic training labels. These labels are used to train a final discriminative model (e.g., Logistic Regression or an LSTM) using a noise-aware loss function. This approach enables a "feature engineering flip": instead of spending weeks manually engineering features, developers spend that time writing LFs to generate a massive training set, then let deep learning models learn the features automatically.
Experiments and Results
The authors evaluated data programming on several real-world relation extraction tasks, including the 2014 TAC-KBP Slot Filling challenge and clinical genomics datasets.
Key Performance Metrics
- Accuracy Gains: Data programming achieved an average 2.34 F1 point improvement over standard distant supervision baselines.
- State-of-the-Art Results: On the TAC-KBP challenge, the approach would have secured a winning score. When combined with an LSTM, it outperformed a state-of-the-art baseline by 6 F1 points.
- Efficiency: A user study with bioinformaticians demonstrated that non-ML experts could build high-quality disease-tagging models in under eight hours starting with zero labeled data.
Conclusion
Data programming offers a scalable alternative to manual data labeling. By treating labeling as a programmatic and generative process, it achieves theoretical parity with traditional supervised learning while significantly reducing human labor. The method's ability to leverage large volumes of unlabeled data and handle complex dependencies makes it a powerful tool for modern machine learning workflows. Future work includes extending this framework to image processing and automating the discovery of labeling functions.
Summary updated