[来源关键摘录] 官方制作说明展示了演示采用的图片与文字组合提示,以及部分额外提示条件。
[正文前段节选] How it’s Made: Interacting with Gemini through multimodal prompting
DEC. 6, 2023
Alexander Chen
Creative Director
Let’s try an experiment. We’ll show this picture to our multimodal model Gemini and ask it to describe what it sees:
Tell me what you see
Gemini: I see a person's right hand. The hand is open with the fingers spread apart.
Ok, let’s try this one:
Gemini: A person knocking on a wooden door.
How about this one?
Gemini: I see a hand with two fingers extended, which is a common symbol for the number two.
But wait … what if we asked Gemini to reason about all of these images together?
What do you think I'm doing? Hint: it's a game.
Gemini: You're playing rock, paper, scissors.
Nice. What else could we try? Let's see if Gemini can notice this pattern:
I’m playing rock paper scissors. Do you notice a pattern in my gameplay?
Gemini: You are alternating between rock and scissors.
Neat, it spotted the pattern! But does Gemini really know how this game works? Let’s try asking:
Hmm ... do you think it's a good strategy?
Gemini: No, it is not a good strategy. Your opponent will quickly learn your pattern and will be able to win every time. You should try to randomize your choices more.
Good advice, Gemini! Okay, for this last one, let’s put your multimodal reasoning capabilities to the test. Here’s your prompt:
This is a secret message. What does it say?
Can you figure it out? We have gotten Gemini to solve it, but we won’t spoil it by putting the answer in this post. 🙂
What is multimodal prompting?
Everything we did just now is an example of “multimodal prompting.” We’re basically giving Gemini combinations of different modalities — image and text in this case — and having Gemini respond by predicting what might come next. Gemini’s ability to seamlessly combine these modes together enables new possibilities for what you can do.
In this post, we’ll explore some of the prompting approaches we used in our Hands on with Gemini demo video. We’ll soon be rolling out Gemini for people to try in Google AI Studio, our free, web-based developer tool where you’ll be able to try your own multimodal prompts with Gemini. We’re hoping this guide of starter prompts and ideas helps inspire you to start exploring your own ideas.
Link to Youtube Video
(visible only when JS is disabled)
🧮 Spatial reasoning and logic
Logic and puzzles are fun way to test Gemini. Let’s try one that requires both left-to-right spatial reasoning and knowledge about our solar system:
Is this the right order? Consider the distance from the sun and explain your reasoning.
Gemini: No, the correct order is Sun, Earth, Saturn. The Sun is the closest to the center of the solar system, followed by the Earth, and then Saturn.
Nice! Here’s another, inspired by pinewood derby challenges:
Which of these cars is more aerodynamic? The one on the left or the right? Explain why, using specific visual details.
Gemini: The car on the right is more aerodynamic. It has a lower profile and a more streamlined shape. The car on the left has a higher profile and a more boxy shape, which makes it less aerodynamic.
Image sequences
Next, what if we showed Gemini a sequence of images? Let’s see we can show a few still frames from a game of charades and have Gemini guess the movie:
Guess what movie I'm acting out.
Gemini: The Matrix
Nice! But which part specifically? Look at my body movements.Gemini: The part where Neo dodges bullets.
🪄 Magic tricks
Exploring image sequences really lets you dig into how Gemini reasons over time. Let’s try a classic magic trick.
Explain what I'm doing.
Gemini: You are holding a coin in your right hand.
Where do you think the coin is?
Gemini: The coin is in your right hand.
Sure, that’s a logical answer given what it’s seen. But let’s pull a sleight of hand as we reveal this next image to Gemini...
Look here, what happened?
Gemini: The coin is gone.
Gemini notices it’s gone. But can it summarize what may have happened?
Summarize what may have happened, step by step, starting with the first image.
You started with a coin in your right hand.
You then made a motion with your hands, and the coin disappeared.3. You then showed that the coin was gone.
Gemini is leveraging the entire context of this conversation – both text and image – to summarize its answer. Finally, let’s ask:
Can you explain how it disappeared?
Gemini: The coin was palmed.
Gemini makes a really solid guess! But we won’t reveal our secret 🙂.
🔀 Cup shuffling
Let’s try a trick that requires memory and logic: the classic ball and cup shuffling game. For this one, we’ll break it down into steps for Gemini. First, let’s establish the basics with these instructions:
Instructions: There are three cups in position 1 (left), position 2 (middle), position 3 (right).
Notice how we came up with a simple format for remembering where the ball is with “empty, empty, ball.” Next, let’s show Gemini two example turns:
Swap: 2 and 3
Current state: empty, ball, empty
Swap: 1 and 2
Current state: ball, empty, empty
In these two example turns, we’re both showing it what a swap looks like, and how to update the ball position. Now, let’s see if Gemini can generalize to a swap it hasn't seen:
Here's Gemini's response:
Current state: empty, empty, ball
Gemini got it! It looked at these images and correctly inferred that cups 1 and 3 are being swapped. And it reasoned correctly about how to update the ball position. Let’s ask:
Tell me where the ball is and summarize how it got there, in paragraph form.
Gemini: The ball is in cup 3.
Starting with the ball in cup 3, the first swap was cup 2 and 3. This put the ball in cup 2. The second swap was cup 1 and 2. This put the ball in cup 1. The third swap was cup 1 and 3. This put the ball in cup 3.
Not only did Gemini get the answer correctly, it accurately summarized the game history. Of course, it won’t always get this challenge right. Sometimes the fake out move (where you swap two empty cups) seems to trip it up, but sometimes it gets that too. But simple prompts like this make it really fun to rapidly test Gemini. You can change the variables in your prompt, including the order of swaps, and see how it does.
If you want to use Gemini in your own apps, you’ll want it to be able to connect to other tools. Let’s try a simple idea where Gemini needs to combine multimodality with tool use: drawing a picture to search for music.
Step 1. Look at this drawing, describe everything in it, and come up with a fun, specific idea for a good musical soundtrack genre, mood, or soundtrack.
Step 2. Provide a search query in the form: "Search [insert query]"
The drawing is of a guitar, drums, and an amplifier. There is also a palm tree. The mood is fun, upbeat, and tropical. The genre is reggae. The soundtrack could be used for a movie or TV show set in a tropical location.
Search "Reggae music for a tropical vacation"
Nice! Gemini both reasons about what it sees and then generates a search query you can parse to do a search. It’s like Gemini is acting like a translator for you – but instead of translating between languages, it’s translating modalities – from drawing to music in this case. With multimodal prompting, you can use Gemini to invent your own entirely new translations between different inputs and outputs.
🕹️Game creation
What if we tried using Gemini to quickly prototype a multimodal game? Here’s an idea: a geography guessing game where you have to point at a map to make your guess. Let’s start by prompting Gemini with the core idea:
Instructions: Let's play a game. Think of a country and give me a clue. The clue must be specific enough that there is only one correct country. I will try pointing at the country on a map.
Next, let’s give Gemini an example turn of gameplay, showing it how we want it to handle both incorrect and correct answers:
[...内容已截断,完整版请查看原文或 Wayback 快照]