thunlp / OpenPrompt

An Open-Source Framework for Prompt-Learning.
https://thunlp.github.io/OpenPrompt/
Apache License 2.0
4.34k stars 449 forks source link

a question about soft_template #247

Closed ghbtest closed 1 year ago

ghbtest commented 1 year ago

in the Doc it says, "if you use {'soft'}, the token will be randomly initialized. If you add some textual tokens at the value position, the soft token(s) will be initialized by these tokens.", then for most soft_template examples in the repo, e.g. scripts/SuperGLUE/CB/soft_template.txt scripts/SuperGLUE/RTE/soft_template.txt scripts/SuperGLUE/BoolQ/soft_template.txt no "soft" marker is seen. so how exactly should a soft_template be defined?

yulinchen99 commented 1 year ago

Hi, sorry for the confusion. You are correct, the three template files you mentioned are actually not soft templates. As for how to define a soft template, you can refer to scripts/FewGLUE/RTE/soft_manual_template.txt scripts/TextClassification/agnews/mixed_template.txt as examples for randomly initialized soft tokens and soft tokens initialized by textual tokens.