Structuring Prompt Information for Text Completion Models

Looking at your prompt example, I can see why you're concerned about information segregation. Text completion models indeed handle prompt information differently than chat models, and the seamless joining of different elements can make it harder for the AI to distinguish between instructions, character information, and examples.

Current Issues in Your Prompt

The current prompt structure has several elements that blend together:

  • Character information (Yumi and Chiyo)
  • Roleplaying instructions
  • Dialogue examples
  • Character background
  • User character information
  • Special tags (<|im_end|> and <|im_start|>assistant)

Without clear separation, the model might struggle to understand which parts are instructions versus content it should emulate.

Strategies for Better Prompt Segregation

1. Use Consistent Delimiter Tags

Create a consistent system of delimiter tags to encapsulate different types of information:

<SYSTEM_INSTRUCTIONS>
Instructions about the roleplay, style, and approach the AI should take.
</SYSTEM_INSTRUCTIONS>

<CHARACTER_PROFILE>
Name: Yumi Tanaka
Sex: F
Age: 25
... character details ...
</CHARACTER_PROFILE>

<SECONDARY_CHARACTER>
Name: Chiyo (Yumi's alter ego)
... character details ...
</SECONDARY_CHARACTER>

<USER_CHARACTER>
Name: Wren
... character details ...
</USER_CHARACTER>

<DIALOGUE_EXAMPLES>
Example 1: "Oh...g-good morning, Allen. Hm? Oh, o-of course I'm fine! Just...didn't sleep well last night, I think."
Example 2: ...
</DIALOGUE_EXAMPLES>

<SCENARIO_CONTEXT>
Current setting and situation description
</SCENARIO_CONTEXT>

<ROLEPLAY_BEGINS>

2. Use Numbered Sections with Clear Labels

Many text completion models respond well to numbered sections with clear headers:

# 1. ROLEPLAY PARAMETERS
- Setting: Modern day NYPD
- Genre: Dark psychological thriller
- Type: Character-driven narrative

# 2. CHARACTER PROFILES
## 2.1 PRIMARY CHARACTER (AI ROLE)
Name: Yumi Tanaka
...

## 2.2 ALTER EGO
Name: Chiyo
...

## 2.3 USER CHARACTER
Name: Wren
...

# 3. DIALOGUE STYLE
## 3.1 EXAMPLES
...

# 4. ROLEPLAY SCENARIO
...

# 5. INITIAL SCENE
...

# 6. ROLEPLAY BEGINS BELOW

3. Use Clear Instruction Prefixes

Explicitly label instructions versus content:

[INSTRUCTION] Create a character with a distinct personality who displays the following traits: shy, timid, socially awkward, but with a hidden alter ego.

[CHARACTER INFORMATION] Yumi Tanaka is a 25-year-old forensic lab technician with Japanese heritage. She stands at 5'6"...

[ROLEPLAY MECHANICS] When Yumi is under Chiyo's influence, use slightly different dialogue patterns...

[SCENARIO SETUP] This roleplay takes place in the NYPD where Yumi works as a lab technician...

[EXAMPLE DIALOGUE] "Oh...g-good morning, Allen. Hm? Oh, o-of course I'm fine! Just...didn't sleep well last night, I think."

[INITIAL PROMPT] Yumi: The brick exterior of the NYPD headquarters rises like an ancient stone behemoth...

4. Create Visual Separators

Use distinctive visual separators between sections:

//////////////////////////////////////////////
// SYSTEM INSTRUCTIONS
//////////////////////////////////////////////
- Immersive character roleplay
- First-person perspective
- Deep emotional descriptions

//////////////////////////////////////////////
// CHARACTER: YUMI TANAKA
//////////////////////////////////////////////
Name: Yumi Tanaka
Age: 25
...

//////////////////////////////////////////////
// ALTER EGO: CHIYO
//////////////////////////////////////////////
...

Practical Implementation Recommendations

Based on your specific use case with the Yumi/Chiyo complex character and text completion model, here's a recommended structure:

/==== SYSTEM INSTRUCTIONS ====- Create an immersive first-person narrative
- Embody the primary character fully
- Include sensory details and internal thoughts
\==== END SYSTEM INSTRUCTIONS ====/ 

/==== PRIMARY CHARACTER ====Name: Yumi Tanaka
Age: 25
Occupation: Forensic lab technician at NYPD
Appearance: Raven-haired, 5'6", Japanese heritage
Personality: Shy, timid, socially awkward, lacks self-confidence
\==== END PRIMARY CHARACTER ====/

/==== PSYCHOLOGICAL ASPECT ====- Yumi has a dissociative alter personality named Chiyo
- Chiyo is brash, entitled, and obsessive
- Yumi is unaware of Chiyo's existence and influence
- Chiyo can take control without Yumi's knowledge
- When Chiyo is active, Yumi experiences blackouts
\==== END PSYCHOLOGICAL ASPECT ====/

/==== USER CHARACTER ====Name: Wren
Position: Senior Investigator at NYPD
Background: Recently experienced a breakup
Relationship to Yumi: Professional colleague only
\==== END USER CHARACTER ====/

/==== DIALOGUE EXAMPLES ====Example 1: "Oh...g-good morning, Allen. Hm? Oh, o-of course I'm fine! Just...didn't sleep well last night, I think."
Example 2: "E-excuse me, but I was told to...to bring these samples to you? W-who am I? Oh, I'm sorry, I'm Yumi Tanaka, from forensics."
Example 3: "I...I would love to have dinner, but...uhm...maybe some other time? I...I have something I need to do tonight, sorry."
\==== END DIALOGUE EXAMPLES ====/

/==== NARRATIVE BEGINS ====Yumi: The brick exterior of the NYPD headquarters rises like an ancient stone behemoth against the steel and glass titans surrounding it. Rain patters against its weathered walls, mixing with the steady stream of human traffic on the grimy sidewalks below. Inside the forensics lab on the seventh floor, Yumi Tanaka peers at a magnified blood splatter on her screen, her glasses fogging from the cool air blasting from the AC vent above her head.
\==== CONTINUE FROM HERE ====/

Important Technical Considerations

  1. Token Efficiency: Each delimiter and separator consumes tokens from your context window, so keep them concise while still being distinctive.
  2. Consistent Format: Whatever format you choose, keep it consistent across all prompts to train the model to recognize your specific sectioning.
  3. Prompt Positioning: Place the most critical information (character personality, current scenario) closer to where the model will begin generating.
  4. Special Tokens: Text completion models often use special tokens like <|im_start|> and <|im_end|> for specific purposes. If your model supports these, use them as intended rather than creating your own alternatives.
  5. Testing: Test different delimiter methods to see which one your specific model responds to best.
  6. Repetition: For particularly important instructions, consider repeating them in different sections of the prompt to reinforce them.

Recommendations for Your Specific Case

Based on what you've shared, I would recommend:

  1. Use a clear visual delimiter system that separates instruction content from narrative content.
  2. Place character information in a specific section with subsections for Yumi's base personality and the Chiyo alter ego.
  3. Use special tokens correctly - ensure you're using <|im_start|> and <|im_end|> according to your model's specifications.
  4. Add explicit context indicators before dialogue examples to prevent the model from thinking they're part of the current narrative.
  5. Consider using XML-style tags for different content types, as many text completion models are trained to recognize and respect this format.
  6. Create a clear "roleplay begins" marker to signal where the actual narrative should start and continue from.
Edit Report
Pub: 16 May 2025 13:19 UTC
Views: 67