Career success tips

Generative AI Prompt Engineering: Providing the Right AI Prompts for Any Use Case

A woman working on her prompt engineering at her laptop, while sitting in a cafe

“Prompt engineering” might sound like a complicated task. In reality, however, it’s pretty simple to learn and doesn’t even require much technical proficiency. By gaining a grasp of these fundamentals, you can start tapping into the incredible power of generative AI today.

Use cases for generative AI tools like ChatGPT are endless. Professionals are applying this technology to streamline content creation, inspire new ideas, conduct research instantaneously, automate time-consuming processes, and much more. 

The key to unlocking all of these capabilities is to first understand prompt engineering. 

What is prompt engineering?

“Generative AI is a broad description for technology that leverages AI to generate data,” explained software developer Ronnie Sheer in the LinkedIn Learning course Introduction to Prompt Engineering for Generative AI. “This data can include text, images, audio, video, and even code. Now, prompt engineering refers to constructing inputs that help us get the most out of generative AI, and language models in particular.”

There are very specific ways of phrasing and ordering the requests you enter into a large language model that can help produce your desired result. You might be surprised by the many different things these language models can do with the right prompting.

How prompting works in generative AI

Large language models are trained on a wealth of information available across the internet, books, and beyond. Like running a Google search, generative AI tools enable you to access and leverage this information for practical purposes. And also just like running a Google search, the way you structure your query matters.

One of the core concepts of prompt engineering is tokens. These units represent the way AI technology processes word-based inputs to understand intent.

“If you think about the word everyday, you can sort of break it into two tokens: every and day,” said Sheer in his learning course. “Now, breaking this down helps the model process this input. If you think about the word joyful, also joy and ful, F-U-L. So one word can be made up of multiple tokens. Some words are one token and some are more.” 

The methods these models use of splitting inputs into tokens, called tokenization, are instrumental to shaping the outputs. 

“A bad prompt can lead to the model making up stuff, known as hallucination,” according to Xavier Amatriain in Prompt Engineering: How to Talk to the AIs, “while a slightly better one can lead to extremely valuable knowledge being generated.”

Example of a basic prompt for generative AI

“A prompt can include instructions, the question, input data, and examples,” said Amatriain. “In order to obtain a result, either the first or second one must be present. Everything else is optional.”

As one example, he used a question plus instructions: 

How should I write my college admission essay? Give me suggestions about the different sections I should include, what tone I should use, and what expressions I should avoid.

Then, he followed with a second prompt that pairs an instruction with input data:

Given the following information about me, write a four-paragraph college essay. "I'm originally from Barcelona, Spain. While my childhood had different traumatic events such as the death of my father when I was only six, I still think I had a quite a happy childhood…" 

The latter example illustrates how one can easily layer in personalization to instantly create something that reflects your own qualities and experiences. This might come in handy, for instance, with creation of customized cover letters for job-seekers

Other common functional outcomes for generative AI prompts include:

  • Summarizing complex information
  • Viewing things from multiple perspectives
  • Getting advice from top experts
  • Discovering interesting facts and statistics
  • Improving your writing

Advancing with generative AI prompt engineering

Prompt engineering is a fast-growing discipline focused on exploring the full scope of what generative AI prompts can accomplish with a goal-oriented mindset. Mastery of this skill set requires a deep understanding of generative AI – both its capabilities and constraints – and how to design optimal prompts in a given model.

Working within the limitations of generative AI is a key part of developing expertise as a prompt engineer. As one example, Amatriain notes that tools like Chat-GPT can often produce information that is inaccurate or fabricated – the so-called “hallucination” effect mentioned earlier. 

“Models have some parameters you can tweak to reduce their creativity, particularly the so-called temperature which you should reduce to decrease model variability,” he said. “However, those parameters alone will not solve all your problems. That is when you need to get a bit more advanced with your prompt design.”

He introduces a technique called “Chain of Thought prompting,” which explicitly encourages the model to follow a transparent series of steps in its reasoning. You can also specify the sources you’d like the AI to draw from when informing its responses. These methods only scratch the surface of what skilled prompt engineers can accomplish.

Build your prompt engineering skills

“Prompt engineering is growing so quickly,” said Amatriain, “that many believe that it will replace other aspects of machine learning, such as feature engineering or architecture engineering for large neural networks.”

Needless to say, it’s a great time to be building prompt engineering skills. Whether you’re looking to increase your future demand in the job market, or simply find helpful ways to benefit from this versatile technology in your current role, becoming an adept navigator of generative AI technology is bound to pay dividends. 

You can start growing your prompt engineering proficiency by learning from experts like Sheer in Introduction to Prompt Engineering for Generative AI and Amatriain in Prompt Engineering: How to Talk to the AIs. Beyond those courses, we encourage you to explore LinkedIn Learning’s full library of generative AI content, featuring dozens of courses to help you harness the hottest technology in business.

Get the latest on trending skills once a week. Right in your inbox.