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

Training with float loss #228

Open
mrdrprofuroboros opened this issue Oct 15, 2024 · 2 comments
Open

Training with float loss #228

mrdrprofuroboros opened this issue Oct 15, 2024 · 2 comments

Comments

@mrdrprofuroboros
Copy link

I'm trying to run prompt training with an LLMasJudge float loss alike G-Eval: 0-0.2-0.4-0.6-0.8-1 values. And the Trainer crashes since it expects the eval values to be 0 or 1

ValueError: acc_score_list should only contain 0 and 1

I'm curious to learn if there are any constraints to it or if it is generally a bad idea to use such eval/loss function? Should it be contributed and just made working or shall we (users) be educated that this is a bad idea?

@liyin2015
Copy link
Member

@mrdrprofuroboros
Thanks for reporting the error. I have trained using LLM as judge for the loss, and the training was fine. Here are the code: https://github.com/SylphAI-Inc/AdalFlow/blob/main/use_cases/question_answering/bbh/word_sorting/train.py

acc_score_list in default should use [0, 0.5) to 0 and [0.5, 1] to 1. Can you share me some code snippet so that I can debug? You can share it to me privately either via my Discord or LinkedIn or a google doc via email [email protected]

It is the right way to use the loss with the eval function that has a value in range [0, 1]!

@mrdrprofuroboros
Copy link
Author

@liyin2015 it happens here during the moving batch sampling
https://github.com/SylphAI-Inc/AdalFlow/blob/main/adalflow/adalflow/optim/trainer/trainer.py#L1551

you see, though before we used to compare scores with 0.5 (https://github.com/SylphAI-Inc/AdalFlow/blob/main/adalflow/adalflow/optim/trainer/trainer.py#L1523)

above we strictly require 0 and 1 which is strange

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