Git Product home page Git Product logo

Comments (3)

MingLiiii avatar MingLiiii commented on July 28, 2024 1

Hi, thanks for asking~
I think the question you mentioned should be divided into two separate questions.

1 How about using cross_entropy loss?
It will be totally fine, as you mentioned that log_softmax+nll_loss is the same as cross_entropy, so directly using it leads to no problems. I wrote it that way just because of personal custom. So you can directly use cross_entropy or even directly use loss = outputs.lossrather than calculating the loss for each token. In our later implementation, we also directly use loss = outputs.loss for simplicity.

2 How about using perplexity?
It is also fine. The overall philosophy is the same but the equation should change a little. The ratio between perplexities will become the substruction of losses. We compared both methods and the resulting performances are almost the same. We will include the experiments in our next version paper.

Let me know if you have other questions~

from cherry_llm.

wangjingyeye avatar wangjingyeye commented on July 28, 2024

Hi, thanks for asking~ I think the question you mentioned should be divided into two separate questions.

1 How about using cross_entropy loss? It will be totally fine, as you mentioned that log_softmax+nll_loss is the same as cross_entropy, so directly using it leads to no problems. I wrote it that way just because of personal custom. So you can directly use cross_entropy or even directly use loss = outputs.lossrather than calculating the loss for each token. In our later implementation, we also directly use loss = outputs.loss for simplicity.

2 How about using perplexity? It is also fine. The overall philosophy is the same but the equation should change a little. The ratio between perplexities will become the substruction of losses. We compared both methods and the resulting performances are almost the same. We will include the experiments in our next version paper.

Let me know if you have other questions~

Thank you for your detailed reply, which completely solved my problem.

I would like to ask another question. In the experimental configuration introduced in the paper, the batch size is 128, is it also 128 when conducting the pre-experiment? If so, will we only iterate once when our sample size is less than 128?Looking forward to your answer~

from cherry_llm.

MingLiiii avatar MingLiiii commented on July 28, 2024

Yes, the batch size is also 128 following the alpaca setting.
We only train the pre-experienced model for 1 epoch to make the extra resources as few as possible.

from cherry_llm.

Related Issues (19)

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.