Struggling to get good text from Mistral-7b-Instruct in my fantasy story program

fredrum
Tue, 05 Mar 2024 05:04:26 +0000

Hello!
I have posted these questions before in the Beginners section but got no answers. So I thought I’d try here as well.

I’m trying to make a simple ‘choose your own path’ fantasy interactive text game using Mistral-7b-Instruct and python. I have a rough setup that lets me bounce back and forth between player and my simple ‘engine’.
I store the ongoing story both the LLM-engine responses and the player input, concatenate it all and use story-so-far + newPrompt for each new request.
I currently have temperature=0.9 and tried top_p=0.5->0.95, do_sample=True

I have two main problems right now,

One,
I’m constantly seeing the same responses from the model. Its an opening in the forest with a Elf with long hair, or its a bunch of goblins hoping around a fire. Etc. The same ones keep coming back even if I change the initiating text prompt. I get variations now and then sure but on the whole too repetitive and similar.

Is there a ‘seed’ or something I can add to push it around into new spaces?
I want the model to come up with new scenarios and not me having to hand-hold it with explicit hand crafted prompt text.

Two,
Another problem I have with it is that the LLM keeps shutting the story down too quickly with just a few lines.
After just a couple of back and forths it’ll say something like:

“You continue your quest and battle a lot of monsters and dragons but in the end you are successful and get the Orb of Light Artifact and the land is once again safe from Evil. You feel happy and Satisfied. This is the end of your journeys.
Let me know if you want to hear another story like this.”

In my instruction prompt I have been trying to explicitly tell it not to end the story until instructed. But it doesn’t work.

This is my current instruct prompt/text:

instruction = '''[INST]Please continue the story. You are the story teller. After each paragraph stop and wait for input by the player.
Give No options. No list of choices. Dont give instructions or explanations just story. Don't give suggestions.
Keep the story going until you get a STOOP command. Do not write endings or drive toward conclusions

Does anyone know why it does this and how I can avoid it happening?

Geratful for any advice or suggestions!

Cheers!

Read full topic