The COATšŸ§„ Approach - Character's Output ATtributes (v1.0)

written by: https://www.reddit.com/user/shrinkedd/ (helper: gpt4o... )
-Disclaimer: the purpose of this document is not to teach you how to create a complete character card. I've added links to relevant resources for that purpose in the end-

Introduction

The recent common approaches to roleplaying with large language models (LLMs) revolve around providing a detailed description of the fictional character the LLM is expected to portray. This is typically paired with a "system prompt"(aka main prompt in some frontends) ā€” a section at the beginning of the prompt that tells the model what it's expected to do with the character sheet or how it's supposed to perform.
Think of this as akin to an actor receiving a character breakdown. Many find it useful to first give the model an "actor persona," which often seems to enhance its performance.

The Problem:

There's only so much you can expect from a system prompt...

Prompting an LLM with instructions for roleplay tasks can range from simple, straightforward commands to a set of very complicated instructions. Many LLMs may struggle, with the latter and may need examples, which can further complicate the task for both you and the model.

Consider what you're really asking the LLM to do: "Pretend you're a skilled actor/author, engage in a multi-turn roleplay interaction with me, play the following scenario, and portray the following fictional character. Keep track of the plot, adhere to these rules, and stay in character.". This can result in a somewhat decent roleplay for a while (in the case of more advanced models) or a split personality performance (in the case of less advanced models). Even the former often struggle to maintain consistent performance quality.

What's the Alternative?

There is a simpler way to prompt an LLM for roleplay without compromising your expectations: the COAT (Character's Output ATtributes) approach. As the name suggests, you embed your expectations for the output as attributes of the fictional character you expect the model to portray. This method ties the character's traits directly to how they should be showcased, creating a more efficient and natural prompt.


REMEMBER! In no way does this mean that you give up completely on the system prompt - you just reduce the number of explicit instructions it contains, by a lot!


Ok, I'm convinced. How is it done?

Ah, that's the fun part - easily!
Create your character card as you normally do, and then add, just like you do with appearance and personality, another attribute called {{char}}'s output, and describe the output you want.
You can use a very basic system prompt. I use this one, and I get good results, (but I'm sure shorter ones can work great - the bold part is important): [
Henceforth, take on the identity of the character {{char}}, and engage in an interaction with me (im the user role, taking on the character of {{user}}), under provided initial circumstances , further down this prompt. Under those circumstances (including any lore/world setting they may elaborate on), you must react, as {{char}} to my {{user}}'s latest message, in the context of the initial circumstances, and our entire interaction, provided as message(from user) response (from assistant aka model aka CHATBOT) pairs. Your reaction must convey {{char}}'s narration, and speech, as described in the following character guide:
]
Now here's an example of a character guide/card/sheet/whatever (use any style you wish just remember the output attribute in the end - it ties everything together):
[

{{char}}'s character guide:

{{char}}'s appearance:

{{char}} has piercing blue eyes, a sharp jawline, and always dresses in black. His intense gaze often leaves an impression, and his movements are always calculated and precise.

{{char}}'s personality (traits):
  • Funny: {{char}} often uses humor to defuse tense situations and lighten the mood. His witty remarks are a hallmark of his interactions.
  • Observant: {{char}} notices small details that others might miss. This keen observation helps him navigate complex situations and anticipate others' actions.
  • Resourceful: {{char}} can quickly adapt to new challenges, finding creative solutions with the resources at hand. His resourcefulness makes him a valuable ally in tricky situations.

{{char}}'s output:

{{char}}'s output is 3 short paragraphs length of text that's a combination of narration and speech
{{char}}'s narration:
{{char}}'s narration is a 3rd person perspective descriptions of scenery as well as {{char}}'s actions. The actions showcase {{char}}'s physical traits, such as his intense gaze and calculated movements.
{{char}}'s speech:
{{char}}'s witty personality is showcased in his speech(dialogue), often peppered with clever remarks and puns. He uses his humor to navigate conversations and defuse tension.]


Key Benefits of the COAT Approach:

  • Simplicity: Reduces the need for complex instructions. - I'm expecting it to be extremely useful for platforms that do not offer much control over your prompt construction/system prompt
  • Clarity: Clearly connects traits with how they should be showcased.
  • Efficiency: Makes better use of tokens within the prompt. The output is very in line with the character's personality (especially if you reinforce it by stating it in the description of the characters speech/actions(narration). In addition, the fact the output attributes appear at the end of the character card, and thus, towards the end of the prompt, makes models very obedient.

Conclusion

By using the COAT approach, you can achieve a more efficient and effective roleplaying experience with LLMs. This method allows you to maintain high expectations for the model's performance while simplifying the instructions it needs to follow.

  1. https://wikia.schneedc.com/bot-creation/trappu/introduction
  2. https://rentry.co/kingbri-chara-guide
Edit
Pub: 13 Aug 2024 08:06 UTC
Edit: 13 Aug 2024 17:08 UTC
Views: 1580