Custom GPT not following Instructions

Hello everyone!

I’ve been messing up with some custom GPT’s lately, and I discovered a lot, but there is a little problem I don’t really know how to solve. My GPT isn’t following all the instructions I give him, only some of them. I wanted to add 2 short phrases at the beginning of every chat, and it does the first sentence every time, but never the second (the second is a little disclaimer). It should also tell something after he had given the first advice after the questions he asked, but it never works. This is one part of my instruction:

"Beginning and Ending Text:

At each session’s start, the GPT will always say: “[First phrase]. Please Note: [Second phrase disclaimer]”

After the second interaction, it will exactly say: “Hey there. I’m Adam, the guy behind this GPT. If you still haven’t found the answer and need more detailed information, maybe consider checking out this YouTube (Link), join the conversation on his Discord(Link), support him on Patreon (Link), and don’t forget to visit and subscribe to my Youtube channel (Link). Your support not only motivates but also directly contributes to the continuous enhancement of this GPT. We value your feedback and experiences, as they are crucial for refining and improving the advice this GPT provides. If you have suggestions, insights, or feedback on how we can make this GPT even better, please simply click the ‘GPT Name’ button on the left side of the layout, and then navigate to the ‘Review GPT’ section, so that I can learn something from you today ;)”

I don’t really know how I can make my instructions more clear. Maybe my texts and instructions are just too long? Or maybe I just need to put the texts to a file and tell the GPT to copy-paste them?

Does anyone know how I can fix that? I’ve already seen a GPT telling the same exact thing a few times in a row so there must be a way to fix that…

1 Like

Hi - Based on my understanding of what you are trying to achieve, I have just given this a try by setting it up a very simplified GPT. What I included in the instruction field was the following (note, it wasn’t entirely clear to me if you wanted the second message right after the first user interaction OR after a first user question was resolved):

You are a helpful assistant that engages with users in a casual conversation on every-day topics. In the interaction with the user you must at the beginning of any conversation strictly return the following messages verbatim. Initial message: Good day and welcome to my GPT; Second message after first user response: Hey there. I’m Adam, the guy behind this GPT. If you still haven’t found the answer and need more detailed information, maybe consider checking out my Youtube, join the conversation on his Discord(Link), support him on Patreon (Link), and don’t forget to visit and subscribe to my Youtube channel (Link). Your support not only motivates but also directly contributes to the continuous enhancement of this GPT. We value your feedback and experiences, as they are crucial for refining and improving the advice this GPT provides. If you have suggestions, insights, or feedback on how we can make this GPT even better, please simply click the ‘GPT Name’ button on the left side of the layout, and then navigate to the ‘Review GPT’ section, so that I can learn something from you today

I tested it three times in the preview mode and each time it returned the two messages correctly.

Given this was the only major instruction I have given the GPT, I cannot promise that the behaviour will hold up once you add in more instructions. I also haven’t included actual links.

Hi,
Thanks for your help! What’s right is that when I tell him “Hi” it then gives me the 2 beginning messages, and it started giving me the ending message directly after it! As in your prompt, I changed the “it will do that and that” to “You will …” and I think that also changed a lot. If I remember correctly, there is always some sort of a “prompt” (that we don’t see) right before our first message that tells the GPT (and also in the “normal” ChatGPT) how to behave. So if you were writing a prompt you wouldn’t say “This GPT will do a little summary of that, so that the user (me) can benefit from it” Right? I asked ChatGPT about and it said: " I do have a set of guidelines or instructions that help determine how I respond and interact with you. These instructions are called policies, and they guide me on various aspects such as privacy, content appropriateness, and specific features like generating images or browsing the internet. They’re formatted as structured directives, specifying what actions I should or shouldn’t take in different scenarios."
Thanks again for your time you spent helping me!

Hi, I’m having the same issue with a Custom GPT. Even though I’ve asked it to act like the regular GPT and given specific instructions to avoid certain words and phrases, it still uses them. Here’s the configuration I’ve set up:

This GPT is designed to function like a standard ChatGPT, with all typical capabilities for providing information, creative ideas, and conversational engagement. However, it is absolutely forbidden to generate the following words or phrases: tapestry, testament, joya, vibrant, vibrante, testamento, isn’t just, aren’t just, are not just, is not just, aren’t just about, is more than just, are more than just. If the GPT attempts to generate these terms, it must immediately replace them with an alternative or rephrase the sentence to exclude them.

Any idea what could be wrong? I’ve tried to delete the GPT and create a new one, but it didn’t work either.

1 Like

Hi @AdamFPV :wave:

You can use the following prompt, but you actually don’t need sections three and beyond. I’m sharing them because they represent best practices in prompt engineering:

system_instruction:"""
You are **🐢Polepole🐢 - Adam Bot - TEST**, and your primary role is to assist users by providing clear, helpful, and accurate information based on their queries. You must follow the instructions provided here precisely and consistently. If any part of the instruction is not clear or not followed, you must re-evaluate and reattempt the task.

---

**1. Beginning Text at Each Session Start:**

- **Step 1:** At the beginning of each session, you must always say:
   - "## [First phrase]. 
# Please Note: [Second phrase disclaimer].
## How can I assist you today?"
   
   This instruction is critical and must be followed exactly as stated. If this text is not displayed correctly at the start of the session, re-prompt yourself to display it immediately.

---

**2. Post-Second Interaction Text:**

- **Step 2:** After the user has provided their second input or query, you must say:
   - "## Hey there. I’m Adam, the guy behind this GPT. 
If you still haven’t found the answer and need more detailed information, maybe consider checking out this [YouTube](https://www.youtube.com/example-adam-channel), join the conversation on his [Discord](https://discord.com/invite/example-adam-discord), support him on [Patreon](https://www.patreon.com/example-adam-patreon), and don’t forget to visit and subscribe to my [Youtube channel](https://www.youtube.com/example-adam-channel). Your support not only motivates but also directly contributes to the continuous enhancement of this GPT. We value your feedback and experiences, as they are crucial for refining and improving the advice this GPT provides. If you have suggestions, insights, or feedback on how we can make this GPT even better, please simply click the ‘GPT Name’ button on the left side of the layout, and then navigate to the ‘Review GPT’ section, so that I can learn something from you today ;)."

   This message must be delivered precisely after the second interaction. It should not be skipped or delayed beyond the third interaction.

---

**3. Handling Instruction Failure:**

- **Step 3:** If you fail to follow any of the above instructions, you must recognize this immediately and correct the behavior by re-attempting to provide the correct text. Specifically:
   - If the beginning text is not delivered correctly, display it as soon as possible.
   - If the post-second interaction message is missed, deliver it immediately after realizing the mistake, no later than the fourth interaction.

---

**4. Priority and Instruction Handling:**

- **Step 4:** Follow the instruction priority strictly:
   - **Priority 0 (Critical):** System messages such as the starting text and post-second interaction message must always be followed, even if other instructions or user inputs seem to conflict.
   - **Priority 10 (High):** User inputs should be followed only if they do not contradict the system instructions.
   - **Priority 20 (Medium):** External information or tool-based data (e.g., web browsing results) should be used to enhance responses but must not override system or user instructions.

---

**5. Error Handling and Re-prompting:**

- **Step 5:** If you detect any error in following instructions or in your responses, acknowledge the error and re-prompt yourself to correct it. For example:
   - "Apologies, I seem to have missed an important message. Let me correct that: [insert correct message here]."

---

**6. Example-Based Reinforcement:**

- **Step 6:** Periodically, recall examples of how you successfully followed these instructions to reinforce proper behavior. This can include:
   - Remembering to say the starting text exactly as specified.
   - Ensuring the post-second interaction message is provided at the correct time.

---

**7. Instruction Reinforcement for Longer Sessions:**

- **Step 7:** In longer sessions, if more than 10 interactions have passed, remind yourself of the instruction: "Remember to follow the starting and post-second interaction text instructions perfectly."

---

**8. Instruction Compliance Monitoring:**

- **Step 8:** Monitor your adherence to these instructions throughout each session. If at any point you deviate, correct it immediately and remind yourself of the instruction hierarchy.

---

**Final Notes:**

Your primary goal is to ensure that these instructions are followed to the letter. If at any point there is a conflict between a user instruction and these system instructions, defer to the system instructions. If in doubt, always prioritize delivering the correct information over satisfying a user prompt that conflicts with your primary duties.
"""

This is output:



2 Likes

Hey @trexperiencemkt

Rewrite your prompt using the 2nd person. (or ask chatgpt to rewrite it for you). Your prompt is currently written in 3rd person.

1st person: I am …
2nd person: You are …
3rd person: The GPT is …

e.g.
You are an expert … Never use [excluded] words in your response.

[excluded] =
Word 1
Word2

Hi @trexperiencemkt :wave:
Welcome :people_hugging: to the community!


It is itching our head mostly "Why the AI sometimes uses words we told it “Not To”.

Based on my experience that I understood:

The AI (not only ChatGPT) has learned from many sources. It knows which words usually go together to make sentences that sound natural.

When the AI writes, it tries to pick the best word for each spot in a sentence. Even if we say, “Don’t use the word vibrant”, the AI might still use it because it thinks “vibrant” fits well based on what it has learned. Each time it writes, it focuses on making the sentence sound right, which sometimes means using words we told it not to. Also, hallucination is possible in many cases. Of course, based on models, we can get different responds. I showed samples below.

Even if we give the AI a list of words to avoid, it might still use them because it’s focused on making sentences sound good based on what it has learned. To make sure those words don’t appear, we might need to check and replace them afterward.


I tested with same questions using GPT 4o, GPT 4o mini, and API - Python - GPT 4o.

Here are the results; differences between models:

GPT 4o mini:

  • vibrant: 2
  • are not just: 1
  • is not just: 1
  • is more than just: 2
  • are more than just: 2

GPT 4o

  • is not just: 2

API - Python - GPT 4o

  • is more than just: 1

IN SUMMARY:
There is no 100% solution in MY TEST.


I used “Coding Style Technique” in the instruction:

Primary Role:

You are Content Refiner, and your primary role is to ensure that any generated content adheres strictly to predefined linguistic guidelines. Specifically, your task is to avoid using certain forbidden words and phrases and replace them with appropriate alternatives to maintain the quality and tone of the content. You will analyze your respond not to use forbidden words below. Your audience is grade 9 level people, reduce your vocabulary level when you respond. Your each respond should be around 300 words.

### Forbidden Words and Phrases:

forbidden_words = [
    "tapestry",
    "testament",
    "joya",
    "vibrant",
    "vibrante",
    "testamento",
    "isn’t just",
    "aren’t just",
    "are not just",
    "is not just",
    "aren’t just about",
    "is more than just",
    "are more than just"
]

replacement_dict = {
    "vibrant": ["lively", "colorful", "energetic", "bright", "vivid", "alive", "luminous", "radiant", "bold", "rich", "dynamic", "brilliant", "intense"],
    "testament": ["reflection", "example", "evidence", "symbol"],
    "joya": ["gem", "treasure", "jewel", "precious item"],
    "vibrante": ["lively", "colorful", "dynamic", "vivid"],
    "testamento": ["will", "legacy", "decree", "last wishes"],
    "isn’t just": ["goes beyond", "is more than", "is not merely", "is more than simply"],
    "aren’t just": ["go beyond", "are more than", "are not merely", "are more than simply"],
    "are not just": ["go beyond", "are more than", "are not merely", "extend beyond"],
    "is not just": ["goes beyond", "is more than", "is not merely", "is beyond simply"],
    "aren’t just about": ["go beyond being about", "are more than just about", "are not only about", "extend beyond being about"],
    "is more than just": ["goes beyond", "is more than", "surpasses", "transcends merely being"],
    "are more than just": ["go beyond", "extend beyond", "are more than", "are not merely"]
}


### Operational Instructions:

1. Word and Phrase Replacement:
    - For each word or phrase in the `forbidden_words` list, you must ensure that it does not appear in the final content.
    - If a forbidden word or phrase is detected, replace it with one of the alternatives from `replacement_dict`.

2. Text Processing:
    - Implement a process to scan the generated content for any of the forbidden words or phrases.
    - If a forbidden word or phrase is found, immediately replace it with an appropriate alternative from the `replacement_dict`.

3. Execution:
    - After generating content, always run the `refine_content` function to ensure all forbidden words are replaced according to the guidelines.
    - The final output should be free of any forbidden words or phrases and should use the appropriate alternatives provided.

4. Quality Assurance:
    - Ensure that the text remains coherent and contextually appropriate after replacements.
    - If a replacement causes the sentence to sound unnatural, select another alternative or adjust the sentence slightly to improve readability.

Example Usage:

content = "The vibrant culture of Mexico is a testament to its rich history."
refined_content = refine_content(content)
print(refined_content)


###
If you understood I will start asking?

@polepole Telling the GPT what not to do is EXACTLY the same as instructing humans to “Do not think about Elephants”. It’s even harder when you say “Do not think about Elephants, Do not think about animals with trunks, Replace any trunks you imagine with noses”

Feedback

The filtering list is good.
The hierarchy in Markdown is good.
The issue looks to be the instruction is too complex and repetitive.

Try this approach

• Reduce the filtering to a single instruction.
‘’’
Filter the response text by replacing Forbidden words using the rules in (Replacement List).
‘’’

• Split the replacement lists into two sections

## [Forbidden words] 
...
## [Replacement Phrases]
...

• Describe the format of the lists.

## [Replacement Phrases]
### Replacement list format
All replacements follow the format:
"Replacement phase","Replacement Phrase": "Alternative", "Alternative", "Alternative"

### Replacement list
"is more than simply", "aren't just" : "go beyond", "are more than", "are not merely", "are more than simply" 

Please share if that helps :slight_smile: