Users are moving from text completion to chat completion.

The initial Completions API, introduced in June 2020, provided a freeform text prompt for interacting with OpenAI’s language models.

However, OpenAI soon realised that a more structured prompt interface could produce far better results.

Chat-based paradigms have proven to be particularly powerful, handling the vast majority of use cases, while offering higher flexibility and specificity.

Considering the image below, there has been a change to the Mode section of the OpenAI playground.

The insert mode has been removed while the Complete and Edit modes are marked as legacy.

The Chat Completions API’s structured interface and multi-turn conversation capabilities (e.g., system messages, function calling) enable developers to build varied conversational experiences and completions tasks.

Furthermore, this structure helps protect against prompt injection attacks, as user-provided content can be kept separated from instructions.

The Chat Completions API’s structured interface and multi-turn conversation capabilities (e.g., system messages, function calling) enable developers to build varied conversational experiences and completions tasks.

Furthermore, this structure helps protect against prompt injection attacks, as user-provided content can be kept separated from instructions.

OpenAI has expressed their intention to focus the majority of platform development efforts to chat completions.

Here are a few complete working code examples for Text Summarisation, Code Completion & Few-Shot Learning.

Text Summarisation Code

Text Summarisation Result:

Code Completion Code

Code Completion Result:

Few-Shot Learning Code

Few-Shot Learning Result:

The last update to Chat Markup Language (ChatML) was four months ago, and I would expect an enhancement soon.

It is clear that OpenAI wants to introduce structure to the format of input data. With the ChatML conversational format extending to generative AI tasks which have been very open in the past, like summarisation, code completion and few-shot contextual prompts.

This structure being imposed from a model level, will have to be absorbed by downstream implementations like autonomous agents, prompt chaining, etc.

As LLM-based generative AI apps can make use of multiple LLMs, the propagation of Chat Completion will surely have benefits, but will surely introduce complexity.

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

Subscribe to HumanFirst Blog

Get the latest posts delivered right to your inbox