Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prompt Tuning #595

Merged
merged 15 commits into from
Nov 19, 2023
Merged

Conversation

lenglaender
Copy link
Member

Depends on: #591

This PR adds Prompt Tuning (https://aclanthology.org/2021.emnlp-main.243/)

Currently the Prompt Tuning Layer was created and the BERT model has been adapted

Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

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

did a first review pass, looks good overall, haven't checked all details though

src/adapters/methods/prompt_tuning.py Outdated Show resolved Hide resolved
src/adapters/methods/prompt_tuning.py Show resolved Hide resolved
src/adapters/configuration/model_adapters_config.py Outdated Show resolved Hide resolved
src/adapters/composition.py Outdated Show resolved Hide resolved
src/adapters/composition.py Outdated Show resolved Hide resolved
src/adapters/model_mixin.py Show resolved Hide resolved
src/adapters/model_mixin.py Show resolved Hide resolved
@calpt
Copy link
Member

calpt commented Nov 7, 2023

Please also add row in table on main readme

@raphaelreimann
Copy link

Hey, love the integration of prompt tuning! I would love to use it when it is stable, do you know when this will be merged? 🙂 @lenglaender @calpt

@lenglaender
Copy link
Member Author

@raphaelreimann We're currently fixing the last few tests that aren't running. For every model except CLIP, EncoderDecoder, GPT-2, GPT-J, LLaMA and T5 the implementation is already working.

As soon as this PR and the sync PR (#602) are merged, we will release the new Adapters library (#584).

@lenglaender lenglaender changed the base branch from adapters to main November 14, 2023 20:54
@lenglaender lenglaender marked this pull request as ready for review November 14, 2023 23:29
@lenglaender lenglaender changed the title WIP: Add Prompt Tuning Add Prompt Tuning Nov 14, 2023
@raphaelreimann
Copy link

@lenglaender Thank you for the update on this, great work!

Copy link
Member

@hSterz hSterz left a comment

Choose a reason for hiding this comment

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

Looks good to me just a few minor comments

src/adapters/model_mixin.py Show resolved Hide resolved
tests_adapters/methods/test_prompt_tuning.py Outdated Show resolved Hide resolved
@lenglaender lenglaender merged commit 84f4f04 into adapter-hub:main Nov 19, 2023
5 checks passed
@lenglaender
Copy link
Member Author

For the subsequent PR, which will extend Prompt Tuning with composition support and which will add support for the not yet supported models, we should think about realising the change of the attention mask for prefix tuning within the function prefix_attention_mask.

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.

4 participants