It's not 50 lines of code if all the real work is done by importing a library... That's like saying, I can solve any problem in 2 lines of code. I'll publish a library for it first, then: import foo; foo.do_the_thing() Magic!
RLHF a LLM in <50 lines of Python
41–50 of 68 posts
Re: RLHF a LLM in <50 lines of Python
#42Re: RLHF a LLM in <50 lines of Python
#43Re: RLHF a LLM in <50 lines of Python
#44Say for simple conversation usecases (eg customer support for a specific product, interactive fiction, things like that without deep technical knowledge).
I was also wondering if it’s possible to do such RLHF for SD running locally.
Re: RLHF a LLM in <50 lines of Python
#45It's not 50 lines of code if all the real work is done by importing a library... That's like saying, I can solve any problem in 2 lines of code. I'll publish a library for it first, then: import foo; foo.do_the_thing() Magic!
did people say the same thing when assembly code got abstracted away?
Re: RLHF a LLM in <50 lines of Python
#46Theoretically the hard part is collecting the examples with rejections etc.
Re: RLHF a LLM in <50 lines of Python
#47Re: RLHF a LLM in <50 lines of Python
#48This is cool, but the data collection is the hard part, right?
https://datadreamer.dev/docs/latest/pages/get_started/quick_...
Re: RLHF a LLM in <50 lines of Python
#49How do you normally do DPO? Is that built in to PyTorch or something? Theoretically the hard part is collecting the examples with rejections etc.
Re: RLHF a LLM in <50 lines of Python
#50This is cool, but the data collection is the hard part, right?
Yes it is :), but the library is also a synthetic data generation library, so for example you can create the data for DPO fully synthetically, check out the self-rewarding LLMs example: https://datadreamer.dev/docs/latest/pages/get_started/quick_...
It would be nice. But I’ve seen too many nice ideas completely fall apart in practice to accept this without some justification. Even if there are papers on the topic, and those papers show that the models rank highly according to some eval metrics, the only metric that truly matters is "the user likes the model and it solves their problems."
By the way, on a separate topic, the 90/10 dataset split that you do in all of your examples turns out to be fraught with peril in practice. The issue is that the validation dataset quality turns out to be crucial, and randomly yeeting 10% of your data into the validation dataset without manual review is a recipe for problems.