From 0f42de886a73b6431429c132621e2ec832894131 Mon Sep 17 00:00:00 2001 From: Trevor Grant Date: Mon, 31 Jul 2023 11:32:52 -0500 Subject: [PATCH 1/5] Update README.md Signed-off-by: Trevor Grant Signed-off-by: Trevor Grant Signed-off-by: gkumbhat --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d5303d07..cb6ce64b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,37 @@ # Caikit NLP +Welcome to the README.md page of `caikit-nlp`! This repository contains the necessary code and resources to enable prompt tuning and fine-tuning capabilities for [caikit](https://github.com/caikit/caikit). + +## Introduction + `caikit_nlp` is a [Caikit](https://github.com/caikit/caikit) library that currently provides [PEFT prompt tuning](https://github.com/huggingface/peft) and MPT (multi-task prompt tuning) functionalities. -More information on MPT can be found at: https://arxiv.org/abs/2303.02861 +### Getting Started + +To help you quickly get started with using Caikit, we have prepared a [Jupyter notebook](examples/Caikit_Getting_Started.ipynb) that can be run in Google Colab. Caikit is a powerful library that leverages prompt tuning and fine-tuning to enhance the capabilities of our main open-source project. + + +### Contributing + +We welcome contributions from the community! If you would like to contribute to `caikit-nlp`, please read the guidelines in the main project's [CONTRIBUTING.md](main/CONTRIBUTING.md) file. It includes information on submitting bug reports, feature requests, and pull requests. Make sure to follow our coding standards, [code of conduct](code-of-conduct.md), [security standards](https://github.com/caikit/community/blob/main/SECURITY.md), and documentation guidelines to streamline the contribution process. + +### License + +This project is licensed under the [ASFv2 License](LICENSE). + +### Glossary + +A list of terms that either may be unfamiliar or that have nebulous definitions based on who and where you hear them, defined for how they are used/thought of in the `caikit`/`caikit-nlp` project: + +* Fine tuning - trains the base model onto new data etc; this changes the base model. +* Prompt engineering - (usually) manually crafting texts that make models do a better job that's left appended to the input text. E.g., if you wanted to do something like sentiment on movie reviews, you might come up with a prompt like The movie was: _____ and replace the _____ with the movie review you're consider to try to get something like happy/sad out of it. +* PEFT - library by Huggingface containing implementations of different tuning methods that scale well - things like prompt tuning, and MPT live there. So PEFT itself isn't an approach even though parameter efficient fine-tuning sounds like one. +Prompt tuning - learning soft prompts. This is different from prompt engineering in that you're not trying to learn tokens. Instead, you're basically trying to learn new embedded representations (sometimes called virtual tokens) that can be concatenated onto your embedded input text to improve the performance. This can work well, but also can be sensitive to initialization. +* Multitask prompt tuning (MPT) - Tries to fix some of the issues with prompt tuning by allowing you to effectively learn 'source prompts' across different tasks & leverage them to initialize your prompt tuning etc. More information on MPT can be found at: https://arxiv.org/abs/2303.02861 -Currently causal language models and sequence-to-sequence models are supported. +The important difference between fine tuning and stuff like prompt tuning/multiprompt tuning is that the latter doesn't change the base model's weights at all. So when you run inference for prompt tuned models, you can have n prompts to 1 base model, and just inject the prompt tensors you need when they're requested instead of having _n_ separate fine-tuned models. #### Notes - The data model for text generative capabilities is baked into this repository itself at `caikit_nlp/data_model/generation.py`. +- Currently causal language models and sequence-to-sequence models are supported. From bf0f4d42c45626f0ca377f03da3c41cd1db21df1 Mon Sep 17 00:00:00 2001 From: Trevor Grant Date: Tue, 1 Aug 2023 12:08:58 -0500 Subject: [PATCH 2/5] Update README.md Co-authored-by: Gaurav Kumbhat Signed-off-by: Trevor Grant Signed-off-by: gkumbhat --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb6ce64b..68759b00 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Welcome to the README.md page of `caikit-nlp`! This repository contains the nece ### Getting Started -To help you quickly get started with using Caikit, we have prepared a [Jupyter notebook](examples/Caikit_Getting_Started.ipynb) that can be run in Google Colab. Caikit is a powerful library that leverages prompt tuning and fine-tuning to enhance the capabilities of our main open-source project. +To help you quickly get started with using Caikit, we have prepared a [Jupyter notebook](examples/Caikit_Getting_Started.ipynb) that can be run in Google Colab. Caikit-nlp is a powerful library that leverages prompt tuning and fine-tuning to add NLP domain capabilities to caikit. ### Contributing From 062146c401e497660257963c7966f0d0b73335ee Mon Sep 17 00:00:00 2001 From: Trevor Grant Date: Tue, 1 Aug 2023 12:09:09 -0500 Subject: [PATCH 3/5] Update README.md Co-authored-by: Gaurav Kumbhat Signed-off-by: Trevor Grant Signed-off-by: gkumbhat --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68759b00..46717fcf 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ A list of terms that either may be unfamiliar or that have nebulous definitions Prompt tuning - learning soft prompts. This is different from prompt engineering in that you're not trying to learn tokens. Instead, you're basically trying to learn new embedded representations (sometimes called virtual tokens) that can be concatenated onto your embedded input text to improve the performance. This can work well, but also can be sensitive to initialization. * Multitask prompt tuning (MPT) - Tries to fix some of the issues with prompt tuning by allowing you to effectively learn 'source prompts' across different tasks & leverage them to initialize your prompt tuning etc. More information on MPT can be found at: https://arxiv.org/abs/2303.02861 -The important difference between fine tuning and stuff like prompt tuning/multiprompt tuning is that the latter doesn't change the base model's weights at all. So when you run inference for prompt tuned models, you can have n prompts to 1 base model, and just inject the prompt tensors you need when they're requested instead of having _n_ separate fine-tuned models. +The important difference between fine tuning and capabilities like prompt tuning/multi-taskprompt tuning is that the latter doesn't change the base model's weights at all. So when you run inference for prompt tuned models, you can have n prompts to 1 base model, and just inject the prompt tensors you need when they're requested instead of having _n_ separate fine-tuned models. #### Notes From 8acbf2ba8b795eceb99e8da951ad4b22542173ef Mon Sep 17 00:00:00 2001 From: Trevor Grant Date: Tue, 1 Aug 2023 12:09:43 -0500 Subject: [PATCH 4/5] Update README.md Co-authored-by: Gaurav Kumbhat Signed-off-by: Trevor Grant Signed-off-by: gkumbhat --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46717fcf..437a9816 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Caikit NLP -Welcome to the README.md page of `caikit-nlp`! This repository contains the necessary code and resources to enable prompt tuning and fine-tuning capabilities for [caikit](https://github.com/caikit/caikit). +Welcome to the README.md page of `caikit-nlp`! This repository provides NLP domain capabilities running on [caikit](https://github.com/caikit/caikit) framework. ## Introduction From a6c04844718ae781f59ea7b30bbe499c027c2223 Mon Sep 17 00:00:00 2001 From: Trevor Grant Date: Fri, 4 Aug 2023 15:29:49 -0500 Subject: [PATCH 5/5] Update README.md Signed-off-by: Trevor Grant Signed-off-by: Trevor Grant Signed-off-by: gkumbhat --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 437a9816..1ae92382 100644 --- a/README.md +++ b/README.md @@ -33,5 +33,4 @@ The important difference between fine tuning and capabilities like prompt tuning #### Notes -- The data model for text generative capabilities is baked into this repository itself at `caikit_nlp/data_model/generation.py`. - Currently causal language models and sequence-to-sequence models are supported.