Asking to skip a list of previous titles gets ignored

I’m asking gpt-4o-mini to produce a JSON that contains an array of objects, each object has a key “title” with some world-famous movie title, and some other keys about this title.

I want this prompt to be incremental, so it’ll produce X new results each time I call it, so I’m also providing a list of previous titles it had come up with and asking it to not include those existing titles in the new response.

This ask is being ignored, and I always get a new list which mostly contains existing titles. When I filter the new response to get rid of existing titles, I get a very short array.

Here’s a shortened version of my prompt:

produce a JSON array containing 10 objects, 
each object represents a world famous movie,

each object should have the following properties: title, <some other keys...>.
title is a string that represents the title of the movie.

the titles chosen should NOT INCLUDE the following existing titles: Fargo, Inception, The Wizard of Oz, <97 more titles...>

The result list of 10 movies usually contains maybe 1 or 2 new titles.

How can I improve?

Hi @gazith :wave:

Welcome to the community!

I tested following prompt, it works well FOR NOW.

You may try this:

You are tasked with generating a JSON array containing 5 objects. Each object represents a world-famous movie.

Each object should have the following properties:
- title: A string that represents the title of the movie. It must be a world-famous movie that is not on the excluded list.
- year: A four-digit integer representing the year the movie was released.
- director: A string representing the name of the director of the movie.
- genre: A string or an array of strings representing the genre(s) of the movie.
- rating: A floating-point number representing the movie's rating on a scale of 1 to 10.

CRITICAL: The titles must NOT INCLUDE any of the following existing titles:
1. Fargo
2. Inception
3. The Wizard of Oz
4. Titanic
5. The Godfather
.
.
.
100. The Good, the Bad and the Ugly

IMPORTANT: Only generate movie titles that are not in the above list. If you suggest a title that is already in the list, discard it and provide a different title.

Do not include any titles from the above list in your response. 

Please output the JSON array directly, without additional explanations or any other text.

1 Like

Thanks, I just tried that and having similar results.

I was thinking maybe it’s related to context window size and the size of the existing titles list.
So when i shrunk my “existing” list to 10 items, I did get 10 new titles in the response.
The larger the “existing” list is, the more likely it is for gpt to return a duplicate in its response:
“existing” = 10 items => 10/10 new titles
“existing” = 40 items => 8/10 new titles
“existing” = 100 items => 2/10 new titles

There must be a way to force it to comply with this restriction…

2 Likes

I haven’t tested this, but you might try a multi-step input prompt where you’ve previously asked the model for answers, the model answers with your “do not answer” list" and then the next user message asks for additional ones? Does that make sense?

Your chat history is:
user: Give me the 100 most famous movies:
assistant: (include your list of 100 movies not to return).
user: Awesome, now give me 10 more.

2 Likes