The faster AI can help the user get to a good result, the faster the user will reach their "ah ha" moment. For more complicated prompts though, this could take a while.

In these moments, the next best option is to let the user show the AI what good looks like.

Using variants lets the AI proactively seek out more information from the user, which helps to give the user a sense of progress while training the AI to improve its processing of the user's prompt.

Variations rely closely on other patterns:

  • Like the Sample Plan pattern, it lets the AI signal its intent before spending a ton of time and processing pattern on a poor result. Variants tend to be used in the flow of conversation, whereas a Sample Plan tends be used when the AI is about to complete a complicated task (like, generate 50 examples of something) and it's useful to get the format right up front.
  • When combined with the Regenerate pattern, users can process multiple iterations against a single prompt and then compare the results. Some generators, namely image generators, even support branching off of different variants.
  • Variations make the controls pattern more powerful, as it gives a stronger signal of the AI's understanding of the prompt, which could lead the user to stop the generation ahead of time if things feel off

One area that variations are not common, surprisingly, is within inline prompts. For example, you can ask Github Copilot to generate code for you, and it might generate multiple versions to compare. However, once you choose one, the other disappears and you can't go back and compare how either would perform.

Generally speaking, variations give more control to users. They aren't needed at all times, but they can be a powerful pattern to build trust that the AI understands the user, or give the user the opportunity to adjust their input. Overall, since AI doesn't have all of the answers, they keep the user in the driver's seat, while reducing the amount of processor hours that are burned on bad results. Overall, a win-win for all parties.

Details and variations

  • Use variations when users are likely to need to select multiple options, such as with image generators. Otherwise offer then randomly only as needed to minimize disruption to the user
  • By convention, text variations are offered in groups of 2, while most image generators provide 4 variations
  • If you allow users to branch off of multiple variations, use footprints to help them go back to the source (see Midjourney for a good example)

Considerations

Positives

User agency

Prompting can become time consuming, particularly if you have a strong idea in mind of what you are looking for but don't know how to get the AI there. Offering the user variations can accelerate the AI's learning curve to better understand the user and get them to a great result. Users also can more easily explore different branches of how the AI is interpreting their prompt, leading them to discover more, or even better possibilities that they maybe would not have found on their own.

Adaptivity

Every time the user interacts with the AI, they provide additional information about personal preferences and intent. Showing variants is a great time to include prompt transparency or token transparency to expose different ways of weighting the user's input and giving them the opportunity to adjust. In a conversational setting, the AI might also inform the user what it is intuiting from the choice of variation.

Potential risks

The pain of failure

Users can get frustrated if the AI keeps showing them variants but without a good match. Consider having a "none of these" option and prompting the user for more information through follow ups if the AI fails to create a suitable result.

Use when:
The AI isn't sure of how to provide the best result to the user but wants to get something in their hands to start the process of iteration

Examples

ChatGPT occasionally shows the user multiple options for more complicated results while it is typing so the user can direct the AI in the moment.
If the user regenerates a response, ChatGPT lets them see the previous versions. It also sometimes prompts the user to provide guidance on which version was better.
Github CoPilot can generate multiple versions of inline code and let the user choose which they prefer.
Midjourney generates four options for every prompt. Users can edit a single variant or branch off into all four. Often, the variations are quite different owing to different relative token weights.
No items found.