Skip to content

🎉 Add Multitask Prompt Tuning#400

Merged
pacman100 merged 49 commits intohuggingface:mainfrom
mayank31398:mpt-os-test
Aug 25, 2023
Merged

🎉 Add Multitask Prompt Tuning#400
pacman100 merged 49 commits intohuggingface:mainfrom
mayank31398:mpt-os-test

Conversation

@mayank31398
Copy link
Copy Markdown
Contributor

Adds code for the paper: https://arxiv.org/abs/2303.02861

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@mayank31398 mayank31398 marked this pull request as ready for review May 6, 2023 23:42
@mayank31398
Copy link
Copy Markdown
Contributor Author

@pacman100
Can you take a look at this PR?
This adds the functionality to use Multitask Prompt Tuning as proposed in this paper.

@mayank31398
Copy link
Copy Markdown
Contributor Author

Also, a working notebook has been added @pacman100 🤗

Copy link
Copy Markdown
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @mayank31398 for adding MultiTask Prompt Tuning 🔥! Could you please resolve the conflicts and run make style and make quality to resolve the quality issues. Post that we can go ahead and merge this PR 🤗.

@BenjaminBossan
Copy link
Copy Markdown
Member

I just noticed that there isn't any addition to the docs for MPT. Could you please add some documentation there? Or are we fine with adding it in a separate PR?

Copy link
Copy Markdown
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @mayank31398, Thank you for iterating! I believe the PR can be merged once the conflicts are resolved as there is an example showing usage and related tests. Thank you for all the work and for your kind patience 🤗

@mayank31398
Copy link
Copy Markdown
Contributor Author

Hey @pacman100 let me add some comments in the code.
There is a some stuff that isn't clear.
I will also resolve the merge conflicts over the weekend

@mayank31398
Copy link
Copy Markdown
Contributor Author

@pacman100 I have addressed the suggestions.
Can you run the unittests?
Thanks

@mayank31398
Copy link
Copy Markdown
Contributor Author

@pacman100 @younesbelkada lets merge this?

@mayank31398
Copy link
Copy Markdown
Contributor Author

Hey, guys still waiting for an update :)

@mayank31398 mayank31398 requested a review from pacman100 August 23, 2023 20:35
Copy link
Copy Markdown
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your patience @mayank31398 and sorry for the delay , I left two tiny comments, apart from that I trust other maintainers review. Can you please revert the changes in the unrelated files?
Thanks!

@mayank31398
Copy link
Copy Markdown
Contributor Author

@younesbelkada addressed the comments

@BenjaminBossan
Copy link
Copy Markdown
Member

@mayank31398 Just to let you know: We'll probably soon merge #807 which adds a new folder structure to the tuners. If you want to, you can already adjust your code to use the new structure. Otherwise, it's also fine as is, then we'll do the refactoring later.

Copy link
Copy Markdown
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@mayank31398
Copy link
Copy Markdown
Contributor Author

@mayank31398 Just to let you know: We'll probably soon merge #807 which adds a new folder structure to the tuners. If you want to, you can already adjust your code to use the new structure. Otherwise, it's also fine as is, then we'll do the refactoring later.

I prefer leaving as is for now.
I am a little busy with some other stuff :)
Lets refactor later

Copy link
Copy Markdown
Contributor

@pacman100 pacman100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mayank31398 for iterating multiple times and for your patience, LGTM! 🔥🚀✨

@junzhang-zj
Copy link
Copy Markdown

@mayank31398 Why can't I locate the distillation process of the source prompt in the code? Am I missing something? 😭

@mayank31398
Copy link
Copy Markdown
Contributor Author

@junzhang-zj yeah, it doesn't have that.
Its not simple to add it to this repo I think.
This is a basic MPT pipeline where you pretrain a joing prompt on a bunch of task, use it for initialization of target prompt and then finetune it for the target prompt.

@junzhang-zj
Copy link
Copy Markdown

@mayank31398 Thank you for your answer, which addressed my concern about carelessness!

Guy-Bilitski pushed a commit to Guy-Bilitski/peft that referenced this pull request May 13, 2025
* mpt

* fix save

* fix save

* add jupyter notebook

* add jupyter notebook

* add jupyter notebook

* drop shuffling

* drop classify_dataset

* drop classify_dataset

* fix keys

* fix keys

* add comments

* use EXACT_SOURCE_TASK in the example

* formatting

* Fix dict index in embedding retrieval

* run style and quality

* run style and quality

* run style and quality

* style

* final fix

* style

* comment out failing tests

* fix generation tests

* fix style and save test

* all testcases

* fix import

* add license header

* reformat

* fix encoder-decoder models

* fix tests running multiple times

* fix paper name for IA3 and add MPT paper

* Trigger CI

* address the recommended changes

* reformat

* address suggestions

* address suggestions

* revert reformatting

* revert reformatting

---------

Co-authored-by: Alex-Brooks <Alex.Brooks@ibm.com>
cyyever pushed a commit to cyyever/peft that referenced this pull request Sep 4, 2025
* fixed rl training args

added steps argument and break to respect max training epochs
added more PPOConfig args to script args
removed llama tokenizer hacks
removed extra args in dataset
changed to llamatokenizer from autotokenizer
black + isort

* black and flake8

* style, quality, and switch back to AutoTokenizer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants