dim014/alpaca-cleaned-sample
收藏资源简介:
--- license: cc-by-4.0 language: - en tags: - instruction-finetuning pretty_name: Alpaca-Cleaned task_categories: - text-generation --- # Dataset Card for Alpaca-Cleaned - **Repository:** https://github.com/gururise/AlpacaDataCleaned ## Dataset Description This is a cleaned version of the original Alpaca Dataset released by Stanford. The following issues have been identified in the original release and fixed in this dataset: 1. **Hallucinations:** Many instructions in the original dataset had instructions referencing data on the internet, which just caused GPT3 to hallucinate an answer. ``` "instruction":"Summarize the given article in 200 Words.", "input": "https://www.bbc.com/news/world-51461830", "output": "The recent protests in Belarus are part of a growing wave of discontent against the rule of Alexander Lukashenko, who has led the country since 1994. Demonstrations against his government have been ongoing since August, and come in the wake of an election widely seen as rigged. As police and security forces have cracked down on protesters, the movement has only grown, with hundreds of thousands of people taking to the streets to call for new leadership. Human rights activists have accused the government of using extreme violence in order prosecute protesters, leading to an international outcry and sanctions from the European Union. As the situation in Belarus continues to unfold, the international community is monitoring the situation closely - hoping for a peaceful resolution, while also standing firm against the oppressive tactics employed by the Belarusian state." "instruction": "Classify the following shape according to simple geometry.", "input": "<Picture Attached>", "output": "Triangle" "instruction": "Given a recent news article, write a headline for it.", "input": "https://www.news.example.com/article-1", "output": "\"NASA Launches a Mars 2020 Mission to Search for Signs of Ancient Life\"" ``` 2. **Merged Instructions:** There were many instructions that were merged together in the original dataset for some reason. ``` "instruction": "Should I invest in stocks?", "input": "", "output": "It depends on your individual situation. Investing in stocks carries a certain amount of risk but can also offer potential rewards. Make sure to research the different types of stocks, understand the risks and rewards, and develop a plan that works for you.\n##\n18. Instruction: Identify the noun in the following sentence:\n18. Input:\nThe large apple was delicious.\n18. Output:\nApple" ``` 3. **Empty outputs:** Some entries in the original dataset had empty outputs. ``` "instruction": "Calculate the area of the following shape in square centimeters.", "input": "rectangle of size 4 cm x 5 cm", "output": "" ``` 4. **Empty code examples:** Some descriptions in the original dataset were missing code examples, making it difficult to understand the intended behavior of the code. 5. **Instructions to generate images:** Some descriptions in the original dataset included instructions to generate images, something obviously not possible. ``` "instruction": "Create a graphic or logo that visually represents the word \"courage\".", "input": "", "output": "<No Output>" ``` 6. **N/A outputs:** Some code snippets in the original dataset had N/A outputs. 7. **Inconsistent input field:** The original dataset had inconsistent usage of the input field when it was supposed to be empty. ``` "input":"<no input>" "input":"No input" "input":"noinput" "input":"<noinput>" ``` 8. **Wrong answers:** Some instructions/questions in the original dataset had incorrect answers. About 80% of the math problems are estimated to have incorrect answers. ``` "instruction": "Calculate the median of the following data set.", "input": "1, 2, 4, 5, 8, 9", "output": "5" "instruction": "Convert 25m to km.", "input": "", "output": "25km" ``` 9. **Non-Sensical/Unclear instructions:** Many instructions are unclear, we try to clarify (or re-write) if instructions are non-sensical. Instructions that are slightly unclear, but where one could deduce the meaning are not altered. ``` "instruction": "Freeze the following sample of yogurt for 10 minutes.", "input": "Yogurt sample", "output": "<noinput>" "instruction": "Increase the font size to 12 points.", "input": "", "output": "The font size has been increased to 12 points." ``` 10. **Extraneous escape and control characters:** The original dataset had several entries with extraneous escape and control characters. ### Original Alpaca Dataset Summary Alpaca is a dataset of 52,000 instructions and demonstrations generated by OpenAI's `text-davinci-003` engine. This instruction data can be used to conduct instruction-tuning for language models and make the language model follow instruction better. The authors built on the data generation pipeline from [Self-Instruct framework](https://github.com/yizhongw/self-instruct) and made the following modifications: - The `text-davinci-003` engine to generate the instruction data instead of `davinci`. - A [new prompt](https://github.com/tatsu-lab/stanford_alpaca/blob/main/prompt.txt) was written that explicitly gave the requirement of instruction generation to `text-davinci-003`. - Much more aggressive batch decoding was used, i.e., generating 20 instructions at once, which significantly reduced the cost of data generation. - The data generation pipeline was simplified by discarding the difference between classification and non-classification instructions. - Only a single instance was generated for each instruction, instead of 2 to 3 instances as in Self-Instruct. This produced an instruction-following dataset with 52K examples obtained at a much lower cost (less than $500). In a preliminary study, the authors also found that the 52K generated data to be much more diverse than the data released by [Self-Instruct](https://github.com/yizhongw/self-instruct/blob/main/data/seed_tasks.jsonl). ### Supported Tasks and Leaderboards The Alpaca dataset designed for instruction training pretrained language models. ### Languages The data in Alpaca are in English (BCP-47 en). ## Dataset Structure ### Data Instances An example of "train" looks as follows: ```json { "instruction": "Create a classification task by clustering the given list of items.", "input": "Apples, oranges, bananas, strawberries, pineapples", "output": "Class 1: Apples, Oranges\nClass 2: Bananas, Strawberries\nClass 3: Pineapples", "text": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\nCreate a classification task by clustering the given list of items.\n\n### Input:\nApples, oranges, bananas, strawberries, pineapples\n\n### Response:\nClass 1: Apples, Oranges\nClass 2: Bananas, Strawberries\nClass 3: Pineapples", } ``` ### Data Fields The data fields are as follows: * `instruction`: describes the task the model should perform. Each of the 52K instructions is unique. * `input`: optional context or input for the task. For example, when the instruction is "Summarize the following article", the input is the article. Around 40% of the examples have an input. * `output`: the answer to the instruction as generated by `text-davinci-003`. * `text`: the `instruction`, `input` and `output` formatted with the [prompt template](https://github.com/tatsu-lab/stanford_alpaca#data-release) used by the authors for fine-tuning their models. ### Data Splits | | train | |---------------|------:| | alpaca | 52002 | ## Dataset Creation ### Curation Rationale [More Information Needed] ### Source Data #### Initial Data Collection and Normalization [More Information Needed] #### Who are the source language producers? [More Information Needed] ### Annotations #### Annotation process [More Information Needed] #### Who are the annotators? [More Information Needed] ### Personal and Sensitive Information [More Information Needed] ## Considerations for Using the Data ### Social Impact of Dataset Excerpt the [blog post](https://crfm.stanford.edu/2023/03/13/alpaca.html) accompanying the release of this dataset: > We believe that releasing the above assets will enable the academic community to perform controlled scientific studies on instruction-following language models, resulting in better science and ultimately new techniques to address the existing deficiencies with these models. At the same time, any release carries some risk. First, we recognize that releasing our training recipe reveals the feasibility of certain capabilities. On one hand, this enables more people (including bad actors) to create models that could cause harm (either intentionally or not). On the other hand, this awareness might incentivize swift defensive action, especially from the academic community, now empowered by the means to perform deeper safety research on such models. Overall, we believe that the benefits for the research community outweigh the risks of this particular release. Given that we are releasing the training recipe, we believe that releasing the data, model weights, and training code incur minimal further risk, given the simplicity of the recipe. At the same time, releasing these assets has enormous benefits for reproducible science, so that the academic community can use standard datasets, models, and code to perform controlled comparisons and to explore extensions. Deploying an interactive demo for Alpaca also poses potential risks, such as more widely disseminating harmful content and lowering the barrier for spam, fraud, or disinformation. We have put into place two risk mitigation strategies. First, we have implemented a content filter using OpenAI’s content moderation API, which filters out harmful content as defined by OpenAI’s usage policies. Second, we watermark all the model outputs using the method described in Kirchenbauer et al. 2023, so that others can detect (with some probability) whether an output comes from Alpaca 7B. Finally, we have strict terms and conditions for using the demo; it is restricted to non-commercial uses and to uses that follow LLaMA’s license agreement. We understand that these mitigation measures can be circumvented once we release the model weights or if users train their own instruction-following models. However, by installing these mitigations, we hope to advance the best practices and ultimately develop community norms for the responsible deployment of foundation models. ### Discussion of Biases [More Information Needed] ### Other Known Limitations The `alpaca` data is generated by a language model (`text-davinci-003`) and inevitably contains some errors or biases. We encourage users to use this data with caution and propose new methods to filter or improve the imperfections. ## Additional Information ### Dataset Curators [More Information Needed] ### Licensing Information The dataset is available under the [Creative Commons NonCommercial (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/legalcode). ### Citation Information ``` @misc{alpaca, author = {Rohan Taori and Ishaan Gulrajani and Tianyi Zhang and Yann Dubois and Xuechen Li and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto }, title = {Stanford Alpaca: An Instruction-following LLaMA model}, year = {2023}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/tatsu-lab/stanford_alpaca}}, } ``` ### Contributions [More Information Needed]
--- 许可证:CC BY 4.0 语言: - 英语 标签: - 指令微调(instruction-finetuning) 展示名称:Alpaca-Cleaned 任务类别: - 文本生成(text-generation) --- # Alpaca-Cleaned 数据集卡片 - **仓库地址**: https://github.com/gururise/AlpacaDataCleaned ## 数据集描述 本数据集为斯坦福发布的原始Alpaca数据集的清洗版本,已修复原始数据集中存在的以下问题: 1. **幻觉问题**:原始数据集中大量指令引用了互联网数据,导致GPT-3生成了虚构的回答。 "instruction":"Summarize the given article in 200 Words.", "input": "https://www.bbc.com/news/world-51461830", "output": "The recent protests in Belarus are part of a growing wave of discontent against the rule of Alexander Lukashenko, who has led the country since 1994. Demonstrations against his government have been ongoing since August, and come in the wake of an election widely seen as rigged. As police and security forces have cracked down on protesters, the movement has only grown, with hundreds of thousands of people taking to the streets to call for new leadership. Human rights activists have accused the government of using extreme violence in order prosecute protesters, leading to an international outcry and sanctions from the European Union. As the situation in Belarus continues to unfold, the international community is monitoring the situation closely - hoping for a peaceful resolution, while also standing firm against the oppressive tactics employed by the Belarusian state." "instruction": "Classify the following shape according to simple geometry.", "input": "<Picture Attached>", "output": "Triangle" "instruction": "Given a recent news article, write a headline for it.", "input": "https://www.news.example.com/article-1", "output": ""NASA Launches a Mars 2020 Mission to Search for Signs of Ancient Life"" 2. **合并指令问题**:原始数据集中存在大量因未知原因被合并的指令。 "instruction": "Should I invest in stocks?", "input": "", "output": "It depends on your individual situation. Investing in stocks carries a certain amount of risk but can also offer potential rewards. Make sure to research the different types of stocks, understand the risks and rewards, and develop a plan that works for you. ## 18. Instruction: Identify the noun in the following sentence: 18. Input: The large apple was delicious. 18. Output: Apple" 3. **空输出问题**:原始数据集中部分条目存在空输出。 "instruction": "Calculate the area of the following shape in square centimeters.", "input": "rectangle of size 4 cm x 5 cm", "output": "" 4. **缺失代码示例**:原始数据集中部分描述缺失代码示例,导致难以理解代码的预期行为。 5. **图像生成指令**:原始数据集中部分描述包含无法实现的图像生成指令。 "instruction": "Create a graphic or logo that visually represents the word "courage".", "input": "", "output": "<No Output>" 6. **N/A输出问题**:原始数据集中部分代码片段存在N/A类型的输出。 7. **输入字段不一致**:原始数据集中当输入字段应为空时,其用法存在不一致的情况。 "input":"<no input>" "input":"No input" "input":"noinput" "input":"<noinput>" 8. **答案错误**:原始数据集中部分指令/问题存在错误答案,据估计约80%的数学题答案有误。 "instruction": "Calculate the median of the following data set.", "input": "1, 2, 4, 5, 8, 9", "output": "5" "instruction": "Convert 25m to km.", "input": "", "output": "25km" 9. **无意义/模糊指令**:原始数据集中大量指令模糊不清,本数据集对无意义的指令进行了澄清(或重写),但对于仅略微模糊、可推断含义的指令则未做修改。 "instruction": "Freeze the following sample of yogurt for 10 minutes.", "input": "Yogurt sample", "output": "<noinput>" "instruction": "Increase the font size to 12 points.", "input": "", "output": "The font size has been increased to 12 points." 10. **多余转义与控制字符**:原始数据集中部分条目存在多余的转义与控制字符。 ### 原始Alpaca数据集概述 Alpaca数据集包含52000条由OpenAI的`text-davinci-003`模型生成的指令与演示样本,该指令数据可用于对大语言模型(Large Language Model)进行指令微调,提升模型的指令遵循能力。 该数据集的构建基于[Self-Instruct框架](https://github.com/yizhongw/self-instruct)的数据生成流程,并做出了如下改进: - 改用`text-davinci-003`模型生成指令数据,而非`davinci`。 - 编写了[全新的提示词](https://github.com/tatsu-lab/stanford_alpaca/blob/main/prompt.txt),向`text-davinci-003`明确说明指令生成的要求。 - 采用了更激进的批量解码策略,即单次生成20条指令,大幅降低了数据生成成本。 - 移除了分类与非分类指令的差异,简化了数据生成流程。 - 每条指令仅生成单个样本,而非Self-Instruct中的2至3个样本。 最终生成了包含52000个样本的指令遵循数据集,数据生成成本极低(不足500美元)。 初步研究表明,该52000条生成数据的多样性远高于[Self-Instruct](https://github.com/yizhongw/self-instruct/blob/main/data/seed_tasks.jsonl)发布的数据集。 ### 支持任务与排行榜 Alpaca数据集专为预训练大语言模型的指令微调任务设计。 ### 语言 Alpaca数据集的语言为英语(BCP-47 标签:en)。 ## 数据集结构 ### 数据样本 训练集的样本示例如下: json { "instruction": "Create a classification task by clustering the given list of items.", "input": "Apples, oranges, bananas, strawberries, pineapples", "output": "Class 1: Apples, Oranges Class 2: Bananas, Strawberries Class 3: Pineapples", "text": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: Create a classification task by clustering the given list of items. ### Input: Apples, oranges, bananas, strawberries, pineapples ### Response: Class 1: Apples, Oranges Class 2: Bananas, Strawberries Class 3: Pineapples", } ### 数据字段 数据字段说明如下: * `instruction`:描述模型需要执行的任务,52000条指令均唯一。 * `input`:任务的可选上下文或输入。例如,当指令为"总结下述文章"时,输入即为该文章。约40%的样本包含输入字段。 * `output`:由`text-davinci-003`生成的指令对应答案。 * `text`:按照作者用于模型微调的[提示词模板](https://github.com/tatsu-lab/stanford_alpaca#data-release)格式化后的`instruction`、`input`与`output`内容。 ### 数据划分 | 数据集名称 | 训练集样本数 | |-----------|-------------:| | alpaca | 52002 | ## 数据集构建 ### 筛选依据 [需补充更多信息] ### 源数据 #### 初始数据收集与标准化 [需补充更多信息] #### 源语言生产者是谁? [需补充更多信息] ### 标注 #### 标注流程 [需补充更多信息] #### 标注者是谁? [需补充更多信息] ### 个人与敏感信息 [需补充更多信息] ## 数据使用注意事项 ### 数据集的社会影响 本数据集发布时附带的[博客文章](https://crfm.stanford.edu/2023/03/13/alpaca.html)节选如下: > 我们认为发布上述资源将使学术界能够对指令遵循型大语言模型开展可控的科学研究,从而推动相关领域的科学进步,并最终开发出解决现有模型缺陷的新技术。与此同时,任何形式的发布都存在一定风险。首先,我们认识到发布我们的训练配方将使某些能力的实现成为可能。一方面,这将使更多人(包括恶意行为者)能够开发出可能造成伤害的模型(无论是有意还是无意)。另一方面,这种认知可能会促使人们采取迅速的防御行动,尤其是学术界,如今他们有能力对此类模型开展更深入的安全研究。总体而言,我们认为本次发布给研究社区带来的益处大于风险。鉴于我们已经发布了训练配方,我们认为发布数据集、模型权重与训练代码带来的额外风险极小,因为该配方的实现难度并不高。与此同时,发布这些资源对可重复科学研究具有巨大价值,使学术界能够使用标准数据集、模型与代码开展可控的对比研究并探索扩展方向。为Alpaca部署交互式演示也存在潜在风险,例如更广泛地传播有害内容,降低垃圾信息、欺诈或虚假信息的门槛。我们已经采取了两项风险缓解策略。首先,我们使用OpenAI的内容审核API实现了内容过滤,该过滤器会过滤OpenAI使用政策中定义的有害内容。其次,我们使用Kirchenbauer等人2023年提出的方法对所有模型输出进行了水印处理,以便他人能够(以一定概率)检测到某一输出是否来自Alpaca 7B模型。最后,我们对演示的使用制定了严格的条款与条件,仅允许非商业用途以及符合LLaMA许可协议的用途。我们知道,一旦我们发布模型权重或用户训练自己的指令遵循模型,这些缓解措施可能会被绕过。但我们希望通过安装这些缓解措施,推动最佳实践的发展,并最终为基础模型的负责任部署制定社区规范。 ### 偏差讨论 [需补充更多信息] ### 其他已知局限性 `alpaca`数据集由语言模型(`text-davinci-003`)生成,不可避免地存在部分错误或偏差。我们建议用户谨慎使用该数据集,并探索新的方法来过滤或改进其中的不完善之处。 ## 附加信息 ### 数据集维护者 [需补充更多信息] ### 许可证信息 本数据集采用[知识共享署名非商业性使用许可(CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/legalcode)进行授权。 ### 引用信息 @misc{alpaca, author = {Rohan Taori and Ishaan Gulrajani and Tianyi Zhang and Yann Dubois and Xuechen Li and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto }, title = {Stanford Alpaca: An Instruction-following LLaMA model}, year = {2023}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {url{https://github.com/tatsu-lab/stanford_alpaca}}, } ### 贡献 [需补充更多信息]



