Synthetic Data Generation with Large Language Models for Text Classification: Potential and Limitations (2023)

Abstract: The collection and curation of high-quality training data is crucial for developing text classification models with superior performance, but it is often associated with significant costs and time investment. Researchers have recently explored using large language models (LLMs) to generate synthetic datasets as an alternative approach. However, the effectiveness of the LLM-generated synthetic data in supporting model training is inconsistent across different classification tasks. To better understand factors that moderate the effectiveness of the LLM-generated synthetic data, in this study, we look into how the performance of models trained on these synthetic data may vary with the \textit{subjectivity} of classification. Our results indicate that subjectivity, at both the task level and instance level, is negatively associated with the performance of the model trained on synthetic data. We conclude by discussing the implications of our work on the potential and limitations of leveraging LLM for synthetic data generation.

## introduction today, machine-learning-powered text classification models have been widely applied in diverse applications such as detecting biased or toxic language on online platforms @xcite and filtering spam emails @xcite . however, the performance of these models largely depends on the quality of the training data. this poses a substantial challenge in practice, especially when models need to be built for a novel task domain or to incorporate new classification categories, as the training data collection and curation process is often costly, time-consuming, and complex. meanwhile, with the recent advancements in large language models (llms), researchers have started to explore the potential of utilizing llms for generating synthetic data tailored to specific tasks and augmenting the training data in lowresourced data settings @xcite @xcite . most recently, a few studies also investigate into the feasibility of generating a synthetic dataset from scratch using llms to support zeroshot learning @xcite @xcite . while llmbased data augmentation is often found to outperform other data augmentation methods in boosting the model performance, mixed results are reported regarding whether the llm-generated synthetic data can effectively support model training to enable a level of model performance that is comparable to models trained on the data collected in the real world and carefully annotated. this leaves uncertainty for researchers and practitioners in deciding whether to rely on llms for synthetic data generation or to proceed with the traditional data collection and curation pipeline when they need to construct a text classification model for a new task. naturally, one may wonder what factors might moderate the effectiveness of llm-generated synthetic data in facilitating successful model training. we conjecture that one such factor could be the subjectivity of classification tasks. indeed, language is inherently subjective and interpretive @xcite . previous research has showed that people often perceive the same text in different ways because of their personal biases and perspectives @xcite @xcite . thus, achieving high model performance for classification tasks with high subjectivity seems to impose a greater demand on the training data in reflecting the richness and nuances present in human language, and the extent to which llm-generated synthetic data can acompolish this objective is unclear. thus, in this paper, we formally evaluate the effectiveness of llm (i.e., the cutting-edge gpt-3.5-turbo model) in generating synthetic data to support model training for different text classification tasks. we adopt two approaches for synthetic data generation-a zero-shot setting in which the llm is directly prompted to generate text instances with different labels of interests, and a few-shot setting in which a few real-world data instances are provided as examples to guide the llm in generating the synthetic data. we conduct two evaluation studies, each corresponding to one dimension of subjectivity-the first study examines the effectiveness of the synthetic data on 10 types of classification tasks and explores how it varies with the task-level subjectivity (i.e., whether this type of classification task is subjective); the second study concerns that given a specific classification task, how the performance of a model trained on synthetic data changes with the instance-level subjectivity (i.e., whether people tend to disagree with each other on the label of this task instance). our findings suggest that across the 10 types of classification tasks that we have considered in this study, models trained on the llm-generated synthetic data generally perform worse than those trained on the real-world data, yet guiding llm's synthetic data generation process with a small amount of real-world data (i.e., as done in the few-shot data generation setting) can improve the effectiveness of the data generated. moreover, we find that the performance of models trained on the llm-generated synthetic data is very close to those trained on the real-world data for tasks with low subjectivity (e.g., news topic classification, spam email detection), while the performance decrease is much bigger on tasks with high subjectivity (e.g., humor or sarcasm detection). finally, even within the same type of classification task, models trained on the llmgenerated synthetic data tend to exhibit a higher level of performance on those task instances with lower subjectivity, for which human annotators exhibit a higher level of agreement in their annotation. together, our study provides important experimental evidence regarding the potential and limitations of using llms to generate synthetic data for text classification tasks. we conclude by discussing the implications, limitations, and future work of our study. ## related work generative ai in synthetic data generation. recent advancements in generative ai have motivated numerous studies to explore the potential of lever-aging generative models to create synthetic data for training machine learning models, especially for computer vision (cv) and natural language processing (nlp) tasks. in the realm of cv, several works have utilized gan-based models @xcite or diffusion models @xcite to generate synthetic data for image recognition @xcite or object segmentation @xcite . similarly, in the nlp field, researchers have also probed into the capacity of language models in generating synthetic data for various text classification tasks @xcite @xcite @xcite , with mixed results reported regarding the effectiveness of the synthetic data generated. in this study, we aim to obtain a better understanding of when the synthetic data generated by language models can lead to effective model training, and we focus on exploring the role of task subjectivity in moderating the effectiveness of the synthetic data. large language models. based on the transformer architecture @xcite , large language models (llms) have facilitated remarkable progress in the field of natural language processing. the utilization of bidirectional contexts in the bert model @xcite has resulted in superior performance across a wide range of tasks. building on this, openai's gpt series, comprising of models like gpt-2 @xcite , the colossal gpt-3 @xcite with an impressive 175 billion parameters and the most recent @xcite , pushed the boundaries of possibilities of llms. these models exhibit remarkable proficiency in generating high-quality human-like text @xcite @xcite , showcasing capabilities in rudimentary reasoning @xcite , translation @xcite , scientific synthetic data generation @xcite , and code generation @xcite . in this study, we focus on leveraging the cutting-edge gpt-3.5-turbo model foot_1 to explore its capabilities and limitations in synthesizing data for text classification tasks with different subjectivity levels. ## methodolgy in this section, we outline the procedure we have followed when leveraging the large language model to generate the synthetic training data for text classification. we consider two data generation settings in this study, i.e., the zero-shot setting and the fewshot setting. ## evaluation i: comparison across different types of tasks in our first evaluation study, we investigate into how well the synthetic data generated by llm under both zero-shot and few-shot settings can support effective model training for different types of text classification tasks. we are especially interested in comparing the model performance between those trained on the real-world data and on the llmgenerated synthetic data, and in understanding how the performance of those models trained on the llm-generated synthetic data varies with the subjectivity of the text classification task. ## evaluation ii: comparison across different task instances in the previous section, we have discovered that the subjectivity of a task can adversely affect the performance of classification models trained on the llm-generated synthetic data. however, even for the same type of task, the classification for each individual task instance may exhibit different levels of subjectivity as well. naturally, one may wonder whether models trained on the llm-generated synthetic data may show different performance on task instances of different subjectivity. we aim to explore the answers to this question in this section. ## conclusions and discussions in this paper, we present an initial exploration into factors that moderate the effectiveness of llmgenerated synthetic data for facilitating the training of text classification models. our results show that the performance of the models trained on synthetic data decreases both for classification tasks with higher levels of subjectivity and on task instances with higher subjectivity. in this section, we provide some potential explanations for the observations of our study, and discuss the implications, limitations, and future directions of our work. we provide a few explanations for why task subjectivity is found to be negatively associated with the performance of models trained on the llmgenerated synthetic data. first, highly subjective tasks often require a deep understanding of nuanced human emotions and contextual subtleties, as well as the ability to discern and accurately interpret different perspectives. as such, llms may encounter limitations in generating data that can capture the extensive range and complexity of real-life use of language. indeed, as shown in our exploratory analysis in section 4.5, the diversity of the llmgenerated synthetic data appears to be particularly limited on tasks with high subjectivity, when compared to the real-world data. this implies that one potential way to improve the effectiveness of synthetic data on high subjectivity tasks is to increase the data diversity and ensure the synthetic data can better reflect real-world data distributions. second, specific to the relationship between the instance-level subjectivity and model performance, we note that the "gold label" of a task instance is usually decided by a majority vote within a group of annotators. this means that the gold label may not represent the perspective of each individual @xcite , and they are sometimes "biased" themselves depending on the annotator decomposition @xcite . thus, it may be challenging for llms to generate synthetic data to recover such potentially biased "majority view," especially if the llms are trained to maintain neutrality. alternatively, one may ask for subjective task instances that humans can hardly reach any consensus on, whether the "gold label" is really the only "correct" label? if not, a rethinking of how to develop and evaluate models for these task instances is urgently needed.