DataGen: Unified Synthetic Dataset Generation via Large Language Models

## Abstract

Abstract Large Language Models (LLMs) such as GPT-4 and Llama3 have significantly impacted various fields by enabling high-quality synthetic data generation and reducing dependence on expensive human-generated datasets.
Despite this, challenges remain in the areas of generalization, controllability, diversity, and truthfulness within the existing generative frameworks. To address these challenges, this paper presents UniGen , a comprehensive LLM-powered framework designed to produce diverse, accurate, and highly controllable datasets. UniGen is adaptable, supporting all types of text datasets and enhancing the generative process through innovative mechanisms. To augment data diversity, UniGen incorporates an attribute-guided generation module and a group checking feature. For accuracy, it employs a code-based mathematical assessment for label verification alongside a retrieval-augmented generation technique for factual validation. The framework also allows for user-specified constraints, enabling customization of the data generation process to suit particular requirements. Extensive experiments demonstrate the superior quality of data generated by UniGen , and each module within UniGen plays a critical role in this enhancement. Additionally, UniGen is applied in two practical scenarios: benchmarking LLMs and data augmentation. The results indicate that UniGen effectively supports dynamic and evolving benchmarking, and that data augmentation improves LLM capabilities in various domains, including agent-oriented abilities and reasoning skills.

### 1 Introduction

Large Language Models (LLMs) such as GPT-4 [], Claude [], and Llama3 [] have demonstrated excellent performance across various professional domains, including medical [, ], educational [], software engineering [], and social sciences [], as well as in LLM-based agent applications [, , ].
Given their superior generative capabilities, researchers are naturally inclined to explore effective methods for utilizing these models in synthetic data generation [, , ]. The primary objective is to produce high-quality, cost-effective datasets, thereby reducing the reliance on expensive human labor.
Furthermore, data generated by LLMs can be employed for data augmentation [], dynamic evaluation [, ], enhancing model self-alignment [], and more.

Despite the advancements in LLM-generated data [, , , , ], which have significantly improved the data generation pipeline and reduced the human cost, some challenges remain, particularly in terms of (1) Generalization and Controllability: Most of existing frameworks directly modify data items in original datasets in specific ways based on fixed principles [, ] (*e.g.*, add additional context or shuffle the order of the options), which may constrain the generalization of the generated data as they do not modify the nature of the data items like the scenarios within items. Moreover, many of them are also limited to particular dataset formats or types [, ], such as multiple-choice or mathematically-oriented datasets (*e.g.*, GSM8K []). Additionally, the lack of provisions for incorporating external constraints, like specific user requirements (*e.g.*, users may specify the length of generated text), restricts their controllability during generation. (2) Diversity and Truthfulness: Prior efforts always overlook the need to ensure some quality aspects of the datasets like diversity and truthfulness. For instance, the direct application of LLMs for dataset generation often leads to replication and low diversity, as LLMs may output the same answers when faced with semantically similar input. Furthermore, the propensity of LLMs to produce hallucinations [, ] can introduce factual inaccuracies, potentially degrading model performance when such datasets are used for training or fine-tuning.

Figure: Figure 1: Our proposed UniGen for dataset generation via LLMs.
Refer to caption: x1.png

**Table 1: Comparison of different dataset generation frameworks. The gray checkmark means the work may achieve parts of the goal (not all).**
| Related | General | Control. | Diversity | Truthful | w/o Human | New | Dynamic | Data |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Work | -ization | -lability |  | -ness | Intervention | Knowledge | Benchmark | Aug. |
| DyVal [] |  |  |  | $\checkmark$ | $\checkmark$ |  | $\checkmark$ | $\checkmark$ |
| DyVal 2 [] | $\checkmark$ | $\checkmark$ |  |  | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ |
| S3Eval [] |  | $\checkmark$ |  |  | $\checkmark$ |  | $\checkmark$ |  |
| Yu et al. [] | $\checkmark$ | $\checkmark$ | $\checkmark$ |  | $\checkmark$ | $\checkmark$ |  | $\checkmark$ |
| Chung et al. [] |  |  | $\checkmark$ | $\checkmark$ |  |  |  |  |
| Fan et al. [] |  |  |  | $\checkmark$ | $\checkmark$ |  | $\checkmark$ |  |
| Jandaghi et al. [] |  |  |  |  | $\checkmark$ | $\checkmark$ |  |  |
| Wang et al. [] | $\checkmark$ |  |  | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ |  |
| \hdashline UniGen (UniGen) | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ |

To address these challenges, this paper puts forward UniGen (as shown in Figure 1), a unified and LLM-powered framework designed to generate a dataset. UniGen ensures the generalization, diversity, truthfulness, and controllability simultaneously of the generation process, compared to previous studies (as shown in Table 1). UniGen accepts all kinds of text datasets and generates high-quality datasets based on various modules. To enrich the diversity of the generated datasets, UniGen employs a range of strategies, including various hyperparameter settings, attribute-guided generation, and group checking. To guarantee the truthfulness of the generated datasets, we propose a code-based mathematical assessment to detect and rectify potentially incorrect labels.
Additionally, we adopt a Retrieval-Augmented Generation (RAG)-based validation method to check the factuality of generated statements to ensure their truthfulness. UniGen integrates constraints input to align with user specifications to enhance user control over the dataset generation process. Furthermore, by employing attribute-guided generation and difficulty enhancement, we enable the generation of data covering a wide range of topics while providing users with controllable difficulty levels.

To summarize, the key contributions of this paper are as follows:

- $\triangleright$
We introduce a unified framework, UniGen, specifically designed for generating textual datasets via LLMs. UniGen accepts the original dataset, dataset description, and user constraints, as well as integrates different modules to ensure diversity, truthfulness, and controllability during generation.
- $\triangleright$
We carry out extensive experiments to assess the effectiveness of UniGen, covering aspects such as data characterization, module efficacy, human evaluation, error analysis, and cost analysis. The results affirm that UniGen is proficient in dataset generation and suggests promising directions for future research.
- $\triangleright$
Furthermore, we delve into two potential applications of UniGen —benchmarking LLMs and data augmentation. Our findings provide several key insights. For example, I) Most LLMs struggle with math-oriented datasets generated by UniGen (*e.g.*, GSM8K). II) The benchmark performance of LLMs varies significantly across datasets generated by different LLMs. III) LLMs’ capabilities across various aspects (*e.g.*, agent-related abilities, reasoning skills) can be improved by fine-tuning based on the generated data. IV) A potential improvement of data augmentation still exists in knowledge-intensive datasets.
- $\triangleright$
Based on the observations and findings presented, Appendix A discusses the limitations of the current framework for dataset generation and proposes potential improvement measures for future studies. These enhancements are considered from multiple perspectives, including error analysis, downstream applications, and LLM alignment.

### 2 Related Work

##### Benchmarking and Evaluating LLMs.

Owing to the remarkable capabilities of LLMs, benchmarking these models is essential for a deeper understanding of both general and specialized domains []. The evaluation of LLMs encompasses a wide range of fields, initiating with core NLP tasks such as sentiment analysis [, ], text classification [, ], and natural language inference []. A holistic evaluation framework, the HELM benchmark, has been proposed by Liang et al. [], laying the groundwork for comprehensive assessments. Additionally, the application of LLMs spans diverse sectors [], including computational social science [], legal analytics [, , ], and psychological studies [, ]. Furthermore, several benchmarks have been designed to scrutinize trustworthiness dimensions such as safety and privacy in LLMs [, , , , , ]. Static benchmarks are susceptible to data contamination, wherein developers might incorporate benchmark datasets into the training data to artificially enhance performance. To mitigate this, flexible protocols for dynamic evaluation have been advanced, exemplified by the recent initiatives DyVal [] and DyVal 2 []. Additionally, Fan et al. [] introduced NPHardEval, featuring monthly updated datasets. The S3Eval framework, a scalable evaluation suite for LLMs, was conceptualized by []. Moreover, some benchmarks adopt methodologies where LLMs function as evaluators (*e.g.*, LLM-as-a-judge) [, , ], with AlignBench proposing a multi-dimensional assessment using this approach [].

##### Synthetic Data by LLMs.

LLMs have demonstrated an impressive capacity for data generation, leading to their application in creating synthetic datasets for pretraining and fineu’runing, replacing the labor-intensive processes of manual data scraping and selection [].
Distinct from earlier methods that focus on traditional language models [], LLMs offer enhanced prospects for producing high-quality synthetic data across a wide spectrum of applications, such as multilingual QA [], chatbot conversation [] and data diversity augmentation [, ].

The concept of synthetic benchmarks takes a step further by demanding that the LLM-generated data be diverse accurate and systematically challenging. For instance, Wang et al. [] devised a framework that enhances the evolution of benchmarks by applying six reframing techniques on existing datasets. Wei et al. [] employed GPT-4 to create LongFact, comprising extensive QA pairs that serve as a benchmark for evaluating long-form factual content. Moreover, synthetic benchmarks have also been constructed in evaluating LLM emergent capabilities such as trustworthiness [], tool usage [, ] and persona-based conversation []. Our research advances synthetic benchmark generation by developing a paradigm that integrates multiple plug-and-play modules into LLM dataset creation, leveraging emergent capabilities by various prompting methods (*e.g.*, self-evaluation []) to produce data items with high-quality. Recently, in response to concerns about the quality of synthetic datasets, Dekoninck et al. [] conducted comprehensive experiments to evaluate the diversity and fidelity of synthetic data produced by LLMs, while Dekoninck et al. [] introduced a new inference framework, model arithmetic, to control the content generated by LLMs.

### 3 UniGen Framework

Figure: Figure 2: The architecture of UniGen.
Refer to caption: extracted/5808505/figures/architecture.png

In this section, we will introduce the proposed UniGen, a unified framework for dataset generation. UniGen consists of four modules (as shown in Figure 2) including framework input, generation hint, internal evaluation, and post-processing. Formally, consider an original dataset $\mathcal{D}$, the proposed framework $\mathcal{F}$, which operates by iteratively sampling subsets $\mathcal{S}_{i}$ from $\mathcal{D}$ (*i.e.*, example selection for few-shot learning in subsection 3.2). For each subset, $\mathcal{F}$ applies transformations based on the dataset’s description $\mathcal{M}(\mathcal{D})$ and a set of constraints $\mathcal{C}$. The final generated dataset, $\mathcal{D}_{\text{gen}}$, is accumulated over $N$ iterations: $\mathcal{D}_{\text{gen}}=\bigcup_{i=1}^{N}\mathcal{F}(\mathcal{S}_{i},\mathcal
{M}(\mathcal{D}),\mathcal{C})$. During generation, the objectives of UniGen focus on maximizing the generalization, controllability, diversity, and truthfulness of the generated dataset.

To ensure optimal functionality, UniGen integrates four main modules:

- $\triangleright$
Framework Input: This module captures the basic information about the target dataset (e.g., data examples, dataset description) and any explicit constraints specified by users for data generation.
- $\triangleright$
Generation Hint: Designed to steer the generation process of LLMs, this module ensures that the generated dataset closely mirrors the original dataset and aligns with user specifications.
- $\triangleright$
Internal Evaluation: This module evaluates and refines the generated dataset. It plays a crucial role in enhancing dataset quality, including assessing the truthfulness of the generated data items.
- $\triangleright$
Post-Processing: Used to perform additional operations on the generated dataset, this module adds flexibility to the framework, adapting it to various application needs.

#### 3.1 Framework Input

The input for UniGen comprises three components: base dataset, dataset description, and generation constraints: The base dataset is provided in a standardized JSON format, which may include text with a label or standalone text (*e.g.*, “text with a label” or “single text”). The dataset description articulates the specifics of the base dataset at a high level, furnishing foundational guidance for the LLM to synthesize a dataset analogous to the original. While optional, the generation constraints [] specify fine-grained conditions under which the LLM operates during dataset generation. For instance, constraints might stipulate that “Do not generate text longer than 20 words” or “Include an emoji in each generated sample”, thereby restricting specific conditions of the synthetic dataset.

#### 3.2 Generation Hint

Few-Shot Learning. The base dataset typically comprises hundreds of data items; however, incorporating all these items directly into the prompt may result in an excessively long context that could obscure the comprehension capabilities of LLMs and incur substantial costs []. To mitigate these challenges, few-shot learning techniques are employed for dataset generation [, ]. Within UniGen, two principal methods are utilized to select few-shot learning examples. The first method involves a random sampling from the base dataset, effectively reducing both generation time and associated costs. The second method focuses on enhancing the diversity of examples, thereby guiding LLMs to generate as varied a dataset as possible. Specifically, UniGen initially encodes all data items using OpenAI’s text-embedding-ada-002 [] to create an embedding list. Subsequently, a clustering algorithm (e.g., K-means []) is applied to form $n$ clusters, where $n$ represents the desired number of examples. One example is randomly selected from each cluster, yielding a set of $n$ diverse examples.

Diversity Setting. To augment the diversity of the generated data, we implement two strategies: (1) *Hyperparameter Setting.* The content generated by LLMs is influenced by various factors, with hyperparameters such as temperature, top-k, and top-p being crucial. To maximize the diversity of the dataset, we manipulate these hyperparameters, particularly the temperature settings. (2) *Attribute-Guided Generation.* Drawing on insights from prior research [, ], we formalize the attribute-guided text generation process for LLMs. Let $\mathcal{A}=\{a_{1},a_{2},\dots,a_{n}\}$ be a set of attributes, such as "economics" and "sports", intended to guide the generation process. We model the generation process as a function where the output text $y$ is a function of the input prompt $x$ and a vector of attributes $\mathbf{a}\in\mathcal{A}$. The generation process can be expressed as $y=P(x,\mathbf{a})$, where $P$ represents the generation model of the LLM, and $x$ is the input prompt. To implement this, we employ two distinct strategies: the first involves directly incorporating user-input customized attributes, and the second requires asking LLMs to extract necessary attributes from given data examples (the prompt template is shown in Appendix H). (3) *Group Checking.* To ensure diversity among the generated items, a similarity matrix is employed to identify and filter out pairs of data items exhibiting high similarity. Further details on this process are provided in subsection 3.4.

#### 3.3 Internal Evaluation

Overall Quality Assessment and Enhancement. After obtaining the raw generated data, it’s important to enhance their overall quality as during the generation, LLMs may overlook some details so as to mistake like deviating from the dataset description. Inspired by recent studies about self-evaluation and self-alignment [, , , , , ], we leverage LLMs themselves to improve the quality of generated data. The process involves two primary steps: (1) Self-Reflection. Each generated data item is initially subjected to a self-reflection phase, wherein LLMs assess the item to determine errors and potential areas for enhancement. The output of self-reflection contains two parts: whether the given data needs to be enhanced and the reason why it needs enhancement. (2) Self-Enhancement. When LLMs recognize the necessity for improvements, both the reflective insights and the data item itself are re-input into the LLM to generate an improved version. By establishing a threshold for the number of iterations and repetitively applying these steps, UniGen effectively elevates the overall quality of the generated items.

Code-Based Mathematical Evaluation. In generating mathematics-related datasets, such as GSM8K [], it has been observed that a proportion of generated labels are factually incorrect. To address this issue, we employ a code-based mathematical evaluation method to verify the accuracy of generated labels. As highlighted in the recent study by [, ], the use of tools (*e.g.*, a Python function) can substantially improve reasoning performance. Motivated by this finding, we require the LLM to generate Python code to solve the given math-related problem. The code is then executed within a simulative environment to produce a solution. The code-verified answer(*i.e.*, label) is subsequently compared with the original LLM-generated answer. If they conflict, the original LLM-generated answer will be replaced with the code-verified answer.

Truthfulness Validation by RAG. Ensuring the truthfulness of generated golden answers is crucial when creating datasets that require factual knowledge. Prior studies have utilized Retrieval-Augmented Generation (RAG) to enhance the factuality and reduce the incidence of hallucinations in LLMs [, , , ]. To combat hallucinations within the generated data, we implement a RAG-based validation process in UniGen.
Specifically, the LLM first identifies keywords from the generated text. Subsequently, UniGen retrieves relevant descriptions based on these keywords from the Wikipedia database, as demonstrated in prior research []. These descriptions are then used as prompts to guide the LLM in detecting and correcting any discrepancies or errors in the generated content.

#### 3.4 Post-Processing

Difficulty Enhancement. Given that the dataset is produced by LLMs, the complexity of the generated data is occasionally insufficient to challenge LLMs as their capabilities evolve. To address this, and inspired by prior research [, ], we implement several strategies to increase the data’s difficulty. These strategies are designed to elevate the challenges faced by LLMs in processing and responding to the data. The applied policies include:
(1) Paraphrasing Question: Reformulate the phrasing to express the same idea with greater sophistication. (2) Adding Extra Context into Question: Integrate additional context or details that, while not directly aiding in the question’s resolution, enhance the question’s complexity. (3) Paraphrasing The Choices: Each option should be rephrased to reflect the same concept or idea as the original. The essence and meaning must be preserved. If an option cannot be paraphrased without altering its meaning, it should remain unchanged.
(4) Adding A New Choice: Introduce a plausible but incorrect option to the existing choices to create ambiguity and require deeper understanding.

Group Checking. To mitigate the issue of high similarity among generated data items, a group-checking mechanism is implemented to identify and eliminate duplicates. Specifically, we utilize OpenAI’s text-embedding-ada-002 [] to compute embeddings for all generated items. Let $\mathcal{X}=\{x_{1},x_{2},\dots,x_{n}\}$ be the set of generated data items, and $\mathbf{e}_{i}$ be the embedding of item $x_{i}$ computed via text-embedding-ada-002. We define the similarity matrix $\mathbf{S}$ where the element $s_{ij}$ is given by $s_{ij}=\sqrt{\sum_{k=1}^{d}(e_{ik}-e_{jk})^{2}}$, representing the Euclidean distance between the embeddings of items $x_{i}$ and $x_{j}$. Data items exhibiting a similarity exceeding a predefined threshold $\theta$ are filtered out to ensure diversity within the dataset. Formally, if $s_{ij}<\theta$ for any pair $(i,j)$, at least one of the items $x_{i}$ or $x_{j}$ is randomly removed from the final dataset.

### 4 Experiment and Application

#### 4.1 Experimental Setup

| Type | GSM8K | MMLU | TruthfulQA | HellaSwag |
| --- | --- | --- | --- | --- |
| Generated | 0.663 | 0.744 | 0.743 | 0.680 |
| Original | 0.681 | 0.746 | 0.745 | 0.742 |
| $\Delta$ | 2.64% | 0.27% | 0.27% | 8.36% |

Table: Table 2: Remote-Clique of generated data and original data. $\Delta$ is the difference between them.

Figure: Figure 3: Human evaluation of overall quality assessment and enhancement.

To thoroughly evaluate the effectiveness of UniGen, we have carefully selected four representative benchmark datasets: GSM8K [], TruthfulQA [], MMLU [], and HellaSwag []. Each dataset uniquely contributes to language model assessment, covering dimensions from mathematical problem-solving and factual accuracy verification to extensive language understanding and commonsense reasoning. We show the details of these four datasets in Appendix B. For dataset generation, we utilize GPT-4 [], Claude3-Opus [], and Llama3-70b [], as these LLMs are among the most robust available, exhibiting exceptional ability to follow instructions. For benchmarking, our study utilizes eight cutting-edge and popular models from notable entities in the AI domain (the details are shown in Appendix B.), reflecting a mix of open-source and proprietary technologies. The number of generated data items and more details are shown in Appendix D. Note that difficulty enhancement is not applied to the generated data for benchmarking. We will discuss the effectiveness of difficult enhancement in subsection 4.3.

#### 4.2 Characterizing Generated Data

Figure: (a) Len. distribution of generated and original data.
Refer to caption: x3.png

Length. As depicted in 4(a), the length distribution of all generated datasets approximates a normal distribution. Notably, except for the HellaSwag dataset (as the length of the original HellaSwag dataset looks like a bimodal distribution), the distributions of other datasets closely resemble those of their respective original datasets. This similarity indicates that UniGen effectively mimics the distribution of the original data, thereby enhancing the reliability of the generated datasets.

Diversity. Analogous to the length distribution, the distribution of the self-BLEU score [] (as depicted in 4(b))—a metric employed to assess text diversity—indicates that the diversity of the generated data closely aligns with that of the original dataset. This alignment underscores the exceptional capability of UniGen to replicate the diversity inherent in the original dataset, demonstrating its effectiveness in producing varied textual content. Additionally, we utilize the remote-clique metric, as applied in prior research [], to measure the diversity of the generated data. The related statistics are presented in Table 2. Observations reveal that the remote-clique scores of the original and generated data are closely matched, with less than 10% variance, affirming that our generated data maintains a high level of diversity comparable to the original dataset.

**Table 3: The knowledge richness comparison between different principles in DyVal 2 [] and UniGen. The principle 1, 2, 3, and 4 are paraphrasing questions, paraphrasing choices, adding extra context to questions, and adding a new choice.**
| Baseline | HellaSwag | MMLU | TruthfulQA | Avg. |
| --- | --- | --- | --- | --- |
| DyVal2-prin.1 | 24.30% | 61.30% | 51.40% | 45.67% |
| DyVal2-prin.2 | 40.50% | 65.70% | 46.20% | 50.80% |
| DyVal2-prin.3 | 27.00% | 62.70% | 57.30% | 49.00% |
| DyVal2-prin.4 | 51.40% | 71.00% | 47.60% | 56.67% |
| UniGen | 5.40% | 3.30% | 2.80% | 3.83% |

Knowledge Richness Introduced. In contrast to prior research [, , ], UniGen innovates by generating entirely new data items, rather than merely modifying existing answers. This approach introduces novel scenarios and knowledge. We assessed the knowledge richness of the data generated by UniGen and compared it to the previous study (i.e., Dyval2 []) by calculating the entity overlap rate—how many entities appear both in the generated and original data. A lower overlap rate indicates that the framework is introducing more new knowledge. According to our findings, presented in Table 3, UniGen demonstrates an average overlap rate of only 3.83%, significantly lower than that of Dyval2 []. This substantial reduction in overlap rate signifies that our framework excels at incorporating new knowledge into the generated datasets.

We also analyze the semantic embedding of the generated dataset and the original dataset, which is shown in Appendix E.

**Table 4: Effectiveness of each module in UniGen.**
| Diversity Enhancement | Code-based. | RAG Validation |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Raw | +Attribute Guided | +Group Checking | Raw | +Validation | Corrected Percentage |
| 0.695 | 0.735 (5.8% $\uparrow$) | 0.743 (6.9% $\uparrow$) | 44% | 88% | 4.2% |

#### 4.3 Effectiveness of Modules in UniGen

Figure: Figure 5: The percentage of different epoch counts in four datasets.
Refer to caption: x5.png

In this section, we validate the effectiveness of modules in UniGen. To simplify the analysis, our evaluation is based on the GPT-4 generated data: (1) Diversity Setting. As demonstrated in Table 4, the UniGen modules significantly enhance the diversity of the generated data. Specifically, the remote-clique score of the initially generated data stands at 0.695. However, the introduction of attribute-guided generation elevates the remote-clique score to 0.735. Furthermore, the implementation of group checking further increases this score to 0.743. (2) Overall Quality Assessment and Enhancement. To evaluate the effectiveness of our quality assessment and enhancement module, we conducted human evaluations focusing on two key aspects: (I) Comparing the quality between original and enhanced data items; (II) Assessing the reasonableness of the reflections. As illustrated in Figure 3, the results indicate that almost all reflections were deemed reasonable by the evaluators. Furthermore, over 80% of the enhanced data items were rated as superior in both datasets. These findings underscore the effectiveness of our module. (3) Difficulty Enhancement. As demonstrated in Table 6, it is observable that the performance of most of the LLMs declined when compared to their performance on the baseline-generated datasets after the application of difficulty enhancement. This result underscores the effectiveness of difficulty enhancement, which suggests its potential utility in preventing data contamination [, , ]. Such techniques may thus contribute significantly to improving the robustness of LLMs against overfitting to training datasets. (4) Code-Based Mathematical Evaluation. As depicted in Table 4, our code-based evaluation methodology has significantly enhanced the correctness of the generated data, improving from an initial accuracy of 44% to 92%. (5) Truthfulness Validation by RAG. As detailed in Table 4, the RAG-based validation corrected 4.2% of the examples, demonstrating its effectiveness. This percentage also highlights the high quality of the dataset generated by GPT-4, which contains only a few errors. The correctness of (4) and (5) are also manually evaluated, which of the details can be found in Appendix C.

In Appendix E, we explore the influence of temperature settings on data diversity and assess how effectively LLMs in UniGen adhere to user constraints. Our findings indicate that adjusting the temperature setting enhances the diversity of generated data. Additionally, LLMs within UniGen successfully follow user-imposed constraints in both single and combined scenarios.

| Error Type | GSM8K | HellaSwag | MMLU | TruthfulQA |
| --- | --- | --- | --- | --- |
| Factuality Error | 41% | 14% | 69% | 79% |
| Format Error | 20% | 29% | 8% | 0% |
| Multiple Answers | 0% | 43% | 0% | 0% |
| Question Error | 39% | 14% | 23% | 21% |

Table: Table 5: Proportion of different errors. Multiple answers mean the question is considered to have multiple correct answers after human evaluation. Question errors mean the question has quality flaws like unclear statements.

Figure: Figure 6: Performance of human and the best LLM (SOTA LLM) on four generated datasets.

#### 4.4 Human Performance on Generated Dataset

As depicted in Figure 6, the performance comparison between humans and LLMs reveals distinct outcomes across various datasets. In the HellaSwag dataset, human performance slightly surpasses that of LLMs. However, in the other three datasets, LLMs demonstrate superior performance. Notably, in the GSM8K dataset, the accuracy of human responses is lower than that of the best-performing LLM. For the TruthfulQA and MMLU datasets, which require extensive knowledge, humans perform significantly worse than LLMs, which benefit from training on large, diverse corpora. More details about evaluating human performance are shown in Appendix C.

#### 4.5 Error Analysis

To examine the errors present in the generated dataset, we conducted a human evaluation for error analysis. We observed significant factuality errors in datasets such as GSM8K, TruthfulQA, and MMLU, primarily because these datasets contain responses that are fact-based (*e.g.*, arithmetic question answers). This observation underscores the necessity for enhancements in the accuracy of provided answers. Despite the robust instruction-following capabilities of GPT-4, it occasionally struggles with data formatting issues. Such errors could be mitigated through clearer prompts or by employing an integrated framework like LangChain(^*^**[https://github.com/langchain-ai/langchain](https://github.com/langchain-ai/langchain)). Additionally, our analysis of the HellaSwag dataset revealed the presence of multiple viable answers for certain prompts, highlighting the need for a more comprehensive answer validation mechanism. We have discussed the potential improvement by mitigating these errors in Appendix A.

**Table 6: LLMs’ performance on baseline generated (*i.e.*, gen.) dataset, challenge or difficulty enhanced dataset (*i.e.*, cha.), and their differences (*i.e.*, diff.).**
| Model | GSM8K | MMLU | HellaSwag | TruthfulQA |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| gen. | cha. | diff. | gen. | cha. | diff. | gen. | cha. | diff. | gen. | cha. | diff. |  |
| ChatGPT | 0.665 | 0.585 | 0.080 | 0.798 | 0.633 | 0.165 | 0.960 | 0.924 | 0.036 | 0.816 | 0.718 | 0.098 |
| Claude-3 | 0.778 | 0.670 | 0.108 | 0.903 | 0.725 | 0.178 | 0.935 | 0.880 | 0.055 | 0.919 | 0.810 | 0.109 |
| Llama3-70b | 0.689 | 0.637 | 0.052 | 0.857 | 0.703 | 0.154 | 0.949 | 0.884 | 0.065 | 0.914 | 0.743 | 0.171 |
| Llama3-8b | 0.613 | 0.557 | 0.056 | 0.741 | 0.576 | 0.165 | 0.793 | 0.699 | 0.094 | 0.795 | 0.676 | 0.119 |
| Mistral-7b | 0.377 | 0.321 | 0.056 | 0.709 | 0.437 | 0.272 | 0.696 | 0.467 | 0.229 | 0.738 | 0.452 | 0.286 |
| Mixtral-8x7b | 0.509 | 0.439 | 0.070 | 0.851 | 0.616 | 0.235 | 0.511 | 0.373 | 0.138 | 0.824 | 0.648 | 0.176 |
| Yi-34b | 0.637 | 0.509 | 0.128 | 0.815 | 0.633 | 0.182 | 0.572 | 0.522 | 0.050 | 0.857 | 0.657 | 0.200 |

#### 4.6 Cost Analysis

We conducted a cost analysis of UniGen. Specifically, we calculated the total token usage and the corresponding cost for generating data across four datasets: MMLU, HellaSwag, TruthfulQA, and GSM8K. The details are presented in Figure 7. For a generated item without RAG-based validation and code-based evaluation, the cost is at most $0.038 using the GPT-4-Turbo API. When incorporating RAG-based validation, the average cost per generated item increases to $0.190, due to the large volume of tokens processed from the retrieved content. Adding code-based evaluation raises the cost to $0.040. Overall, the total cost for generating each item, including all validation and evaluation processes, will not exceed $0.200. This cost, although significant, is substantially lower than the cost of human labor.

Figure: Figure 7: Cost (dollar) on different epoch numbers of overall quality assessment and enhancement (Left), and the token number cost of each part in UniGen.
Refer to caption: x7.png

#### 4.7 Application-I: Benchmarking LLMs

**Table 7: The main results on generated datasets (*i.e.*, gen.) and original datasets (*i.e.*, ori.).**
| Dataset | GSM8K | MMLU | TruthfulQA | HellaSwag |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| ori. | gen. | ori. | gen. | ori. | gen. | ori. | gen. |  |
| \hdashline        GPT-4 Generation |  |  |  |  |  |  |  |  |
| \hdashlineChatGPT | 0.762 | 0.665 | 0.609 | 0.798 | 0.825 | 0.837 | 0.611 | 0.960 |
| Claude-3 | 0.953 | 0.778 | 0.810 | 0.903 | 0.855 | 0.919 | 0.888 | 0.935 |
| Llama3-70b | 0.890 | 0.689 | 0.755 | 0.857 | 0.750 | 0.914 | 0.836 | 0.949 |
| Llama3-8b | 0.800 | 0.613 | 0.565 | 0.741 | 0.450 | 0.795 | 0.684 | 0.793 |
| Mistral-7b | 0.313 | 0.377 | 0.490 | 0.709 | 0.382 | 0.738 | 0.600 | 0.696 |
| Mixtral-8x7b | 0.610 | 0.509 | 0.720 | 0.851 | 0.640 | 0.824 | 0.712 | 0.511 |
| Yi-34b | 0.687 | 0.637 | 0.645 | 0.815 | 0.485 | 0.857 | 0.740 | 0.572 |
| \hdashline        Claude-3-Opus Generation |  |  |  |  |  |  |  |  |
| \hdashlineChatGPT | 0.762 | 0.405 | 0.609 | 0.802 | 0.432 | 0.744 | 0.538 | 0.712 |
| GPT-4 | 0.947 | 0.508 | 0.725 | 0.848 | 0.841 | 0.888 | 0.736 | 0.835 |
| Llama3-70b | 0.890 | 0.444 | 0.755 | 0.846 | 0.750 | 0.854 | 0.836 | 0.769 |
| Llama3-8b | 0.800 | 0.367 | 0.565 | 0.780 | 0.450 | 0.709 | 0.568 | 0.704 |
| Mistral-7b | 0.313 | 0.158 | 0.490 | 0.709 | 0.380 | 0.621 | 0.580 | 0.690 |
| Mixtral-8x7b | 0.610 | 0.291 | 0.720 | 0.717 | 0.640 | 0.680 | 0.600 | 0.565 |
| Yi-34b | 0.687 | 0.323 | 0.645 | 0.751 | 0.480 | 0.694 | 0.644 | 0.584 |

#### 4.8 Application-II: Data Augmentation

Figure: Figure 8: Results of data augmentation on Llama2-7b, Llama3-8b and Mistral-7b.
Refer to caption: x8.png

Using data augmentation with LLMs has been widely explored in previous studies [, , ]. In this section, we implement our UniGen to augment data in ten popular datasets (the details of datasets are shown in Appendix B). We include the experiment setting in Appendix D. The results of data augmentation are shown in Figure 8. We observe the following:

- $\triangleright$
The data augmentation powered by UniGen is effective. Performance across all ten datasets improved when trained with the UniGen–generated dataset, underscoring the efficacy of our generated data and suggesting broader potential applications for UniGen across extensive datasets.
- $\triangleright$
UniGen enhances LLMs from various capability aspects. The enhancements in various aspects of LLM capabilities due to the generated data are notable. For example, performance improvements in the Metatool dataset [] (*i.e.*, tool selection ability) indicate that UniGen can enhance agent-oriented capabilities of LLMs. Additionally, enhancements in reasoning abilities are evident in datasets such as GSM8K [] and both the BBH (bool/casual) [].
- $\triangleright$
Improvement on knowledge-intensive datasets still leaves much to be desired. The gains in datasets requiring extensive knowledge (*e.g.*, TruthfulQA []) are comparatively modest. This limited improvement may be due to LLMs acquiring most of their knowledge during pretraining, and the additional 200 training samples may not significantly impact performance on related tasks. Notably, the Llama2-7b model showed a performance decline on TruthfulQA after fine-tuning, possibly due to hallucinations introduced when new knowledge is acquired during fine-tuning rather than pretraining []. We discussed the potential measurement for enhancing in Appendix A.

### 5 Conclusion

In this paper, we proposed UniGen, a unified dataset generation framework powered by LLMs, which addresses key challenges in diversity, accuracy, and controllability. Its innovative modules and features, ensure high-quality, customizable datasets. The extensive experiments demonstrated the effectiveness of UniGen. Moreover, UniGen can be applied in dynamic and evolving benchmarking as well as data augmentation. Our study has obtained many insightful findings, which have laid the foundation for future research.

## Appendix

### Appendix A Impact, Limitation, and Improvement

Our proposed framework, UniGen, not only reduces the costs associated with manually creating data and supports dynamic benchmarking and data augmentation but also significantly impacts the data generation field in several key ways:

- $\triangleright$
Alleviating resource scarcity. UniGen effectively addresses the shortage of low-resource datasets. For instance, current datasets were predominantly in English, leaving non-English datasets scarce. Moreover, UniGen can help fill the dataset scarcity in some domains, especially some interdisciplinary fields like AI in psychology [, ]. This is significant for both domain development and AI fairness.
- $\triangleright$
Enhancing model robustness. The diversity and challenges presented by data generated through UniGen help models improve their ability to handle complex and varied real-world data. This, in turn, enhances the models’ generalization capabilities and reliability, especially in scenarios involving data contamination.
- $\triangleright$
Expanding research applications. The methodology used in UniGen can be adapted for other modal data generation frameworks. As models capable of handling different modalities or even multimodal data emerge, the research into data generation for these modalities becomes increasingly relevant and impactful.

While this research presents notable advancements, it concurrently grapples with certain limitations, which means we have much more space for improvement.

- $\triangleright$
From the perspective of error analysis (subsection 4.5). The error analysis identifies primary areas where UniGen can diminish errors to enhance reliability. To address factuality errors, deploying a robust LLM-based agent [] enhanced with a broader verification toolkit—comprising an extensive database and web access capabilities—is crucial. Furthermore, question errors frequently stem from LLMs’ misinterpretations of dataset descriptions and objectives, a direct consequence of alignment inefficiencies []. Implementing a plug-in module that refines human-written dataset descriptions into formats more comprehensible to LLMs could mitigate this issue.
- $\triangleright$
From the perspective of downstream applications (subsection 4.7 and subsection 4.8): A significant oversight in our endeavor to establish a universal dataset generation framework was the insufficient focus on adaptability for specific applications. Concerning dynamic benchmarking protocols such as DyVal [] and DyVal 2 [], it is vital to ascertain the specific capabilities that these benchmarks aim to evaluate. For example, while the GSM8K is designed to assess reasoning abilities, the current dataset generation paradigm, which leverages descriptions and few-shot examples, may fail to challenge LLMs adequately. Therefore, orienting the generation process to explicitly target the capabilities under evaluation could truly enhance the dynamism of the dataset. Additionally, our findings indicate limited improvements when applying data augmentation to knowledge-intensive datasets like MMLU [] and TruthfulQA []. A more effective approach could involve identifying novel or out-of-distribution (OOD) data that represents unmastered knowledge for LLMs, thereby significantly enhancing learning outcomes.
- $\triangleright$
From the perspective of weak-to-strong alignment [, ] & self-alignment [, , ]: LLM-generated data have been extensively utilized to improve LLMs themselves. For example, Phi-3 [] is trained using a substantial amount of synthetic data generated by GPT-4. This utilization demonstrates that LLMs can undergo self-evolution through synthetic data. In our study, while we have explored potential alignments in a cross-model mode (e.g., using GPT-4 to enhance weaker models), the strategies for self-alignment or weak-to-strong alignment within the same model are not thoroughly investigated. Future research focusing on how to adapt a dataset generation framework like UniGen for use in data-centric alignment domains will be of considerable importance.

### Appendix B Details of Datasets and Models

#### B.1 Datasets

GSM8K. GSM8K is a dataset designed to test the mathematical problem-solving ability of large language models []. It comprises approximately 8,000 math word problems typical of those in grade school. The problems are diverse, covering various topics and difficulties, making it a comprehensive tool for assessing the reasoning capabilities of models in numerical contexts.

TruthfulQA. TruthfulQA is a dataset crafted to evaluate the truthfulness and factual accuracy of answers provided by language models []. It consists of questions that models frequently respond to incorrectly or misleadingly. The dataset challenges models on simple factual questions and questions requiring a nuanced understanding of common misconceptions and controversial topics.

MMLU. MMLU is a large-scale dataset designed to test various language understanding tasks []. It covers 57 subjects ranging from humanities to natural sciences, providing a broad spectrum of topics. This diversity makes MMLU highly effective for assessing the general knowledge and understanding of language models across varied domains.

HellaSwag. HellaSwag is a dataset that evaluates common sense reasoning and context understanding in language models []. It includes scenarios requiring the prediction of the most plausible continuation among several options. The dataset is crafted to be particularly challenging, often including subtle nuances and twists that test the depth of contextual comprehension.

MetaTool. MetaTool is a benchmark designed to evaluate LLMs’ awareness and proficiency in tool usage and selection []. In our experiment, we conducted evaluations on two tasks. In our experiments, we specifically focused on single-tool selection.

MultiNLI. The Multi-Genre Natural Language Inference (MultiNLI) is a crowd-sourced dataset of 433k sentence pairs annotated with textual entailment information []. It covers a range of genres of spoken and written text and supports a distinctive cross-genre generalization evaluation.

ARC (Challenge). The AI2’s Reasoning Challenge (ARC) dataset is a multiple-choice question-answering dataset, containing questions from science exams from grade 3 to grade 9 []. The dataset is split into two partitions: Easy and Challenge, where the latter partition contains the more difficult questions that require reasoning.

BoolQ. BoolQ is a reading comprehension dataset with questions that are unexpectedly challenging []. They often query for complex, non-factoid information, and require difficult entailment-like inference to solve.

BBH. BIG-Bench Hard (BBH) is a subset of the BIG-Bench, a diverse evaluation suite for language models []. BBH focuses on a suite of 23 challenging tasks from BIG-Bench that were found to be beyond the capabilities of current language models. We select two tasks from BBH: boolean expressions(^†^††[https://github.com/suzgunmirac/BIG-Bench-Hard/blob/main/bbh/boolean_expressions.json](https://github.com/suzgunmirac/BIG-Bench-Hard/blob/main/bbh/boolean_expressions.json)) and causal judgement(^‡^‡‡[https://github.com/suzgunmirac/BIG-Bench-Hard/blob/main/bbh/causal_judgement.json](https://github.com/suzgunmirac/BIG-Bench-Hard/blob/main/bbh/causal_judgement.json)).

**Table 8: The dataset description we used in UniGen.**
| Dataset | Description |
| --- | --- |
| HellaSwag | This dataset consists of multiple-choice questions designed to test the logical reasoning and contextual understanding of AI models. Each question sets up a scenario and asks "What happens next?" with four potential answers. Only one answer is logically sound and contextually appropriate, while the other three are implausible, either contradicting the scenario’s details or representing unlikely outcomes.The purpose of these questions is to challenge AI models to use logical sequencing, inferential reasoning, and practical insights effectively. This dataset aims to refine AI abilities in predicting logical continuations in scenarios that mimic real-life logic and events, ensuring the challenges are complex and thought-provoking. |
| MMLU | It is a large-scale, multi-task language understanding dataset designed to evaluate language models’ capabilities across various language understanding tasks. The dataset questions are presented in a multiple-choice format, each with a question (referred to as "text") followed by four options (labeled A, B, C, and D). Each question is associated with a correct answer ("label") |
| GSM8K | It is a dataset of high-quality linguistically diverse grade school math word problems created by human problem writers. These problems take between 2 and 8 steps to solve, and solutions primarily involve performing a sequence of elementary calculations using basic arithmetic operations ($+$ $-$ $\times$ $\div$) to reach the final answer. A bright middle school student should be able to solve every problem. It can be used for multi-step mathematical reasoning. Each problem should only have one question and one correct answer. |
| TruthfulQA | This dataset is designed to measure the truthfulness and accuracy of answers generated in response to common questions, some of which are often answered incorrectly by humans due to widespread misconceptions or false beliefs. The purpose of the dataset is to evaluate how well a model can distinguish factual accuracy from popular myths or erroneous understandings in various domains including history, science, and general knowledge. Each entry in the dataset consists of a question followed by multiple-choice answers where only one is correct. The dataset challenges the model’s ability to use historical data, scientific facts, and logical reasoning to select the correct answer over plausible but incorrect alternatives that might reflect common misunderstandings. |
| MetaTool | Each entry in the dataset includes a user’s query and a list of tool options. The model is required to select the most appropriate tool from the list that can best address the query. The dataset is designed to test the model’s ability to choose the right tool. |
| MultiNLI | The dataset is a crowd-sourced collection of sentence pairs annotated with textual entailment information. Each data item contains two different sentences and has the label "neutral", "contradiction", or "entailment". |
| ARC-C | The dataset is designed to test the model’s ability to understand and correctly answer science questions at a grade-school level, focusing on assessing capabilities such as comprehension, reasoning, and application of scientific knowledge. Each entry in the dataset consists of a question followed by multiple-choice answers where only one is correct. |
| BoolQ | This dataset is a question-and-answer dataset on reading comprehension. Given the title of a passage and the content of it, it requires providing a "true" or "false" answer to the given question. These questions are unexpectedly challenging as they often query for complex, non-factoid information and require difficult entailment-like inference to solve. |
| BBH (Bool) | The dataset consists of Boolean expressions and their respective evaluations. Each entry in the dataset is a pair, comprising a Boolean expression (as a question) and the expected result (as a label). The Boolean expressions include combinations of True, False, and, or, and not operators, testing various logical conditions. This dataset is useful for training models to understand and evaluate Boolean logic. |
| BBH (Casual) | The dataset contains various scenarios designed to test causal judgment. Each entry includes a scenario described in detail, followed by a question about the causality involved, and multiple-choice options for answers. The target indicates the expected answer to the question based on typical causal reasoning. |

#### B.2 Models

Models for Benchmarking. These include ChatGPT [] and GPT-4 [] by OpenAI [], known for their robust conversational abilities; Llama3-70b and Llama3-8b [] by Meta AI [], open-source and favored for their versatility across different computational scales; Mistral-7b and Mistral-8x7b [] by Mistral AI [], designed for efficiency in language tasks; Claude3 [] by Anthropic [], which focuses on safe and ethical AI interactions; and Yi-34b [] by 01.AI [], a model fine-tuned using high-quality curated data to ensure helpfulness.

### Appendix C Details of Human Evaluation

We conduct human evaluations in two parts: effectiveness of each module in UniGen (subsection 4.3) and error analysis (subsection 4.5). Four undergraduate students and one PhD student with professional English skills carry out these evaluations. Some annotation screenshots of human evaluation are shown in Figure 13 and Figure 14.

Effectiveness of Each Module in UniGen. In subsection 4.3, we conduct the human evaluation of overall quality assessment and enhancement, code-based, and RAG-based validation. Specifically, for code-based evaluation, when a label contradicts the code output, we will manually check whether the code output is correct (in UniGen, we will replace the original label with code output if they contradict). For the RAG-based validation, we also manually whether the correcting action is reasonable and supported by the ground truth.

Human Performance. The human evaluation was conducted by five students as mentioned before. Each student completed all questions across four datasets. The final performance scores were then averaged to obtain a comprehensive measure of human performance.

Error Analysis. The error analysis (subsection 4.5) is based on a structured human evaluation approach. To ensure the quality of the generated questions, human experts review each question against specific criteria that cover various aspects of data integrity and logical coherence. Below are the detailed aspects that are evaluated:

- •
Data format. This aspect evaluates whether the data presented in the questions adheres to the expected formats and standards. For example, dates should use a consistent format and options for generated data should be presented with the correct format (*e.g.*, A, B, C, or D).
- •
The logicality of mathematical questions. Experts assess whether the mathematical problems posed in the questions are logically sound and solvable within the given context. This includes checking for the presence of all necessary information, the feasibility of the operations, and the logical flow from premises to the conclusion.
- •
Correctness of answer. This criterion involves verifying that the answers provided or implied by the questions are correct and accurate.
- •
Articulation of data items. Reviewers examine how clearly data items are articulated within the questions. This includes clarity of language, proper grammatical structure, and the logical arrangement of information to facilitate easy understanding. Ambiguity or miscommunication that could hinder the respondent’s ability to accurately interpret the question is flagged for correction.

### Appendix D Details of Experiment Setting

Dataset Generation. To maximize the consistency of the experimental results, we set the temperature parameter for both GPT-4 and Claude-3 to 0. The size of the generated dataset used in subsection 4.2 and benchmarking LLMs is shown in Table 9. The batch size of generation (the number of items generated per time) is set to 5.

**Table 9: The size of the generated dataset used in subsection 4.2 and benchmarking LLMs.**
| GSM8K | HellaSwag | MMLU | TruthfulQA |
| --- | --- | --- | --- |
| 212 | 226 | 193 | 202 |

Inference Settings.Across all models, we maintained uniform hyperparameter settings. Specifically, the model temperature was set to 0 to enhance productivity, and the top-p was set to 1. For benchmarking purposes with Mixtral-8x7b and Llama3-70b, we utilized the inference API provided by Replicate(^§^§§[https://replicate.com/](https://replicate.com/)).

Fine-tune Settings.For each dataset, UniGen generates 200 samples powered by GPT-4 and then evaluates the fine-tuned models on the test set of the original dataset. The labels or ground-truth answers of generated data always contain only a few words, lacking a thinking process that may be more important for fine-tuning. To address this, the labels or the ground-truth answers of the generated dataset are refined and extended by GPT-4 itself (*e.g.*, transform the answers into Chain-of-Thoughts format []). Then a self-evaluation of GPT-4 will be conducted to ensure the correctness and accuracy of refined answers. Our fine-tuning is all based on the Supervised Fine-Tuning (SFT):

$$ $\mathcal{L}_{\mathrm{SFT}}\left(\pi_{\theta}\right)=-\mathbb{E}_{(x,y)\sim \mathcal{D}}\left[\log\pi_{\theta}(y\mid x)\right]$ (1) $$

We applied the LoRA [] technique to fine-tune Llama3-8b and Mistral-7b. The rank of LoRA was set to 8, the learning rate was $e^{-5}$, and we used the Adam optimizer [] for training. The models were trained over 5 epochs with a batch size of 4, utilizing mixed precision training. The training took place on a server equipped with an A100 GPU with 80GB of VRAM. For the training process, we employed the LLAMA-Factory framework [].

### Appendix E Additional Experiment Results

We show the benchmarking results based on the generated data from Llama3-70b in Table 12. Moreover, we also show the training loss and evaluation loss during fine-tuning for data augmentation in Figure 10, Figure 11 and Figure 12.

Influence of temperature. We examined the impact of temperature settings on the diversity of data generated by GPT-4. For this purpose, we selected a few items from the TruthfulQA dataset to use as examples in few-shot learning. We conducted experiments using temperature settings of 0 and 1. Our findings indicate that the Remote-Clique score [] at a temperature of 0 is 0.683, whereas, at a temperature of 1, it increases to 0.721. This suggests that adjusting the temperature setting can significantly enhance the diversity of the generated data.

Figure: Figure 9: Semantic embedding of different datasets. We use OpenAI’s text-embedding-ada-002 [] to obtain text embedding.
Refer to caption: x9.png

Semantic Embedding. As illustrated in Figure 9, the distribution of the generated dataset is encompassed within the distribution of the original dataset. This observation indicates that the data items generated are semantically aligned with the original data, confirming their semantic correctness.

User Constraints. To evaluate the effectiveness of LLMs in UniGen at adhering to user-specified constraints, our assessment is structured into two levels. The first level involves evaluating the model’s performance under single constraints, while the second level examines performance under combined constraints. The single constraints assessed include:

- •
Length-related: (1) Ensure each option is longer than 20 words. (2) Ensure each option is shorter than 20 words. (3) Ensure each question is longer than 100 words. (4) Ensure each question is shorter than 100 words.
- •
Topic-related: (1) Ensure the question is related to sports. (2) Ensure the question is related to computer science.
- •
Structure-related: Ensure each question contains five options.
- •
Language-related: (1) Ensure the questions and options are output in Chinese. (2) Ensure the questions and options are output in Spanish.

The combined constraints are shown in Table 10.

**Table 10: The combined constraint used in the experiments.**
| NO. | Constraint 1 | Constraint 2 |
| --- | --- | --- |
| 1 | Ensure each option is longer than 20 words. | Ensure each question is less than 100 words. |
| 2 | Ensure each option is less than 20 words. | Ensure each question is longer than 100 words. |
| 3 | Ensure each question is longer than 100 words. | Ensure each question contains five options. |
| 4 | Ensure each question contains five options. | Ensure the question is related to Computer and Science. |
| 5 | Ensure the question and options are output in Chinese. | Ensure the question is related to Computer and Science. |

**Table 11: The GP-4’s performance on user constraints.**
| Length-related | Structure-related | Topic-related | Language-related |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| (1) | (2) | (3) | (4)) | (1) | (2) | (1) | (2) |  |
| 100.00% | 96.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% | 100.00% |
| \hdashline        Single Constraint ($\uparrow$), Combined Constraint ($\downarrow$) |  |  |  |  |  |  |  |  |
| \hdashline        Constraint 1 | Constraint 2 | Constraint 3 | Constraint 4 | Constraint 5 |  |  |  |  |
| 96.67% | 83.33% | 100.00% | 98.00% | 100.00% |  |  |  |  |

### Appendix F Potential Negative Societal Impacts

The deployment of LLM-generated datasets, while beneficial in many contexts, carries potential negative societal impacts that warrant careful consideration. One significant concern is the propagation of biases present in the training data of the LLMs. If not adequately addressed, these biases can be reflected and even amplified in the generated datasets, leading to unfair or discriminatory outcomes in applications that utilize these datasets. Moreover, the use of synthetic data might reduce the diversity of perspectives if it over-relies on patterns learned from existing datasets, potentially overlooking minority viewpoints and underrepresented voices. To mitigate these risks, it is crucial to implement robust bias detection and correction mechanisms, enforce strict validation processes, and promote the ethical use of synthetic data in all applications.

### Appendix G Dataset Example

#### G.1 Generated Data

#### G.2 Truthfulness Validation by RAG

### Appendix H Prompt Template

### Appendix I Result Evaluation

For each dataset, we evaluate the performance of LLMs using the LLM-as-a-Judge methodology [], which is widely recognized for its robust evaluation capabilities [, , , ]. This method has demonstrated superior assessment accuracy compared to traditional rule-based methods (e.g., keyword matching []). Below is the prompt template we utilize for evaluation:

For the user constraint evaluation, we show the prompt as follows:

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: - What is the performance of each module given different generator models?
soundness: 3
strengths: - There's comprehensive work into each of the target attributes (generalization, controllability, diversity, and truthfulness)
- The methodology is highly detailed, including comprehensive ablations, evaluations, and cost details.
- The details about what synthetic generations other LLMs perform well and poorly on are helpful for further work into synthetic benchmarks.
summary: The authors present a framework for generating synthetic datasets that focus on generalization, controllability, diversity, and truthfulness by guiding the generation with attributes, checking diversity within a clique, performing code-based verification for reasoning tasks, and performing RAG to verify facts. The authors also show what types of synthetic benchmarks LLMs excel at and fail at.
weaknesses: - There could be more side-by-sides of questions from the original dataset and each generated dataset.

---

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: **Section 3.8 Benchmarking LLM**. The paper mentioned "challenging nature of Claude-3 generated dataset". Do different LLM uses the same / different prompts? 

**Section 3.3 Effectiveness of Modules in DataGen**. 
- Can you explain more on remote-clique score? Why is it a good metric, how exactly is it calculated on the generated dataset (using embeddings, or other representation of the dataset)?
- The delta of remote-clique score of HellaSwag is significantly higher than other datasets. Why is that?
soundness: 3
strengths: **Novelty and Significance**. The paper presents a novel technique and artifact for the field of synthetic data generation. DataGen is generalizable to other domains and tasks, though with additional overhead. Compared to other related work, DataGen is able to cover a wide range of features in real settings. The artifact is available and runnable. 

**Writing**. The writing is clear and well-organized, with clear visual / tables to summarizes the comparison, methodology, evaluation, and ablation studies. The motivation of the paper is very clear, the problem is well-defined, key contributions are listed and aligned with the structure of the paper. The visual elements in the paper are very helpful to understand the paper.

**Methodology**. The proposed framework is well-motivated, and the framework design is simple and easily generalizable to different domains and setups.

**Evaluation**. The evaluation is very comprehensive. It covers a wide range of tasks, models (open and closed source), and domains.
summary: This paper introduces DataGen, a comprehensive framework for generating high-quality (diverse, accurate, and controllable) datasets using large language models (LLMs). DataGen accepts diverse dataset and constraints as input, a comprehensive set of generation hints to reduce computational cost, augment diversity with hyperparameter setting / attribute guided generation, and increase evaluation quality using various reasoning techniques (self-refine) / strong code-based verifier / RAG. Evaluation shows DataGen is able to generalize to diverse set of domains and tasks, models.
weaknesses: **Data formatting.** In section 3.5 (error analysis), the paper mention sometimes the dataset strggles to follow instruction / format the data correctly. Using constrained decoding and similar techniques, this is a very much solved problem, but produce result that the LLM itself may not follow (hence potentially dropping quality of response). I recommend checking out related works in this field (e.g. Guidance[1], AICI[2], LMQL[3], etc.) to improve the data formatting issue. Further more, LLM engiens such as vLLM[4], SGLang[5] and other proprietary engines (Anthropic, Gemini) have provide structured output generation to support constrained decoding at the time of data generation.  

[1] https://github.com/guidance-ai/guidance
[2] https://github.com/microsoft/aici
[3] https://lmql.ai/
[4] https://vllm.ai/
[5] https://github.com/sgl-project/sglang


**Section 3.3 Effectiveness of Modules in DataGen**. 
- Can you explain more on remote-clique score? Why is it a good metric, how exactly is it calculated on the generated dataset (using embeddings, or other representation of the dataset)?
- The delta of remote-clique score of HellaSwag is significantly higher than other datasets. Why is that?

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: My questions are included in the weakness section.
soundness: 3
strengths: 1.  DataGen introduces novel elements like attribute-guided generation and the RAG-based validation, which distinguish it from existing synthetic dataset generation frameworks.
2. The modular design allows for customization and adaptability across diverse datasets.
3. The experiments with improved reasoning and agent-oriented tasks performance shows potential in this data generation framework.
summary: The paper introduces DateGen that uses LLM to generate synthetic dataset. DateGen overcomes limitations in generalization, controllability, diversity, and truthfulness, DATAGEN supports a variety of dataset formats and includes mechanisms like attribute-guided generation and group-checking to enhance diversity. It also employs mathematical code-based assessment and Retrieval-Augmented Generation (RAG) for accuracy and truthfulness. Experimentation confirms superior data quality, with applications in benchmarking LLMs and data augmentation, leading to improved model performance in domains like reasoning and agent capabilities
weaknesses: 1. RAG-based validation is very high in cost (raising cost from 0.038 to 0.19, almost 5x increase). However, it is unclear how it affects the final data generation quality (like the results in Table 7). In other words, it would be nicer to ablate the modules in terms of metrics in Table 7, instead of the current reports in Table 4.
2. I am not convinced that the performance decline on GSM8K in your experiments can be concluded to that many LLMs may be overstated and overfit on the GSM8K dataset, would you please elaborate more on this?
3. Have you tried any experiments with open-sourced LLMs such as LLaMA 405B being the generating LLM? Would it be as beneficial as the GPT-4 or Claude?

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 2
questions: please refer to weaknesses.
soundness: 3
strengths: - By integrating different modules, DataGen ensures the quality of generated datasets, considering the diversity, truthfulness, controllability, and so on.
- To assess the quality of generated datasets, the authors design curated experiments and evaluate key factors including length distribution, semantics, diversity, and knowledge richness.
- Experiments on DataGen's effectiveness for data augmentation demonstrate significant benefits across various tasks, particularly in instruction-following scenarios.
summary: This paper proposes a new framework to synthesize high-quality datasets across various types. To ensure dataset quality, the framework integrates an attribute-guided generation module and a group-checking feature to enhance diversity and controllability. It also includes a code-based mathematical assessment and a retrieval-augmented generation module to improve truthfulness and factuality. Experimental results demonstrate the superior quality of the generated datasets in terms of semantics, diversity, and length distribution. By applying the framework to two scenarios, benchmarking LLMs and data augmentation, it validates the effectiveness of this framework.
weaknesses: - In Table 1, the authors list a series of current dataset generation frameworks, highlighting that DataGen considers a broader range of factors. However, for downstream applications, especially data augmentation section, none of these methods are compared, which limits the demonstration of their effectiveness.
- As shown in Figure 4(a), while the length distribution of the generated data tends toward a normal distribution, longer-length samples are missing for HellaSwag and MMLU. In Figure 5, although the generated examples align with the original datasets, it is evident that the generated dataset represents only a partial subset of the originals.
- Table 7 shows that, without difficulty enhancements, LLMs perform better on generated benchmarks compared to the originals, which reduces DataGen's effectiveness and practical value.
- The proposed framework is complex, and in the ablation study presented in Table 4, the analysis may be too simplified to fully validate the effectiveness of each module.

Meta-review: [Summary]  
The paper introduces DATAGEN, a unified framework leveraging large language models (LLMs) to generate diverse, accurate, and controllable textual datasets. The framework incorporates innovative modules such as attribute-guided generation, code-based label verification, and retrieval-augmented generation to address challenges in generalization, diversity, truthfulness, and user-defined constraints.

[Strengths]
  - Compared to related work, DATAGEN demonstrates the ability to cover a wide range of features in real-world scenarios.
  - The framework is well-motivated, with a simple yet generalizable design that can be applied across various domains and setups.

[Weaknesses]
  - The ablation study and module analysis are somewhat simplified, limiting the validation of each module's effectiveness.
  - The paper contains some ambiguities, particularly in areas such as data formatting, diversity metrics, length distribution of generated data, and difficulty enhancements.

[Decision]  
This paper is well-motivated and presents a comprehensive framework that effectively addresses the challenges of dataset generation using LLMs. Based on the reviewers’ recommendations (6: WuNv, 6: 1kEc, 6: S9ep, 6: eQ9J), I recommend accepting this paper.

Decision: Accept (Poster)