
Understanding how to interact with Generative AI systems is crucial in this era of advanced technologies. As these systems’ capabilities to analyze big data and generate human-like creative content increase, the gap widens between users familiar with AI tools and those who aren’t. It’s become essential to understand how to use these technologies in ways that enhance productivity and foster creativity, while remaining aware of the ethical and security challenges associated with their use. Additionally, companies and educational institutions must develop programs to train individuals in AI interaction skills, enabling them to confidently and efficiently work with future technologies.
Overview of Generative AI:
Generative AI refers to the ability of intelligent systems to produce new and useful content based on input data. This technology, one of the most prominent achievements in artificial intelligence, enables computers to learn, adapt, and interact in ways that mimic human intelligence. Today, generative AI is used in a wide range of applications, from producing literary texts and articles to designing games and music, and even in scientific research and medical diagnosis. This technology puts us on the threshold of exploring unknown limits of artificial intelligence and represents a significant step in computers participating in human domains that were once exclusively areas of human creativity.
Prompt Engineering:
Prompt engineering is defined as the practice of developing and formulating prompts in a way that improves AI models’ understanding of requests and enhances the quality of outputs. This concept is relatively new and has emerged with the new generation of large generative language models such as GPT-3 and BERT, which are built on the principles of deep learning and natural language processing (NLP). In prompt engineering, users aim to improve their interaction with AI systems in a way that makes prompts more precise and clear to the system. This process is crucial for reducing ambiguity and improving response accuracy, thus enhancing the efficiency of AI-based systems.
For example, in a study published by OpenAI, researchers indicate that designing prompts in a specific way can significantly affect the generative performance of models. Small modifications in prompts can produce large changes in output. Additionally, it’s worth noting that prompt engineering requires a deep understanding of how language models work and the factors that affect their responses. A study conducted at Stanford University showed that prompts containing more detailed context enable the model to generate more accurate and relevant responses, reducing the rate of hallucination in answers.
It’s important to note that prompt engineering is not limited to improving linguistic prompts, but also includes strategies for evaluating and improving the overall model performance. This means studying results, making necessary adjustments to prompts, and analyzing data to arrive at best practices in interacting with intelligent models.
Improving prompts to enhance the performance of generative models involves multiple techniques, and can be as simple as clarifying the question or as complex as changing the context or providing examples:
Example of an unoptimized prompt:
Write an email.
This prompt is ambiguous and doesn’t provide enough information for the model to produce a high-quality email. The model might respond with additional questions for clarification or produce a generic, unfocused email.
Example of an optimized prompt:
Write a professional email addressed to the HR manager expressing interest in the recently advertised Senior Data Management Consultant position, focusing on having over ten years of experience in data management and analysis fields.
This prompt is more specific and gives the model enough information to generate a professional, detailed, and targeted email that meets the required purpose.
Example of using context to improve the prompt:
Based on the attached resume and job description for the Assistant Consultant position at Al-Ruwwad Group, write a cover letter highlighting the experiences and skills that make the candidate the best choice for the advertised position.
This prompt directs the model to use specific information (resume and job description) to create a customized cover letter, increasing the likelihood that the result will be relevant and persuasive. Here are a set of practices that will help in getting better responses from generative AI systems:
- 1. Define a goal
Incorrect use: Tell me about Vision 2030.
Better use: I want to understand the impact of Saudi Arabia’s Vision 2030 on the local economy over the next fifty years.
Setting a clear and unambiguous goal helps the model direct its responses to be appropriate and effective, avoiding confusion and helping it provide information that directly and accurately meets the purpose.
- 2. Be specific
Incorrect use: Write an article about technology.
Better use: Write a 500-word article about the impact of artificial intelligence on new drug development in the last decade.
Setting a clear goal for your request can greatly improve the quality and accuracy of the AI model’s response. When your prompts are specific, the model can better understand what you’re looking for and provide information directly related to your request.
- 3. Use delimiters
Incorrect use: Analyze Q1 sales.
Better use: [Request] Please analyze the data related to Q1 sales and extract trends and patterns. [Data] January sales: 150 units February sales: 200 units March sales: 250 units [End]
Dividing the prompt into [Request], [Data], and [End] helps the model understand that the user wants a specific analysis for a defined dataset, thus reducing the likelihood of responding with irrelevant information or misinterpreting the request. Using delimiters in prompts for the AI model works like signals that organize information and guide the model to understand what is required more clearly.
- 4. Imagine a scenario
Incorrect use: Give me marketing tips.
Better use: Imagine you’re a marketing manager in a Saudi marketing company and you want to launch a marketing campaign for a new product in the digital health field. Create a marketing plan for its launch.
Creating an imaginary scenario can help generate more detailed responses from the model, putting the model in a specific situation that requires thinking and imagination, thus giving the model a framework to produce an answer that fits the context presented.
- 5. Encourage analysis
Incorrect use: Give me information about graphic design programs.
Better use: What are the main differences between Photoshop and GIMP in terms of cost, learning curve, and ease of use?
Formulating prompts that encourage the model to analyze options will lead to more accurate and insightful answers, as it allows the model to think.
- 6. Give the model space to think
Incorrect use: Analyze the new investment opportunity in the stock market.
Better use: I want to analyze a new investment opportunity. Please consider the following points before providing your recommendation:
- Analyze the target market and growth projections.
- Study the barriers to entry and level of competition.
- Evaluate financial and operational risks.
- Calculate potential return versus cost.
- Conclude and provide recommendations based on systematic analysis.
Encouraging the model to think about the problem step by step can help improve the quality of the response and avoid incorrect conclusions. This means that the prompt should guide the model to analyze the problem in an organized and gradual manner, where this approach relies on directing the model to use an organized thinking process and logical sequence, leading to more accurate and in-depth analytical responses.
- 7. Clarify the format
Incorrect use: Write something about stars.
Better use: Write an educational article with bullet points explaining the life cycle of a star from birth to supernova.
- 8. Mention sources
Incorrect use: Provide information about the impact of greenhouse emissions on climate changes and temperature rise.
Better use: When providing information about climate changes, it’s important to rely on reliable scientific data. Therefore, please refer to studies or reports that support your information. For example: “Reports issued by the Intergovernmental Panel on Climate Change (IPCC) indicate that the rise in global temperatures is directly linked to human activities, especially greenhouse gas emissions from industries and transportation.”
In these examples, the model is encouraged to use scientifically verifiable sources, which increases confidence in the answers provided and helps avoid uncertain information. Asking the model to cite its sources can reduce the risks of answers that may be based on inaccurate or non-existent information, known as “informational hallucination”. This is especially important in contexts that require high accuracy such as scientific research, historical reports, or literary quotations.
- 7. Avoid jargon
Incorrect use: What are the best practices for partial optimization of database performance in distributed computing environments?
Better use: How can we make databases work faster in large companies?
Avoiding specialized terminology and using simple and easy language in prompts helps improve the model’s responses and understanding, thus providing a more accurate response. Using specialized terms can lead to misinterpretation of the request by the model, especially if the terms have multiple meanings in different contexts.
- 8. Set a time frame
Incorrect use: Give me a summary of developments in renewable energy.
Better use: I want a summary of the latest developments in renewable energy over the past five years.
Adding a time frame to prompts helps set the context that the model should consider when providing the answer. The time frame also shows that there is a need for information quickly, giving the response a sense of urgency, and ensures that the information provided is accurate regarding the specified time period.
- 9. Clarify the format
Incorrect use: Compare the latest smartphones in the market.
Better use: I want a comparison of the latest smartphones in the market. Design a table that includes the brand, model, price, and specifications.
Specifying the format gives clear directions to the model on how the response should appear, whether in the form of a list, paragraphs, table, or any other format. It helps process the request more efficiently because it reduces the need to guess how the user prefers to receive information, improves the clarity of the answer, and makes it easier to absorb the information provided.
- 10. Mention sources
Incorrect use: Explain the concept of artificial intelligence to me.
Better use: Summarize the concept of artificial intelligence and mention three main references that have addressed this topic.
By correctly applying these ten practices, we help the generative model better understand the purpose and context, leading to improved output quality. Interaction with AI systems can be enhanced and more accurate and useful results can be obtained.