Google Lab Sessions is a series of experimental AI collaborations with innovators. In our latest Lab Session we wanted to explore specifically how AI could expand human creativity. So we turned to GRAMMY® Award-winning rapper and MIT Visiting Scholar Lupe Fiasco to build an AI experiment called TextFX.
The discovery process
We started by spending time with Lupe to observe and learn about his creative process. This process was invariably marked by a sort of linguistic “tinkering”—that is, deconstructing language and then reassembling it in novel and innovative ways. Some of Lupe’s techniques, such as simile and alliteration, draw from the canon of traditional literary devices. But many of his tactics are entirely unique. Among them was a clever way of creating phrases that sound identical to a given word but have different meanings, which he demonstrated for us using the word “expressway”:
express whey (speedy delivery of dairy byproduct)
express sway (to demonstrate influence)
ex-press way (path without news media)
These sorts of operations played a critical role in Lupe’s writing. In light of this, we began to wonder: How might we use AI to help Lupe explore creative possibilities with text and language?
When it comes to language-related applications, large language models (LLMs) are the obvious choice from an AI perspective. LLMs are a category of machine learning models that are specially designed to perform language-related tasks, and one of the things we can use them for is generating text. But the question still remained as to how LLMs would actually fit into Lupe’s lyric-writing workflow.
Some LLMs such as Google’s Bard are fine-tuned to function as conversational agents. Others such as the PaLM API’s Text Bison model lack this conversational element and instead generate text by extending or fulfilling a given input text. One of the great things about this latter type of LLM is their capacity for few-shot learning. In other words, they can recognize patterns that occur in a small set of training examples and then replicate those patterns for novel inputs.
As an initial experiment, we had Lupe provide more examples of his same-sounding phrase technique. We then used those examples to construct a prompt, which is a carefully crafted string of text that primes the LLM to behave in a certain way. Our initial prompt for the same-sounding phrase task looked like this:
Word: defeat
Same-sounding phrase: da feet (as in "the feet")
Word: surprise
Same-sounding phrase: Sir Prize (a knight whose name is Prize)
Word: expressway
Same-sounding phrase: express whey (speedy delivery of dairy byproduct)
(...additional examples...)
Word: [INPUT WORD]
Same-sounding phrase:
This prompt yielded passable outputs some of the time, but we felt that there was still room for improvement. We actually found that factors beyond just the content and quantity of examples could influence the output—for example, how the task is framed, how inputs and outputs are represented, etc. After several iterations, we finally arrived at the following:
A same-sounding phrase is a phrase that sounds like another word or phrase.
Here is a same-sounding phrase for the word "defeat":
da feet (as in "the feet")
Here is a same-sounding phrase for the word "surprise":
Sir Prize (a knight whose name is Prize)
Here is a same-sounding phrase for the word "expressway":
express whey (speedy delivery of dairy byproduct)
(...additional examples...)
Here is a same-sounding phrase for the word "[INPUT WORD]":
After successfully codifying the same-sounding word task into a few-shot prompt, we worked with Lupe to identify additional creative tasks that we might be able to accomplish using the same few-shot prompting strategy. In the end, we devised ten prompts, each uniquely designed to explore creative possibilities that may arise from a given word, phrase, or concept:
SIMILE - Create a simile about a thing or concept.
EXPLODE - Break a word into similar-sounding phrases.
UNEXPECT - Make a scene more unexpected and imaginative.
CHAIN - Build a chain of semantically related items.
POV - Evaluate a topic through different points of view.
ALLITERATION - Curate topic-specific words that start with a chosen letter.
ACRONYM - Create an acronym using the letters of a word.
FUSE - Create an acronym using the letters of a word.
SCENE - Create an acronym using the letters of a word.
UNFOLD - Slot a word into other existing words or phrases.
We were able to quickly prototype each of these ideas using MakerSuite, which is a platform that lets users easily build and experiment with LLM prompts via an interactive interface.