allenai / tk-instruct-base-def-pos

huggingface.co
Total runs: 3.3K
24-hour runs: 0
7-day runs: 49
30-day runs: 3.1K
Model's Last Updated: Janvier 24 2023
text2text-generation

Introduction of tk-instruct-base-def-pos

Model Details of tk-instruct-base-def-pos

Model description

Tk-Instruct is a series of encoder-decoder Transformer models that are trained to solve various NLP tasks by following in-context instructions (plain language task definitions, k-shot examples, explanations, etc). Built upon the pre-trained T5 models , they are fine-tuned on a large number of tasks & instructions that are collected in the Natural Instructions benchmark , which contains 1600+ tasks in 70+ broach categories in total. This enables the model to not only process the training tasks, but also generalize to many unseen tasks without further parameter update.

More resources for using the model:

Intended uses & limitations

Tk-Instruct can be used to do many NLP tasks by following instructions.

How to use

When instructing the model, task definition or demonstration examples or explanations should be prepended to the original input and fed into the model. You can easily try Tk-Instruct models as follows:

>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

>>> tokenizer = AutoTokenizer.from_pretrained("allenai/tk-instruct-3b-def")
>>> model = AutoModelForSeq2SeqLM.from_pretrained("allenai/tk-instruct-3b-def")

>>> input_ids = tokenizer.encode(
        "Definition: return the currency of the given country. Now complete the following example - Input: India. Output:", 
        return_tensors="pt")
>>> output = model.generate(input_ids, max_length=10)
>>> output = tokenizer.decode(output[0], skip_special_tokens=True)   # model should output 'Indian Rupee'

>>> input_ids = tokenizer.encode(
        "Definition: negate the following sentence. Input: John went to school. Output:", 
        return_tensors="pt")
>>> output = model.generate(input_ids, max_length=10)
>>> output = tokenizer.decode(output[0], skip_special_tokens=True)   # model should output 'John did not go to shool.'
Limitations

We are still working on understanding the behaviors of these models, but here are several issues we have found:

  • Models are generally sensitive to the instruction. Sometimes rewording the instruction can lead to very different output.
  • Models are not always compliant to the instruction. Sometimes the model don't follow your instruction (e.g., when you ask the model to generate one sentence, it might still generate one word or a long story).
  • Models might totally fail on some tasks.

If you find serious issues or any interesting result, you are welcome to share with us!

Training data

Tk-Instruct is trained using the tasks & instructions in Natural Instructions benchmark , which contains 1600+ tasks in 70+ broach categories in total. We follow the official train/test split. Tk-Instruct model series were trained using 757 tasks, and mTk-Instruct series were trained using 1271 tasks (including some non-English tasks).

The training tasks are in 64 broad categories, such as text categorization / question answering / sentiment analysis / summarization / grammar error detection / dialogue generation / etc. The other 12 categories are selected for evaluation.

Training procedure

All our models are initialized from either T5 models or mT5 models. Because generating the output can be regarded as a form of language modeling, we used their LM adapted version . All data is converted into a text-to-text format, and models are fine-tuned to maximize the likelihood of the output sequence.

Our released models are in different sizes, and each of them was trained with a specific type of instruction encoding. For instance, tk-instruct-3b-def-pos was initialized from t5-xl-lm-adapt , and it saw task definition & 2 positive examples as the instruction during training time. Although they are trained with only one type of instruction encodings, we found they can usually work with other type of encodings at test time (see more in our paper).

BibTeX entry and citation info
@article{wang2022benchmarking,
  title={Benchmarking Generalization via In-Context Instructions on 1,600+ Language Tasks},
  author={Yizhong Wang and Swaroop Mishra and Pegah Alipoormolabashi and Yeganeh Kordi and Amirreza Mirzaei and A. Arunkumar and Arjun Ashok and Arut Selvan Dhanasekaran and Atharva Naik and David Stap and Eshaan Pathak and Giannis Karamanolakis and Haizhi Gary Lai and Ishan Purohit and Ishani Mondal and Jacob Anderson and Kirby Kuznia and Krima Doshi and Maitreya Patel and Kuntal Kumar Pal and M. Moradshahi and Mihir Parmar and Mirali Purohit and Neeraj Varshney and Phani Rohitha Kaza and Pulkit Verma and Ravsehaj Singh Puri and Rushang Karia and Shailaja Keyur Sampat and Savan Doshi and Siddharth Deepak Mishra and Sujan C. Reddy and Sumanta Patro and Tanay Dixit and Xu-dong Shen and Chitta Baral and Yejin Choi and Hannaneh Hajishirzi and Noah A. Smith and Daniel Khashabi},
  year={2022},
  archivePrefix={arXiv},
  eprint={2204.07705},
  primaryClass={cs.CL},
}

Runs of allenai tk-instruct-base-def-pos on huggingface.co

3.3K
Total runs
0
24-hour runs
-43
3-day runs
49
7-day runs
3.1K
30-day runs

More Information About tk-instruct-base-def-pos huggingface.co Model

More tk-instruct-base-def-pos license Visit here:

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

tk-instruct-base-def-pos huggingface.co

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

tk-instruct-base-def-pos huggingface.co Url

https://huggingface.co/allenai/tk-instruct-base-def-pos

allenai tk-instruct-base-def-pos online free

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

allenai tk-instruct-base-def-pos online free url in huggingface.co:

https://huggingface.co/allenai/tk-instruct-base-def-pos

tk-instruct-base-def-pos install

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

tk-instruct-base-def-pos install url in huggingface.co:

https://huggingface.co/allenai/tk-instruct-base-def-pos

Url of tk-instruct-base-def-pos

tk-instruct-base-def-pos huggingface.co Url

Provider of tk-instruct-base-def-pos huggingface.co

allenai
ORGANIZATIONS

Other API from allenai

huggingface.co

Total runs: 91.7K
Run Growth: 78.6K
Growth Rate: 85.70%
Updated: Octobre 18 2023
huggingface.co

Total runs: 91.3K
Run Growth: 63.3K
Growth Rate: 69.57%
Updated: Janvier 06 2025
huggingface.co

Total runs: 77.3K
Run Growth: -517.1K
Growth Rate: -669.13%
Updated: Octobre 10 2024
huggingface.co

Total runs: 63.3K
Run Growth: 51.7K
Growth Rate: 81.63%
Updated: Octobre 10 2024
huggingface.co

Total runs: 61.6K
Run Growth: -50.5K
Growth Rate: -81.96%
Updated: Décembre 04 2024
huggingface.co

Total runs: 23.0K
Run Growth: 7.7K
Growth Rate: 33.79%
Updated: Août 14 2024
huggingface.co

Total runs: 8.5K
Run Growth: 3.3K
Growth Rate: 36.78%
Updated: Juillet 16 2024
huggingface.co

Total runs: 6.1K
Run Growth: -21.5K
Growth Rate: -354.06%
Updated: Juillet 03 2024
huggingface.co

Total runs: 5.1K
Run Growth: -17.0K
Growth Rate: -321.48%
Updated: Juillet 16 2024
huggingface.co

Total runs: 2.5K
Run Growth: -163
Growth Rate: -6.49%
Updated: Décembre 04 2024
huggingface.co

Total runs: 1.7K
Run Growth: -110
Growth Rate: -6.43%
Updated: Juillet 16 2024
huggingface.co

Total runs: 895
Run Growth: 878
Growth Rate: 98.10%
Updated: Janvier 24 2023
huggingface.co

Total runs: 502
Run Growth: -100
Growth Rate: -21.23%
Updated: Janvier 24 2023
huggingface.co

Total runs: 486
Run Growth: 256
Growth Rate: 52.67%
Updated: Février 12 2024
huggingface.co

Total runs: 374
Run Growth: 354
Growth Rate: 94.65%
Updated: Juin 13 2024
huggingface.co

Total runs: 313
Run Growth: -437
Growth Rate: -139.62%
Updated: Avril 30 2024
huggingface.co

Total runs: 297
Run Growth: 159
Growth Rate: 53.54%
Updated: Avril 19 2024