Back to blog
Articles
May 5, 2023
·
3 min read

Users of the ChatGPT API Will Need To Keep track Of Context

May 5, 2023
|
3 min read

Latest content

Customer Stories
4 min read

How Infobip Generated 220+ Knowledge Articles with Gen AI For Smarter Self-Service and Better NPS

Partnering with HumanFirst, Infobip generated over 220 knowledge articles, unlocked 30% of their agents' time, and improved containment by a projected 15%.
September 16, 2024
Articles
7 min read

Non-Technical AI Adoption: The Value of & Path Towards Workforce-Wide AI

Reviewing the state of employee experimentation and organizational adoption, and exploring the shifts in thinking, tooling, and training required for workforce-wide AI.
September 12, 2024
Articles
6 min read

AI for CIOs: From One-Off Use to Company-Wide Value

A maturity model for three stages of AI adoption, including strategies for company leaders to progress to the next stage.
September 12, 2024
Tutorials
4 min read

Building Prompts for Generators in Dialogflow CX

How to get started with generative features.
August 15, 2024
Announcements
3 min read

HumanFirst and Infobip Announce a Partnership to Equip Enterprise Teams with Data + Generative AI

With a one-click integration to Conversations, Infobip’s contact center solution, HumanFirst helps enterprise teams leverage LLMs to analyze 100% of their customer data.
August 8, 2024
Tutorials
4 min read

Two Field-Tested Prompts for CX Teams

Get deeper insights from unstructured customer data with generative AI.
August 7, 2024
Tutorials
5 min read

Optimizing RAG with Knowledge Base Maintenance

How to find gaps between knowledge base content and real user questions.
April 23, 2024
Tutorials
4 min read

Scaling Quality Assurance with HumanFirst and Google Cloud

How to use HumanFirst with Vertex AI to test, improve, and trust agent performance.
March 14, 2024
Customer Stories
4 min read

How Infobip Generated 220+ Knowledge Articles with Gen AI For Smarter Self-Service and Better NPS

Partnering with HumanFirst, Infobip generated over 220 knowledge articles, unlocked 30% of their agents' time, and improved containment by a projected 15%.
September 16, 2024
Articles
7 min read

Non-Technical AI Adoption: The Value of & Path Towards Workforce-Wide AI

Reviewing the state of employee experimentation and organizational adoption, and exploring the shifts in thinking, tooling, and training required for workforce-wide AI.
September 12, 2024
Articles
6 min read

AI for CIOs: From One-Off Use to Company-Wide Value

A maturity model for three stages of AI adoption, including strategies for company leaders to progress to the next stage.
September 12, 2024

Let your data drive.

Users of the ChatGPT API Will Need To Keep track Of Context

COBUS GREYLING
May 5, 2023
.
3 min read

ChatGPT is currently powered by gpt-3.5-turbo-0301, the most advanced OpenAI language model. Although OpenAI has made the API for this model accessible, the API does not automatically manage conversations contextually...

GPT-3.5-Turbo-0301 is effective at single-turn tasks, even without any conversational dialog turns.

Therefore, a ChatGPT implementation should be able to keep track of conversation context and logical connections in order to respond appropriately.

The ChatGPT models hold no memory of past requests, all relevant information must be supplied via the conversation.

The ChatML document submitted must include conversational history in order to maintain conversational context and manage dialog state. This allows the model to answer contextual questions by leveraging prior dialog turns.

OpenAI explicitly indicates that their models lack the capacity to retain memory of prior and subsequent queries. Therefore, all necessary information must be provided in the conversation.

Remember, if the conversation exceeds the model's token limit, it must be condensed. This can be done by creating a rolling log that stores the last n dialog turns for re-submission.

Below are a few practical examples. You can enter a sequence of messages and the model will return a text output, as seen below:

The Output:

Below is a different question relating to motor sport and the ChatML document submitted to the gpt-3.5-turbo-0301 model:

The correct response given to the last question:

Note, when a follow-up question is asked with no context provided in the ChatML document…as seen below:

The context is lost and the ChatGPT API states that fact.

What is the correct way to ask a follow-up question, providing the necessary contextual reference to the system?

The correct response is given:

Finally

OpenAI states that gpt-3.5-turbo-0301 does not pay strong attention to system messages, so extra focus is needed for instructions in a user message in addition to context management.

If the model's generated output is not satisfactory, it is necessary to try different approaches to improve it.

This could include making the instructions more clear, specifying the answer format, asking the model to go through the steps sequentially (chain-of-thought prompting), and even fine-tuning the base GPT-3 model (GPT-3.5-turbo models are not able to be fine-tuned).

I’m currently the Chief Evangelist @ HumanFirst. I explore and write about all things at the intersection of AI and language; ranging from LLMs, Chatbots, Voicebots, Development Frameworks, Data-Centric latent spaces and more.

Subscribe to HumanFirst Blog

Get the latest posts delivered right to your inbox