All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

What is a prompt and prompt engineering?

Post cover: What is a prompt and prompt engineering?
Table of contentsClick link to navigate to the desired location
This content has been automatically translated from Ukrainian.
The term "prompt" (in the context of AI) describes a request or command that a person submits to artificial intelligence in order to receive a specific response or result. This can be text, an image, or a more complex task. 
Prompts are the foundation of interaction between humans and AI, allowing AI to understand the context and task.
In other words, a prompt is what you tell it, and AI, in turn, must correctly understand you and provide the result you need. If the result does not satisfy you, modify the prompt and make the request again. It is a kind of iterative process where you try to make AI understand you and do some work for you.

What is prompt engineering?

There is the concept of "prompt engineering," which describes the role in interacting with AI. Prompt engineering involves developing and optimizing prompts to improve the quality and accuracy of AI responses. A skilled prompt engineer can "teach" artificial intelligence to perform complex tasks using only limited input data. This art requires a deep understanding of how AI interprets human requests, as well as knowledge of the specifics of a particular AI system.
For example, a simple prompt might look like this: "Describe what a typical workday for a veterinarian looks like. In two paragraphs."
Here is the generated response ChatGPT (4):
A typical workday for a veterinarian begins with a morning review of the appointment schedule and checking that all necessary medical instruments and medications are available. Veterinarians often perform diagnostic procedures such as X-rays, ultrasounds, and blood tests to accurately determine health issues in animals. They also engage in vaccinations, treating chronic illnesses, and providing first aid in emergencies. Communication with pet owners is an important part of the job, as the veterinarian provides instructions on caring for their furry friends, discusses treatments, and recommends preventive measures.
Throughout the day, the veterinarian may encounter a variety of cases, from routine check-ups to emergencies requiring quick decisions. Often, the day is spent in a dynamic between surgical interventions, consultations, and care procedures. Veterinarians also dedicate time to training assistants and managing the clinic's administrative tasks. An important part of their work is also maintaining medical records, which help in keeping track of animals' health histories and planning future visits. The evening usually ends with preparations for the next day, reviewing the schedule, and planning treatments for sick animals.
Let's slightly modify the prompt to get a list instead of text.
"Describe what a typical workday for a veterinarian looks like. In a list."
Here’s what a typical workday for a veterinarian might look like:
Reviewing the appointment schedule - The veterinarian reviews the consultations, procedures, and surgeries planned for the day.
Preparing tools and medications - The veterinarian ensures that everything needed for the day is prepared and available.
Receiving animals - The veterinarian conducts examinations, diagnoses, and treats animals coming into the clinic.
Performing diagnostic tests - This may include X-rays, ultrasounds, blood draws, and other analyses.
Treatment and procedures - Administering vaccinations, performing medical procedures, and surgical interventions.
Consultations with pet owners - Discussing the health status of animals, treatment plans, and providing care recommendations.
Administrative tasks - Maintaining medical records, planning future visits, and managing the clinic.
Educational duties - Sometimes veterinarians conduct training for veterinary students or new assistants.
Closing the clinic - Checking and preparing the premises and tools for the end of the workday.
Summarizing the day - The veterinarian reflects on the day's cases, plans future actions, and updates records before going home.
This is a direct request that AI uses to generate a response, diving into the world of veterinary medicine and providing a detailed description of typical tasks that may include receiving animals, diagnosing diseases, treatment, and communicating with pet owners. Note the prompt - "In two paragraphs", "In a list" and the result. ChatGPT reacted to the prompt and provided us with the information we needed in the required format.
This is the simplest example of manipulating AI's work using a prompt. Of course, there are very complex prompts that contain algorithms, specific datasets, etc. So, don't think that prompt engineering is only about what to write to AI in a chat.

This post doesn't have any additions from the author yet.

14 Apr 09:14

Accept - HTTP header, what is it for and how does it work?

meme code
meme code@memecode
15 Apr 17:50

What is entropy?

meme code
meme code@memecode
15 Apr 18:11

What are HTTP Client hints?

meme code
meme code@memecode
18 Apr 05:27

Fixing ActiveRecord::ProtectedEnvironmentError in the local environment

meme code
meme code@memecode
18 Apr 06:06

Analyzing the PG::ObjectInUse error (Ruby on Rails)

meme code
meme code@memecode
27 Apr 09:29

What are CC and BCC in emails? What are they for and how to use them?

meme code
meme code@memecode
ZOMBIE in Ruby. What is it?
03 May 12:41

ZOMBIE in Ruby. What is it?

meme code
meme code@memecode
03 May 13:13

What is the Garbage Collector in Ruby? How does it work and what is GC used for?

meme code
meme code@memecode
A little about the types of Ruby implementations (CRuby (MRI), JRuby, Rubinius, TruffleRuby, mruby)
05 May 12:36

A little about the types of Ruby implementations (CRuby (MRI), JRuby, Rubinius, TruffleRuby, mruby)

meme code
meme code@memecode
07 May 07:24

What is native machine code?

meme code
meme code@memecode
Enabling YJIT in Ruby 3.2.1 (Ruby on Rails)
08 May 07:57

Enabling YJIT in Ruby 3.2.1 (Ruby on Rails)

meme code
meme code@memecode
09 May 12:43

[Fix] Rails Admin - undefined local variable or method javascript_importmap_shim_nonce_configuration_tag

meme code
meme code@memecode