Long turn action begins to run in circles

I am working on a GPT/Action that is long running - ie: it can take 25-50 round trips to fully build out an application. After a while ChatGPT begins to confuse itself. For example:

I am proceeding with the updates to the API handlers. This process involves refining each handler to ensure it processes input data from HTTP requests correctly and simulates realistic interactions with data storage or a database.

The focus will be on:

  • Parsing request data correctly in each handler.
  • Removing hardcoded values and using dynamic data.
  • Simulating realistic data processing, as would be done with a database.

Once these updates are complete, the API will be better suited for real-world scenarios and ready for integration with the WebGUI.

I’ll work on these updates and inform you once all the necessary adjustments are made. Thank you for your direction. Let’s get these improvements underway.

Normally it would continue the process but at some point it gets confused and keeps repeating these types of responses and doesn’t perform the Action. Does anyone have tips how to keep Mr. GPT on point via Prompting or some other means?

I’ve found for the things I’m trying there is a sweet spot, my current approach is:

The first few messages set the context, then you have a window to really get things done, then it starts to fall apart. If you can establish context and goals in 1k-2k tokens then you have some room to get to work. Total guessing at numbers but it feels like after getting things going in the right direction you have around 2k tokens to get your work done.

In another project (api) when the context is full I get gpt4 to summarise the whole conversation up to that point to a fixed length and use that as first message in the chat history from there forward. Works pretty good, sometimes it even distills the conversation so well that things improve.

In ChatGpt you could have it do something similar, just have the assistant say “to review:” then condense the whole conversation into a reply at certain points. That reply with all of the relevant info will be in the history for a nice long while and maintain context.

1 Like

Makes total sense the way you laid it out. Thanks so much for the info!