google / flan-t5-large

huggingface.co
Total runs: 1.4M
24-hour runs: -65.5K
7-day runs: -180.2K
30-day runs: -26.9K
Model's Last Updated: July 17 2023
text2text-generation

Introduction of flan-t5-large

Model Details of flan-t5-large

Model Card for FLAN-T5 large

drawing

Table of Contents

  1. TL;DR
  2. Model Details
  3. Usage
  4. Uses
  5. Bias, Risks, and Limitations
  6. Training Details
  7. Evaluation
  8. Environmental Impact
  9. Citation
  10. Model Card Authors

TL;DR

If you already know T5, FLAN-T5 is just better at everything. For the same number of parameters, these models have been fine-tuned on more than 1000 additional tasks covering also more languages. As mentioned in the first few lines of the abstract :

Flan-PaLM 540B achieves state-of-the-art performance on several benchmarks, such as 75.2% on five-shot MMLU. We also publicly release Flan-T5 checkpoints,1 which achieve strong few-shot performance even compared to much larger models, such as PaLM 62B. Overall, instruction finetuning is a general method for improving the performance and usability of pretrained language models.

Disclaimer : Content from this model card has been written by the Hugging Face team, and parts of it were copy pasted from the T5 model card .

Model Details

Model Description
  • Model type: Language model
  • Language(s) (NLP): English, Spanish, Japanese, Persian, Hindi, French, Chinese, Bengali, Gujarati, German, Telugu, Italian, Arabic, Polish, Tamil, Marathi, Malayalam, Oriya, Panjabi, Portuguese, Urdu, Galician, Hebrew, Korean, Catalan, Thai, Dutch, Indonesian, Vietnamese, Bulgarian, Filipino, Central Khmer, Lao, Turkish, Russian, Croatian, Swedish, Yoruba, Kurdish, Burmese, Malay, Czech, Finnish, Somali, Tagalog, Swahili, Sinhala, Kannada, Zhuang, Igbo, Xhosa, Romanian, Haitian, Estonian, Slovak, Lithuanian, Greek, Nepali, Assamese, Norwegian
  • License: Apache 2.0
  • Related Models: All FLAN-T5 Checkpoints
  • Original Checkpoints: All Original FLAN-T5 Checkpoints
  • Resources for more information:

Usage

Find below some example scripts on how to use the model in transformers :

Using the Pytorch model
Running the model on a CPU
Click to expand

from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large")

input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids

outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
Running the model on a GPU
Click to expand
# pip install accelerate
from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large", device_map="auto")

input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")

outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
Running the model on a GPU using different precisions
FP16
Click to expand
# pip install accelerate
import torch
from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large", device_map="auto", torch_dtype=torch.float16)

input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")

outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
INT8
Click to expand
# pip install bitsandbytes accelerate
from transformers import T5Tokenizer, T5ForConditionalGeneration

tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-large")
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-large", device_map="auto", load_in_8bit=True)

input_text = "translate English to German: How old are you?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")

outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))

Uses

Direct Use and Downstream Use

The authors write in the original paper's model card that:

The primary use is research on language models, including: research on zero-shot NLP tasks and in-context few-shot learning NLP tasks, such as reasoning, and question answering; advancing fairness and safety research, and understanding limitations of current large language models

See the research paper for further details.

Out-of-Scope Use

More information needed.

Bias, Risks, and Limitations

The information below in this section are copied from the model's official model card :

Language models, including Flan-T5, can potentially be used for language generation in a harmful way, according to Rae et al. (2021). Flan-T5 should not be used directly in any application, without a prior assessment of safety and fairness concerns specific to the application.

Ethical considerations and risks

Flan-T5 is fine-tuned on a large corpus of text data that was not filtered for explicit content or assessed for existing biases. As a result the model itself is potentially vulnerable to generating equivalently inappropriate content or replicating inherent biases in the underlying data.

Known Limitations

Flan-T5 has not been tested in real world applications.

Sensitive Use:

Flan-T5 should not be applied for any unacceptable use cases, e.g., generation of abusive speech.

Training Details

Training Data

The model was trained on a mixture of tasks, that includes the tasks described in the table below (from the original paper, figure 2):

table.png

Training Procedure

According to the model card from the original paper :

These models are based on pretrained T5 (Raffel et al., 2020) and fine-tuned with instructions for better zero-shot and few-shot performance. There is one fine-tuned Flan model per T5 model size.

The model has been trained on TPU v3 or TPU v4 pods, using t5x codebase together with jax .

Evaluation

Testing Data, Factors & Metrics

The authors evaluated the model on various tasks covering several languages (1836 in total). See the table below for some quantitative evaluation: image.png For full details, please check the research paper .

Results

For full results for FLAN-T5-Large, see the research paper , Table 3.

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019) .

  • Hardware Type: Google Cloud TPU Pods - TPU v3 or TPU v4 | Number of chips ≥ 4.
  • Hours used: More information needed
  • Cloud Provider: GCP
  • Compute Region: More information needed
  • Carbon Emitted: More information needed

Citation

BibTeX:

@misc{https://doi.org/10.48550/arxiv.2210.11416,
  doi = {10.48550/ARXIV.2210.11416},
  
  url = {https://arxiv.org/abs/2210.11416},
  
  author = {Chung, Hyung Won and Hou, Le and Longpre, Shayne and Zoph, Barret and Tay, Yi and Fedus, William and Li, Eric and Wang, Xuezhi and Dehghani, Mostafa and Brahma, Siddhartha and Webson, Albert and Gu, Shixiang Shane and Dai, Zhuyun and Suzgun, Mirac and Chen, Xinyun and Chowdhery, Aakanksha and Narang, Sharan and Mishra, Gaurav and Yu, Adams and Zhao, Vincent and Huang, Yanping and Dai, Andrew and Yu, Hongkun and Petrov, Slav and Chi, Ed H. and Dean, Jeff and Devlin, Jacob and Roberts, Adam and Zhou, Denny and Le, Quoc V. and Wei, Jason},
  
  keywords = {Machine Learning (cs.LG), Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
  
  title = {Scaling Instruction-Finetuned Language Models},
  
  publisher = {arXiv},
  
  year = {2022},
  
  copyright = {Creative Commons Attribution 4.0 International}
}

Runs of google flan-t5-large on huggingface.co

1.4M
Total runs
-65.5K
24-hour runs
-101.5K
3-day runs
-180.2K
7-day runs
-26.9K
30-day runs

More Information About flan-t5-large huggingface.co Model

More flan-t5-large license Visit here:

https://choosealicense.com/licenses/apache-2.0

flan-t5-large huggingface.co

flan-t5-large huggingface.co is an AI model on huggingface.co that provides flan-t5-large's model effect (), which can be used instantly with this google flan-t5-large model. huggingface.co supports a free trial of the flan-t5-large model, and also provides paid use of the flan-t5-large. Support call flan-t5-large model through api, including Node.js, Python, http.

flan-t5-large huggingface.co Url

https://huggingface.co/google/flan-t5-large

google flan-t5-large online free

flan-t5-large huggingface.co is an online trial and call api platform, which integrates flan-t5-large's modeling effects, including api services, and provides a free online trial of flan-t5-large, you can try flan-t5-large online for free by clicking the link below.

google flan-t5-large online free url in huggingface.co:

https://huggingface.co/google/flan-t5-large

flan-t5-large install

flan-t5-large is an open source model from GitHub that offers a free installation service, and any user can find flan-t5-large on GitHub to install. At the same time, huggingface.co provides the effect of flan-t5-large install, users can directly use flan-t5-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

flan-t5-large install url in huggingface.co:

https://huggingface.co/google/flan-t5-large

Url of flan-t5-large

flan-t5-large huggingface.co Url

Provider of flan-t5-large huggingface.co

google
ORGANIZATIONS

Other API from google

huggingface.co

Total runs: 1.4M
Run Growth: -453.9K
Growth Rate: -31.85%
Updated: January 25 2023
huggingface.co

Total runs: 839.9K
Run Growth: 14.7K
Growth Rate: 1.81%
Updated: February 29 2024
huggingface.co

Total runs: 767.6K
Run Growth: 165.2K
Growth Rate: 21.88%
Updated: July 17 2023
huggingface.co

Total runs: 722.8K
Run Growth: -98.0K
Growth Rate: -13.64%
Updated: January 25 2023
huggingface.co

Total runs: 691.6K
Run Growth: -66.0K
Growth Rate: -9.66%
Updated: July 27 2023
huggingface.co

Total runs: 539.2K
Run Growth: -44.1K
Growth Rate: -8.18%
Updated: October 11 2023
huggingface.co

Total runs: 421.8K
Run Growth: 21.9K
Growth Rate: 5.28%
Updated: August 28 2024
huggingface.co

Total runs: 390.3K
Run Growth: 54.4K
Growth Rate: 14.38%
Updated: August 28 2024
huggingface.co

Total runs: 235.7K
Run Growth: -189.7K
Growth Rate: -89.93%
Updated: September 27 2024
huggingface.co

Total runs: 231.7K
Run Growth: 231.2K
Growth Rate: 97.13%
Updated: February 17 2023
huggingface.co

Total runs: 211.7K
Run Growth: 14.9K
Growth Rate: 7.04%
Updated: November 28 2023
huggingface.co

Total runs: 183.0K
Run Growth: -130.9K
Growth Rate: -76.87%
Updated: August 08 2024
huggingface.co

Total runs: 156.0K
Run Growth: -21.6K
Growth Rate: -14.28%
Updated: August 28 2024
huggingface.co

Total runs: 150.6K
Run Growth: 4.7K
Growth Rate: 3.15%
Updated: November 07 2023
huggingface.co

Total runs: 132.6K
Run Growth: 43.0K
Growth Rate: 32.69%
Updated: January 25 2023
huggingface.co

Total runs: 114.8K
Run Growth: 8.8K
Growth Rate: 7.75%
Updated: September 18 2023
huggingface.co

Total runs: 114.3K
Run Growth: -22.7K
Growth Rate: -20.09%
Updated: January 25 2023
huggingface.co

Total runs: 110.9K
Run Growth: 27.6K
Growth Rate: 25.07%
Updated: January 25 2023
huggingface.co

Total runs: 109.7K
Run Growth: -30.3K
Growth Rate: -27.67%
Updated: January 25 2023
huggingface.co

Total runs: 104.7K
Run Growth: 26.4K
Growth Rate: 25.42%
Updated: January 25 2023
huggingface.co

Total runs: 101.5K
Run Growth: 18.9K
Growth Rate: 18.84%
Updated: September 27 2024
huggingface.co

Total runs: 97.0K
Run Growth: -133.9K
Growth Rate: -141.07%
Updated: January 25 2023
huggingface.co

Total runs: 82.7K
Run Growth: -23.6K
Growth Rate: -28.95%
Updated: January 25 2023
huggingface.co

Total runs: 71.9K
Run Growth: -59.7K
Growth Rate: -81.59%
Updated: August 08 2024
huggingface.co

Total runs: 67.6K
Run Growth: -277.8K
Growth Rate: -364.22%
Updated: August 14 2024
huggingface.co

Total runs: 62.0K
Run Growth: 9.8K
Growth Rate: 17.09%
Updated: June 27 2024
huggingface.co

Total runs: 48.5K
Run Growth: 37.3K
Growth Rate: 76.82%
Updated: April 29 2024
huggingface.co

Total runs: 46.2K
Run Growth: 8.4K
Growth Rate: 17.93%
Updated: January 25 2023
huggingface.co

Total runs: 44.4K
Run Growth: 20.0K
Growth Rate: 53.96%
Updated: January 25 2023
huggingface.co

Total runs: 22.4K
Run Growth: 14.8K
Growth Rate: 66.68%
Updated: January 25 2023
huggingface.co

Total runs: 11.1K
Run Growth: 2.9K
Growth Rate: 26.45%
Updated: April 29 2024
huggingface.co

Total runs: 10.8K
Run Growth: -618.9K
Growth Rate: -5724.48%
Updated: August 08 2024
huggingface.co

Total runs: 10.0K
Run Growth: 7.7K
Growth Rate: 77.50%
Updated: November 28 2023
huggingface.co

Total runs: 9.9K
Run Growth: 2.1K
Growth Rate: 20.44%
Updated: September 07 2023
huggingface.co

Total runs: 9.9K
Run Growth: 5.6K
Growth Rate: 56.59%
Updated: January 25 2023
huggingface.co

Total runs: 9.6K
Run Growth: 2.0K
Growth Rate: 21.80%
Updated: July 06 2023
huggingface.co

Total runs: 8.7K
Run Growth: 7.0K
Growth Rate: 80.27%
Updated: August 08 2024