Live data from Hacker News

How to Finetune GPT-Like Large Language Models on a Custom Dataset

lightning.ai

41–50 of 126 posts

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#41
post #37

Earlier quoted context omitted.

MS lawyers have a good track record at sending out those scary cease&desist letters

I don't think that works. LLM-generated contents are not copyrightable.

Breach of contract for violating the TOS agreed to when signinf uo for the service doesn’t depend on copyright.

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#42

Can someone explain why I'd want to use fine-tuning instead of a vector database (or some other way of storing data/context)?

Wouldn't a vector database just get you nearest-neighbors on the embeddings? How would that answer a generative or extractive question? I can see it might get you sentiment, but would it help with "tell me all the places that are mentioned in this review"?

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#43

Can someone explain why I'd want to use fine-tuning instead of a vector database (or some other way of storing data/context)?

Assuming you would want to fine-tune over a codebase or set of documents, I would argue vector databases and fine-tuning are completely different tools.

I would strongly recommend against fine-tuning over a set of documents as this is a very lossy information system retrieval system. LLMs are not well suited for information retrieval like databases and search engines.

The applications of fine-tuning that we are seeing have a lot of success is making completion models like LLaMA or original GPT3 become prompt-able. In essence, prompt-tuning or instruction-tuning. That is, giving it the ability to respond with a user prompt, llm output chat interface.

Vector databases, for now, are a great way to store mappings of embeddings of documents with the documents themselves for relevant-document information retrieval.

I would highly recommend skimming this RLHF paper for how demonstration data was used to make a model prompt-able [1]. Keep in mind RLHF is another concept all together and we might be seeing a revolution where it might become optional (thanks to LIMA)!

1: https://huyenchip.com/2023/05/02/rlhf.html

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#44

Earlier quoted context omitted.

And yet they trained theirs on commercial content on the internet. If that’s legal I doubt their argument holds up in court right?

They trained on publicly-available (no signup with TOS agreement) data, on the theory that training is fair use. You signed up and agreed to their TOS to use GPT-4. The legal situations are not similar. OTOH, lots of people are openly using GPT-4 in one way or another to develop models, though they might generally be at arm’s length from people intending to sell services.

> They trained on publicly-available (no signup with TOS agreement) data, on the theory that training is fair use.

They openly state they used thousands of books from a pirate site as a training source. Go look up the datasets listed in the GPT-3 paper.

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#45

Earlier quoted context omitted.

And yet they trained theirs on commercial content on the internet. If that’s legal I doubt their argument holds up in court right?

They trained on publicly-available (no signup with TOS agreement) data, on the theory that training is fair use. You signed up and agreed to their TOS to use GPT-4. The legal situations are not similar. OTOH, lots of people are openly using GPT-4 in one way or another to develop models, though they might generally be at arm’s length from people intending to sell services.

So set up a shell company that uses GPT4 to make public domain examples of what RLHF data would look like, and then the parent company takes that data afterwards since it's public domain. Shell company didn't break TOS.

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#46

When is fine tuning worth it, rather than just prompt engineering?

If you want to teach it eg. all of the text in your private training manuals and internal documentation, which wouldn't fit in the input token size.

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#47

When is fine tuning worth it, rather than just prompt engineering?

I think these are two very separate concepts.

What we are mostly seeing when it comes to fine-tuning is making a model promptable. Models like LLaMA or the original GPT3 weren't promptable. They were fine-tuned with demonstration data that looks like a prompt input, prompt output.

See below: { "instruction": "What would be the output of the following JavaScript snippet?", "input": "let area = 6 * 5;\nlet radius = area / 3.14;", "output": "The output of the JavaScript snippet is the radius, which is 1.91." }, [1]

Prompt engineering is really just carefully designing what inputs and outputs on a prompt-ready model work best.

I highly recommend skimming this RLHF article and looking for the parts where it talks about demonstration data [2]

1: https://github.com/sahil280114/codealpaca/blob/master/data/c...

2: https://huyenchip.com/2023/05/02/rlhf.html

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#48

Have a question to the Generative AI experts here. So, I can use smthg like GPT-4 to label data and then use that as a train set for my own LLM, right? EDIT: adding this from OpenAI Restriction TOS: "(iii) use output from the Services to develop models that compete with OpenAI;"

> I can use smthg like GPT-4 to label data and then use that as a train set for my own LLM, right? Yes, almost all improved LLama models are tuned exactly that way (trained on examples of questions and answers from say GPT 4). If OpenAI stole copyrighted works to train their models it is morally fair game to do the same to them regardless of their TOS. It's not like they can prove it anyway. Plus there's the other po…

I'm a lawyer so one should never break the law.

Nonethless, I can observe and predict that non-consensual "open sourcing" of these models would likely end up probably the best and safest way to do all of this stuff.

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#49
post #26

Can someone explain why I'd want to use fine-tuning instead of a vector database (or some other way of storing data/context)?

I've been playing with using documents as OpenAI embeddings for the past weeks and, at least for my use case, the results are meh. It seems sometimes just using context is not enough. My next step is to play with fine tunning, but I have no results to report yet.

have you tried other models to generate embeddings? I am going to that direction too to create an additional layer of helpers for search. Also, thinking if the document is not too big, it might fit into the initial context with the prompt

Re: How to Finetune GPT-Like Large Language Models on a Custom Dataset

#50
post #19

How does this compare to fine tuning something like BERT?

I would say similar since the building block is the transformer for both. In this blog post, the fine-tuning strategy used is Adapter. It basically adds a learnable layer to the Transformer block.
Post reply on HN