LeeBoonstra.dev
The Art of Writing Effective Prompts

The Art of Writing Effective Prompts

Whether you are writing a prompt to let the LLM answer a question from a contract, summarize a report, classify user feedback, or extract order information, writing a prompt containing just one line with the question is likely insufficient. You will need to provide instructions, constraints, reasoning, and a few-shot examples, and you will set your expectations for the style and output format. Trust me, you will quickly end up with an extensive written prompt, which increases in size over the various iterations.

Writing prompts can present challenges, particularly when instructions or constraints clash. For instance, an instruction to ‘avoid hallucinations or fabrications’ could hinder creativity or explanations in certain edge cases. This underscores the importance of adaptability in your prompt writing approach. When working with a test set of example user inputs, it’s crucial to be flexible and ready to revisit and verify if recent prompt changes don’t disrupt previously successful prompts. This adaptability is key to maintaining the effectiveness of your prompts.

This is the 5th blog of the series: Prompt engineering for business applications. Prompt Engineering is complex and requires careful planning and refinement to achieve desired results from AI models. As a software engineer @Google with experience in prompt engineering for major businesses, I will share practical learnings in a blog series to help others unlock the power of AI beyond simple tasks.

Lee Boonstra

Lee Boonstra

Lee Boonstra (they/them) has been a presence in the tech world since 2007, wearing many hats from software engineer to prompt engineer, web developer to technical trainer, and developer advocate.

With eight years of experience at Google under their belt, they now hold the role of SWE Tech Lead at the Google Cloud office of the CTO. Leading innovation projects, Lee aims to disrupt markets and foster collaboration globally. Their expertise in Conversational and Voice technology, alongside (Generative) AI, has led to recognition as a respected public keynote speaker and published author for O’Reilly and Apress. Lee eases tech headaches and celebrates those light bulb moments.

Lee Boonstra

Lee wrote a book for O’Reilly: Hands-on Sencha Touch 2 and lately: the Definitive Guide to Conversational AI with Dialogflow and Google Cloud for Apress.

My book
Documenting Your Prompts a Best Practice for Success

Documenting Your Prompts a Best Practice f...

Let’s be real; documenting stuff isn’t the most exciting part of any job. But when it comes to...

Beyond the Basics How to Choose and Configure Your LLM for Maximum Impact

Beyond the Basics How to Choose and Config...

When it comes to prompt engineering, the choice of language model (LLM) is crucial. Each promp...

The Foundation Understanding LLMs and Prompt Engineering, and Why It All Matters

The Foundation Understanding LLMs and Prom...

Let’s get down to basics and talk about how Large Language Models (LLMs) actually work. Think ...

Demystifying Prompt Engineering for the Enterprise

Demystifying Prompt Engineering for the En...

Prompt engineering for business applications isn’t as simple as asking a question. It’s a comp...

Disclaimer: The opinions stated here are my own, not those of my company. - 2022 ® Lee Boonstra