Alpaca 数据格式最早由 Stanford Alpaca 项目提出,目的是用来微调大语言模型(LLM),特别是用于 Instruction Tuning(指令微调)。它基于 Self-Instruct 方法,即使用更强大的模型(如 OpenAI 的 GPT-3)来自动生成高质量的指令数据,从而让小型模型也能理解和执行指令任务。
Alpaca 数据集的格式通常是 JSON,包含以下几个字段:
{
"instruction": "Describe the benefits of exercise.",
"input": "",
"output": "Regular exercise improves cardiovascular health, strengthens muscles, boosts mental health, and helps with weight management."
}
或者带有输入数据的情况:
{
"instruction": "Summarize the following paragraph.",
"input": "Artificial intelligence is transforming various industries, including healthcare, finance, and education...",
"output": "AI is revolutionizing multiple industries like healthcare, finance, and education."
}
ShareGPT 主要用于 对话数据微调,它是 OpenAI ChatGPT 用户分享的对话数据集合,适用于训练对话式大模型,如 Vicuna、LLaMA-2-Chat 等。
ShareGPT 数据通常以 JSON 格式存储,结构如下:
{
"conversations": [
{"from": "human", "value": "What is the capital of France?"},
{"from": "gpt", "value": "The capital of France is Paris."},
{"from": "human", "value": "Can you tell me more about Paris?"},
{"from": "gpt", "value": "Paris, known as the 'City of Light', is famous for its rich history, art, fashion, and gastronomy."}
]
}
数据格式 | 适用场景 | 数据结构 | 特点 |
---|---|---|---|
Alpaca | 指令微调(Instruction Tuning) | 独立的指令-输入-输出 | 适用于任务型对话,结构清晰 |
ShareGPT | 对话微调(Chat Fine-tuning) | 多轮对话(human & gpt) | 适用于对话模型,可用于 RLHF |