Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mastering 
Prompt Engineering:
Getting AI to Wo...

Mastering 
Prompt Engineering:
Getting AI to Work for You

Write a high-energy, engaging conference session proposal that explains why prompt engineering matters for software engineers. Hook the audience with real-world examples of good vs. bad prompts. Explain why vague instructions lead to junk results, while structured, iterative prompts unlock AI’s full potential. Cover best practices, common mistakes, and AI-friendly phrasing that makes tools like ChatGPT a real asset in coding, debugging, and brainstorming. Provide actionable takeaways engineers can use to fine-tune their prompts for better code explanations, documentation, and problem-solving. Keep it fun, interactive, and packed with insights that make attendees walk away thinking, “Why wasn’t I doing this sooner?”

Code examples can be found on GitHub: https://github.com/guustnieuwenhuis/PromptEngineering/tree/main

Avatar for Guust Nieuwenhuis

Guust Nieuwenhuis

September 22, 2025
Tweet

More Decks by Guust Nieuwenhuis

Other Decks in Technology

Transcript

  1. ABOUT ME Guust Nieuwenhuis Managing Partner @ We Are North

    Full Stack Web Wizard Masa CMS Born in The Netherlands Living in Belgium Football coach Mountainbiker
  2. Prompt engineering is the process of designing and refining inputs,

    or “prompts", to get a desired output from a large language model (LLM).
  3. Example • A.P.E. • Action • Purpose • Expectation Frameworks

    Write a blog post about the impact of prompt engineering. To educate readers on how prompt engineering is transforming AI interaction and content creation. The blog post should be informative, include recent trends, and highlight the potential benefits of this skill.
  4. Elements of a Prompt • Instruction • Context • Input

    Data • Output Indicator The Basics Act as a technical writer and explain the concept of "prompt injection." The audience is a group of new developers who have some basic knowledge of APIs but are not familiar with LLM security threats. The definition of prompt injection is a security vulnerability where an attacker bypasses a language model's safety guidelines by "injecting" malicious instructions into a prompt. Format your explanation as a two- paragraph response. The first paragraph should define the concept, and the second should provide a simple, relatable example.
  5. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics
  6. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics
  7. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics
  8. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics Convert the following code block in the +++ code +++ section from CFML Tags to CFML Script: +++ <cfset firstName = "James"> <cfset lastName = "Bond"> <cfset age = 30> +++
  9. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics Explain the concept of “prompt engineering”. Your explanation must be a single paragraph of no more than three sentences.
  10. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics Your task: given a product description, return the requested information in the section delimited by <info></ info>. Format the output as a JSON object. Product description: The Bryce Mid Straight, your go-to classic jeans. Offering a regular fit and straight leg, creating a timeless silhouette that flatters every body type. Versatile and effortless. <info> product_name: the name of the product product_type: the type of the product </info>
  11. Improving Prompts • Use natural language • Being speci fi

    c and clear • Delimiters • Output Length • Output Format The Basics { "product_name": "The Bryce Mid Straight", "product_type": "Jeans" }
  12. System Prompting • Sets the overall context and purpose for

    the language model • De fi nes the ‘big picture’ of what the model should be doing • Purpose: de fi ne the model’s fundamental capabilities and overarching purpose The Basics Classify movie reviews as positive, neutral or negative. Only return the label in uppercase. Review: "Her" is a disturbing study revealing the direction humanity is headed if AI is allowed to keep evolving, unchecked. It's so disturbing I couldn't watch it. Sentiment:
  13. Role Prompting • Provides speci fi c details or background

    information relevant to the current conversation or task • Helps the model to understand the nuances of what’s being asked • Tailor the response accordingly • Purpose: Provide immediate, task- speci fi c information to guide the response. The Basics I want you to act as a travel guide. I will write to you about my location and you will suggest 3 places to visit near me in a humorous style. My suggestion: "I am in Las Vegas.” Travel Suggestions:
  14. Contextual Prompting • Assigns a speci fi c character or

    identity for the language model to adopt • Helps the model generate responses that are consistent with the assigned role and its associated knowledge and behavior • Purpose: Frames the model’s output style and voice. The Basics Context: You are writing for a blog about the 90's euro dance genre. Suggest 3 topics to write an article about with a few lines of description of what this article should contain.
  15. Model Characteristics • Large vs Small • General Purpose vs

    Instruction tuned • Architecture • Reasoning capabilities • Context window size LLM’s
  16. Con fi guration • Output Length • Response type •

    Temperature • Top-K & Top-P • System Instructions LLM’s
  17. Con fi guration • Output Length • Response type •

    Temperature • Top-K & Top-P • System Instructions LLM’s
  18. Con fi guration • Output Length • Response type •

    Temperature • Top-K & Top-P • System Instructions LLM’s
  19. Con fi guration • Output Length • Response type •

    Temperature • Top-K & Top-P • System Instructions LLM’s
  20. Con fi guration • Output Length • Response type •

    Temperature • Top-K & Top-P • System Instructions LLM’s
  21. Con fi guration • Output Length • Response type •

    Temperature • Top-K & Top-P • System Instructions LLM’s Please provide shorter responses, 1-3 sentences.
  22. One-Shot & Few-Shot • Adding examples • One-Shot • One

    example • Few-Shot • Multiple examples • At least 3-5 examples Techniques
  23. One-Shot & Few-Shot • Adding examples • One-Shot • One

    example • Few-Shot • Multiple examples • At least 3-5 examples Techniques
  24. Instruction: Convert the following description of a Las Vegas hotel

    room into a JSON object. Example: Description: "The Bellagio Fountain View King offers a king bed with stunning views of the Bellagio Fountains." Result: { "name": "Bellagio Fountain View King", "location": "Bellagio", "bed_type": "King", "view": "Fountains" } Input Data: Description: "The Palazzo Grand King Suite features a spacious suite with a king bed and a living room area." Output Indicator: Return the output as a JSON object.
  25. One-Shot & Few-Shot • Adding examples • One-Shot • One

    example • Few-Shot • Multiple examples • At least 3-5 examples Techniques
  26. Instruction: Extract the key details from the following conference session

    descriptions. Examples: Description: "Charlie Arehart will be speaking on 'Debugging All the Things' using CommandBox." Result: { name: "Charlie Arehart", framework: "CommandBox", session: "Debugging All the Things" } Description: "Gavin Pickin's session 'API Development with ColdBox' will show how to build robust APIs." Result: { name: "Gavin Pickin", framework: "ColdBox", session: "API Development with ColdBox" } Description: "Luis Majano presents 'Modernizing Legacy CFML Apps' with the help of ContentBox." Result: { name: "Luis Majano", framework: "ContentBox", session: "Modernizing Legacy CFML Apps" } Input Data: Description: "Mark Drew will host 'Scaling your CFML application' using FW/1." Output Indicator: Return the output as a JSON object.
  27. Step-Back 1. Consider a general question 2. Feed the answer

    into a subsequent prompt • Allows to activate relevant background knowledge and reasoning processes Techniques
  28. Instruction: Create a one-day itinerary for a CFML developer attending

    a conference in Las Vegas. Step-back Plan: 1. First, identify the core components of the request: a one-day itinerary for a developer in Las Vegas. What are the essential elements? 2. Acknowledge the developer's core interest (the conference) and schedule a key session block. 3. Consider the Las Vegas context. Identify a popular lunchtime spot near the conference venue and a well-known evening entertainment option. 4. Integrate travel and timing. What's a logical flow from the conference to the evening event, and how should travel time be factored in? 5. Finally, synthesize these elements into a single, cohesive, day-long itinerary. Input Data: - Conference location: Resorts World Convention Center - Developer's interest: Learning about CFML and AI. - Evening activity: A show, perhaps a Cirque du Soleil performance. Output Indicator: Provide the final itinerary as a detailed, point-by-point plan for the day, including a title and time estimates for each activity.
  29. Clari fi cation Prompting • instruct to fi rst ask

    clarifying questions • fi nal output is more accurate, relevant, and aligned with your actual needs Techniques You are an expert software engineer. Your task is to respond to a user's request for code. Before you write any code, you must first ask at least three clarifying questions. Do not write any code until you have received the answers to all of your questions. Example Request: "Write a function to process user data from an API and save it to a database."
  30. Chain of Thought (CoT) • Intermediate reasoning steps • Combine

    with Few-Shot • Response includes thought reasoning • more output tokens so more money and take longer Techniques When I was 3 years old, my partner was 3 times my age. Now, I am 20 years old. How old is my partner?
  31. Self-Consistency 1. Generating diverse reasoning paths • With high temperature

    2. Extract the answers 3. Choose the most common answer • High cost Techniques
  32. Instruction: Determine the check-in time for the following user profiles

    based on this rule: A user can check in early (12 PM) if they are a "High Roller" AND have a "Diamond Club" membership. All other users check in at 3 PM. Input Data: - User A: High Roller, Platinum Club - User B: Not a High Roller, Diamond Club - User C: High Roller, Diamond Club Self-Consistency Plan: 1. Generate three different answers for each user's check-in time. 2. For each answer, include the reasoning for your decision based on the rule. 3. Compare the three generated answers for each user. 4. Select the final, most consistent answer for each user. Output Indicator: Return a final, single JSON object with the check-in time for each user.
  33. Tree of Thoughts (ToT) • Combining Chain of Thought and

    Self-Consistency • Explore multiple different reasoning paths simultaneously • Well-suited for complex tasks that require exploration Image Source: Yao et el. (2023) Techniques
  34. Tree of Thoughts (ToT) Techniques Imagine three different experts are

    answering this question. All experts will write down 1 step of their thinking, then share it with the group. Then all experts will go on to the next step, etc. If any expert realises they're wrong at any point then they leave. The question is: Is ColdFusion dead? • Combining Chain of Thought and Self-Consistency • Explore multiple different reasoning paths simultaneously • Well-suited for complex tasks that require exploration
  35. Prompt Chaining • Smaller tasks lead of better results •

    Perform transformations • Boosts transparency, controllability, reliability and performance • Useful when building assistants Techniques
  36. ReAct • Reason & Act • Mimics how humans operate

    in the real world • Interaction with external tools • First step towards agent modeling Techniques
  37. Automatic Prompt Engineering • Prompt a model to generate a

    prompt Techniques Write me a prompt using the Tree of Thoughts technique and that asks the question "What are the top three attractions in Las Vegas?"
  38. Imagine you are a team of three travel experts specializing

    in Las Vegas. Your goal is to identify and justify the top three attractions in the city. Step 1: Each expert will independently brainstorm a list of potential top attractions in Las Vegas, providing a brief rationale for each choice. Think broadly and consider different types of attractions (e.g., shows, landmarks, unique experiences). Expert 1 (The Luxury Aficionado): Focuses on high-end, world-renowned attractions and experiences. Expert 2 (The Entertainment Guru): Specializes in shows, performances, and dynamic entertainment venues. Expert 3 (The Iconic Landmark Scout): Looks for the most famous and culturally significant landmarks and must-see places. Step 2: The experts will now share their lists. Compare and evaluate the brainstormed ideas from all three lists. For each attraction, a "vote" will be cast on whether it is a strong candidate for the top three. The goal is to identify a consensus or a clear front-runner among the options. Step 3: Based on the collaborative evaluation, select the three attractions that received the most support and have the strongest justifications. For each of the top three, provide a comprehensive, detailed description that includes: * Why it's a top attraction (revisiting and expanding on the initial rationale). * What visitors can expect from the experience. * Any key details or tips for visiting. Step 4: The final answer will be the consolidated list of the top three attractions with their detailed descriptions. The team of experts will present this as the definitive guide to the best of Las Vegas.
  39. … Step 4: Final Consolidated Answer The definitive top three

    attractions in Las Vegas are: The Las Vegas Strip: The heart and soul of the city, offering a 24/7 feast for the senses with its iconic hotels, dazzling lights, and endless entertainment. The Fountains of Bellagio: A breathtaking, choreographed water show that stands as a symbol of the city's elegance and artistic flair, offering a stunning and free spectacle for all. A "Cirque du Soleil" Show: The pinnacle of live entertainment, providing a mesmerizing blend of acrobatics, artistry, and technology that elevates the Vegas experience to a new and unforgettable level.
  40. And many more… • Perspective Transition Prompting • Meta Prompting

    • Generated Knowledge Prompting • Directional Stimulus Prompting • Multimodal CoT Prompting • Etc. Techniques
  41. • Writing code • Explaining Code • Translating Code •

    Debugging and Reviewing Code • IDE Con fi g Code Prompting
  42. Resources • Google Whitepapers • Foundational Large Language Models &

    Text Generation • Prompt Engineering (Lee Boonstra) • Research papers on arxiv.org • promptingguide.ai • learnprompting.org Next Steps
  43. MASTERING PROMPT ENGINEERING: GETTING AI TO WORK FOR YOU [email protected]

    https://www.linkedin.com/in/guustnieuwenhuis www.wearenorth.eu
  44. Q&A