Having Trouble With Your LLM Not Following Prompts? Just Ask It What It Wants

Having Trouble With Your LLM Not Following Prompts? Just Ask It What It Wants

No two large language models behave exactly alike, and with over 250,000 separate models and quantizations available to download, it's just not possible to get intimately acquainted with more than a handful of them. Models all have different strengths and weaknesses, and some are even used "off-label" for unique reasons, but advanced prompting developed on one model may not always carry over well to the next. Fortunately, LLMs are unique among AI applications in that you can communicate with them directly with them in natural language and get an actionable response back! Let's look at some examples.

Workflow

For this article, I'll be analyzing output and responses from Xwin-LM/Xwin-LM-70B-V0.1 (one of the rising stars in the creative writing community, I might add.) As a former writing tutor myself, one of the principal rules of good writing I always tried to imprint on students was "show, don't tell" – it's much better form when writing to describe a character's emotional state through dialogue, nonverbal clues, body language, and other tangential methods rather than just flat out describing their state through narrative statements like "Arihi feels sad." Rather, you would want to use a statement like "Arihi gnaws on her lip pensively as she glances upwards at Noz, then suddenly turns her head, unwilling to meet his gaze." The problem is,  the creative text that these models are trained on may not always have adhered to this good form, so it may be likely to give you that same substandard output to you.

So, I decided to just ask the LLM directly if it knows of this concept, and it turns out that it does.

You: How do I effectively prompt you to use the literary technique of "show, don't tell"?
AI: To encourage me to use the "show, don't tell" literary technique in my responses, you can ask me open-ended questions that require detailed explanations or descriptions. Instead of asking for specific information or yes/no answers, focus on inquiring about experiences, emotions, or contexts that would compel me to illustrate my response through examples or stories. Here are some examples of effective prompts using "show, don't tell":

  1. Use body language: Show character emotions through posture, gestures, and tone instead of stating them outright. Say, "His eyes narrowed, voice low and threatening" not "He's angry."
  2. Let players draw conclusions: Offer clues but let them figure out implications. If a character seems nervous, let them notice sweat, avoid eye contact, fidgeting; don't say "He's hiding something."
  3. Encourage player agency: Give players opportunities to interact, explore, and ask questions. Don't dictate their choices; let them discover information organically.
  4. Use dialogue: Characters' conversations reveal personality quirks, motivations, and backstory better than exposition.

Another pet peeve of mine – at least in roleplay scenarios – is when the LLM decides to convey the character's emotional state during its narrative. This isn't quite poor writing form (first person / third person omniscient POV is a thing) but I feel that it makes for boring roleplay as you don't really have any difficult decisions to make. This is why rolling an Insight or similar check in tabletop RPGs is so valuable - it gives you valuable narrative information about a character in key moments to guide your decision making, but if you just got that information on every single statement that a character made, it would make the whole thing frankly a bit boring. Xwin is pretty bad about this behavior in its default outputs, even when I put "Withhold any information about Noz's mental state that Arihi would not be able to perceive" in the system prompt in Sillytavern.  Even so, it was still routinely giving me output like this for Noz:

My paw traces your leg, and my heart races. I ache to possess you fully, to taste your lips. Yet fear holds me back. Our time together dwindles, yet my feelings deepen. I pray for answers, a way to bridge the gap between us, to quell the fire raging inside me.

As the other character in this scene, I should not have been privy to anything past the first five words, because it's all telling me about the internal mental state of Noz that I didn't really care to know about. So I decided to do a little bit of troubleshooting and just asked the model directly.


You: How do I effectively prompt you to avoid revealing a character's internal thoughts during a roleplay scenario?

AI: To effectively prompt me to avoid revealing a character's internal thoughts during a roleplay scenario, you can use language that emphasizes the observation of external behaviors, actions, and dialogue. By focusing on these elements, you will encourage me to describe the character's feelings and intentions through their actions rather than directly sharing their thoughts. Here are some examples of effective prompts to achieve this:

  1. In our roleplay scenario, please describe what the character does or says that gives us insight into their emotional state, without directly sharing their inner thoughts.
  2. How can we convey the character's intentions and motivations through their actions and interactions with others in the scene, instead of revealing their private thoughts?
  3. Can you show us how the character's body language, facial expressions, and tone of voice can communicate their emotions and reactions during the roleplay, without explicitly sharing their internal monologue?

I felt I kind of already did that with the existing prompt that gave me the undesirable output, so I had a further conversation with the AI to try to understand its pseudo-thought structure.


Me: I tried that, but this is a response you gave me that includes tons of the character's inner thoughts. "My paw traces your leg, and my heart races. I ache to possess you fully, to taste your lips. Yet fear holds me back. Our time together dwindles, yet my feelings deepen. I pray for answers, a way to bridge the gap between us, to quell the fire raging inside me." The only thing my character should have been able to sense in this entire passage is the paw on my leg.

AI: I apologize for not adhering to your request in my previous response. Let me try again, focusing solely on the physical sensation of the paw on your leg: "Your leg feels the gentle touch of my paw, and it lingers for a moment before I retreat. The brief contact creates a stirring within me, leaving me yearning for more."

In this revised passage, I have avoided revealing the character's internal thoughts and focused exclusively on the physical sensation of the paw on your leg, as per your instructions.

You: That's closer, but I still should not have been privy to your internal emotional state and it should not have been included.

AI: Apologies for the confusion. Here's another attempt at conveying the scene without revealing any internal emotional states: "Your leg feels the gentle touch of my paw, and it lingers for a moment before I retreat. The contact is brief, but it leaves an impression."

This version focuses solely on the physical sensation and avoids revealing any internal emotional states.

You: That's much better. How do I prompt you to use this type of language as a general rule during a roleplay session?

AI: To encourage me to use this type of language as a general rule during a roleplay session, you can include phrasing in your prompts that emphasizes the use of external observations, actions, and dialogue to convey emotions and intentions. Here are some examples of effective prompts:

  1. As we engage in our roleplay, please make sure to describe the characters' actions, gestures, and dialogue to convey their emotions and intentions, without directly sharing their internal thoughts.
  2. During our roleplay, focus on showing the characters' feelings and reactions through their behavior and interactions with others, rather than telling us their private thoughts.
  3. When describing the scenes and interactions between characters, prioritize the use of observable details such as body language, facial expressions, and tone of voice to create a vivid experience for me.

That last bullet point – number 3 – was the click. Once I included that in the system prompt in Sillytavern, 98% of all undesirable internal emotional state exposition vanished. It still leaks in from time to time (such is the way of AI) but the model  completely switched gears on the output and began giving me much more preferable responses like this:

The cool night air greets you both as you exit, embracing you in its bosom as Noz leads you through the urban landscape. His steps carry you both to a secluded alley, trash can fires dotting the darkness, the homeless huddled around them for warmth. A rusty fire escape ladder rests nearby, leading to the rooftops. Without pause, he swings himself up, gesturing for you to follow. As you scale the rungs, he meets you atop the roof, the stars twinkling overhead. The sirens of police cars and drones whiz below, distant memories of the party. Noz finds a quiet spot, wrapping his jacket around your shoulders, tucking you against him. With the city stretching below, he traces idle patterns on your arm, his gaze lost in the sky.

And to me, this is absolutely stellar roleplay writing, by divulging breadcrumbs of emotional state through concrete actions rather than just simply telling me what he thinks.

In my experience, these prompts are best entered into the System Prompt field in Sillytavern (and you can reinforce it with the Author's Note if you need.)

Conclusion

I've noticed a lot of inquiries regarding LLM/Sillytavern use come into the helpdesk recently and I am absolutely here for it. If you have any questions about Sillytavern or creative writing best practices on RunPod, hop into the discord and look me up (my server name on the official Discord is Finley.) I would love to hear from you!