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

Does this version of few-shot learning make sense? : LocalLLaMA #551

Open
1 task
irthomasthomas opened this issue Feb 18, 2024 · 0 comments
Open
1 task
Labels
AI-Agents Autonomous AI agents using LLMs AI-Chatbots Topics related to advanced chatbot platforms integrating multiple AI models Algorithms Sorting, Learning or Classifying. All algorithms go here. finetuning Tools for finetuning of LLMs e.g. SFT or RLHF in-context-learning Examples of few-shot prompts for in-context learning. llm Large Language Models llm-experiments experiments with large language models

Comments

@irthomasthomas
Copy link
Owner

TITLE: Does this version of few-shot learning make sense? : LocalLLaMA

DESCRIPTION: I know I'm supposed to give examples when teaching an LLM a new task. I've always seen it done in the first prompt: Help me perform sentiment analysis on some reviews. Here are a few examples: "This movie rocks!" - Positive "This movie sucks!" - Negative "The movie was meh" - Neutral My question is if there are cases where the examples work better if they are split as separate messages, alternating between roles: [{'role':'system', 'content':'Help me perform sentiment analysis on some reviews'}, {'role':'user', 'content':'This movie rocks!'}, {'role':'assistant', 'content':'Positive'}, {'role':'user', 'content':'This movie sucks!'}, {'role':'assistant', 'content':'Negative'}, {'role':'user', 'content':'This movie is meh'}, {'role':'assistant', 'content':'Neutral'}] Or are those the same thing? Or are there case where one is better than the other? 5 comments sharesavehidereport all 5 comments sorted by: best

Want to add to the discussion? Post a comment!

[–]phree_radical 3 points 21 hours ago The second one is few-shot, as it follows a pattern, and targets in-context learning which is something LLMs learn in pre-training. The first, on the other hand, relies on the instruct training, and assumes the fine-tuning taught it well how to fish examples out of instructions. It may leverage some of the in-context learning ability to some extent, while also working against it. When following a pattern like your second example, you will find you can remove the instructions. If you leave them in or change them, you can observe that the pattern-following overrides the instructions. This might seem unreasonable, but it irks me that OpenAI pushed the terminology to say "few-shot" when you provide examples in instructions, as it's not taking advantage of in-context task learning, it's relying on facets of the fine-tuned task permalinkembedsavereportreply

[–]Revolutionary_Ad6574[S] 1 point 21 hours ago Thank you for the detailed response, but could you give me the ELI5 version? permalinkembedsaveparentreportreply

[–]phree_radical 2 points 21 hours ago First one is following instructions, which might not be strong. The chatbot might not know how to follow your instruction with examples. I don't think people should call it few-shot. Second one follows a pattern, which is strong. So strong that there's really no point in putting instructions (like your system prompt) as the strong pattern-following will just overpower them permalinkembedsaveparentreportreply

[–]Revolutionary_Ad6574[S] 1 point 21 hours ago So whenever I have time to set it up it's always better to use the second one? permalinkembedsaveparentreportreply

[–]phree_radical 2 points 21 hours ago* I'm pretty sure, yeah. If you want an LLM to follow examples, use the second pattern An exception might be if there's something about the examples you don't want to follow. Like placeholder text or something permalinkembedsaveparentreportreply

URL: https://old.reddit.com/r/LocalLLaMA/comments/1at0zat/does_this_version_of_fewshot_learning_make_sense/

Suggested labels

{'label-name': 'instruction-based-learning', 'label-description': 'Discussion on teaching AI systems through following instructions and examples sequentially.', 'gh-repo': 'content-labels', 'confidence': 67.09}

@irthomasthomas irthomasthomas added AI-Agents Autonomous AI agents using LLMs AI-Chatbots Topics related to advanced chatbot platforms integrating multiple AI models Algorithms Sorting, Learning or Classifying. All algorithms go here. in-context-learning Examples of few-shot prompts for in-context learning. llm Large Language Models llm-experiments experiments with large language models New-Label Choose this option if the existing labels are insufficient to describe the content accurately finetuning Tools for finetuning of LLMs e.g. SFT or RLHF and removed New-Label Choose this option if the existing labels are insufficient to describe the content accurately labels Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI-Agents Autonomous AI agents using LLMs AI-Chatbots Topics related to advanced chatbot platforms integrating multiple AI models Algorithms Sorting, Learning or Classifying. All algorithms go here. finetuning Tools for finetuning of LLMs e.g. SFT or RLHF in-context-learning Examples of few-shot prompts for in-context learning. llm Large Language Models llm-experiments experiments with large language models
Projects
None yet
Development

No branches or pull requests

1 participant