VOOZH about

URL: https://huggingface.co/distilbert/distilgpt2

⇱ distilbert/distilgpt2 · Hugging Face


DistilGPT2

DistilGPT2 (short for Distilled-GPT2) is an English-language model pre-trained with the supervision of the smallest version of Generative Pre-trained Transformer 2 (GPT-2). Like GPT-2, DistilGPT2 can be used to generate text. Users of this model card should also consider information about the design, training, and limitations of GPT-2.

Model Details

  • Developed by: Hugging Face
  • Model type: Transformer-based Language Model
  • Language: English
  • License: Apache 2.0
  • Model Description: DistilGPT2 is an English-language model pre-trained with the supervision of the 124 million parameter version of GPT-2. DistilGPT2, which has 82 million parameters, was developed using knowledge distillation and was designed to be a faster, lighter version of GPT-2.
  • Resources for more information: See this repository for more about Distil* (a class of compressed models including Distilled-GPT2), Sanh et al. (2019) for more information about knowledge distillation and the training procedure, and this page for more about GPT-2.

Uses, Limitations and Risks

Limitations and Risks

Potential Uses

Since DistilGPT2 is a distilled version of GPT-2, it is intended to be used for similar use cases with the increased functionality of being smaller and easier to run than the base model.

The developers of GPT-2 state in their model card that they envisioned GPT-2 would be used by researchers to better understand large-scale generative language models, with possible secondary use cases including:

  • Writing assistance: Grammar assistance, autocompletion (for normal prose or code)
  • Creative writing and art: exploring the generation of creative, fictional texts; aiding creation of poetry and other literary art.
  • Entertainment: Creation of games, chat bots, and amusing generations.

Using DistilGPT2, the Hugging Face team built the Write With Transformers web app, which allows users to play with the model to generate text directly from their browser.

Out-of-scope Uses

OpenAI states in the GPT-2 model card:

Because large-scale language models like GPT-2 do not distinguish fact from fiction, we don’t support use-cases that require the generated text to be true.

Additionally, language models like GPT-2 reflect the biases inherent to the systems they were trained on, so we do not recommend that they be deployed into systems that interact with humans unless the deployers first carry out a study of biases relevant to the intended use-case.

How to Get Started with the Model

Training Data

DistilGPT2 was trained using OpenWebTextCorpus, an open-source reproduction of OpenAI’s WebText dataset, which was used to train GPT-2. See the OpenWebTextCorpus Dataset Card for additional information about OpenWebTextCorpus and Radford et al. (2019) for additional information about WebText.

Training Procedure

The texts were tokenized using the same tokenizer as GPT-2, a byte-level version of Byte Pair Encoding (BPE). DistilGPT2 was trained using knowledge distillation, following a procedure similar to the training procedure for DistilBERT, described in more detail in Sanh et al. (2019).

Evaluation Results

The creators of DistilGPT2 report that, on the WikiText-103 benchmark, GPT-2 reaches a perplexity on the test set of 16.3 compared to 21.1 for DistilGPT2 (after fine-tuning on the train set).

Environmental Impact

Carbon emissions were estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019). The hardware, runtime, cloud provider, and compute region were utilized to estimate the carbon impact.

  • Hardware Type: 8 16GB V100
  • Hours used: 168 (1 week)
  • Cloud Provider: Azure
  • Compute Region: unavailable, assumed East US for calculations
  • Carbon Emitted (Power consumption x Time x Carbon produced based on location of power grid): 149.2 kg eq. CO2

Citation

@inproceedings{sanh2019distilbert,
 title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
 author={Sanh, Victor and Debut, Lysandre and Chaumond, Julien and Wolf, Thomas},
 booktitle={NeurIPS EMC^2 Workshop},
 year={2019}
}

Glossary

  • : As described in Sanh et al. (2019), “knowledge distillation is a compression technique in which a compact model – the student – is trained to reproduce the behavior of a larger model – the teacher – or an ensemble of models.” Also see Bucila et al. (2006) and Hinton et al. (2015).
👁 Image
Downloads last month
3,510,511
Safetensors
Model size
88.2M params
Tensor type
F32
·

Model tree for distilbert/distilgpt2

Adapters
80 models
Finetunes
1502 models
Merges
2 models
Quantizations
23 models

Dataset used to train distilbert/distilgpt2

Spaces using distilbert/distilgpt2 100

Papers for distilbert/distilgpt2

Evaluation results