Getting started with Azure OpenAI GPT Modules and Azure OpenAI

Azure OpenAI

OpenAI has developed a series of cutting-edge natural language processing models called Generative Pre-trained Transformers (GPT).

The Transformer architecture, a deep learning architecture that has demonstrated remarkable efficacy in a range of language-related tasks, serves as the foundation for these models.

Important characteristics

  • Pre-training: A vast variety of text data from the internet is used to pre-train GPT models. The models learn the fundamental linguistic patterns and structures with the aid of this pre-training.
  • Unsupervised Learning: GPT models acquire their knowledge from the input data without the need for task-specific labels since they are trained in an unsupervised fashion. They can thus effectively generalize to a variety of language tasks.
  • Transformer Architecture: The Transformer architecture, first presented in the "Attention is All You Need" paper by Vaswani et al., is used by GPT models. The Transformer architecture, which is now commonplace in natural language processing, enables the models to capture long-range dependencies in text.

GPT models

Azure GPT models

GPT-4 and  GPT-4 Turbo (Preview)

Compared to OpenAI's earlier models, GPT-4 is more accurate at solving challenging problems. Similar to GPT-3.5 Turbo, GPT-4 is well suited for conventional completion tasks and is chat-optimized. To use GPT-4, use the Chat Completions API.

  • GPT-4 
  • GPTT-4-32k
  • GPT-4-vision
  • GPT-3.5

Natural language or code can be understood and produced by GPT-3.5 models. The GPT-3.5 Turbo is the most capable and economical model in the GPT-3.5 family; it is well-suited for chat and can also be used for more conventional completion tasks. You can use GPT-3.5 Turbo with the Chat Completions API. Similar features as text-davinci-003 are available in GPT-3.5 Turbo Instruct when the Completions API is used rather than the Chat Completions API.

  • Gpt-35-instructor
  • Gpt-35-turbo
  • Gpt-35-turbo-16k

Getting started with Azure OpenAI Studio

Azure OpenAI Studio provides access to model management, deployment, experimentation, customization, and learning resources.

After creating a resource, you can access the Azure OpenAI Studio via the Azure portal or by logging in with your Azure OpenAI resource instance at https://oai.azure.com. Choose the relevant directory, Azure subscription, and Azure OpenAI resource during the sign-in process.

Azure OpenAI Studio

call-to-action button to launch your first model will appear at the top of the screen when you first launch Azure OpenAI Studio. By choosing the "Create new deployment" option, you can access the Deployments page and begin experimenting with a base model.

Create new deployment

Selecting and deploying a base model is the first step towards starting to build with Azure OpenAI. Microsoft offers base models as well as the ability to make personalized base models. The current base models are covered in this module.

Azure OpenAI offers multiple model types

The most recent generation of generative pre-trained (GPT) models, known as GPT-4 models, are capable of producing code completions and natural language responses in response to prompts in natural language.

Based on natural language prompts, GPT 3.5 models are able to produce code completions and natural language. Specifically, GPT-35-turbo models function well in the majority of generative AI scenarios and are tailored for chat-based interactions.

Text can be converted into numerical vectors using embedding models, which are helpful in language analytics applications like comparing text sources for similarities. and Dall-E

Azure OpenAI multiple model

Use Azure OpenAI Studio for deployment

By choosing a model name from the menu on the Deployments page of Azure OpenAI Studio, you can create a new deployment.

The models page's list is where the accessible base models are found.

Deploy Model

Prompt engineering

The OpenAI GPT-3, GPT-3.5, and GPT-4 models are prompt-based. In models that are prompt-based, the user interacts with the model by typing a text prompt, and the model provides a text completion in response. The input text is continued by the model in this completion.

These models are very strong, but they also respond very strongly to prompts in terms of behavior. Because of this, being able to construct quickly is a crucial ability.

Timely construction can be challenging. In actuality, the prompt sets the model weights in order to accomplish the intended task, but creating an effective prompt is more of an art than a science and frequently calls for intuition and experience. This article's objective is to assist you in beginning this process of learning.

It makes an effort to capture broad ideas and trends that are relevant to all GPT models. It's crucial to realize that every model behaves differently, so the lessons might not apply to every model.

prompt elements

Prompt elements

Even though there is no distinction between the various components of the prompt when using the Completion API, it can still be helpful for learning and discussion to pinpoint the fundamental components of the prompt. Different portions of the prompt are sent to the Chat Completion API in the form of an array of dictionaries with the system, user, and assistant roles associated with them. This guide does not offer prescriptive guidance tailored to any particular API; instead, it focuses more broadly on how to approach prompt construction.

It's also critical to realize that, despite the possibility of other insightful interpretations, the purpose of this breakdown is to offer a comparatively straightforward framework for considering prompt construction. While each component of the Completion API is optional, most prompts have multiple components, and at least one must be present. Additionally, there may be some ambiguity between components. The following roughly represents the order in which each component is used, from most to least.

Best methods

  • Specify exactly: Try not to leave much room for interpretation. Limit the area used for operations.
  • Use descriptive language: Apply comparisons.
  • Go Two for One: You might occasionally need to address the model again. Use a cue and an instruction, give instructions before and after your main content, etc.
  • Matters of Order: The model's output could be affected by the sequence in which you give it the data. The order in which you place instructions "summarize the following" or "summarize the above" before or after your content can affect the final product. It can even matter which few-shot examples come first. The term "recent bias" describes this.
  • Offer the model a "way out": If the model is unable to finish the task given to it, it can occasionally be useful to provide an alternate path. For example, when asking a question over a piece of text you might include something like "respond with ‘not found’ if the answer is not present". This can help the model avoid generating false responses.

Hope this article helped you find clarity, Thanks for reading, and all the best.


Similar Articles