When to use LLMs

Completed

Overall, we recommend that you use large language models when you need to generate text, images, or even code.

There are three different categories of generative AI models:

  • Natural language models take in natural language and generate responses.
  • Generative pre-trained transformer (GPT) models take natural language or code snippets and translate them into code.
  • Image generation models take prompts, a base image, or both, and create a new image.

Text processing

Large language models can perform multiple natural language tasks, including:

Task Prompt
Summarizing text "Summarize this text into a short blurb."
Classifying text "What genre of book is this?"
Generating names or phrases "Write a tagline for my flower company."
Translation "Translate 'How are you' to French."
Answering questions "What does Azure OpenAI do?"
Suggesting content "Give me the five best weddings songs."

Work with code

Large language models are proficient in over a dozen programming languages, such as C#, JavaScript, Perl, PHP, and Python. By using LLMs to code, you can solve the following challenges:

  • Build applications: You can use LLMs to generate code like a web API based on prompts.
  • Maintain applications: If you work on an existing codebase, LLMs can help you update or maintain the existing code.
  • Improve applications: You can use LLMs to improve code for a specific metric, like increased security or logging.

For example, given the input "Write a for loop counting from 1 to 10 in Python," the following answer is provided:


for i in range(1,11):

    print(i)

Image processing

Large language models can create both realistic and artistic images, change the layout or style of an image, and create variations on a provided image. For example:

  • Image generation: LLMs can generate original images by using input text of what you would like the image to be. The more detailed you are, the more likely it is that the model produces the desired image.

  • Editing an image: LLMs can edit an image by using input text of what you would like changed about the image. You can change the style of an image, add or remove items, or generate new content to add.

  • Image variations: LLMs can generate variations of an image by using the image itself and input text specifying how many variations of the image to produce. The original image stays the same, but the color, background scene, and where the objects are located might change in variations.