Back to blog
Articles
May 8, 2023
·
3 MIN READ

Chat Markup Language (ChatML) Is Important For A Number Of Reasons

May 8, 2023
|
3 MIN READ

Latest content

Customer Stories
4min read

Lightspeed Uses HumanFirst for In-House AI Enablement

Meet Caroline, an analyst-turned-AI-expert who replaced manual QA, saved countless managerial hours, and built new solutions for customer support.
December 10, 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
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
Customer Stories
4min read

Lightspeed Uses HumanFirst for In-House AI Enablement

Meet Caroline, an analyst-turned-AI-expert who replaced manual QA, saved countless managerial hours, and built new solutions for customer support.
December 10, 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

Let your data drive.

Chat Markup Language (ChatML) Is Important For A Number Of Reasons

COBUS GREYLING
May 8, 2023
.
3 MIN READ

Here I will discuss why ChatML, introduced alongside OpenAI's ChatGPT and Whisper APIs on 1 March 2023, is an important development that should not be overlooked.

A short Recap

The OpenAI announcement focused on several key aspects, including a dramatic decrease in the price of the hosted API, ChatGPT, which has been reduced by 90% since December 2022.

Additionally, the APIs hosted on Azure are expected to have more granular management and regional and geographic availability zones, providing further value.

The Whisper and ChatGPT APIs also make implementation and experimentation easier, and allow voice data to be included with text data.

ASR vendors must be feeling the pressure to stand out, and this can be achieved through superior customer service, fine-tuning, and support for minority languages.

Finally, OpenAI is allowing users to access a specific model version and update when needed, providing greater stability for production implementations, demonstrating the continuing maturation of the LLM environment.

Back to Chat Markup Langauge (ChatML)


The introduction of ChatML is highly significant and important due to its ability to protect against prompt injection attacks, to some degree at lest.

It segregates conversations into layers or roles, such as System, assistant, and user.

This is just version zero of the language, and more developments are expected.

Currently, the payload accommodated for in ChatML is only text, but OpenAI is planning on introducing other data types.

Users can still use the unsafe raw string format, but this approach is much more susceptible for injections. OpenAI is in a strong position to guide and manage the LLM landscape responsibly, setting the standard for creating applications.

ChatML makes explicit to the model the source of each piece of text, and particularly shows the boundary between human and AI text.
This gives an opportunity to mitigate and eventually solve injections, as the model can tell which instructions come from the developer, the user, or its own input.
~ OpenAI

ChatML Example Code

Below is a ChatML example JSON file with the roles defined of system, user & assistant.

And the working Python code snippet:

With the output below, notice the role which is defined, the model detail which is gpt-3.5-turbo-0301 and other detail.

In Closing

Creating a conversational interface based on Large Langauge Models (LLMs) presents a challenge due to the difficulty of sequencing prompt nodes into chains.

This is complicated by the unstructured nature of input, often in the form of natural language or conversation, making it difficult to manage the edges between nodes. ChatML can provide a standard target for data transformation and submission to a chain, thereby alleviating this issue.

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