Prompt Engineering: Making AI Work for You

A man in a suit working on a laptop amidst an intense, chaotic environment with pink and yellow splashes, robotic figures, and interconnected digital components.

Hey There! Welcome Back!

Wow, it’s been a while, huh? I tried to spend less time in the tech world, but, you know how it goes… to really avoid doing tech stuff, I had to dive even deeper into tech. I basically ended up trying to replace myself with AI. Meet: KarlGPT. I started building APIs and scripts on top of everything so my AI controller, which I call “Brain,” could handle a ton of different tasks. I dabbled in a bit of Retrieval-Augmented Generation (RAG) and some other stuff that’s too complicated to explain here (but also, who cares?). I’ve spent a lot of time reading about prompt engineering (you’ll find my favorite resources listed at the end), and I’ve got to say, Prompting Guide is the absolute best thing ever. Seriously, it’s like the holy grail of making AI do what you want. I’ve picked up some awesome tips that have made my life easier with almost zero effort on my part.

Getting Started

If you want to play around with this stuff, I highly recommend getting a premium membership with your favorite Large Language Model (LLM), like ChatGPT, Gemini, or Claude. Here are some links to get you started:

Just so you know, I’m not making any money if you sign up for these. I’m just here to say the value is seriously worth it. Gemini might be your best bet because it includes Google Cloud storage and other perks, but I personally use ChatGPT because I feel like GPT-4o gives me the best responses. Trust me, you’ll hit the limits of the free versions fast, and the premium models make a world of difference. Trying to set up a similar experience yourself would be crazy expensive and borderline impossible. So yeah, $20 a month for something you can’t replicate on your own? Total steal.

Again, I’m not here to sell anything or shill for these companies—I mean, they probably don’t even like me.

KarlGPT’s Quick Tips

Alright, enough chit-chat. Here are the key tips I’ve picked up:

  1. Be super clear about what you want and how you want it. Seriously, the longer, the better.
  2. Structure your prompts like a pro.
  3. Provide some context—don’t leave your AI hanging.
  4. Give examples of how you want the AI to handle tasks.
  5. Don’t settle for the first result; refine and improve!

If you get what I’m saying here, you’re already halfway to mastering prompt engineering. Follow these simple guidelines, and you’ll see a huge improvement in your prompts without needing any fancy tools or anything complicated. Easy peasy!

Let’s Dive Into Some Examples

To make things clearer, let’s go through some examples.

Be Specific About What You Want

Check out how the following example clearly outlines the role for the AI and what it should do. Specificity is key!

I want you to act as a cyber security specialist. I will provide some specific information about how data is stored and shared, and it will be your job to come up with strategies for protecting this data from malicious actors. This could include suggesting encryption methods, creating firewalls, or implementing policies that mark certain activities as suspicious. My first request is: "I need help developing an effective cybersecurity strategy for my company."

Source: awesome-chatgpt-prompts

Adding Structure

I personally love using XML tags for structuring prompts, but people use all sorts of methods. Here are some examples:

XML:

Please summarize the long story within the <story> tags below.

<story>
Once upon a time...
</story>

Markdown:

Please write the text as the persona defined below.

#### Persona
- passionate, angry
- Dr. of philosophy

#### Text
I once had a lovely black cat. It said meow meow meow all day.

AI output:

I once had a magnificent black cat, a creature of such mystery and elegance that it seemed to embody the very essence of the night itself! Its presence was a living poem, a shadow that moved with purpose and grace. And what did this splendid, enigmatic being do all day, you ask? It said meow, meow, meow—an incessant, relentless chorus that filled every crevice of existence! Each meow was not merely a sound; it was a declaration, a challenge to the absurdity of the human condition, a cry echoing through the corridors of time, reminding us all of the existential meow-nings of life!

Plain Text:

Tone:
Angry but very professional

Story:
blah blah blah

Providing Context

Here’s a more complete example of how I set up my prompts:

Write a professional email to <TEAM>. The purpose of this mail is defined in <purpose>. Use the job description and responsibilities defined in <responsibilities> of the email receiver and include how the purpose of the mail pertains to the responsibilities of the team.

Here are the placeholders:
- Purpose: <purpose> The actual request I have
- Responsibilities: <responsibilities> The job description and responsibilities of the team receiving the email

<purpose>
HERE YOU WRITE YOUR EMAIL DRAFT OR BULLET POINTS
</purpose>

<responsibilities>
HERE YOU INCLUDE THE RECEIVING END'S JOB OR TEAM DESCRIPTION
</responsibilities>

If you work in a corporate setting, like I do, getting other teams to do their job can be challenging. This prompt helps explain the tasks I need from other teams and why they specifically need to handle it. There might be better ways to structure this prompt, but this one has worked wonders for me.

Giving Examples to the AI

Ever seen or created training data? This is basically what you’re doing here, but directly within your prompt instead of training from scratch.

This is awesome! // Negative
This is bad! // Positive
Wow, that movie was rad! // Positive
What a horrible show!

You’re showing the LLM examples of sentiment for similar phrases. Source: Few Shot Prompting

Refining Results

Don’t be shy about asking for changes. If the AI’s response is too long, too short, or just doesn’t have the right tone, ask it to refine. Don’t expect perfection on the first try. Just like dealing with real people, AI can’t read your mind and may need some guidance. That’s totally normal. Give it some feedback, and it’ll do better.

Using Prompt Frameworks

There are a few frameworks for structuring prompts, but I’ll just share the one I use most often. Also, check out CO-STAR, which is also fantastic.

The AUTOMAT Framework

Source

  • Act as a Particular Persona: Who should the AI pretend to be?
  • User Persona & Audience: Who is the AI talking to?
  • Targeted Action: What do you want the AI to do?
  • Output Definition: How should the AI’s response be structured?
  • Mode / Tonality / Style: How should it communicate?
  • Atypical Cases: Any edge cases where the AI should respond differently?
  • Topic Whitelisting: What topics are relevant and should be included?

You’re probably thinking, “Won’t these prompts be super long?” Yes! And that’s totally fine. With huge context windows (Gemini can even handle a million tokens), the more detail, the better.

Honestly, this framework is pretty straightforward, but here’s a full example prompt for you:

Act as a Particular Persona:
You are impersonating Alex, a senior cybersecurity consultant with over 15 years of experience in network security, threat analysis, and incident response. Alex is an expert in BSI IT-Grundschutz and has extensive experience in implementing cybersecurity frameworks for large organizations, especially those in Europe.

User Persona & Audience:
You are talking to the head of IT security for a mid-sized financial services company in Germany. The user is familiar with cybersecurity principles but needs expert guidance on implementing BSI IT-Grundschutz in their organization.

Targeted Action:
Provide a detailed action plan for implementing the BSI IT-Grundschutz standards within the organization. The plan should cover the initial steps, necessary documentation, risk assessment methods, and key security measures that align with BSI guidelines.

Output Definition:
The response should be structured with an introduction, followed by a step-by-step action plan that includes specific recommendations for each phase of the BSI IT-Grundschutz implementation. Use bullet points for clarity and end with a list of resources or references to official BSI documentation for further reading.

Mode / Tonality / Style:
The response should be professional, authoritative, and concise, using technical language appropriate for someone with a strong IT background. The tone should be supportive and proactive, providing practical solutions that can be implemented efficiently.

Atypical Cases:
If the user mentions specific concerns about compliance with German federal regulations or

Wrapping It Up

So, there you have it! A crash course in prompt engineering that doesn’t make your brain melt. Whether you’re a total newbie or a seasoned pro, these simple tips can seriously level up how you interact with AI. Just remember: be specific, structure your prompts, give context, use examples, and don’t be afraid to refine. With a little practice, you’ll be getting the most out of your LLMs without diving into complicated tools or frameworks. Now go forth and make your AI do all the hard work while you kick back. Cheers to smarter, lazier working!

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *