ARCLab-MIT / kspdg

ARCLab-MIT participation in the KSPDG challenge
MIT License
4 stars 0 forks source link

few-shot prompting #16

Open vrodriguezf opened 10 months ago

vrodriguezf commented 10 months ago

One common thing in prompt engineering (or crafting) is providing examples of how you want the assistant to respond, prior to the conversation itself. These examples can be:

I don't know which of these methods is better to be honest. One good idea is try them in the OpenAI playground with a human gamplay log side by side, testing if the model answer with the same throttles that the human had replied (remember that we want the agent to replicate human behaviour).

You can format the human gameplays into a observation-action text log to use it as examples:

Image

OhhTuRnz commented 10 months ago

Great news! I've made a few shot prompting where i translate all the CSV's into actual GPT history content and it responds succesfully (i hope better than other agents)

I'm adding snapshots and a json folder example:

history_pe1_i3_keyboard_agent_actions_20231016-151738.json

image

I don't know if i have to parse the history messages everytime. Token limit is 4096 so I am a bit restricted. I can pop 10 by 10 stacks of fake responses everytime i ask GPT.

Here is the footage where i learnt how to implement this: https://learn.deeplearning.ai/chatgpt-building-system/lesson/6/chaining-prompts

vrodriguezf commented 10 months ago

awesome! I see that it replies with countinuos numbers but it has been shown only discrete values (-1.0, 1.0, ...). Can you try processing the throttle vectors from the CSVs nto just one command? (forward, backward, right, left, down, up)

OhhTuRnz commented 10 months ago

awesome! I see that it replies with countinuos numbers but it has been shown only discrete values (-1.0, 1.0, ...). Can you try processing the throttle vectors from the CSVs nto just one command? (forward, backward, right, left, down, up)

Yes, i only passed history into the first prompt, i didn't know if the agent would remember or not (i don't think so but i remember playing with history in the FastAPI tutorial so i need to keep trying)

Here is the code fragment where you can see that it's only parsed the first time image

OhhTuRnz commented 10 months ago

I also process the throttle vectors into the function call that jason did "function_call": { "name": "perform_action", "arguments": "{\n \"forward_throttle\": 0,\n \"right_throttle\": -1.0,\n \"down_throttle\": 0\n}" }

vrodriguezf commented 10 months ago

What's the benefit of using a function call here? Wouldn't a categorical reply with the direction(s) to apply (or replying to do nothing at all) would be equivalent?

escharf320 commented 10 months ago

@OhhTuRnz That's incredible to see! Are you getting consistent answers if you pass in the same information multiple times? I've been successful in getting answers that are correct, but I've also had vectors returned that are not correct even if the same data was passed through.

OhhTuRnz commented 9 months ago

@OhhTuRnz That's incredible to see! Are you getting consistent answers if you pass in the same information multiple times? I've been successful in getting answers that are correct, but I've also had vectors returned that are not correct even if the same data was passed through.

As we have seen in the last meeting, it is consistent with enough data. I've been trying multiple times with the gpt model that accepts 128k tokens and it constantly responds with a valid output (3 integers)

vrodriguezf commented 9 months ago

That makes sense according to the last OpenAI keynote

OhhTuRnz commented 9 months ago

I should add that the input lag is a huge problem because human agent is almost real-time. GPT actually tells u it's getting further and it should not.

vrodriguezf commented 9 months ago

Good point...how can we fix that?

OhhTuRnz commented 9 months ago

Good point...how can we fix that?

I can only think of two alternatives, get some faster model or ask for more than one action