Prompt Engineering — How to trick AI into solving your problems

<p>This is the fourth article in a&nbsp;<a href="https://towardsdatascience.com/a-practical-introduction-to-llms-65194dda1148" rel="noopener" target="_blank">series on using large language models</a>&nbsp;(LLMs) in practice. Here, I will discuss prompt engineering (PE) and how to use it to build LLM-enabled applications. I start by reviewing key PE techniques and then walk through Python example code of using LangChain to build an LLM-based application.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:700/0*ZcfH-qxXT4AYAqwr" style="height:467px; width:700px" /></p> <p>Photo by&nbsp;<a href="https://unsplash.com/@ninjason?utm_source=medium&amp;utm_medium=referral" rel="noopener ugc nofollow" target="_blank">Jason Leung</a>&nbsp;on&nbsp;<a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral" rel="noopener ugc nofollow" target="_blank">Unsplash</a></p> <p>When first hearing about prompt engineering, many technical people (including myself) tend to scoff at the idea. We might think, &ldquo;<em>Prompt engineering? Psssh, that&rsquo;s lame. Tell me how to build an LLM from scratch.</em>&rdquo;</p> <p>However, after diving into it more deeply, I&rsquo;d caution developers against writing off prompt engineering automatically. I&rsquo;ll go even further and say that&nbsp;<strong>prompt engineering can realize 80% of the value</strong>&nbsp;of most LLM use cases with (relatively) very low effort.</p> <p>My goal with this article is to convey this point via a practical review of prompt engineering and illustrative examples. While there are surely gaps in what prompt engineering can do, it opens the door to discovering simple and clever solutions to our problems.</p> <h1><strong>What is Prompt Engineering?</strong></h1> <p>In the&nbsp;first article of this series, I defined&nbsp;<strong>prompt engineering</strong>&nbsp;as&nbsp;<strong>any use of an LLM out-of-the-box</strong>&nbsp;(i.e. not training any internal model parameters). However, there is much more that can be said about it.</p> <p><a href="https://towardsdatascience.com/prompt-engineering-how-to-trick-ai-into-solving-your-problems-7ce1ed3b553f">Click Here</a></p>