Converstational AI Frameworks

4 GPT

GPT stands for Generative Pre-trained Transformer and as of January 2022  is in it’s third generation. GPT is an auto-regressive language model that uses deep learning to produce human-like text.  GPT-3 utilizes a total of 175 billion of parameters it is one of the largest publicly available language models available. Although the model is now owned by Microsoft there are a number of API interfaces to the model for a varieties of uses.

In general GTP-3 is advertised to be able to be “applied to virtually any task that involves understanding or generating natural language or code. We offer a spectrum of models with different levels of power suitable for different tasks, as well as the ability to fine-tune your own custom models. These models can be used for everything from content generation to semantic search and classification.”[1]

GPT-3 Key Features

In general there are 4 key features of GPT-3. These are

  • Completion
  • Classification
  • Search

According to the GPT-3 Documentation[2] there are number of API endpoints that can be accessed within each of these three key features.

Completion

Completion provides a simple but powerful interface whereby the user provides some textual input as a prompt, and the model will generate a text completion that attempts to match whatever context or pattern you gave it.

 

Generation – One of the most powerful yet simplest tasks you can accomplish with the API is generating new ideas or versions of input. You can ask for anything from story ideas, to business plans, to character descriptions and marketing slogans. In this example, we’ll use the API to create ideas for using virtual reality in fitness.

Conversation – The API is extremely adept at carrying on conversations with humans and even with itself. With just a few lines of instruction, we’ve seen the API perform as a customer service chatbot that intelligently answers questions without ever getting flustered or a wise-cracking conversation partner that makes jokes and puns. The key is to tell the API how it should behave and then provide a few examples.

Transformation – The API is a language model that is familiar with a variety of ways that words and characters can be used to express information. This ranges from natural language text to code and languages other than English. The API is also able to understand content on a level that allows it to summarize, convert and express it in different ways.

Summarization – The API is able to grasp the context of text and rephrase it in different ways. In this example, we create an explanation a child would understand from a longer, more sophisticated text passage. This illustrates that the API has a deep grasp of language.

Factual responses – The API has a lot of knowledge that it’s learned from the data that it was been trained on. It also has the ability to provide responses that sound very real but are in fact made up. There are two ways to limit the likelihood of the API making up an answer.

 

Classification 

Can be used to evaluate future data against a number of criteria such as  positive and negative. The Classifications endpoints provides the ability to leverage a labeled set of examples without fine-tuning and can be used for any text-to-label task. By avoiding fine-tuning, it eliminates the need for hyper-parameter tuning. The endpoint serves as an “autoML” solution that is easy to configure, and adapt to changing label schema. Up to 200 labeled examples or a pre-uploaded file can be provided at query time.

This diagram shows how GPT classification operates by gathering input, narrowing examples, randkinig examples then classifing text.

Search

The Search endpoint  allows you to do a semantic search over a set of documents. This means that you can provide a query, such as a natural language question or a statement, and the provided documents will be scored and ranked based on how semantically related they are to the input query.

GPT search digram. It shows how GPT-3 Gathers input, nrrows documents then ranks results.

 


  1. Source: https://beta.openai.com/docs/introduction/overview
  2. Source: https://beta.openai.com/docs/guides/completion/prompt-design

License

Icon for the Creative Commons Attribution 4.0 International License

A Pragmatic Guide to Conversational AI Copyright © 2022 by Ross Bigelow is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book