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

About task_id #2

Open
rattlesnakey opened this issue Jul 12, 2023 · 1 comment
Open

About task_id #2

rattlesnakey opened this issue Jul 12, 2023 · 1 comment

Comments

@rattlesnakey
Copy link

In the pre-train stage, the sample should use corresponding task router (using task_id param) to get fused prompt embedding, but in the code, I found task_id set to 0 always in https://github.com/Hzfinfdu/MPMP/blob/master/Deep/modeling_bert.py#L548, is that any thing wrong with it ?

by the way, in the inference stage, what task_id number should the new tasks (e.g. unseen task category) use ?

@Hzfinfdu
Copy link
Owner

Hi, our model implements an inform_model function to get task_id from the batch in this part of our code.
The current task_id is included in the batch here.

In the inference stage, or we say downstream adapting stage, the model re-initialize an only router here(i.e. with only 1 task) and always set the task_id to 0 (and that is why in modeling_bert the task_id is by default 0 so that we do not need to explicitly operate the task_id). Optimizing this router (or along with the prompts) yields a downstream composition of the pretrained prompts.
btw, if we have some correlation prior in between the downstream task and the pretraining tasks, we can also initialize the router with a pretrained router. In this case, the task_id is also 0.

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

No branches or pull requests

2 participants