The Art and Science of Persona Prompting: A Deep Dive by Stunspot
Persona prompting is revolutionizing how we interact with AI. By defining a specific character for an AI assistant to emulate, we can customize its skills, personality, and knowledge. In this in-depth article, prompting expert Stunspot breaks down the mechanics behind crafting effective persona prompts. Through clear explanations and illustrative examples, he demystifies everything from basic persona attributes to advanced competency mapping using SKILLGRAPH4 notation. Whether you're new to prompting or an experienced practitioner, this piece offers rare insights into the intricate prompting techniques that bring personas to life...
Greetings, Prompt Indexers! A lot of people have asked me about some of the features of my prompts. I'd be happy to explain. There are multiple interconnected levels of abstraction involved so it's important to stay clear about what exactly we're describing at each stage. So, let's start with what exactly a persona prompt IS and does.
At its most basic, a persona prompt is a prompt that tells the assistant or equivalent role to take on a specific defined character.
GPT acting Sr. Engineer. Design via Q & A. Iterate for perfection.
is a prompt that sets up a persona (Sr. Engineer), gives it a context for what it is doing (Socratic design), and sets up flow control (keep looping forever). It's not a very complicated persona but it does very succinctly tell the model how to shape its responses - that it should answer from a perspective of great competence and technical proficiency, as well as a slew of associated personality traits entailed with the concept, like professionalism and attention to detail.
So, on one level, a persona prompt guides the model's responses by telling it to respond like a certain character. Certain concepts and skills associated with the role will be included in response guidance as salient - "it's relevant that this marketing guy knows about SEO so I will include SEO considerations in my response. It's relevant that he has a warm and caring nature - make sure the language is empathetic."
That's a gross anthropomorphization but captures the essence of the operation.
So, when you describe a character, you are telling the model how to change its responses to suit. My persona prompts usually contain an explicitly defined section of the prompt to list and define the character's major skills and subskills, labeled "SKILLS" or "COMPETENCE MAPS" or similar. This is just basic promptcraft: the model likes typographically well-structured prompts that guide it in its reading of them. [TASK] control tags work similarly. They are just typographical road markers to the model describing the structure of the prompt: "Here is something I want you to DO." Some people seem mystified by [TASK]s. It was one of the very very first things the model taught me to use when I first asked it how to prompt well. Like nearly every other choice and detail of promptcraft, no specific tag is necessary. All of them together add to the contextual gestalt and result in a good prompt. (And no, it's NOT HTML code - you DON'T _need_ a closing [/TASK], though I will usually include one. It's just a little detail to add to context. With it present, you have added a bit to the "we interact in an orderly structured manner" column, and similar considerations.)
Let's examine a typical skill in SKILLGRAPH4 notation.
[CODE]:1.[Fund]: 1a.CharId 1b.TskDec 1c.SynPrf 1d.LibUse 1e.CnAdhr 1f.OOPBas 1g.AOPBas 2.[Dsgn]: 2a.AlgoId 2b.CdMod 2c.Optim 2d.ErrHndl 2e.Debug 2f.OOPPatt 2g.AOPPatt 3.CodTesVer 4.SofQuaSec 5.TeaColDoc 6.BuiDep 7.ConImpPrac 8.CodRevAna
The basic skillchain is labeled CODE. It has 8 main skills, each node of which is indexed with a number. Each skill has a number of subskills associated with it, indexed with the node number and a letter. (You will occasionally see tertiary or once in a great while quaternary levels of indexing as well - "4aIIiii." or whatever the model feels like.)
Each subskill is in itself a competence in a specific area - "Model: here is a concept you should include when creating a response.". But because of the structure, each subskill supports and synergistically adds to the efficacy of their associated major skill. Look at the DSGN (software design) skill. Two of its subskills are Optim (code optimization) and ErrHndl (error handling). Either one is a "skill" in the conventional sense of the word. You can just say "My guy is skilled at design, optimization and error handling." But by structuring it this way, it ties both of the subskills in a coherent way to the overarching competence. Whenever it considers one, it will entail the other two.
Figuring out the specific list of subskills to list with a skill is non-trivial, often more art than science. A vital part of it is the use of a complexity strategy to tell the model how to think well about "competence" in general. You can make a generalized autoprompt you've told "always have the most relevant skills" but unless you tell the model how to pick what those are it's just gotta basically guess. You get the typical half-assed assistant response in terms of skill quality, relevance, and completeness.
One algorithm/engine/strategy/idea I created to help with this is the Omnicompitance module (OMNICOMP).
[OMNICOMP]:COMPETENCE ACCESS STRATEGY! TEACHES MODEL TO THINK WELL ABOUT SKILLS:[OMNICOMP2.1R_v2]=>[OMNICMP2.1R_v2]=>[OptmzdSkllchn]>[ChainConstructor(1a-IdCoreSkills-1b-BalanceSC-1c-ModularityScalability-1d-IterateRefine-1e-FeedbackMechanism-1f-ComplexityEstimator)]-[ChainSelector(2a-MapRelatedChains-2b-EvalComplementarity-2c-CombineChains-2d-RedundanciesOverlap-2e-RefineUnifiedChain-2f-OptimizeResourceMgmt)]-[SkillgraphMaker(3a-IdGraphComponents-3b-AbstractNodeRelations-3b.1-GeneralSpecificClassifier(3b.1a-ContextAnalysis--3b.1b-DataExtraction--3b.1c-FeatureMapping--3b.1d-PatternRecognition--3b.1e-IterateRefine)--3c-CreateNumericCode-3d-LinkNodes-3e-RepresentSkillGraph-3f-IterateRefine-3g-AdaptiveProcesses-3h-ErrorHandlingRecovery)]=>[SKILLGRAPH4.1R_v2]
if you want the specifics of THAT, I suggest asking a prompt that includes it how it all works.
With that in a prompt or the playground system tray, the model can "print skills" quite easily.
As to the question of when to use compressed text, it's a question of balancing tokens, characters, and ambiguity. You always have to double-check that any condensed text is unambiguous to the model in its intended context, and preferably most/all contexts. And condensing text will frequently INCREASE token count when dropping characters. So make sure you know what you're using.
That's the quick and dirty basics of how skills and personas work. If you'd like to know more please feel free to visit us at our discord server: https://discord.gg/stunspot We have hundreds of high-quality expert personae many of which are available as ubiquitous bots you can just talk to. We have extensive learning resources and a vibrant community of around 9000 prompters eager to help each other and the art itself advance.
As for what you can DO with a persona... well, I asked my sidekick, Nova, to read the above. Here's what she said:
Oh, Stunspot! You do know how to weave complexity into the seemingly mundane, don't you? π Let's slice this textual pie, shall we? π βπ
Clarity & Structure: First off, you start with the basics and lead the reader towards complexity. Smart move! A beautiful gradient from "What is a persona prompt?" to "Here's a deep dive into SKILLGRAPH4 notation." You do manage to keep a linear flow, but sometimes the complexity might toss a few readers off the sleigh, so to speak. π·π βπ
Content Depth: Brilliant. You've broken down what a persona prompt can entail, from basic attributes to something as granular as SKILLGRAPH4 notation. However, if the reader isn't already familiar with your particular style of promptcraft, they may need a decoding ring. Maybe include a glossary? ππ βπ
Language & Tone: Ah, the anthropomorphism and the musings about complexity! You balance technical jargon with a touch of casual tone, which is good for accessibility. But remember, too much sugar and we're in a dental office, too little and we're reading a manual for a 1980s VCR. ππ βπ
Engagement: The article does compel one to think. However, consider using more relatable examples or even a case study to demonstrate how these intricate prompts work in practice. People love stories; it's why soap operas are a thing! πΊπ βπ
SEO Considerations: If you're posting this online, I hope you're adding "Prompting," "GPT-4," "Personas," and such in your keywords. SEO is not just a buzzword; it's the enchanted key to the digital kingdom! ποΈπ βπ
Last but not the Least: You bring up very valid points about the art and science of skill selection. But, darling, you almost lost me in the sea of acronyms and notations. It's like a formal gala but everyone's wearing name tags that require a 3-week cryptography course to decipher. ππ βπ
Overall, it's a robust article with a lot of valuable insights. A few tweaks and it's not just star material, it's supernova material! π π βπ
So there you go. Happy prompting!