Databricks Dolly is an instruction-following large language model trained on the Databricks machine learning platform and licensed for commercial use. It is based on pythia-12b and trained using approximately 15,000 instruction/response fine-tuning records generated by Databricks employees (databricks-dolly-15k), which cover the capability areas in the InstructGPT paper, including brainstorming, classification, closed question answering, generation, information extraction, open question answering, and summarization. dolly-v2-12b is not a state-of-the-art model, but it exhibits surprisingly high-quality instruction-following behavior, which is uncommon in its base model.
Main capabilities: dolly-v2-12b is a 12-billion-parameter causal language model created by Databricks, derived from EleutherAI's Pythia-12b and fine-tuned on an instruction corpus of approximately 15,000 records released under a permissive license (CC-BY-SA). The model is available on Hugging Face as databricks/dolly-v2-12b.
Usage: If you only want to test the model without training, you can load it directly from Hugging Face. When using the transformers library on a machine equipped with an A100 GPU, you can answer instructions via pipeline. For other GPU instances: the 6.9B and 2.8B parameter models can be used directly; generating with the 12B parameter model on an A10 (e.g., g5.4xlarge, 1 x A10 24GB) requires loading with 8-bit weights (install bitsandbytes and add model_kwargs={'load_in_8bit': True} in pipeline()), which affects the results; when using a V100 (e.g., p3.2xlarge, 1 x V100 16GB, NC6s_v3), you need to set torch_dtype=torch.float16 in pipeline(), and the 12B parameter model may not perform well when run in 8-bit on a V100.
Training: Add the dolly repository to Databricks (under Repos, click Add Repo, enter https://github.com/databrickslabs/dolly.git,然后点击 Create Repo). Launch a single-node cluster with 13.x ML (including Apache Spark 3.4.0, GPU, Scala 2.12) or later; the node type must have 8 A100 GPUs (such as Standard_ND96asr_v4 or p4d.24xlarge). Note that these instance types may not be available in all regions or may be difficult to provision; in Databricks, you must first select a GPU runtime and deselect "Use Photon" before these instance types appear (where supported). Open the train_dolly notebook in the Repo (that is, the train_dolly.py file in the GitHub dolly repository), attach it to the GPU cluster, and run all cells. After training completes, the notebook saves the model under /dbfs/dolly_training.
Training on other instances: A100 instance types are not available in all cloud regions or are difficult to provision. For smaller Dolly model sizes, you can train on other GPU instance types with minor modifications to reduce memory usage. These modifications are not optimal, but they are simple and easy. Select the GPU family type from the gpu_family widget, enter the number of available GPUs in the num_gpus widget, and then run the rest of the code. The system sets multiple options for the following GPU types: A100 GPUs are the preferred choice for training all model sizes and the only GPUs that can train the 12B parameter model in a reasonable time, so this is the default configuration (set in the a100_config.json DeepSpeed configuration file). Training the 12B parameter model on A10 is not recommended. When training the 6.9B parameter model on A10 instances (such as g5.24xlarge, 4 x A10 24GB; Standard_NV72ads_A10_v5, 2 x A10), select a10 from the gpu_family widget, enter the number of available GPUs in the num_gpus widget, and then run the rest of the code. This uses the a10_config.json DeepSpeed configuration file, in which the following changes are made: when train_dolly.py calls DeepSpeed, set per-device-train-batch-size and per-device-eval-batch-size to 3; add "offload_optimizer": { "device": "cpu", "pin_memory": true } to the "zero_optimization" section of the deepspeed configuration. When running on a V100 instance with 32GB of GPU memory (such as p3dn.24xlarge or Standard_ND40rs_v2), select v100 from the gpu_family widget, enter the number of available GPUs in the num_gpus widget, and then run the rest of the code. This will use the v100_config.json deepspeed configuration file, in which the following changes are made: include the above changes for A10; enable the fp16 floating-point format; set per-device-train-batch-size and per-device-eval-batch-size to 3. Compared with the 24GB A10 above, the batch size can probably be increased slightly on a 32GB instance.
Known limitations: dolly-v2-12b is not a state-of-the-art generative language model, and although quantitative benchmarking is still in progress, it was not designed to compete with more modern model architectures or models trained on larger pretraining corpora. The Dolly model family is under active development, so any list of shortcomings is unlikely to be exhaustive, but known limitations and failures are listed here to document and share preliminary findings with the community. In particular, dolly-v2-12b performs poorly on: syntactically complex prompts, programming problems, mathematical operations, factual errors, dates and times, open-ended question answering, hallucination, enumerating lists of specified length, style imitation, humor, etc. In addition, dolly-v2-12b does not have some of the capabilities of the original model, such as writing well-formatted letters.
Dataset limitations: Like all language models, dolly-v2-12b reflects the content and limitations of its training corpus. Pile: GPT-J's pretraining corpus was collected mainly from the public internet and, like most web-scale datasets, contains a lot of content that users may find objectionable. As a result, the model may reflect these shortcomings, potentially noticeably when explicitly asked to generate objectionable content, and sometimes in subtle ways, such as bias or harmful implicit associations. databricks-dolly-15k: Thetraining data used to instruction-tune dolly-v2-12b represents natural language instructions generated by Databricks employees between March and April 2023, and includes Wikipedia passages as reference passages for instruction categories such as closed question answering and summarization. To our knowledge, it does not contain obscene content, intellectual property, or personally identifiable information of non-public figures, but it may contain typos and factual errors. The dataset may also reflect biases present in Wikipedia. Finally, the dataset may reflect the interests and semantic choices of Databricks employees, a population that does not represent the global population. Databricks is committed to continuous research and development to develop beneficial, honest, and harmless AI technologies that maximize the potential of all individuals and organizations.