Coder Social home page Coder Social logo

lpt's People

Contributors

xyltt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lpt's Issues

Tunable parameter calculation

First, great work! A new approad towards the prompt study. Your's study make me confirmed my experiments on P-Tuning v2.

I have some problem about parameter calculation.

self.proj_down = nn.Linear(config.hidden_size, config.proj_down_size)
self.intermediate_act_fn = nn.ReLU()
self.proj_up = nn.Linear(config.proj_down_size, config.num_prompt_tokens * config.hidden_size)

self.prompt_generator = PromptGeneratorWithNaivePromptGenerator(self.config)

PromptGeneratorWithNaivePromptGenerator(
  (proj_down): Linear(in_features=768, out_features=128, bias=True)
  (intermediate_act_fn): ReLU()
  (proj_up): Linear(in_features=128, out_features=3840, bias=True)
  (dropout): Dropout(p=0.1, inplace=False)
)

On your code, you use the same weight for all prompt generation, regardless of layers. Such should be much less.
On your paper, the tunable parameter is 792K vs 985K, compared with P-Tuning v2. In this case, the weight shall be different for each layer.
image

简单用中文说,从代码上看NPG可调的参数量,可能比论文中少,不知道是不是我看漏了或者算错了。按照论文中计算,在添加Prompt的每一层,Prompt都由不同的weight生成。(对比P-Tuning v2毕竟每层都加)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.