Hacker News new | past | comments | ask | show | jobs | submit login

ChatGPT feeds the context of the conversation back into itself. When it hits max tokens, it then summarizes the conversation to feed back into itself. This is one of the things where ChatGPT can start losing track of what it was talking about if that summary doesn't have key things in it or missummrizes the conversation.

For

    The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

    Human: Hello, who are you?
    AI: I am an AI created by OpenAI. How can I help you today?
    Human: I am fine.  Working hard.
It will then add in some text in line:

    The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

    Human: Hello, who are you?
    AI: I am an AI created by OpenAI. How can I help you today?
    Human: I am fine.  Working hard.
    AI: That's great to hear! Do you need any assistance with anything?
    Human: How many peks are in a bushel?
This is 93 tokens.

And then I get:

    The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

   Human: Hello, who are you?
   AI: I am an AI created by OpenAI. How can I help you today?
   Human: I am fine.  Working hard.
   AI: That's great to hear! Do you need any assistance with anything?
   Human: How many peks are in a bushel?
   AI: A bushel contains 8 US (or 32 UK) pecks. Is there anything else I can help you with?
Human:

And then...

    The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

    Human: Hello, who are you?
    AI: I am an AI created by OpenAI. How can I help you today?
    Human: I am fine.  Working hard.
    AI: That's great to hear! Do you need any assistance with anything?
    Human: How many peks are in a bushel?
    AI: A bushel contains 8 US (or 32 UK) pecks. Is there anything else I can help you with?
    Human: What produces does that measure?
    AI: A bushel is a dry measure used for measuring fruits, vegetables, and other grain products.
    Human: 
You will see each time it is feeding in the entire chat history as part of the prompt. That is how you maintain the context of the chat.

To do this as part of a command line interface, yep - it would need something like .gpthistory which gets fed in to each message... though this eats tokens.

You can see some of this in the playground if you look at the 'view code' button at the top.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: