Skip to main content

Prompt engineering

Prompt Engineering simply means asking good questions to the AI. A prompt is your input with your question or request.

Prompt engineering involves crafting targeted questions and instructions to help AI models provide the right answers during chats. With better prompts, you get better results.

Together with the specifications of the chosen model, this determines the quality of the answer.

Elements of a prompt (question)​

To get better results, you should consider the following points:

  • Goal: what exactly do you want from the language model?
  • Role: what role does the language model have? (e.g., 'Marketing Analyst', 'Legal Advisor', 'Project Manager')
  • Context: background information about the request (e.g., business objectives, project details, market information)
  • Style: what style do you want to use? (e.g., formal, persuasive, concise)
  • Output: what format do you want? (e.g., a report, email, presentation outline, code snippet)

The goal​

Precisely describing the goal of your question is essential and cannot be omitted.

What do you want to know?

  • Fact-based questions are possible, but be aware of limitations (e.g., lack of up-to-date knowledge)
  • Just like with Google, you will not get exactly the same answer if you ask the question multiple times
  • The advantage is the “chat” function so you can ask follow-up questions

Example prompt with a clear goal:

Prompt with goal only

Give a description of the main challenges for implementing a new AI platform in a medium-sized company.

Implementing a new AI platform in a medium-sized company brings several challenges. Some key challenges are:

  1. Resistance to change: Employees are accustomed to existing processes and systems. A new AI platform requires adaptation and may cause resistance, especially if the impact on workflows is unclear.
  2. Data quality and availability: AI platforms heavily depend on data. Collecting, cleaning, and structuring data for the new platform can be complex and time-consuming.
  3. Integration with existing systems: The AI platform often needs to be integrated with other business applications (ERP, data sources, BI tools). This can pose technical challenges.
  4. Costs: Besides the platform license fees, there are costs for implementation, training, data infrastructure, and possibly specialized personnel.
  5. Training and adoption: Employees must be trained to use the new platform and interpret the output. Without good training and continuous support, adoption rates may remain low.
  6. Choosing the right platform and use cases: There are many AI platforms and technologies. Selecting a platform and defining relevant use cases that fit the specific needs and strategic goals of the company is crucial.
  7. Ethical considerations and compliance: Depending on the application of the AI platform, there may be ethical issues and compliance requirements (e.g., GDPR) that must be carefully addressed.
  8. Project management: Successful implementation requires solid project management, clear objectives, and involvement of stakeholders from various departments.

Adding role and context​

Adding a role and context results in better and more specific answers.

Example of the same question but with role and context:

Prompt with goal, role, and context

As a project manager responsible for implementing a new AI platform for data analysis and process optimization at a B2B service provider with 150 employees, provide a description of the main challenges and possible mitigation strategies.

As a project manager for implementing a new AI platform for data analysis and process optimization at a B2B service provider with 150 employees, I see the following key challenges and possible mitigation strategies:

  1. Resistance to change & User adoption:
    • Challenge: Employees, especially those whose tasks are directly affected, may be reluctant to abandon their familiar workflows and embrace the new AI-driven insights.
    • Mitigation: Engage key users early. Clearly communicate the benefits (efficiency, better decision-making, new insights). Provide extensive, role-based training and continuous support. Appoint 'AI champions' within departments.
  2. Data quality, governance, and migration:
    • Challenge: The effectiveness of the AI platform depends on high-quality, well-managed data. Data from existing systems is often inconsistent, incomplete, or incorrect.
    • Mitigation: Start with a thorough data audit, define a data governance framework, and perform data cleansing before integration/migration. Define clear data models and flows. Conduct tests and carefully validate the data.
  3. Integration with existing IT infrastructure:
    • Challenge: Connections with existing data sources, ERP, CRM, and other business systems must work seamlessly and securely.
    • Mitigation: Identify all required integrations early. Choose an AI platform with robust API capabilities or standard connectors. Test integrations thoroughly.
  4. Scope creep & Budget overruns:
    • Challenge: During the project, new wishes for AI applications may arise that broaden the scope and increase costs.
    • Mitigation: Define a clear, bounded scope with well-defined use cases (MVP - Minimum Viable Product) for the first phase. Apply a strict change management process. Maintain a realistic project schedule and budgeting, including a buffer.
  5. Selection of the right technology and implementation partner:
    • Challenge: The AI market is complex. A wrong technology choice or an inexperienced partner can cause the project to fail.
    • Mitigation: Conduct thorough research on suitable AI technologies for the defined use cases. Select a partner with proven experience in your industry and with the chosen technologies. Request references.
  6. Lack of AI knowledge and skills within the organization:
    • Challenge: There may be insufficient internal expertise to effectively use, maintain, or further develop the AI platform.
    • Mitigation: Invest in training and education. Consider hiring specialized personnel or work closely with the implementation partner for knowledge transfer. Create a culture of continuous learning.
  7. Ethical considerations and explainability (Explainable AI):
    • Challenge: Decisions made or supported by AI must be transparent and explainable, especially if they impact customers or employees. Bias in data can lead to unfair outcomes.
    • Mitigation: Establish ethical guidelines for AI use. Choose interpretable models where possible. Implement processes to detect and mitigate bias. Ensure human oversight on critical AI decisions.

By proactively addressing these challenges, we increase the chances of a successful AI platform implementation that truly contributes to business objectives.

Techniques​

Below we describe several techniques you can use for more advanced prompts.

Technique 1 - providing examples​

To ensure the language model uses the style you want, provide one or two examples.

This method is called “one & few-shot prompting”

Technique 1 - providing examples

Write a draft email to customers about an upcoming planned system update. Use our internal policy for customer communication (include relevant points from policy). Use this recent newsletter as a style guide, but do not include substantive information: (insert newsletter text)

The full prompt is as follows:

Internal policy for customer communication:

  • Always be professional and polite.
  • Provide timely updates about important changes or outages.
  • Offer clear and concise information.
  • Provide a solution or compensation if applicable.

Use this newsletter for style, but do not use information from this newsletter. Dear customer,

We would like to inform you about an upcoming system update that may affect our services.

Date and time of the update: [date and time] Expected duration of the interruption: [duration] Affected services: [services]

During this period, our services may be temporarily interrupted. We will do our best to minimize inconvenience and restore services as quickly as possible.

Technique 1 - the answer

Below is the language model's answer to the extended prompt with examples

Dear customer,

We would like to inform you about an upcoming system update that may affect our services.

Date and time of the update: [date and time] Expected duration of the interruption: [duration] Affected services: [services]

During this period, our services may be temporarily interrupted. We will do our best to minimize inconvenience and restore services as quickly as possible.

If you have any questions, please feel free to contact us.

Kind regards,
[Your Name]
[Your Position]
[Company Name]
[Contact Information]

Technique 2 - providing a template​

To ensure the language model uses a specific format, provide a template and an example. This ensures the language model structures or formats its answer in a certain way. You can think of very different formats useful in situations such as:

  • csv output for importing into an Excel sheet or data analysis tool
  • json output for API integrations or configuration files
  • Agenda outline for a project meeting

Example prompt:
Generate a list of three potential marketing channels for a new SaaS product aimed at SMEs. Format your answer as follows:
Channel:
Target audience reach:
Potential ROI:
Required resources:

For example:
Channel: LinkedIn Advertising
Target audience reach: Specific job titles, industries, company size
Potential ROI: High, if well targeted
Required resources: Advertising budget, content creation, campaign management

This method is called “output templates”

Technique 2 - providing a template

Below is the language model's answer to the prompt with an output template

Channel: Content Marketing (Blog & SEO)
Target audience reach: Companies actively searching for solutions to their problems, organic traffic
Potential ROI: High in the long term, builds authority
Required resources: Content writers, SEO specialist, time for keyword research and content promotion

Channel: Google Ads (Search)
Target audience reach: Companies actively searching for specific keywords related to the SaaS product
Potential ROI: Medium to high, depending on competition and CPC
Required resources: Advertising budget, keyword research, landing page optimization, campaign management

Channel: Email Marketing (Lead Nurturing)
Target audience reach: Leads collected via website, webinars, or other channels
Potential ROI: High, effective for converting leads to customers
Required resources: Email marketing platform, content for email sequences, segmentation skills

Technique 3 - giving a hint​

To ensure the language model starts and writes in a certain way, give a hint. Here we write the hint at the end of the prompt.

Example prompt:
Can you summarize this market research report for me? (paste the relevant sections of the report). Start your answer with:
The main findings from this market research are:

  • PASTE THE TEXT OF THE REPORT

This method is called “cues and hints”
This example uses a fictional report.

Technique 3 - giving a hint

Below is the language model's answer to the prompt with a hint

The main findings from this market research are:

  • Demand for cloud-based project management software within SMEs has increased by 35% over the past two years.
  • Key decision factors for SMEs are ease of use, integration possibilities with existing tools, and pricing.
  • Competitor A has a market share of 25%, followed by Competitor B with 18%. There is room for new players focusing on specific niches or offering a superior user experience.
  • The biggest challenges for SMEs adopting new software are the initial investment and the time needed for employee training.
  • The market is expected to continue growing annually by 15% over the next five years.

Technique 4 - splitting content from instructions​

Sometimes the prompt is very long due to extra content and the language model does not interpret exactly what you want. You probably saw this in the previous example. Then split the content with triple quotes at the beginning and end of the text from the rest of the prompt.

Example prompt:
Can you summarize this article for me?
"""
(paste your article text).
"""
Start your answer with:
The main points from this article are:

This method is called “content splitting”
This example uses an article or report from the internet as source material. You can use a policy note, research report, or public information page for this.

Technique 4 - splitting content

Below is the language model's answer to the prompt with split content. We use triple quotes or triple asterisks to separate the context of the question.

The main points from this source are:

  • The report describes which target groups are affected by the policy.
  • The source names preconditions for careful implementation, such as privacy, accessibility, and clear communication.
  • The analysis shows which risks and dependencies must be considered in advance.
  • The document contains recommendations that can be translated into concrete actions for teams or departments.
  • For decision-making, it is important to explicitly state assumptions, uncertainties, and next steps.

Technique 5 - ask for additional information first​

You can give instructions to first ask additional questions before generating the answer. This helps the language model refine and specify your request.

Example prompt:
“I want to draft a project proposal for developing a new mobile app for internal communication. The app should include features for news updates, an employee directory, and direct messaging. Before you write the project proposal, can you ask me additional questions to improve the proposal?”

This method is called “ask before answer prompting”

Technique 5 - ask for additional information first

Below is the language model's answer to the prompt asking for additional information

Of course! Here are some questions I can ask to improve the project proposal:
What is the primary goal of the internal communication app? (e.g., increase engagement, improve information dissemination, facilitate collaboration)
Who is the specific target audience within the company? (e.g., all employees, specific departments, field workers)
Are there existing systems or platforms the app must integrate with? (e.g., intranet, HR system, Active Directory)
What is the intended budget and desired timeline for development and implementation?
Are there specific security or compliance requirements the app must meet? (e.g., GDPR, data retention policy)
Which key performance indicators (KPIs) will be used to measure the app’s success?
Are there any ideas about the design or branding of the app? Should it align with the organization’s identity?
Is there a preference for the development platform (iOS, Android, cross-platform)?

With this additional information, we can get a better picture of the scope and requirements and thus create a stronger project proposal.

Technique 6 - emotional prompt​

You can give instructions to adjust the tone of the text to the underlying emotions or to evoke a specific emotional response. This is useful for customer service, internal communication, or marketing.

Example prompt:
“I need to draft an email to a customer who is unhappy about a recent service outage. The customer wrote the following: """ …. """ (paste the customer's text) I want the email to be empathetic, acknowledge the customer's frustration, and offer a constructive solution.”

This method is called “emotional prompting”
This example uses a fictional complaint.

The full prompt is:

I need to draft an email to a customer who is unhappy about a recent service outage. The customer wrote the following:
"""Dear Sir/Madam,

I am very disappointed about the unexpected service outage yesterday afternoon. This severely disrupted our operations and caused productivity loss. We rely on your services and such incidents are unacceptable. I expect a clear explanation and appropriate compensation."""

I want the email to be empathetic, acknowledge the customer's frustration, and offer a constructive solution.

Technique 6 - emotional prompt

Below is the answer we received from the language model

Dear [Customer Name],

Thank you very much for your message and our sincere apologies for the service outage you experienced yesterday afternoon. I fully understand your frustration and the impact this has had on your operations. We deeply regret that we did not meet your expectations and our service standards.

The outage was caused by [brief, clear explanation of cause, e.g., an unforeseen technical failure in our data center]. We took immediate action and our technicians worked hard to restore the service as quickly as possible. The service has been fully operational since [time].

We take this incident very seriously and are already evaluating the cause to prevent recurrence in the future.

To somewhat compensate for the inconvenience, we would like to offer you [concrete proposal, e.g., a discount on your next invoice / a free upgrade for one month / a service credit]. One of our account managers will contact you within 24 hours to discuss this personally and answer any further questions.

Again, our apologies for the inconvenience. We appreciate your business and strive to provide you with the reliable service you expect from us in the future.

Kind regards,

[Your Name/Company Name]

Technique 7 - asking for multiple versions​

Here you request multiple versions of an answer so you have options. For example, you want the model to help generate different marketing slogans for a new product. There are many different angles possible, so you want several options. This can be effectively combined with setting a specific role for the model and a system prompt to further guide the model.

You can read more about roles in the related article. This example with multiple versions is at the very bottom of that article. It is not fully repeated here.

Technique 8 - combining with a system prompt​

With a system prompt, you can give instructions to the AI model. It is an instruction you provide to the model to specifically shape the task or behavior of the model. You can specify what kind of output you expect from the AI model. It is a way to steer the model and prevent irrelevant or unwanted answers.

Some examples of simple and general system prompts:

"I want you to be a friendly and helpful assistant."

"Always remain professional and respectful in your language."

"Focus on giving concrete, to-the-point answers without unnecessary details."

The system prompt essentially sets the tone and expectations for the specific conversation or task you want to perform with the AI model.

You can also devise more advanced system prompts for specific tasks, such as summarizing a text:
"Carefully analyze the given text and provide a concise but informative summary of the main points. Identify the core message and key details."

System prompts do not have the same influence on the outcome for every AI model. With chatGPT it works very strongly, with Claude also, with other models the influence of a system prompt is less. It is interesting to try and see which model works best for your input.

You can set a general system prompt in preferences, but it is best to create these system prompts per task you want to automate. We call these roles.

You can read more about roles in the related article.

Annotating a passage​

Select text in a completed chat message and choose Annotate. Write a question or change instruction in the window, for example ‘Make only this sentence simpler’, and choose Save. You can annotate multiple passages this way. Then send; an extra prompt in the input field is not necessary but allowed. The passage remains saved with the comment, even if you switch to another window in between. You can delete an annotation before sending. On mobile, press and hold the text to select.