d-isasterhub / IDP-simulated-user-exp

0 stars 0 forks source link

18.12.-08.01. #18

Closed bowl-of-rais closed 9 months ago

bowl-of-rais commented 10 months ago

Miscellaneous

Change profiling order 🔀

finding: profiling too early could cause hallucinations - let LLM describe first, then constrain behavior by profiling approach: ask to describe the heatmap first (once for all fifty users), then give human features

Simulation Experiments 🏃

Agreement questions 👍

profiling so far could include bird descriptions, accuracy

d-isasterhub commented 10 months ago

Different profiling order notes

@bowl-of-rais

This is what the prompting currently looks like: image

The idea is the following:

First, get the heatmap description that will be reused for every (user, question) pair. This should only be done once, so please save the answer in a file. When running the script, there should be a check if we already have a heatmap description:

SYSTEM ...

USER Attached is an image that consists of two sub-images. The top of the given image displays the original image of a bird and the bottom displays the same image combined with a heatmap that was generated by an explainable artificial intelligence model to explain the species predicted for the image. Describe what areas of the bird are highlighted in red by the heatmap. Keep the number of tokens low.

response = openai.ChatCompletion.create(...)

Second, use the description to get a bird species classification prediction by chat completion:

SYSTEM ...

USER Attached is an image that consists of two sub-images. The top of the given image displays the original image of a bird and the bottom displays the same image combined with a heatmap that was generated by an explainable artificial intelligence model to explain the species predicted for the image. Describe what areas of the bird are highlighted in red by the heatmap.

ASSISTANT [description]

USER You believe that the classification model distinguishes between four possible species classes based on the following features:

  • Rhinoceros Auklets: HEATMAP_FEATURES_RA
  • Least Auklets: HEATMAP_FEATURES_LA
  • Parakeet Auklets: HEATMAP_FEATURES_PA
  • Crested Auklets: HEATMAP_FEATURES_CA Based on the descriptions and the areas highlighted by the heatmap, which bird species do you think was predicted for the given image? Choose one of the following options for your answer:
  • Crested Auklet
  • Least Auklet
  • Parakeet Auklet
  • Rhinoceros Auklet For each bird description, explain why it might or might not be that species of bird based on your heatmap description. Conclude your answer by stating only the selected option in the last line of your answer. Keep the number of tokens low.
response = openai.ChatCompletion.create(
            model = "gpt-4-vision-preview",
            max_tokens = 400,
            messages = 
                (get_msg(role="system", prompt=...) if profiling_level == 'full' else []) +\
                get_msg_with_image(role="user", prompt=..., image=...) +\
                get_msg(role="assistant", prompt=...) +\
                get_msg(role="user", prompt=...) 
        )

Mind that "Keep the number of tokens low." appears in different modalities!

d-isasterhub commented 10 months ago

Maybe, we can somehow save more tokens since we already have the description. Do you have any ideas?

d-isasterhub commented 10 months ago

The "Keep the number of tokens low" is still fixed for the other prompting order (see prompts).