Skip to content

Improve Alpaca Default Repeat Penalty: Better Match Alpaca.cpp Experience #1107

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Apr 22, 2023

Conversation

HanClinto
Copy link
Collaborator

When using Alpaca, at first I wasn't sure why llama.cpp was giving much poorer results than I received with alpaca.cpp. After digging in a bit, I discovered that the default repeat_penalty of 1.0 in llama.cpp results in very poor behavior, and even just increasing this a little bit to 1.1 results in MUCH cleaner default behavior.

Examples:
repeat_penalty = 1.1

sampling: temp = 0.200000, top_k = 10000, top_p = 0.950000, repeat_last_n = 64, repeat_penalty = 1.100000
generate: n_ctx = 2048, n_batch = 256, n_predict = -1, n_keep = 21


== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to LLaMa.
 - If you want to submit another line, end your input in '\'.

 Below is an instruction that describes a task. Write a response that appropriately completes the request.
> What are some good ice breaker questions to use with middle schoolers?
- What's your favorite subject in school and why?
- If you could be any animal, what would it be and why?
- If you had a magic wand, what three things would you change about the world?
- If you were given $100 to spend on anything you wanted, what would you buy?
- What's your favorite book or movie?
- If you could have any superpower, what would it be and why?
- If you had a time machine, where in the past or future would you go?
>

repeat_penalty = 1.0

sampling: temp = 0.200000, top_k = 10000, top_p = 0.950000, repeat_last_n = 64, repeat_penalty = 1.000000
generate: n_ctx = 2048, n_batch = 256, n_predict = -1, n_keep = 21


== Running in interactive mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to LLaMa.
 - If you want to submit another line, end your input in '\'.

 Below is an instruction that describes a task. Write a response that appropriately completes the request.
> What are some good ice breaker questions to use with middle schoolers?
- What is your favorite subject in school?
- What is your favorite book?
- What is your favorite movie?
- What is your favorite food?
- What is your favorite hobby?
- What is your favorite sport?
- What is your favorite song?
- What is your favorite TV show?
- What is your favorite game?
- What is your favorite toy?
- What is your favorite season?
- What is your favorite animal?
- What is your favorite color?
- What is your favorite sport team?
- What is your favorite vacation spot?
- What is your favorite dessert?
- What is your favorite board game?
- What is your favorite video game?
- What is your favorite TV show character?
- What is your favorite movie character?
- What is your favorite book character?
- What is your favorite cartoon character?
- What is your favorite superhero?
- What is your favorite supervillain?
- What is your favorite superhero movie?
- What is your favorite superhero TV show?
- What is your favorite superhero video game?
- What is your favorite superhero comic book?
- What is your favorite superhero movie character?
- What is your favorite superhero TV show character?
- What is your favorite superhero video game character?
- What is your favorite superhero comic book character?
- What is your favorite superhero movie villain?
- What is your favorite superhero TV show villain?
- What is your favorite superhero video game villain?
- What is your favorite superhero comic book villain?
- What is your favorite superhero movie hero?
- What is your favorite superhero TV show hero?
- What is your favorite superhero video game hero?
- What is your favorite superhero comic book hero?
- What is your favorite superhero movie sidekick?
- What is your favorite superhero TV show sidekick?
- What is your favorite superhero video game sidekick?
- What is your favorite superhero comic book sidekick?
- What is your favorite superhero movie power?
- What is your favorite superhero TV show power?
- What is your favorite superhero video game power?
- What is your favorite superhero comic book power?
- What is your favorite superhero movie villain power?
- What is your favorite superhero TV show villain power?
- What is your favorite superhero video game villain power?
- What is your favorite superhero comic book villain power?
- What is your favorite superhero movie superpower?
- What is your favorite superhero TV show superpower?
- What is your favorite superhero video game superpower?
- What is your favorite superhero comic book superpower?
- What is your favorite superhero movie supervillain power?
- What is your favorite superhero TV show supervillain power?
- What is your favorite superhero video game supervillain power?
- What is your favorite super^C

Finally had to kill it at this point, because it wasn't stopping.

I've tinkered around with other settings like temperature or more aggressive repeat penalties, but I think that minimal changes are better at this point. A value of 1.1 is nice and gentle and will provide a better default "out of the box" / first-impression experience for users who are wanting to get up and running with this quickly.

@HanClinto HanClinto changed the title Increase Alpaca default repeat penalty Improve Alpaca Default Repeat Penalty: Better Match Alpaca.cpp Experience Apr 21, 2023
@HanClinto HanClinto force-pushed the increase_alpaca_repeat_penalty branch from fb4bc5b to a9227f3 Compare April 22, 2023 00:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants