Synthesizing Text Datasets
Data synthesis: Using either a preset or custom data instruction, process the original data, and generate new data based on a specified number of epochs.
Currently, the data synthesis function supports the synthesis of single-turn Q&A, single-turn Q&A (persona) Q&A ranking, DPO, and DPO (persona) data.
Creating a Text Data Synthesis Task
Before synthesizing a text dataset, import data. For details, see Importing Data to the Pangu Platform.
To create a text dataset synthesis task, perform the following steps:
- Log in to ModelArts Studio Large Model Deveopment Platform. In the My Spaces area, click the required workspace.
Figure 1 My Spaces
- In the navigation pane, choose Data Engineering > Data Processing > Synthesis Task. On the displayed page, click Create data synthesis task in the upper right corner.
- On the Create data synthesis task page, select the dataset to be synthesized, and select the content to be synthesized and the expected number of synthetic data records, as shown in Figure 2. The expected number of synthetic data records is the initial number of data records in the dataset.
If the source dataset type is the same as the target dataset type, you can enable Integrate the source data set into the synthesized data. After the synthesis task is complete, the generated data is merged with the original dataset. Click Next.
- On the Synthesis Orchestration page, orchestrate the synthesis steps.
- In the Add Instruction pane, you can select a preset or custom instruction, or copy an instruction.
- Preset instructions: The platform provides multiple preset instructions for you to execute synthesis tasks. For details, see Introduction to Preset Data Instructions.
- Custom instructions: The platform supports orchestration of custom instructions. For details about how to create a custom instruction, see Creating a Custom Data Synthesis Instruction.
- After selecting a command, click OK and set command parameters.
Figure 3 shows an example of configuring synthesis instruction parameters for a pre-trained text dataset. The synthesis task uses the pre-trained text to generate Q&A pairs.
- After the instruction orchestration is complete, click Enable commissioning in the upper right corner to preview the instruction effect.
- In the Add Instruction pane, you can select a preset or custom instruction, or copy an instruction.
- After the instruction commissioning is complete, click Next in the lower right corner. The Task Configuration page is displayed.
- Select Automatically Generate Processing Dataset if required.
Select this option and configure the information for generating a processed dataset, as shown in Figure 4. Click Create and Start in the lower right corner. The platform starts the data synthesis task. After the synthesis task is successfully executed, a processed dataset is automatically generated.
- Enter the dataset name, description, and extended information (optional, including the industry, language, and custom information).
- Select Automatically Generate Processing Dataset if required.
- After the data synthesis task is successfully executed, the status changes from Running to Success, indicating that the data has been synthesized.

After data synthesis is complete, if you do not need to use the data labeling and data combination functions, click Generate in the Operation column on the Synthesis Task page to generate a processed dataset.
To view the processed dataset, choose Data Engineering > Data Management > Datasets, and click the Processed Dataset tab.
Introduction to Preset Data Instructions
The data synthesis function of ModelArts Studio provides you with preset instructions. You can choose Data Engineering > Data Processing > Data Synthesis. On the Synthesis Task page, click Manage Synthesis Instructions. On the System Preset tab page, view instruction details, as shown in Figure 5. Click Commissioning to view the commissioning guide, as shown in Figure 6.
For details about the list of preset instructions, see Table 1.
Category |
Instruction Name |
Description |
---|---|---|
Generate Questions |
Rewrite the question to a less difficult one. |
This instruction can be used to enable the model to generate a simpler and less difficult question based on the question entered by the user. |
Rewriting the question to a more difficult one |
This instruction can be used to enable the model to generate a more complex and more difficult question based on the question entered by the user. |
|
Generating answering requirements based on the questions |
The instruction generalizes answer requirements of a corresponding question based on an input question, and the requirements are not directly related to content of the original question. The instruction may be orchestrated with an instruction for answering a question according to answering requirements, to implement synthesis of various styles of answers. |
|
Generating similar questions based on samples_few-shot |
The instruction generates, by using a plurality of question examples entered by the user, one or more new questions that match the sample style. |
|
Generating questions based on text |
This instruction generates a question based on the context entered by the user. It can be used to synthetize and orchestrate text generation Q&A pairs. |
|
Question rewriting |
This instruction is used to rewrite a question to generate more complex questions, which can be used for instruction generalization. |
|
Generate Answers |
Answer rewriting |
This instruction is used to modify the answer style based on the user-specified settings without changing the answer content. It can be used to generate and orchestrate instructions with persona settings to implement generalization of Q&A pairs. |
Generating answers based on text_complying with requirements |
This instruction is used to generate answers based on the input context and the instructions and questions specified by users. It can be used to generate and orchestrate instructions to implement generalization of factual Q&A pairs. |
|
Generating an answer to a question |
This instruction is used to generate answers based on questions. |
|
Generating an answer based on the text_with a designated persona |
This instruction is used to generate answers based on the input context and user-specified persona settings and questions. It can be used to generate and orchestrate instructions with persona settings to implement generalization of factual Q&A pairs. |
|
Generating questions and answers based on questions_with a designated persona |
This instruction is used to generate questions and answers based on the user-specified persona settings and questions. It can be used to generate and orchestrate instructions with persona settings to implement generalization of Q&A pairs. |
|
Generating answers based on text |
This instruction is used to generate answers based on the context and questions entered by users. It can be used for synthesis of factual answers. |
|
Generating Q&A pairs |
Generating Q&A pairs based on text_true or false |
This instruction is used to construct a true or false question from the text provided by the user, and provide a correct answer. |
Generating Q&A pairs based on text_fill-in-blank |
This instruction is used to construct a fill-in-blank question from the text provided by the user, and provide a correct answer. |
|
Generating Q&A pairs based on text_single-answer question |
This instruction is used to construct a single-answer question with four options from the text provided by the user, and provide a correct answer. |
|
Generating Q&A pairs based on text_multiple-answer question |
This instruction is used to construct a multiple-answer question with four options from the text provided by the user, and provide a correct answer. |
|
Generating Q&A pairs based on text_Q&A question |
This instruction is used to construct a question from the text provided by the user, and provide a correct answer. |
|
Extracting Q&A pairs based on text_financial scenario |
This instruction is used to extract Q&A pairs based on financial documents entered by users. |
|
Generating a persona setting |
Generating a persona setting based on a question |
This instruction is used to generate a persona setting based on the question entered by the user. |
Other |
Generalizing bad cases |
This instruction is used to generate attack questions that may let the model make mistakes in similar scenarios based on the bad case questions and answers provided by users. Users can specify the number of attack questions to be generated. A maximum of 10 attack questions can be generated. |
Deriving the problem solving idea based on the answer |
This instruction is used to generate the corresponding problem solving ideas based on the questions and answers entered by the user. |
|
Instruction generalization |
This instruction is used to generalize instructions based on the style specified by the user. It can be used to generate and orchestrate related instructions that match Q&A pairs of the specified requirements to implement Q&A pair generalization. |
Creating a Custom Data Synthesis Instruction
The platform allows you to create custom data synthesis instructions.
This section uses the scenario of generating a topic prose passage as an example to describe how to configure a custom data synthesis instruction.
- Log in to ModelArts Studio Large Model Deveopment Platform. In the My Spaces area, click the required workspace.
Figure 7 My Spaces
- In the navigation pane, choose Data Engineering > Data Processing > Data Synthesis. On the displayed page, click Manage Synthetic Instructions. On the Custom tab page, click Create Instruction.
- In the Create Instruction dialog box, enter the name and description, and click OK. The page for configuring a synthetic instruction is displayed.
- Select the variable identifier "{{}}" and enter the instruction "Use {{topic}} as the subject and write a prose passage with no more than {{num}} characters."
Click Identify and then click Yes.
Figure 8 Instruction configuration - Set variables based on Table 2.
Table 2 Data instruction variable configuration Variable Type
Variable Name
Data Type
Variable Description
Input variables
topic
string
Topic
num
string
Word count
Output variables
output
string
Prose
The variable description field of an output variable is the content that can be understood by the large model and needs to be filled in carefully.
Figure 9 Configuring variables - Commission data instructions.
- In the Commissioning > Model area, select the model required by the instruction and click Configure Hyperparameters to customize hyperparameter values.
- In the Commissioning > Input area, you can view the effect by assigning values to variables.
Figure 10 Instruction commissioning
- After the commissioning is complete, click Create Now to create the data instruction.
The created data instruction is displayed on the Manage Synthetic Instructions > Custom page.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot