The Limited Times

Now you can see non-English news...

How to engineer precise instructions for AI and achieve excellent results - the complete guide - voila! Marketing and digital

2024-02-22T16:52:32.625Z

Highlights: How to engineer precise instructions for AI and achieve excellent results - the complete guide - voila! Marketing and digital. Everyone talks about AI, but when it comes to engineering instructions, few are able to get the desired results from it. So how do you talk to GPT so that he listens to you and understands you? Amit Kama, m . The OpenAI language model. At the end of November 2022, something happened, another wave of digital transformation broke out from the offices of the OpenAI company in San Francisco California.


Everyone talks about AI, but when it comes to engineering instructions, few are able to get the desired results from it. So how do you talk to GPT so that he listens to you and understands you? Amit Kama, m


The OpenAI language model./Unsplash

At the end of November 2022, something happened, another wave of digital transformation broke out from the offices of the OpenAI company in San Francisco California, producing surges of shock that do not miss any large or small office around the world.

This is not the first time we experience such a technological storm that threatens to change reality as we know it, on January 9, 2007 Steve Jobs did it with the announcement of the iPhone, and the proof is that there is almost no person in the world who does not know or walk around with a smartphone in his pocket.



Just as the smartphone revolution created a new economy that includes smartphone app and game developers, engineers and repair technicians, managers of the mobile field in organizations, all the way to the economy of network creators (influencers) who owe much of their success to the combination of social networks and a smartphone that goes with us everywhere, so the creative artificial intelligence revolution ( Generative AI) is growing new professions and roles, some of which we see today but most of which we still don't know how to anticipate.

First, let's understand what a prompt is and why it is so important

Amit Kama./PR

Despite the feeling that we are having a conversation with a rational and intelligent entity, the artificial intelligence-based chat tools we are talking to are large text models (Large Language Models) that statistically (for now) guess the probability of the next word in the sequence based on billions of examples they have seen before on the Internet.

They actually do not really understand what they are writing (and again it is important to emphasize - "for now").


These models were named Foundation Models, because they are used as a basis for many artificial intelligence-based applications such as the familiar chats, image creation tools, video history character creation, and more.



These are enormous sized models who have learned vast and diverse information from the internet.

But the advantage of models and the vast variety of information they possess is also their greatest disadvantage.

The same vast variety causes these models to string together meaningful words and sentences that sound very convincing but are not true or realistic, a phenomenon that has been dubbed "hallucinations" by artificial intelligence.



In order to get the exact answer to our question or request, we are required to "direct" the model and help it "search" for the correct and most relevant information in the most reliable sources in its vast knowledge base ("its memory") so that it provides us with the most accurate answer to the question or at our request without inventing facts that do not exist.



That is: our instruction directs the model to provide us with an accurate answer while reducing the irrelevant or wrong information from all the information the model was trained on the Internet.

The more precise our guidance is, the less random the result we get will be.



The use of guidelines is true for all models and artificial intelligence tools, but each model and tool has the structure of the guideline and the precisions relevant to it, these arise from the way the model was trained, the data used to train the model, and its final product - that is, text, sound, images, video and more.



Therefore, instructions for creating images in Midjourney will be different from that of Dall-E or Stable Diffusion, and all of these will be completely different from the instructions we write for Chat GPT, Gemini or Claude.

It is also important to note that the exact same instruction will provide us with different answers in the different tools.

Instructional engineering - not what you thought

"Guideline engineering" is actually a combination of the fields of engineering and guidance.

In fact, the idea is to write logically in a defined and structured order of questions or requests to the artificial intelligence model, as we have already mentioned in order to get the most correct answer to our need.

Here is also the place to point out that most of us are not used to engineering instructions but will learn to formulate our questions correctly.

But we'll get to that later.



When referring to instruction engineering or the role of "instructions engineer" it refers to an employee who has the skills to logically write instructions for artificial intelligence in the process of creating tools or systems that are based on large language models such as Chat GPT, although he is not the one who trains and builds the model, but he is definitely the one who "directs" " the model on organizational information and writes the exact instructions so that the model provides well-founded answers and does not deviate from the script it received.

The secret?

rowing swimming

How to look and feel great, live healthy and lose weight?

In collaboration with TI SWIM

Two examples to illustrate the concept of guideline engineering:

First example: since these models read our instruction as part of the text that we want to summarize, expand or change, we are required to indicate to the model what our instruction is and what text it is required to carry out our instruction on.

We will do this by marking our text with a series of symbols such as scales or dashes.



For example, instead of writing "Summarize the text" and then randomly attach the text we want to add, you can instruct him as follows: "Summarize only the text that is between the ### marks. Do not refer to the other parts of the text but only for the needs of the summary. Below is the text for the summary."

After that, add three scales, the text section you want to summarize, and three more scales.



A second, more complex example, instead of writing: "Extract from the following text the main characteristics of the product - below is a document or technical specification of the product", write the following instruction:



Job definition: act as a social media marketing manager for a home products marketing company.

Your job is to analyze the responses of users on the network and arrange them in a structure that will allow me to absorb them into our marketing system.



The following text section between the brackets describes the reactions of the various users on the network to our publications.

Please extract for each commenter or client separately only the information I requested, emphasizing the analysis of the client's sentiment.

This is the information I would like to extract: the customer's name, position, place of residence, a brief description of the response, the sentiment of the response.



Please summarize long texts to 20 words and no more, if there is no part of the information please confirm the value is empty.

I would like to receive the result in a JSON file only in the following structure:


{


"customer name": "customer name",


"customer role": "customer role",


"place of residence": "place of residence",


"description": "summary description of the text ",


"sentiment": "Description of the sentiment of the content",


}



Summarize in short points the guidance I have provided you.

Only after confirming that you have understood my instructions correctly, you will receive the description of the customers' reactions in the text between the dashes.



Below is the text of the customers' responses from the social networks: (here you will add the text plus hyphens to indicate the beginning and end of the text).

The two examples shown are simple examples of directive engineering, ones that an average user can create although complex logical thinking is required.



Most instruction engineering approaches are much more complex and involve a combination of logical thinking with arithmetic thinking.

For example, the Automatic Reasoning and Tool-use approach in which we ask the model to decide when it uses external tools that are not part of its language model to provide us with an answer, or the Program-Aided Language Models approach in which we deal with complex mathematical and logical problems through a combination of natural language and writing Code (usually Python) that the model writes for itself to handle file and data analysis requests or complex computational problems.



As you probably already understood, most of us don't write our requests and questions to the artificial intelligence that way, so when most of us use the concept of instruction engineering, we actually mean a correct and structured formulation of requests to the language models.

Different approaches to writing instructions

After years when the field of artificial intelligence was the exclusive domain of data scientists, machine learning and deep learning engineers whose role was to train specific models for tasks such as image recognition, text translations, classification and analysis of different types of data, the real news of OpenAI, Google, Facebook and others was the democratization of intelligence the artificial

Now we can all ask the artificial intelligence to perform tasks and answer questions in a relatively simple way.



In the space between those who train and create the artificial intelligence models and everyone else who uses it, a whole field of research has been created that is designed to help us maximize the value from the above tools and write our questions in an optimal configuration. Although this is defined by everyone as engineering instructions, but in fact it can be precise and formulate our questions in a logically correct way.So



what are the common approaches to prompt engineering?

Simple prompting or Zero-Shot Prompting

A single prompt (Zero Shot) is a simple prompt that includes a defined request or task without explanations or examples.

In this case the model relies solely on his existing knowledge and general understanding, as well as his ability to reason and deduce information from the instruction given to him.

This is the most common guideline that most of us use but also the one with the greatest potential for hallucinations and inaccuracies.



Sample prompt:


Please create a catchy new slogan for a sports shoe brand that focuses on comfort, modern design and advanced technology.


The slogan should be short and catchy (no more than 7 words).


Words that emphasize the advantages of the brand should be incorporated into it.


The slogan should be clear and easy to remember.

A single prompt combined with examples - One / Few Shot Prompting

Writing instructions with examples (One / Few Shot) is a method in which we provide a limited number of examples as part of the instructions in order to focus and make the answer we receive more precise.

Incorporating the examples into the prompt is a method of "explaining" to the model what result we want to get without training it on new information.



Sample Prompt:



Based on the following examples, create a catchy new slogan for a sneaker brand that focuses on comfort, modern design, and cutting-edge technology.



Here are some examples:


Example 1: 'Shoes that progress with you.'


Example 2: 'Leap into the future of convenience.'


Example 3: 'Walking in giant strides of style and technology.'



Additional guidelines:


The slogan should be short and catchy (no more than 7 words).


Words that emphasize the advantages of the brand should be incorporated into it.


The slogan should be clear and easy to remember.

Chain-of-Thought Prompting

This approach uses the process of "intermediate thinking" to solve complex tasks.

Instead of providing a direct answer, we ask the model to generate for us a chain of thinking steps that lead to the final answer.

This allows the model to solve problems more systematically and understand the process that led to the answer.



This method is especially required when dealing with problems that require multi-step thinking or when it is necessary to explain the process that led to the answer.

This helps us understand the way the model "thought" about the answer and examine the logic behind the answers it provides, which increases the credibility and transparency of the answer we received.



Example prompt:



Follow these instructions to create a new and attractive slogan for a sports shoe brand that focuses on comfort, modern design and advanced technology



1. The brand focuses on comfort - we will use words like 'comfort', 'soft' or 'ideal'.


2. The brand is designed in a modern way - we will add words like 'modern', 'style' or 'design'.


3. The brand incorporates advanced technology - we will include words like 'technology', 'innovation' or 'advanced'.


4. We will combine the selected words into a short and catchy slogan.



Additional guidelines:


The slogan should be short and catchy (no more than 7 words).


Words that emphasize the advantages of the brand should be incorporated into it.


The slogan should be clear and easy to remember.



First explain to me step by step what are the steps to create the slogan.

At the end, without asking me for additional instructions and based on the insights I mentioned, I will ask you to create for me the most appropriate and effective slogan for the shoe brand.

Prompt Chaining - Prompt Chaining

Chaining of directives is a technique where the request from the model is complex and large.

In such cases the model may get "confused" due to the abundance of text and our requests in the guideline.

In this case we can optimize the directive by breaking down our request into small, well-defined subtasks.

Instead of giving the model a long and detailed request, we break down our requests/tasks into short questions and use the output of one step as input to the next step.

This way we create a chain of requests that guide the model towards the desired result.

Example



prompt

:

To create a slogan for a sports shoe brand please find the keywords that describe the following features of our sports shoe brand.

Comfort, modern design, advanced technology.

Possible result (for example):

Comfort: soft, airy, pampering

Modern design: stylish, innovative, elegant

Advanced technology: smart, advanced, innovative.

Based on the results you created and the following additional words: soft, airy, pampering, stylish, innovative, elegant, smart, advanced, innovative - please create an attractive slogan for the shoe brand.

Result (example):

"Soft steps in innovative design and smart technology."

Now that we have an agreed upon tagline, please improve the tagline for Instagram advertising so that it results in a 50% increase in ad clicks.















Additional and even more complex approaches

  • Self-consistency

    - a method in which the model generates several possible answers and after comparing them chooses the most suitable answer.

  • Generate Knowledge Prompting

    - with this approach we ask to receive knowledge before the final answer to the question.

    Only after creating the content do we ask him based on the knowledge he created to receive an answer.

  • Tree of Thoughts

    - In this complex approach we build together with the model a tree of intermediate answers, where each answer represents a step in a different path to solving the problem.

    The model examines each route and presents several options from which we choose the most appropriate and correct one.

  • Automatic Prompt Engineer

    - In this approach we will ask the model after a number of instructions and answers we received to independently improve our initial instruction in order to get more accurate answers to our need.

  • Active Prompt

    - complex tasks are used in this approach.

    This approach incorporates the chain of thought (COT) approach.

    The main innovation is the selection of the most important and useful questions that will help the model in answering the question.

  • Directional Stimulus Prompting

    - In this approach we provide the model with "direction" by presenting the context, examples, restrictions or specific conditions that will help the model better understand the desired goal and produce responses that are more relevant and accurate.

The various components that will ensure correct guidance

These approaches describe various techniques that have been researched and proven to actually improve the response of the various artificial intelligence models.

But as with any good recipe, the key to success is choosing the right ingredients.



Over the past year, many recommended methods for writing guidelines have been published, based on the experience of the users and the published studies.

This does not mean that you must use all of the following components, but that it is recommended to use them according to your context and task in order to achieve better results.

The following table lists some of the common components in the assembly of a directive

Cut and save: the ingredients that build a successful guide./Walla system!, Amit Kama

Correct instruction assembly

There are many structures circulating on the net for assembling instructions in a way that will produce an optimal response.

In most cases, it is not a research-backed structure, but based on the cumulative experience of the users and the various studies that have been published.

All the described methods consist of instructions based on the various components described in the previous section:

1. Role - Task - Format (RTF-Role-Task-Format)

RTF model./Walla system!, Amit Kama

2. Task - Action - Goal (TAG-Task-Action-Goal)

TAG model./Image processing, Amit Kama

3. Context-Goal-Task

CGT model./Image processing, Amit Kama

4. Context - task - target - examples (CARE-Context-Action-Result-Examples)

CARE model./Image processing, Amit Kama

5. Role-Context-Task-Steps-Examples (RISE-Role-Input-Context-Steps-Examples)

RISE model./Image processing, Amit Kama

6. Role-Objective Goal-Scenario-Expected Solution-Steps (ROSES-Role-Objective Goal-Scenario-Expected Solution-Steps) Context-Expected

ROSES model./Image processing, Amit Kama

7. ERA-Expectation-Role-Action

ERA model./Image processing, Amit Kama

8. APE-Action-Purpose-Expectation

EPA model./Image processing, Amit Kama

So what does the future hold for guideline engineering?

Anyone who is involved in the field and examines the pace and trend understands that the smarter the artificial intelligence models become, the less the need to formulate precise instructions for them in a precise and logically comprehensible way.

Whether it will take a year, two years or five, is still unclear.

But already today the models are much "smarter" and know how to answer our questions and instructions even when they are short and without examples.

Apparently, in the future they will know how to write the instructions for themselves in a much more precise way based on our needs.

This means that the average user will no longer need to learn all the techniques and methods presented in this article.

He will simply be able to ask or request a short request and the model will answer accurately and clearly and without biases and hallucinations.



Instructional engineering used to create AI-based tools will also eventually become redundant, but it will take longer due to regulation, which requires that there always be a human as part of the processes involving AI.

Not for nothing did the World Economic Forum define the aforementioned role as "the role of the future" and Sam Altman tweeted that this is a highly valuable skill.



"Writing a really great prompt for a chatbot persona is an amazingly high-leverage skill and an early example of programming in a little bit of natural language"



Amit Kama is the CEO and owner of Kamedia Technological Services, which deals with consulting, development, and characterization of operating concepts and digital literacy in organizations.

  • More on the same topic:

  • artificial intelligence

  • Instructions

  • AI

  • CHATGPT

Source: walla

All news articles on 2024-02-22

You may like

Trends 24h

Latest

© Communities 2019 - Privacy

The information on this site is from external sources that are not under our control.
The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.