Attributes as Textual Genes: Leveraging LLM s as Genetic Algorithm Simulators for Conditional Synthetic Data Generation (2025)

Abstract: Large Language Models (LLMs) excel at generating synthetic data, but ensuring its quality and diversity remains challenging. We propose Genetic Prompt, a novel framework that combines genetic algorithms with LLMs to augment synthetic data generation. Our approach treats semantic text attributes as gene sequences and leverages the LLM to simulate crossover and mutation operations. This genetic process enhances data quality and diversity by creating novel attribute combinations, yielding synthetic distributions closer to real-world data. To optimize parent selection, we also integrate an active learning scheme that expands the offspring search space. Our experiments on multiple NLP tasks reveal several key findings: Genetic Prompt not only significantly outperforms state-of-the-art baselines but also shows robust performance across various generator model sizes and scales. Moreover, we demonstrate that fusing our synthetic data with the original training set significantly boosts downstream model performance, particularly for class-imbalanced scenarios. Our findings validate that Genetic Prompt is an effective method for producing high-quality synthetic data for a wide range of NLP applications.

## introduction leveraging large language models (llms) to synthesize training data for smaller models is a promising path to efficiency and accuracy across nlp tasks @xcite , yet improving the quality and diversity of such data remains underexplored @xcite . prior work often steers synthetic data generation with pre-defined conditions such as clinical named entities @xcite , label correlations @xcite , and writing styles @xcite . however, reliance on static cues limits model reasoning, cross domain generalization, and dataset diversity. recent findings further suggest that instructional diversity is crucial for high quality synthesis @xcite @xcite , which motivates our core question: how can we automatically amplify data diversity and generator adaptability for robust downstream training? inspired by the genetic algorithms @xcite (gas), we propose genetic prompt framework for generating high-quality synthetic data that 1) automatically identifies and treats textual attributes as gene sequences, 2) integrates active learning to optimize parent selection process, and 3) diversifies synthetic data by simulating the genetic processes of crossover and mutation. gas are population-based search heuristics inspired by the process of natural selection iteratively evolving solutions to optimization problems @xcite . however, optimizing synthetic data generation via genetic method and llms has rarely been explored, due to two primary issues. first, assessing the fitness of individual samples is hard for downstream models, because a data point's effect is context-dependent and hinges on high-order interactions with the rest of the training set, as shown by recent study @xcite . second, data characteristics can be diverse and complex, while only focusing on partial scopes of target data may not be applicable to yield a large amount of high-quality synthetic data by llms. for example, a close study @xcite alters words and sentences on the syntactic level to continue optimizing the best individual samples. this approach is inherently constrained to generating only a small volume of data, limiting its scalability for large-scale synthetic data generation. to mitigate the unreliability of per example fitness in selecting parents, we replace conventional fitness based selection with an active learning (al) strategy @xcite . in each round, al pairs previously unused, diverse parents, enlarging the search space for offspring generation. to improve coverage and scalability, we avoid operating on individual tokens or sentences or treating them as genes. instead, we encode higher level linguistic and semantic attributes (e.g., readability and sentence structure) as genes. this design lets us leverage the knowledge and comprehension abilities of llms to implement crossover and mutation at the attribute level, producing large volumes of high quality and diverse data. our experiments demonstrate that genetic prompt consistently outperforms state-of-the-art baselines like attrprompt @xcite and curated llm @xcite , while also exhibiting superior robustness and scalability across various generator llm sizes. our qualitative analysis shows that the data generated by genetic prompt has superior semantic and lexical diversity and more accurately captures the statistical characteristics of real data. furthermore, we find that incorporating this synthetic data with gold data can significantly boost model performance, particularly in data imbalance settings. these findings validate the effectiveness of our genetic prompt framework for producing high-quality synthetic data for downstream tasks. ## genetic prompt for synthetic data generation in this section, we present our genetic prompt framework in figure 1 . the key idea is to automatically identify and treat data attributes as genes and prompt llms to do crossover and mutation operations over a small initial population from gold data. it consists of four major modules: 1) textual genes identification, 2) active parents selection, 3) crossover and mutation, and 4) downstream training. we include detailed algorithmic process in algorithm 1 under the appendix. ## results to evaluate the effectiveness of our genetic prompt method, we conducted four major studies, including intrinsic analysis of data quality, extrinsic evaluations on downstream tasks, integrative evaluation with real-world data, and ablation studies on individual modules. we also report extensive performance results and a case study in appendix a. ## effects analysis of generator size and data scale as data varies in effects of data generator size. as shown in figure 2a , different datasets exhibit varying sensitivity to generator model size. on the chemprot data (relation extraction), performance of our genetic prompt positively correlates with the size of the llama models, while simprompt and curated llm exhibit the opposite trend, and attrprompt shows a decrease in performance using the middlesize llama model. on the agnews data (text classification), methods show large performance gaps on smaller models (3b, 8b) but converge to similar performance levels on the largest model (70b), suggesting that sufficient model capacity can compensate for methodological differences in this task. on the scitldr data (text summarization), moderate sensitivity is observed with some performance fluctuations across model sizes. these observations reveal that the impact of generator size is highly task-dependent. larger generators do not universally lead to improved performance on downstream tasks, while our method demonstrates consistent robustness across models of various sizes, with notable advantages on tasks that are more sensitive to model scale such as relation extraction. effects of synthetic data scale. our genetic prompt demonstrates consistent improvement as synthetic data size increases across all three tasks in figure 2b . in contrast, other methods show different scaling patterns: on agnews, all methods steadily improve with increasing data scale; on chemprot, simprompt, attrprompt, and curated llm plateau or decline after reaching peak performance around 1-2k samples; on scitldr, most methods show relatively stable performance with modest improvements. we also observe two key patterns across differ-ent methods and data. first, although different methods achieve varying peak performance levels on each dataset, they tend to reach their optimal performance at similar data scales per task. second, different datasets exhibit significantly different optimal synthetic data scales despite having comparable task complexity -for instance, while agnews (4 classes) and chemprot (5 classes) have similar numbers of categories, agnews reaches peak performance around 4k samples while chemprot peaks at approximately 2k samples. the superior scalability of our method, particularly evident on chemprot where other methods suffer from performance degradation at larger scales, suggests better data diversity and reduced overfitting in our generated samples. this is consistent with the results in ## conclusion in this work, we introduced the genetic prompt framework, a novel approach combining llms and genetic algorithms for synthetic data generation. experiments on 8 datasets from multiple domains and nlp tasks demonstrate the effectiveness of genetic prompt, as it consistently outperformed three state-of-the-art baselines across multiple settings. our ablation and effect analysis have summarized multiple insights for future studies on generating synthetic data or applying synthetic data over downstream tasks: 1) semantic-level generation of synthetic data can capture more data characteristics and thus promote synthetic data quality, 2) combining synthetic and real-world data generally boost model performance but rely on llm options and prompting methods, and 3) synthetic data play a more critical role in downstream tasks with smaller and domain-specific data. our future work will further expand and verify the potentials to apply our approach to broader domains, modalities, and applications, such as synthetic generation for health tabular data and training small language models.