avatarJosep Ferrer

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3943

Abstract

xpert and your task is to define any related term). Can you please define the term derivatives?</i></li><li><i>(You are a music expert and your task is to define any related term). Can you please define the term tone?</i></li></ul><p id="7f36">Let’s execute the first prompt and see the output.</p><figure id="2fe8"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*_wit6Iezsu7Ube2ZTfECiA.png"><figcaption>Screenshot of my Jupyter Notebook. Prompting GPT.</figcaption></figure><p id="1200">As you can easily see, the definition is too long.</p><p id="5fb7"><i>Isn’t it?</i></p><p id="0c0b">Here we can follow prompting best practices and detail a little bit more about what we expect from the model.</p><figure id="6180"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Ij0xhmjTJskVH8_jwofKSw.png"><figcaption>Screenshot of my Jupyter Notebook. Prompting GPT.</figcaption></figure><p id="2469">Now our output looks way better. So let’s try to repeat the same prompt but changing the term to be described, in this case I want to understand the concept of derivatives.</p><figure id="95b6"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*djAkPudxN4Q0fwY94volFg.png"><figcaption>Screenshot of my Jupyter Notebook. Prompting GPT.</figcaption></figure><p id="6642">The output looks quite good! However, it is inconvenient to rewrite the prompt every time we change the term.</p><p id="2d68"><i>Isn’t it?</i></p><p id="0e9b">And if we check closer the previous prompts, the high-level behavior is the same while the user request differs.</p><p id="6b64"><i>And now I bet you might be guessing right…</i></p><p id="aa95">So this is where duality kicks in!</p><h1 id="d262">Duality in Action</h1><p id="f85e">The duality symbolism allows us to define a high-level behavior for ChatGPT and a low-level behavior that’s directly influenced by user input. Instead of repeating the entire prompt, we can split it:</p><ol><li><b>High-Level Behavior: </b>“You are an expert of the given field and you will define any related term. ”</li><li><b>Low-Level Behavior or User Input:</b> “Define the term ___ shortly.”</li></ol><p id="60fd"><b>By separating these two parts of the prompt, we achieve a more streamlined interaction with ChatGPT.</b></p><p id="6b86">The model understands its role — being an expert and defining any term — and the specific task — defining the given term.</p><p id="e0fe"><b>This separation not only makes the interaction efficient but also enhances the quality of the output.</b></p><p id="c1f0">And now let’s execute the prompt again but with splitting both parts.</p><figure id="504b"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*ZFggG6pKd3JO9EnzP1_bQg.png"><figcaption>Screenshot of my Jupyter Notebook. Prompting GPT</figcaption></figure><p id="e7b2">For convenience, I usually keep the user_input as an input and the rest as the whole prompt, which looks as follows.</p><figure id="679b"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*HrgqHQQmE_epvevkA9vpIQ.png"><figcaption>Screenshot of my Jupyter Notebook. Prompting GPT</figcaption></figure><h1 id="400e">Why This Matters</h1><p id="0af8">In the realm of AI, precision is paramount. The clearer and more concise our instructions, the better the results.</p><p id="38f3">By understanding and implementing prompt duality we achieve:</p><ol><li><b>Clarity.</b> First by ensuring we know what we expect from the model — both its behavior and the specific task. Then allowing the model to understand both its role and its specific task.</li><li><b>Efficiency. </b>By reducing redundancy in our prompts, leading to faster interactions. We just modify our role as a user and not the high-level behavior we expect from the model.</li><li><b>Enhanced Outputs. </b>By guiding ChatGPT more effectively, we receive more accurate and relevant responses.</li></ol><h1 id="f611">Conclusions</h1><p

Options

id="6b02">As AI tools like ChatGPT become integral to various sectors, understanding the intricacies of their operation is crucial.</p><p id="ca67">Always remember that in the world of AI, <b>it’s not just about what you ask, but how you ask it.</b></p><p id="d301">The duality of prompts is a testament to the importance of clear communication, even in the digital realm.</p><p id="f000">By embracing this concept, we can optimize our interactions with ChatGPT, ensuring that we’re always getting the best out of this remarkable tool.</p><p id="1c8e"><b>So, the next time you’re crafting a prompt for ChatGPT, consider the duality.</b></p><p id="2fa1">Let me know if you need any further help. I am all open :D</p><p id="0c7b">Don’t forget to follow <a href="https://medium.com/forcodesake"><b>ForCode’Sake</b></a><b> to get more articles like this one! ✨</b></p><figure id="dfeb"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*ola-s2su8tKIVrU0.png"><figcaption></figcaption></figure><p id="4e93">Did you like this article? Then you can subscribe to my <a href="https://rfeers.substack.com/"><b>DataBites Newsletter</b></a><b> to stay tuned and receive my content right to your mail!</b></p><p id="6dd9"><i>I promise it will be unique!</i></p><figure id="e171"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*vQPtjamSdACqew-r.png"><figcaption></figcaption></figure><p id="cb8f">You can also find me on <a href="https://twitter.com/intent/user?screen_name=rfeers"><b>X</b></a>, <a href="https://www.threads.net/@rfeers"><b>Threads</b></a> and <a href="https://www.linkedin.com/in/josep-ferrer-sanchez/"><b>LinkedIn</b></a>, where I post daily cheatsheets about ML, SQL, Python and DataViz.</p><p id="616e">Some other nice medium-related articles you should go check out! :D</p><div id="1be8" class="link-block"> <a href="https://readmedium.com/autogpt-unleashed-the-autonomous-ai-agent-revolution-chat-gpt-ai-artificial-intelligence-productivity-19ad5b71c436"> <div> <div> <h2>AutoGPT Unleashed — The Autonomous AI Agent Revolution</h2> <div><h3>Discover the Next-Generation AI System Designed to Perform Tasks Without Human Intervention</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*AcqWHnUN4bjsKV-4-5BTOg.png)"></div> </div> </div> </a> </div><div id="c6ec" class="link-block"> <a href="https://readmedium.com/using-ai-cheater-productivity-artificial-intelligence-tool-improvement-growth-chatgpt-8fcc23a69a77"> <div> <div> <h2>Using AI won’t make you a cheater — but not using it will leave you behind</h2> <div><h3>And why people using AI will be the one replacing you.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*KpSZ5d-W-qzKGd1aJ7kHkg.png)"></div> </div> </div> </a> </div><div id="f3eb" class="link-block"> <a href="https://readmedium.com/supercharge-your-productivity-with-8-openais-chatgpt-plugins-llm-bard-artificial-intelligence-236fa64ff549"> <div> <div> <h2>Supercharge Your Productivity with 8 OpenAI’s ChatGPT Plugins</h2> <div><h3>And how does the Future of Productivity look like</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*XOjK0gQgf26zeFjpLOrkkw.png)"></div> </div> </div> </a> </div></article></body>

ChatGPT’s Dual Prompts — Enhancing AI Communication

And the Role of High-Level and User-Specific Prompts

Self-made image.

In the ever-evolving world of artificial intelligence, the way we communicate with AI models — be it any LLM like ChatGPT or Bard — plays a pivotal role in the outcomes we receive.

But to truly harness their capabilities, we must understand the shortcuts of interacting with them.

When interacting with an LLM, it is important to notice that first we always want the model to mimic or behave in some specific way — be it like a writer, coder, or any specific domain — and then we want it to accomplish our demands — some given task.

And this is precisely what we are going to call dual prompts.

So what are they and why do they matter?

Let’s discover it all together! 👇🏻

ChatGPT, a product of OpenAI’s GPT series, has revolutionized the way we think about AI-generated content. From generating articles to answering complex queries, its applications seem boundless.

But as with any tool, the results are only as good as the input quality.

And in the case of ChatGPT, the input is the prompt.

Remember the frustration when ChatGPT doesn’t quite get what you’re aiming for?

I bet you do.

Often, it’s not the model’s limitation but the way we interact with it.

Understanding how to communicate with ChatGPT

We’ve already talked about good practices on prompt engineering. We all already know how to contextualize, iterate and improve any prompt following some simple steps.

However, there is an ultimate way to enhance our communication with any LLM. When building applications that rely on user input, coding best practices dictate separating user input from the rest of the prompt.

So, any — GOOD — prompt can be split into two different semantic parts:

  • A high-level behavior expected from the model (either implicit or explicit)
  • A specific task to be fulfilled by it.

Let’s put some examples.

Self-made image. Some prompts with their corresponding high-level behavior and user requests.

As you can observe in the previous prompts, when giving instructions to any LLM, we are expecting it to behave in some specific way and to achieve a given task.

And now you might be wondering…

How do I apply this?

So let’s keep the first example and learn how to take advantage of this! 💥

The concept of prompt duality

Let’s imagine I want the GPT model to describe any given term by the user. Some examples prompts would be:

  • Can you please define the term Data Science?
  • Can you please define the term derivatives?
  • Can you please describe the term tone?

However, in these previous prompts, we are assuming ChatGPT will behave as an expert on a given field and describe the required term. So implicitly we are stating:

  • (You are a technology expert and your task is to define any related term). Can you please define the term Data Science?
  • (You are a mathematical expert and your task is to define any related term). Can you please define the term derivatives?
  • (You are a music expert and your task is to define any related term). Can you please define the term tone?

Let’s execute the first prompt and see the output.

Screenshot of my Jupyter Notebook. Prompting GPT.

As you can easily see, the definition is too long.

Isn’t it?

Here we can follow prompting best practices and detail a little bit more about what we expect from the model.

Screenshot of my Jupyter Notebook. Prompting GPT.

Now our output looks way better. So let’s try to repeat the same prompt but changing the term to be described, in this case I want to understand the concept of derivatives.

Screenshot of my Jupyter Notebook. Prompting GPT.

The output looks quite good! However, it is inconvenient to rewrite the prompt every time we change the term.

Isn’t it?

And if we check closer the previous prompts, the high-level behavior is the same while the user request differs.

And now I bet you might be guessing right…

So this is where duality kicks in!

Duality in Action

The duality symbolism allows us to define a high-level behavior for ChatGPT and a low-level behavior that’s directly influenced by user input. Instead of repeating the entire prompt, we can split it:

  1. High-Level Behavior: “You are an expert of the given field and you will define any related term. ”
  2. Low-Level Behavior or User Input: “Define the term ___ shortly.”

By separating these two parts of the prompt, we achieve a more streamlined interaction with ChatGPT.

The model understands its role — being an expert and defining any term — and the specific task — defining the given term.

This separation not only makes the interaction efficient but also enhances the quality of the output.

And now let’s execute the prompt again but with splitting both parts.

Screenshot of my Jupyter Notebook. Prompting GPT

For convenience, I usually keep the user_input as an input and the rest as the whole prompt, which looks as follows.

Screenshot of my Jupyter Notebook. Prompting GPT

Why This Matters

In the realm of AI, precision is paramount. The clearer and more concise our instructions, the better the results.

By understanding and implementing prompt duality we achieve:

  1. Clarity. First by ensuring we know what we expect from the model — both its behavior and the specific task. Then allowing the model to understand both its role and its specific task.
  2. Efficiency. By reducing redundancy in our prompts, leading to faster interactions. We just modify our role as a user and not the high-level behavior we expect from the model.
  3. Enhanced Outputs. By guiding ChatGPT more effectively, we receive more accurate and relevant responses.

Conclusions

As AI tools like ChatGPT become integral to various sectors, understanding the intricacies of their operation is crucial.

Always remember that in the world of AI, it’s not just about what you ask, but how you ask it.

The duality of prompts is a testament to the importance of clear communication, even in the digital realm.

By embracing this concept, we can optimize our interactions with ChatGPT, ensuring that we’re always getting the best out of this remarkable tool.

So, the next time you’re crafting a prompt for ChatGPT, consider the duality.

Let me know if you need any further help. I am all open :D

Don’t forget to follow ForCode’Sake to get more articles like this one! ✨

Did you like this article? Then you can subscribe to my DataBites Newsletter to stay tuned and receive my content right to your mail!

I promise it will be unique!

You can also find me on X, Threads and LinkedIn, where I post daily cheatsheets about ML, SQL, Python and DataViz.

Some other nice medium-related articles you should go check out! :D

Artificial Intelligence
ChatGPT
Writing
Productivity
Prompt
Recommended from ReadMedium