task_categories:text-generation language:af language:ar language:az language:bn language:cs language:de language:en language:es language:et language:fi language:fr language:gl language:gu language:he language:hi language:hr language:id language:it language:ja language:ka language:kk language:km language:ko language:lt language:lv language:mk language:ml language:mn language:mr language:my language:ne language:nl language:pl language:ps language:pt language:ro language:ru language:si language:sl language:sv language:sw language:ta language:te language:th language:tl language:tr language:uk language:ur language:vi language:xh language:zh license:cc-by-nc-4.0 instruction-finetuning multilingual arxiv:2008.00401 arxiv:2305.15011 region:us
---
license: cc-by-nc-4.0
task_categories:
- text-generation
language:
- af
- ar
- az
- bn
- cs
- de
- en
- es
- et
- fi
- fr
- gl
- gu
- he
- hi
- hr
- id
- it
- ja
- ka
- kk
- km
- ko
- lt
- lv
- mk
- ml
- mn
- mr
- my
- ne
- nl
- pl
- ps
- pt
- ro
- ru
- si
- sl
- sv
- sw
- ta
- te
- th
- tl
- tr
- uk
- ur
- vi
- xh
- zh
tags:
- instruction-finetuning
- multilingual
pretty_name: Bactrian-X
---


# Dataset Card for "Bactrian-X"

## Table of Contents
- [Dataset Description](#a-dataset-description)
  - [Dataset Summary](#dataset-summary)
  - [Languages](#languages)
- [Dataset Structure](#b-dataset-structure)
  - [Data Fields](#data-fields)
  - [Data Instances](#data-instances)
  - [Data in 52 Languages](#data-in-52-languages)
- [Dataset Creation](#c-dataset-creation)
- [Considerations for Using the Data](#d-considerations-for-using-the-data)
- [Additional Information](#e-additional-information)


## A. Dataset Description

- **Homepage:** https://github.com/mbzuai-nlp/Bactrian-X
- **Repository:** https://huggingface.co/datasets/MBZUAI/Bactrian-X
- **Paper:** to-be-soon released

### Dataset Summary


<h3 align="center">
<img src="https://raw.githubusercontent.com/fajri91/eval_picts/master/BactrianX_dataset.jpg" width="950" align="center">
</h3>


The Bactrain-X dataset is a collection of 3.4M instruction-response pairs in 52 languages, that are obtained by translating 67K English instructions ([alpaca-52k](https://github.com/tatsu-lab/stanford_alpaca) + [dolly-15k](https://github.com/databrickslabs/dolly/tree/master/data)) into 51 languages using Google Translate API. The translated instructions are then fed to ChatGPT (`gpt-3.5-turbo`) to obtain its natural responses, resulting in 3.4M instruction-response pairs in 52 languages (52 languages x 67k instances = 3.4M instances).

### Languages

We follow 52 languages of [mBART-50](https://arxiv.org/abs/2008.00401), with details can be found [below](#data-in-52-languages).

## B. Dataset Structure

### Data Fields

The data fields are as follows:

* `instruction`: describes the task the model should perform. Each of the 67K 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 `gpt-3.5-turbo`.
* `id`: the unique index for each data piece in a specific language. The same `id` across splits corresponds to the same original English data.

### Data Instances

An example in `en` looks as follows.

```json
{
"instruction": "What is the main idea of this text?", 
"input": "The robotics industry has become one of the fastest growing sectors in today’s economy. Robotics technology is being applied in various industries and applications, such as manufacturing, healthcare, and defense.", 
"output": "The main idea of the text is that the robotics industry is rapidly growing and its technology is being used in many different industries and applications.", 
"id": "alpaca-107"
}
```

An example in `ar` looks as follows.
```json
{
"instruction": "قم بالوصول إلى إعدادات المتصفح الافتراضية على جهاز الكمبيوتر.", 
"input": "",  
"output": "لا يمكن لي كمساعد افتراضي القيام بهذه المهمة كونها تحتاج إلى الوصول إلى الجهاز المادي. يرجى الرجوع إلى دليل المستخدم للكمبيوتر الخاص بك أو البحث على الإنترنت لمعرفة كيفية الوصول إلى إعدادات المتصفح الافتراضية على جهاز الكمبيوتر الخاص بك.",
"id": "alpaca-41997"
}
```

An example in `id` looks as follows.
```json
{
"instruction": "Berapa banyak angka penting yang harus digunakan untuk nilai 0,000187?", 
"input": "",  
"output": "Ada tiga angka penting dalam nilai 0,000187.",
"id": "alpaca-40382"
}
```

An example in `de` looks as follows.
```json
{
"instruction": "Komponieren Sie ein Musikstück mit einem Titel, der Trauer bezeichnet.", 
"input": "", 
"output": ""Schmerzendes Herz"\n\nDas Stück beginnt mit einer langsamen, traurigen Melodie, gespielt von einem Solo-Violoncello. Die Harmonien, die von einem Klavier begleitet werden, sind durcheinander und dissonant, um ein Gefühl von Schmerz und Trauer zu vermitteln.\n\nIm Laufe des Stücks treten andere Instrumente ein, wie Streicher, Flöte und Oboe, um die Melodie zu unterstützen und zu intensivieren. Der Rhythmus bleibt langsam und schwerfällig, um die Schwere des Schmerzes darzustellen.\n\nIn der Mitte des Stücks gibt es einen Höhepunkt, wo die Melodie und Harmonien sich verdichten und ein Gefühl von Überwältigung erzeugen. Der Solo-Violoncello spielt eine traurige und schnelle Phrase, die die Verzweiflung und Isolation des Protagonisten ausdrückt.\n\nDas Stück endet mit einer Wiederholung der ersten Melodie, gespielt von einem Solo-Klavier, während die anderen Instrumente auslaufen. Die Harmonien werden jedoch weicher und sanfter, um einen Hauch von Hoffnung zu vermitteln, dass der Schmerz langsam vergeht.",
"id": "alpaca-33619"
}
```

An example in `fr` looks as follows.
```json
{
"instruction": "Les Ceanothus ont-ils des racines peu profondes ?", 
"input": "",
"output": "En tant qu'IA, je ne peux pas répondre avec une certitude absolue, mais voici des informations générales sur les racines de Ceanothus : \n\nLes Ceanothus ont tendance à avoir un système racinaire étendu et peu profond. Les racines peuvent s'étaler jusqu'à 4 à 6 fois la taille de la plante et s'étendre à environ 60 à 90 cm de profondeur. Cependant, cela peut varier en fonction du type de sol et de la variété de Ceanothus. Certaines variétés de Ceanothus pourraient avoir des racines plus profondes si les conditions s'y prêtent.",
"id": "dolly-10940"
}
```


### Data in 52 Languages

| No | Languages       | Code  | Train |
| ---|---------------- | ----- | ----- |
|  1 | [Afrikaans](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/af)       | af_ZA | 67017 | 
|  2 | [Arabic](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ar)          | ar_AR | 67017 | 
|  3 | [Azerbaijani](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/az)     | az_AZ | 67017 | 
|  4 | [Bengali](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/bn)         | bn_IN | 67017 | 
|  5 | [Czech](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/cs)           | cs_CZ | 67017 | 
|  6 | [German](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/de)          | de_DE | 67017 | 
|  7 | [English](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/en)        | en_XX | 67017 | 
|  8 | [Spanish](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/es)         | es_XX | 67017 | 
|  9 | [Estonian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/et)        | et_EE | 67017 | 
| 10 | [Persian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/fa)         | fa_IR | 67017 | 
| 11 | [Finnish](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/fi)         | fi_FI | 67017 | 
| 12 | [French](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/fr)          | fr_XX | 67017 | 
| 13 | [Galician](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/gl)        | gl_ES | 67017 | 
| 14 | [Gujarati](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/gu)        | gu_IN | 67017 | 
| 15 | [Hebrew](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/he)          | he_IL | 67017 | 
| 16 | [Hindi](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/hi)           | hi_IN | 67017 | 
| 17 | [Croatian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/hr)         | hr_HR | 67017 | 
| 18 | [Indonesian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/id)       | id_ID | 67017 | 
| 19 | [Italian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/it)         | it_IT | 67017 | 
| 20 | [Japanese](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ja)         | ja_XX | 67017 | 
| 21 | [Georgian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ka)         | ka_GE | 67017 | 
| 22 | [Kazakh](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/kk)           | kk_KZ | 67017 | 
| 23 | [Khmer](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/km)            | km_KH | 67017 | 
| 24 | [Korean](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ko)           | ko_KR | 67017 | 
| 25 | [Lithuanian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/lt)       | lt_LT | 67017 | 
| 26 | [Latvian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/lv)         | lv_LV | 67017 | 
| 27 | [Macedonian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/mk)       | mk_MK | 67017 | 
| 28 | [Malayalam](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ml)        | ml_IN | 67017 | 
| 29 | [Mongolian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/mn)        | mn_MN | 67017 | 
| 30 | [Marathi](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/mr)          | mr_IN | 67017 | 
| 31 | [Burmese](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/my)          | my_MM | 67017 | 
| 32 | [Nepali](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ne)           | ne_NP | 67017 | 
| 33 | [Dutch](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/nl)            | nl_XX | 67017 | 
| 34 | [Polish](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/pl)           | pl_PL | 67017 | 
| 35 | [Pashto](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ps)           | ps_AF | 67017 | 
| 36 | [Portuguese](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/pt)       | pt_XX | 67017 | 
| 37 | [Romanian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ro)         | ro_RO | 67017 | 
| 38 | [Russian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ru)          | ru_RU | 67017 | 
| 39 | [Sinhala](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/si)          | si_LK | 67017 | 
| 40 | [Slovene](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/sl)          | sl_SI | 67017 | 
| 41 | [Swedish](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/sv)          | sv_SE | 67017 | 
| 42 | [Swahili](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/sw)          | sw_KE | 67017 | 
| 43 | [Tamil](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ta)            | ta_IN | 67017 | 
| 44 | [Telugu](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/te)           | te_IN | 67017 | 
| 45 | [Thai](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/th)             | th_TH | 67017 | 
| 46 | [Tagalog](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/tl)          | tl_XX | 67017 | 
| 47 | [Turkish](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/tr)          | tr_TR | 67017 | 
| 48 | [Ukrainian](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/uk)        | uk_UA | 67017 | 
| 49 | [Urdu](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/ur)             | ur_PK | 67017 | 
| 50 | [Vietnamese](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/vi)       | vi_VN | 67017 | 
| 51 | [Xhosa](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/xh)            | xh_ZA | 67017 | 
| 52 | [Chinese](https://huggingface.co/datasets/MBZUAI/Bactrian-X/viewer/zh)          | zh_CN | 67017 | 

## C. Dataset Creation

1. English Instructions: The English instuctions are obtained from [alpaca-53k](https://github.com/tatsu-lab/stanford_alpaca), and [dolly-15k](https://github.com/databrickslabs/dolly/tree/master/data).
2. Instruction Translation: The instructions (and inputs) are translated into 51 languages using Google Translation API (conducted on April 2023).
3. Output Generation: We generate output from `gpt-3.5-turbo` for each language (conducted on April 2023).

## D. Considerations for Using the Data

### Social Impact of Dataset

NLP for everyone: this dataset helps to democratize the cutting-edge instruction-following models in 52 languages. This dataset also allows the first experiment on the multilingual LoRA-based LLaMA model. 

### Discussion of Biases

(1) Translation bias; (2) Potential English-culture bias in the translated dataset.

### Other Known Limitations

The `Bactrian-X` data is generated by a language model (`gpt-3.5-turbo`) 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.

## E. Additional Information

### Dataset Curators

[Haonan Li](https://haonan-li.github.io/) and [Fajri Koto](http://www.fajrikoto.com)

### 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{li2023bactrianx,
      title={Bactrian-X : A Multilingual Replicable Instruction-Following Model with Low-Rank Adaptation}, 
      author={Haonan Li and Fajri Koto and Minghao Wu and Alham Fikri Aji and Timothy Baldwin},
      year={2023},
      eprint={2305.15011},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```

### Contributions

Thanks to [@haonan-li](https://github.com/haonan-li), [@fajri91](https://github.com/fajri91) for adding this dataset.
