GithubHelp home page GithubHelp logo

DPO loss about alignment-handbook HOT 7 OPEN

huggingface avatar huggingface commented on May 15, 2024
DPO loss

from alignment-handbook.

Comments (7)

ChenDRAG avatar ChenDRAG commented on May 15, 2024

It seems that full finetuning has this problem, while lora doesn't. Could you share the yaml training configuration? Also how many GPUs are you using?

image

from alignment-handbook.

JiuhaiChen avatar JiuhaiChen commented on May 15, 2024

Thanks for your reply. I don't try the full model fine-tuning. For the lora, i only changed: gradient_accumulation_steps: 1, per_device_train_batch_size: 16, per_device_eval_batch_size: 4, save_strategy: "epoch". I am using the 8 A6000. Also, i am not sure if you observed the eval loss is increasing in the training.
image

from alignment-handbook.

ChenDRAG avatar ChenDRAG commented on May 15, 2024

Sorry, I did not encounter this problem. Do you use the official binary dataset? What is your base model? Though I don't think they matter that much.

from alignment-handbook.

JiuhaiChen avatar JiuhaiChen commented on May 15, 2024

Yeah, i agree eval loss does not matter. For the lora, how many cards you are using?

from alignment-handbook.

ChenDRAG avatar ChenDRAG commented on May 15, 2024

8 A40 cards. My new experiments also encounter this problem.
image

Difference between the two configurations
previous

bath size 4 accumulation 2 cards 8 lr 1e-7

new
batch size 8 accumulation 1 cards 8 lr 1e-4

I think the main change it I increase lr a lot, are you sure you use a lr=1e-7 in your experiments?

from alignment-handbook.

NicolasMejiaPetit avatar NicolasMejiaPetit commented on May 15, 2024

I’m currently training a lora across all mistral modules with the standard setting with the exception of no eval, and a single batch size on a 3090. My loss is hitting .29 and it’s only been training for 180 steps. (.4 epochs).

edit:
Epoch .52, 210 steps in, the loss is at .18 and rewards/accuracy is 1.0.

from alignment-handbook.

fblgit avatar fblgit commented on May 15, 2024

quite weird, i just trained the DPO and my loss is normal across epochs, pretty much similar to the results shared on hf model card.
how about rebase and try again ? definitively .29 or lower is because the model is seeing the right prediction token somehow.

from alignment-handbook.

Related Issues (20)

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.