The Multimodal Reinforcement Learning from Human Feedback (RLHF) annotation template provides features for multimodal annotation. This template builds on conversation rewriting and can connect to an input bot for automated Q&A. In manual Q&A mode, you can input multimodal content, such as text and images.
Background information
Documents recently published by OpenAI show that ChatGPT outperforms natural language processing (NLP) models, such as Bidirectional Encoder Representations from Transformers (BERT), in conversational scenarios. Its core optimization mechanism is Reinforcement Learning from Human Feedback (RLHF). This topic analyzes the application of RLHF in ChatGPT and the importance of annotation from the perspective of the training process and goals.
The RLHF training mechanism includes three main stages:
Fine-tuning to generate a Supervised Fine-Tuning (SFT) model
Fine-tuning is based on GPT-3.5. High-quality prompts and their answers are critical. This data is provided by multi-model predictions or by humans, a process that requires highly skilled annotators.
Building a reward model
ChatGPT currently uses a ranking method to evaluate and filter the output of the SFT model. It uses a supervised learning optimization technique based on ordered data or rankings. The manual annotation required at this stage is ranking annotation, which requires precise and large-scale ranked data.
Reinforcement learning optimization
This stage uses proximal policy optimization (PPO) to adjust the model's behavior based on the output of the reward model. This part requires almost no manual annotation.
These three stages form the complete training loop for ChatGPT and are continuously iterated and optimized. Although the demand for manual annotation is less than in pre-training, the quality and quantity of the annotation significantly impact the final model's performance.
Data format examples
In CSV and XLSX formats, each column corresponds to a dataset field. In the Manifest format, the sub-fields of the data field also correspond to dataset fields. You can customize the Field Name. When you configure the dataset, select the corresponding name for each field. Common image file formats such as JPG and PNG are supported.
In manual input mode, the second column, which contains the first-round question data, is not required. Only the topic data is needed.
CSV and XLSX formats
topic |
first-question |
Fruit01 |
Are apples delicious? |
Fruit02 |
Are oranges delicious? |
Demo:
Manifest format (JSONL format)
{"data":{"topic":"Fruit01","first-question":"Are apples delicious?"}}
{"data":{"topic":"Fruit02","first-question":"Are oranges delicious?"}}
Demo:
Configuration description
Subject area (Required)
The Subject area is where you configure the topic field.
Click Current Topic and select a dataset. Then, configure the parameters in the Configuration area on the right. The parameters are described as follows:
Parameter |
Description |
Title |
Do not modify the default title area. |
Dataset Field |
Select the field to display for the subject in the dataset field. The field name can be customized. |
Prompt |
Do not modify the default prompt area. |
Click the link |
No configuration is required. This parameter does not take effect. |
Text Highlight |
No configuration is required. This parameter does not take effect. |
Card Style Configuration |
No configuration is required. This parameter does not take effect. |
Question area (The first-round question is required in automated Q&A mode)
In automated Q&A mode, you can use the Question area to configure the first-round question and the subject. This configuration is not applicable in manual input mode.
The automated Q&A bot includes a first-round question component that requires configuration. The manual Q&A mode does not include this component. After you configure the first-round question, you must also configure the user-defined function (UDF) information for the question bot.
Click First-round Question and configure the parameters in the Configuration area on the right. The parameters are described as follows:
Parameter |
Description |
Title |
Do not modify the default title area. |
Dataset Field |
Configure the dataset field that corresponds to the first-round question. The field name can be customized. |
Prompt |
Do not modify the default prompt area. |
Go to Link |
No configuration is required. This parameter does not take effect. |
Text Highlight |
No configuration is required. This parameter does not take effect. |
Card Style Configuration |
No configuration is required. This parameter does not take effect. |
Answer area (Optional)
The Answer Area is where you configure the chatbot's text responses to questions.
Select the answer area. Then, configure the parameters in the Configuration area on the right. The parameters are described as follows:
Parameter |
Description |
Title |
Enter the question title. |
Options
Note
This parameter is required if the answer type is Single-select, Multi-select, or Tree-select. |
|
Placeholder Text
Note
This parameter is required if the answer type is Single-line Input Box or Input Box-Markdown Preview. |
Enter the placeholder text for a fill-in-the-blank question. This text guides users on what to enter. |
Prompt |
Enter the tooltip text that appears when a user hovers over the question title. |
Required |
Specify whether the question is required. If it is required, a validation check is performed when the question is answered. |
Supported Search Options
Note
This parameter is required for Single-select or Multi-select answer types. |
After the configuration is complete, you can search for options. |
Effective Stage |
Select the stage at which the question takes effect. If you do not select a stage, the question is effective throughout process by default. |
Global questions (Optional)
You can use Global questions to ask about the entire subject as needed.
Select a question to configure its parameters in the Configuration area on the right. The parameters are described as follows:
Parameter |
Description |
Title |
Enter the question title. |
Placeholder Text
Note
This parameter is required if the answer type is Input Box-Markdown Preview or Single-line Input Box. |
Enter the placeholder text for a fill-in-the-blank question. This text guides users on what to enter. |
Options
Note
This parameter is required for the following answer types: Single-select, Multi-select, Tree-select, or Multi-select Tree. |
|
Prompt |
Enter the tooltip text that appears when a user hovers over the question title. |
Required |
Specify whether the question is required. If it is required, a validation check is performed when the question is answered. |
Supported Search Options
Note
This parameter is required if the answer type is Single-select or Multi-select. |
After the configuration is complete, you can search for options. |
Effective Period |
Select the stage at which the question takes effect. If you do not select a stage, the question is effective throughout process by default. |
Global configuration
Configure the user-defined functions (UDFs) for the template in Global configuration.
Click
to configure the Q&A bots in the panel on the right. You can configure up to three answer bots. After you select a bot's UDF, add the configuration parameters.
In automated Q&A mode, after you configure the initial question, you must configure the User-Defined Function (UDF) for the question bot. The UDF for the question bot uses pai-qw-generate-question-based-on-context. The other parameters are the same as those for the answer bot. The input_data and MarkResult parameters ensure that the UDF correctly accepts the input parameters and must not be modified. The return_nums parameter specifies the number of items to return. You can modify this parameter, but its value cannot exceed 5.
Demo
Multimodal RLHF annotation - Automated Q&A
Click to start the Q&A session. The bot automatically begins the session.
You can rewrite the initial question and the bot's answer, and then answer the configured questions.
Multimodal RLHF annotation - Input-based Q&A
In the dialog box, you can enter text or upload images, videos, or audio files.
You can rewrite the bot's answer and answer the questions. You can also click a sent message in the history to modify it and have the bot generate a new answer.