IKH

What and Why of Prompts

Now that you have understood the basics of generative AI and experimented with ChatGPT, you may have noticed that the output of generative models depends on how you define the input prompts. The more specific your prompt, the better the output. Even text-to-image models, such as MidJourney, Stable Diffusion and Dall-E, require prompts for effective functioning. But what exactly is a prompt, and why is it necessary?

Prompts are textual or visual inputs provided to generative AI models to influence the nature and output of their creations. They serve as the initial spark, providing context and guidance for the model’s generation process and steering it towards the desired output.

Prompts can take various forms. For language models (LMs), prompts are text-based and can be in the form of questions, sentence fragments or complete paragraphs. In the case of visual generation models, prompts can be image-based or textual descriptions of the desired output. Some models can work with both image- and text-based input prompts.

It is important to grasp how LLMs work to understand why prompts are necessary. In simple terms, LLMs are ‘token generators’. Tokens are units of text, such as words, characters or subwords, processed by a language model during training and inference. Trained on a vast corpus of text data, language models excel at learning underlying patterns, structures, rules of languages, and a significant amount of factual information using statistical methods which are then stored as the model’s parameters, which may typically range from few million to billions (refer to the first image in the article). With such large parameters, these models become adept at predicting the next token for a given set of input tokens. The model generates subsequent tokens that are most likely to follow based on the patterns and structures it learned during training. This process is known as ‘text-continuation’ or ‘completion’.

In a nutshell, for an LLM like ChatGPT, prompts act as the initial instructions or cues that guide the model’s understanding and steer it to generate the most probable token/ text that completes the prompt according to the specified instruction.

Let’s summarise the important pointers from the video:

  • LLMs generate tokens, which are basically numerical representations of words and characters.
  • The model doesn’t look at the holistic meaning of the words, rather they refer to group of words that are similar in meaning. 
  • In addition to being pre-trained on enormous text data, LLMs such as ChatGPT, are further trained and aligned to be safe and helpful.

In the next video, we will see that LLMs are not mistake-proof even if the prompts are well-written.

In the above video, Kshitij explained the limitations of LLMs. In a nutshell, LLMs are text generators and not problem solvers. In the upcoming segments, we’ll explore how to navigate around these limitations by designing better prompts through prompt engineering techniques that can allow models to ‘understand’, ‘analyse’ and perform ‘reasoning’ tasks to obtain better results.

Prompt engineering is a relatively new discipline focussed on developing and optimising prompts to use language models efficiently for a wide range of tasks. It is an active research area in generative AI, constantly evolving with the development of new techniques. Prompt engineering techniques have been formulated by the research community after understanding the capabilities and the limitations of the large language models. If done correctly, prompt engineering techniques have been proven to enhance the capabilities of LLMs for complex tasks such as question answering, chat conversation and logical reasoning. 

In the upcoming segments, we will delve into the important principles and techniques of prompt engineering. By understanding the nuances of prompt engineering, you can guide language models with precision and achieve results that closely align with your intentions. Let’s explore the key aspects of what makes a good prompt and how you can optimise your interactions with generative AI models through prompt engineering.

Report an error