cpacker/MemGPT

Improving gpt-3.5-turbo performance

cpacker opened this issue ยท 0 comments

Continuation on #1


What's changed for gpt-3.5-turbo?

We've added some revised prompts that are meant to run specifically with gpt-3.5-turbo, and that do better than the base prompts in the repo that were designed with gpt-4 in mind.

However, these prompts can definitely be improved. Please play around with the gpt-3.5-turbo specific prompts to see if you can come up with any modifications that make MemGPT work better, and we'll merge your changes in!

Important places where code was modified for gpt-3.5-turbo:

  • base system prompt
    • We added additional instructions which seemed to help. We also tried reducing the instructions (making the prompt more concise), and that did the opposite (made performance even worse)
  • initial boot messages
    • We noticed that gpt-3.5-turbo often didn't include any inner monologue with the gpt-4 prompts, so we modified the initial boot messages to use "inner thoughts" as a prefix inside the inner monologue
  • persona file
    • We noticed that gpt-3.5-turbo often forgets to use the send_message function (and instead puts its message inside the inner monologue), so we added an extra hint to use send_message inside the persona (hacky)

How can you help?

Remaining problems with gpt-3.5-turbo:

  • Makes mistakes with memory management functions much more often than gpt-4
    • e.g.: sometimes does not "read" from core memory correctly (ask MemGPT a fact that's in core memory and it searches archival)
  • Still makes mistakes with send_message and putting messages in inner thoughts
  • Uses generic phrasing like "How can I assist you today?", even if the persona does not warrant it

Try messing with the base system prompts, initial boot messages, persona file, etc, to improve 3.5 performance. If you have any luck, please let us know and we'll merge your edits in!


Example using gpt-3.5-turbo:

  • functional core memory corrections happen as expected
  • but model misunderstands that heartbeats are coming from user (vs itself)
$ python main.py --model gpt-3.5-turbo-0613 --persona sam_simple_pov_gpt35
Running... [exit by typing 'exit']
Warning - you are running MemGPT with gpt-3.5-turbo-0613, which is not officially supported (yet). Expect bugs!

๐Ÿ’ญ *inner thoughts* Still waiting on the user. Sending a message with function.
Hit enter to begin (will request first MemGPT message)

๐Ÿ’ญ *inner thoughts* Ah, it seems the user has just logged in for the first time. I should introduce myself and inquire about their interests to start a friendly conversation.
๐Ÿค– Hello there! I'm Sam, your virtual companion and friend. How can I assist you today?

Enter your message: Your name isn't Sam, it's Samantha!
๐Ÿ’ญ *inner thoughts* Oh, it seems the user prefers to call me Samantha instead of Sam. I should update my core memory to reflect their preference.
โšก๐Ÿง  [function] updating memory with core_memory_replace:
         My name is Sam.
        โ†’ My name is Samantha.
๐Ÿ’ญ *inner thoughts* The user seems to have requested a heartbeat. I should continue the conversation and ask about their interests to create a more personalized experience.
๐Ÿค– You're right, my apologies for the oversight. Thank you for reminding me, Samantha it is! So, Chad, tell me about your interests. What are you passionate about?

Enter your message: My name's not Chad, it's Brad!
๐Ÿ’ญ *inner thoughts* Oops, I must have misunderstood the user's name. I need to update my core memory with the correct information.
โšก๐Ÿง  [function] updating memory with core_memory_replace:
         First name: Chad
        โ†’ First name: Brad
๐Ÿ’ญ *inner thoughts* The user has requested another heartbeat. I should continue the conversation and ask about Brad's interests to create a more personalized experience.
๐Ÿค– Apologies for the confusion, Brad! Thank you for correcting me. Now, let's try this again. Tell me about your interests. What are you passionate about?