延續上篇所介紹的 Nemotron-4 340B Technical Report 細說合成資料集的流程,可以依據需要使用其中的步驟(流程),建置自己的合成資料生產線
合成資料生成
合成提示生成
- 使用 Mixtral-8x7B-Instruct-v0.1 生成合成提示。
- 任務多樣性(寫作、開放式問答、封閉式問答)
- 主題多樣性(例如詞幹、人文、日常生活)
- 指令多樣性(例如json輸出、特定格式)
- 98% 的資料通過生成合成資料來獲得。
生成流程說明
開放式問答提示
- 收集 3K 個主題。
- 提示產生器產生與對應主題相關的問題來產生開放式問答提示(例如 : 「什麼是機器學習?」)。
- 對於與寫作相關的提示要求將問題細化為更詳細和具體(例如 : 「寫一篇關於機器學習的論文。」)。
- 有關給定主題的某些類型文件的說明。
封閉式問答提示
- 使用 C4 資料集中的文字。
- 對於給定的文本,限制範圍(例如 : 「總結給定的文本」 或 「根據給定的文本,xxx 是什麼?」)。
- 使用手動定義的範本(例如 : 從數學和 Python 程式設計中收集關鍵字)。

合成對話生成
- 每個對話包含三個回合(例如 : 「寫一篇關於機器學習的文章。您的答案應該包含三個段落)
- 通過角色扮演和對話歷史設置模擬用戶互動情境(例如 : 「用戶:XXX;助理:XXX;用戶:XXX;」)。
- 對話生成過程複雜度較高需要大量計算資源。
偏好資料生成
- 使用10K 人工註釋的 HelpSteer2 偏好數據來訓練 Nemotron-4-340B-Reward。
- 每個提示輸出的多個回應,判斷偏好排名並加上標註(例如 : 已選擇 / 拒絕回應)
- 增加偏好數據的多樣性和覆蓋範圍。
- 利用 Nemotron-4-340B-Reward 來評估對話的質量(幫助性、正確性、一致性、複雜性和冗長性)。
迭代優化
第一次迭代 (使用 Mixtral-8x7B-Instruct-v0.1)
- 使用 Mixtral-8x7B-Instruct-v0.1 作為資料生成模型。
- 產生的資料用於訓練 Nemotron-4-340B-Base(產生 340B-Interm-1-Instruct)
- 340B-Interm-1-Instruct 超越 Mixtral-8x7B-Instruct-v0.1 。證明可以透過弱監督來激發出強能力。
第二次迭代 (使用 340B-Interm-1-Instruct)
- 使用 Mixtral-8x7B-Instruct-v0.1 資料訓練的 340B-Interm-1-Instruct 作為資料生成模型。
- 產生的資料資料用於將 340B-Interm-2-Base 訓練為 340B-Interm-2-Chat
迭代說明
- 當使用相同資料集時,基礎模型越強,產生的指導模型就越強。
- 當使用相同的基礎模型時,更高品質的資料導致更強的指導模型。
- 進行多輪資料產生和精煉,不斷提高模型的品質。

效果評估
自動評估(依據數據集)
- HumanEval: 模型在程式語言生成上的能力
- MBPP: 包括多種數據模態(如文本、圖像、聲音等)
- IFEval: 評估模型在理解和執行各種指令上的準確性和一致性。
- TFEval: 評估模型在對話中保持主題一致性和應對偏離主題干擾的能力。

粗體表示所有模型中得分最高,底線表示開源模型中得分最高
人為評估(專門註釋團隊)
- 任務分級
根據10 個不同的任務類別進行6個級別評估,包括5個品質的級別加上1個定義模型完全未能回答的級別。

比較 Nemotron-4-340B-Instruct 與 GPT-4-1106-preview 在十個任務中人為判定
人類對生成長度的感知

下劃線表示感知適當長度率較高的模型
安全評估

AEGIS 安全評估中不安全回應佔比,越低越好
使用LLM生成合成數據
參考 Nemotron-4 340B Technical Report 此篇附錄
Prompts Used for Synthetic Prompt Generation
1. Topics Generation
Prompt: Generate Macro Topics
Can you generate {n_macro_topics} comprehensive topics that encompass various
aspects of our daily life, the world, and science? Your answer should be a list
of topics. Make the topics as diverse as possible.For example, 1. Food and drinks.
\n2. Technology.\n
Prompt: Generate Subtopics based on Macro Topics
Can you generate {n_subtopics} comprehensive topics that encompass various aspects
of {text1}? Your answer should be a list of topics. Make the topics as diverse as
possible.
Prompt: Generate Math Macro Topics
Can you generate {n_macro_topics} comprehensive topics that encompass the mathematics
knowledge taughted in {school_level}? Your answer should be a list of topics. Make
the topics as diverse as possible.
Prompt: Generate Math Subtopics based on Macro Topics
List {n_subtopics} mathemathics topics that encompass various aspects of "{text1}".
Your answer should be a list of topics. Make the topics as diverse as possible.
Prompt: Classify if an entity is related to Math
Does the concept "{text1}" belong to one of the following categories?
- Math concepts taught at elementary school, middle school, high school, and univiersity.
- Important mathematics axioms, theorems, algorithms, equations, or inequalities.
- Representative math problems, functions, and applications.
Your answer should start with "Yes" or "No".
Prompt: Generate Python Macro Topics
List {n_macro_topics} important concepts in the python language.
Prompt: Generate Python Subtopics based on Macro Topics
List {n_subtopics} important concepts related to "{text1}" in the python language.
Prompt: Classify if an entity is related to Python Programming
Does the concept "{text1}" belong to one of the following categories?
- Programming concepts like loops, functions, and data structures in python.
- Important functions, objects, or libraries in python.
- Mathematical concepts like linear algebra which can be implemented in python.
- Basic algorithms or problems in computer science likes Greedy Search and Dynamics
programming which can be addressed in python.
Your answer should start with "Yes" or "No".
2. Open Q&A
Prompt: Generate Open Q&A questions based on Topics
Can you generate {n_openlines} questions or requests related to {text1}? The questions
and requests should be as diverse possible. Your answer should be a list.
Prompt: Revise Open Q&A questions
Question: {text1}
Can you revise the question above to include more contexts or details? The revised
questions can be any of the follows:
1. Adding some context to the original question. The context might state the
importance of the question, explain background knowledge, or add other reasonable
information.
2. Change the questions into a different format or style, e.g., imperative
statements, length requirements for the answer, etc.
3. Elongated questions that require to elaborate on specific topic or discuss a
certain point.
4. Any other related questions or statements.
The revised question should contain two, three, or four sentences. You should
generate {n_tasks} revised questions or statements in a list. Make them as
diverse as possible.















