Lurker News
I've been playing around with https://github.com/zphang/minimal-llama/ and https://github.com/tloen/alpaca-lora/blob/main/finetune.py, and wanted to create a simple UI where you can just paste text, tweak the parameters, and finetune the model quickly using a modern GPU.

To prepare the data, simply separate your text with two blank lines.
There's an inference tab, so you can test how the tuned model behaves.
This is my first foray into the world of LLM finetuning, Python, Torch, Transformers, LoRA, PEFT, and Gradio.
Enjoy!

Comments (98) 20 threads

Show all comments

Showing thread 2 of 20

spunker5403 replies#
Is there a consensus yet on when you should fine-tune vs when you should use prompt engineering?

It seems not that hard to include in your prompt “here is some examples, please write like this and follow the style set here”. While that may make every completion request more expensive (more tokens), it also seems like fine tuning these models can also be quite expensive.
I’m curious if there are other trade offs besides cost— maybe quality achieved is better with fine tuning? Very interested to see how it all plays out. On the one hand a massive model like gpt4 can probably be prompted to match any style quite well, albeit costly, vs fine tuning a cheap model may get exactly what you want.

wazer51 reply#
Even GPT-4 can only handle a few pages of text as prompt for examples. In most cases you'd want to fine tune.
spunker5401 reply#
I guess I’m just curious what the killer use-cases are for fine tuning. For example it seems like overkill to fine tune a Shakespeare model, because you can just say “write like Shakespeare” and it already knows what you want.
ttoinou1 reply#
I guess you'd want to fine tune for content that wasn't already parsed before
underlines1 reply#
to my understanding there are 4 levels to add information:

1. train a model
2. fine tune a model
3. create embeddings for a model
4. use few shot prompt examples at inference time
These have decreasing resource need, but also decreasing quality.
For example, the GPT-3 API (not yet the GPT-4 API) has a functionality to send it your own embeddings, for example of your own source code documentation. Then you can query GPT-3 and it "knows" your source code doc and answers specifically with that in mind.

Continue this thread — 1 reply

stu2b50#
Empirically, while the ability for LLMs to zero shot learn is impressive, it’s significantly worse than fine tuning. An obvious example is LLaMA itself, from which it’s quite hard to get useful instructional behavior out, and requires a significant amount of prompt engineering, and is still brittle at that.

Fine tuning it in just 52k examples (alpaca) makes a night and day difference in usability for instruction following.

lxe#
If there's context limitations (your document cant' fit in the context, or your session quickly loses the context), fine-tuning is a great option.