Multi-input prompt/finetuning

Is it possible to prompt GPT with many inputs to get one input? Also, can I finetune this?

Example:
System: “You are a game master for a roleplaying game.”
User: “I try to stab the dragon with my magic dagger.”
Action score: “Diceroll 5. Agility 7. Dagger 7. Total 19.”
Action outcome: “Success.”
Assistant: “You stab the dragon with the dagger and cut of its tail.”

The finetuning message would be something like:

{"messages": [{"role": "system", "content": "You are a game master for a roleplaying game."}, {"role": "user", "content": "I try to stab the dragon with my magic dagger."},  {"role": "Action score", "content": "Diceroll 5. Agility 7. Dagger 7. Total 19."} {"role": "Action outcome", "content": "Success."}{"role": "assistant", "content": "You stab the dragon with the dagger and cut of its tail."}]}

Is the question to prompt GPT with many inputs to get one output?

If so, I think that you would need a sequence of events, for example if you’re using a function calling gpt model it might look something like:

  1. User input (I try to stab the dragon…)
  2. Model chooses a function to call and passes the parameters (action: dice roll, attributes: agility, weapon: dagger, enemy: dragon, etc.)
  3. Your function would need to take in all the inputs and do something like: 1. dice roll 2. take dice roll + attributes to determine total damage/remaining hp/any thresholds for what happens when it’s below a certain hp/etc.
  4. Pass all of that info back to the model and have it relay to the user the outcome “You stab the dragon with the dagger for a total of 19 damage, which cuts off it’s tail!”

I haven’t fine-tuned a model yet, so I can’t give advice there.

I hope that helps even a little!

1 Like

Only system, user, and assistant roles are allowed (function return roles, possibly in the future).
Role messages can be given a name parameter.
A name like “gaming_app” could let the AI understand assistant injections are not it.

The messages you suggest might not work well; the base assistant would have no idea where they came from (another AI?). Injection of knowledge usually comes right before the user question (but can be after for an AI that calls functions to answer that is trained on that). Actions or computations resulting from user input might make sense to show after the user input, though.

Chat models of GPT regularly get many role messages - containing the past conversation.

Fine-tuning a model requires hundreds of examples. The AI doesn’t infer well actions on inputs you haven’t trained it on.

2 Likes

Yes, that is how I have been doing it before. I was mainly wondering if there is any way to use a multidimensional dataset to finetune with.

I guess I should finetune it with player input, action score and action outcome all passed into the user column as one concatenated message then.

You mean I can pass name as well into the message like this:

{"messages": [{"role": "system", "content": "You are a game master for a roleplaying game."}, {"role": "user", "name": "player_input", "content": "I try to stab the dragon with my magic dagger."},  {"role": "user", "name": "action_input", "content": "Diceroll 5. Agility 7. Dagger 7. Total 19."} {"role": "user", "name": "action_outcome", "content": "Success."}{"role": "assistant", "content": "You stab the dragon with the dagger and cut of its tail."}]}