Enhancing LLM prompting with CO-STAR
Obviously, AI-generated

Enhancing LLM prompting with CO-STAR

The quality of output we receive from LLMs largely depends on the quality of our input, namely the prompt. This is crucial for ChatGPT users, and even more so for those developing LLM applications.

There have been several techniques emerging from the community, but I recently came across an intriguing one: the CO-STAR framework, as detailed in an article on Medium.

Interestingly, I haven't found many formal references to it beyond that article, so I decided to give it a quick try.

I'll provide a practical example, and we can observe the results together. You might be surprised!

But first, let's shed light on the CO-STAR framework, introduced by Singapore GovTech.

CO-STAR stands for Context, Objective, Style, Tone, Audience, Response:

  1. Context: Understanding the 'where' and 'why' behind each query. By feeding LLMs with rich contextual data, we can significantly enhance their ability to provide accurate and relevant responses.
  2. Objective: Clarity of purpose is key. Each query should have a well-defined goal, whether it's solving a coding issue, brainstorming AI strategies, or discussing the latest trends in GenAI. This clarity enables LLMs to tailor their responses more effectively, leading to more productive outcomes.
  3. Style: The way we communicate with LLMs matters. Adapting our style to suit different scenarios - be it technical, creative, or instructional - allows us to extract the best possible responses from LLMs. For instance, a more technical style might be used when seeking solutions to complex programming challenges.
  4. Tone: It's not just what we say, but how we say it. The tone of our queries can influence the nature of LLM responses. A professional tone can be particularly effective in eliciting detailed and methodical answers, which is essential in the realm of software development.
  5. Audience: Recognizing our target audience enables us to refine LLM interactions. Whether it's fellow developers, potential clients, or the curious layman, tailoring our use of LLMs to suit our audience can drastically improve the effectiveness of the information shared.
  6. Response: The end goal - impactful, accurate, and relevant answers.


Now, here's the surprise (or perhaps not so surprising): I've employed the CO-STAR framework to explain the CO-STAR framework itself when presenting its concept to an LLM.

The following was the prompt, crafted in adherence to the CO-STAR guidelines:

# CONTEXT #
I want to post on Linkedin an article about a new technique to enhance LLM prompting. My field is software development and GenAI.

# OBJECTIVE #
Create a post for me about CO-STAR framework created by Singapore GovTech to increase effectiveness and relevance of an LLM’s response. CO-STAR stands for Context, Objective, Style, Tone, Audience, Response. Please associate these things to the increase of quality of responses from an LLM such as ChatGPT.

# STYLE #
Follow the writing style of successful AI writers.

# TONE #
Smart.

# AUDIENCE #
Other IT professionals, people interested in GenAI, LLM app developers.

# RESPONSE #
The Linkedin post, impactful.        

Almost everything presented in the ordered bullet list is actually the response from the LLM using the CO-STAR framework.

What are your thoughts on its effectiveness?

Please share any other LLM prompting techniques you've been using as well!


Caitlin Meyer

Director of Content & Regional Director SA

1 年

Natasha Nel very relevant post for what we are working on now. Can't wait to try it!

Nicole Lee

GovTech Prompt Royale Lead ? 6th at Global Prompt Engineering Championship 2024

1 年

Hi Sebastian, thanks for advocating our framework! Saw the liner on how you couldn't find further references to the CO-STAR framework. If you'd like to read further, you can check out the framework in our larger Prompt Engineering Playbook here: https://go.gov.sg/promptengineering-playbook-file-public! ?? Joseph Tan

Ashish Tyagi

Principal Solutions Architect @ Genesis Global | MBA in Finance

1 年

This is great Article. Thank you

Juarez Gaia Neto

Growth | Capital Markets | Strategic Sales | Fintech | AI | Digital Assets

1 年

Great article!

要查看或添加评论,请登录

Sebastian Galvao的更多文章

  • Tools for thought or tools for fools?

    Tools for thought or tools for fools?

    If you're building AI tools these days, have you found yourself questioning things like "Will this be useful?", "Will…

社区洞察

其他会员也浏览了