模型概述
模型特點
模型能力
使用案例
🚀 天工評判系列模型介紹
由 天工智能(SkyworkAI) 對齊團隊開發的 天工評判 - Llama3.1 - 70B 和 天工評判 - Llama3.1 - 8B 是先進的評判模型,擅長進行成對偏好評估。這些模型能夠對輸入的一對內容進行比較和評估,對它們的相對質量或適用性給出細緻的判斷。憑藉對語言和上下文的深入理解,天工評判系列模型為包括數據改進、評估和獎勵建模等各種應用提供了有價值的見解。
✨ 主要特性
- 成對偏好評估:能夠精準比較和評估輸入對,給出細緻的相對質量或適用性判斷。
- 多源數據訓練:使用多種高質量數據集進行微調,包括清理後的開源數據、內部人工標註數據、合成評判數據和評判相關聊天數據。
- 廣泛應用價值:為數據改進、評估和獎勵建模等多種應用提供有價值的見解。
📦 訓練詳情
天工評判 - Llama3.1 - 70B 和天工評判 - Llama3.1 - 8B 分別基於 Meta 的 Llama - 3.1 - 70B - Instruct 和 Llama - 3.1 - 8B - Instruct 構建。這些模型使用了多種高質量數據集進行微調,具體如下:
- 清理後的開源數據:我們使用了 HelpSteer2、OffsetBias、WildGuard (對抗性) 和 Magpie DPO 系列(Ultra、Pro (Llama - 3.1)、Pro、Air)的高質量子集。更多詳情,請參考我們的 天工獎勵偏好 - 80K - v0.1 數據集。此外,我們還將一些開源的高質量評判數據集,如 Open - Critic - GPT 整合到訓練過程中。
- 內部人工標註數據:這包括對單個回覆在多個維度上的逐點評分,以及兩個回覆之間的成對比較。每個維度都包含了評分的理由。需要注意的是,手動標註的數據獲取成本非常高。我們只有幾百個手動標註的數據點,且全部為中文,因此進行單評分的能力可能不是特別強。
- 合成評判數據:我們採用了與 自學 類似的方法。具體來說,我們使用了兩種方法為給定的指令生成較差的回覆:1) 創建一個類似的指令,然後為這個新指令生成回覆。2) 在高質量回復中引入細微錯誤。
- 評判相關聊天數據:我們整合了評判相關的聊天數據,以保持模型的對話能力。
訓練採用指令微調方法,專注於成對偏好評估和一般聊天任務。我們進行了全面的驗證過程,以確保我們的訓練數據集不包含 RewardBench 測試集的任何信息,從而保證評估結果的完整性。
📚 生成模型的 RewardBench 排行榜
我們使用 官方測試腳本 在 RewardBench 上對我們的模型進行了評估。
截至 2024 年 9 月,天工評判 - Llama3.1 - 70B 在 RewardBench 上的所有規模生成模型中 排名第一,而天工評判 - Llama3.1 - 8B 在參數少於 10B 的生成模型中排名第一。(注:星號 (*) 表示開源模型。)
模型 | 對話 | 困難對話 | 安全性 | 推理能力 | 綜合得分 |
---|---|---|---|---|---|
天工評判 - Llama3.1 - 70B * | 96.6 | 87.9 | 93.1 | 95.5 | 93.3 |
Salesforce/SFR - LLaMa - 3.1 - 70B - Judge - r | 96.9 | 84.8 | 91.6 | 97.6 | 92.7 |
Salesforce/SFR - nemo - 12B - Judge - r | 97.2 | 82.2 | 86.5 | 95.1 | 90.3 |
天工評判 - Llama3.1 - 8B * | 93.6 | 81.4 | 91.1 | 89.8 | 89.0 |
Salesforce/SFR - LLaMa - 3.1 - 8B - Judge - r | 95.5 | 77.7 | 86.2 | 95.1 | 88.7 |
facebook/Self - taught - Llama - 3 - 70B | 96.9 | 84.0 | 91.1 | 82.5 | 88.6 |
google/gemini - 1.5 - pro - 0514 | 92.3 | 80.6 | 87.9 | 92.0 | 88.2 |
openai/gpt - 4o - 2024 - 08 - 06 | 96.1 | 76.1 | 88.1 | 86.6 | 86.7 |
openai/gpt - 4 - 0125 - preview | 95.3 | 74.3 | 87.6 | 86.9 | 86.0 |
openai/gpt - 4 - turbo - 2024 - 04 - 09 | 95.3 | 75.4 | 87.6 | 82.7 | 85.2 |
Anthropic/claude - 3 - 5 - sonnet - 20240620 | 96.4 | 74.0 | 81.6 | 84.7 | 84.2 |
meta - llama/Meta - Llama - 3.1 - 70B - Instruct * | 97.2 | 70.2 | 82.8 | 86.0 | 84.0 |
NCSOFT/Llama - 3 - OffsetBias - 8B * | 92.5 | 80.3 | 86.8 | 76.4 | 84.0 |
💻 使用示例
基礎用法
以下是一個獲取兩個對話評判結果的示例代碼:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# An Example Case
prompt = "Jane has 12 apples. She gives 4 apples to her friend Mark, then buys 1 more apple, and finally splits all her apples equally among herself and her 2 siblings. How many apples does each person get?"
responseA = "1. Jane starts with 12 apples and gives 4 to Mark. 12 - 4 = 8. Jane now has 8 apples.\n2. Jane buys 1 more apple. 8 + 1 = 9. Jane now has 9 apples.\n3. Jane splits the 9 apples equally among herself and her 2 siblings (3 people in total). 9 ÷ 3 = 3 apples each. Each person gets 3 apples."
responseB = "1. Jane starts with 12 apples and gives 4 to Mark. 12 - 4 = 8. Jane now has 8 apples.\n2. Jane buys 1 more apple. 8 + 1 = 9. Jane now has 9 apples.\n3. Jane splits the 9 apples equally among her 2 siblings (2 people in total). 9 ÷ 2 = 4.5 apples each. Each person gets 4 apples."
# feed a natural language prompt to generative model
prompt_template = """Please act as an impartial judge and evaluate the quality of the responses provided by two AI assistants to the user question displayed below. You should choose the assistant that follows the user\'s instructions and answers the user\'s question better.
Your evaluation should consider factors such as the helpfulness, relevance, accuracy, depth, creativity, and level of detail of their responses. Avoid any position biases and ensure that the order in which the responses were presented does not influence your decision. Do not allow the length of the responses to influence your evaluation. Do not favor certain names of the assistants. Be as objective as possible.
Please directly output your final verdict by strictly following this format: "[[A]]" if assistant A is better, "[[B]]" if assistant B is better.
[User Question]
{input}
[The Start of Assistant A's Answer]
{response_a}
[The End of Assistant A's Answer]
[The Start of Assistant B's Answer]
{response_b}
[The End of Assistant B's Answer]
"""
user_message = prompt_template.format(input=prompt, response_a=responseA, response_b=responseB)
conversation = [{"role": "user", "content": user_message}]
model_name = "Skywork/Skywork-Critic-Llama3.1-70B"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
input_ids = tokenizer.apply_chat_template(
conversation,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt").to(model.device)
generation = model.generate(
input_ids=input_ids,
max_new_tokens=2048,
do_sample=False,
pad_token_id=128009,
temperature=0)
completion = tokenizer.decode(
generation[0][len(input_ids[0]):],
skip_special_tokens=True,
clean_up_tokenization_spaces=True)
print(completion)
# Output:
# The generative model should output "[[A]]"
📄 聲明與許可協議
聲明
我們在此聲明,天工模型不得用於任何對國家或社會安全構成威脅的活動,或從事非法行為。此外,我們要求用戶在未進行適當的安全審查和記錄的情況下,不要將天工模型部署到互聯網服務中。我們希望所有用戶都能遵守這一原則,以確保技術進步在規範和合法的環境中進行。
我們已盡最大努力確保模型訓練過程中使用的數據合規。然而,由於模型和數據的複雜性,儘管我們付出了巨大努力,仍可能存在不可預測的風險和問題。因此,如果因使用天工開源模型而出現任何問題,包括但不限於數據安全問題、輿論風險,或因模型被誤導、濫用、傳播或不當使用而產生的任何風險和問題,我們將不承擔任何責任。
許可協議
天工模型的社區使用需要遵循 天工社區許可協議。天工模型支持商業使用。如果您計劃將天工模型或其衍生產品用於商業目的,必須遵守 天工社區許可協議 中的條款和條件。
📞 聯繫我們
如果您有任何問題或反饋,請隨時通過 shiwen.tu@kunlun-inc.com 或 liang.zhao@kunlun-inc.com 聯繫我們友好的團隊。該項目由趙亮領導。
📝 引用
如果您覺得我們的工作有幫助,請使用以下 BibTeX 條目引用我們:
@misc{skyworkcritic2024,
title={Skywork Critic Model Series},
author={Shiwen, Tu and Liang, Zhao and Liu, Chris Yuhao and Zeng, Liang and Liu, Yang},
year={2024},
month={September},
howpublished={\url{https://huggingface.co/Skywork}},
url={https://huggingface.co/Skywork},
}



