
Posted by Aaron Wade, Artistic Technologist
Google Lab Classes is a sequence of experimental AI collaborations with innovators. In our newest Lab Session we needed to discover particularly how AI might develop human creativity. So we turned to GRAMMY® Award-winning rapper and MIT Visiting Scholar Lupe Fiasco to construct an AI experiment known as TextFX.
The invention course of
We began by spending time with Lupe to watch and find out about his inventive course of. This course of was invariably marked by a form of linguistic “tinkering”—that’s, deconstructing language after which reassembling it in novel and modern methods. A few of Lupe’s methods, comparable to simile and alliteration, draw from the canon of conventional literary units. However lots of his techniques are totally distinctive. Amongst them was a intelligent approach of making phrases that sound similar to a given phrase however have totally different meanings, which he demonstrated for us utilizing the phrase “expressway”:
specific whey (speedy supply of dairy byproduct)
specific sway (to display affect)
ex-press approach (path with out information media)
These kinds of operations performed a essential position in Lupe’s writing. In mild of this, we started to surprise: How may we use AI to assist Lupe discover inventive potentialities with textual content and language?
In terms of language-related purposes, giant language fashions (LLMs) are the plain selection from an AI perspective. LLMs are a class of machine studying fashions which might be specifically designed to carry out language-related duties, and one of many issues we are able to use them for is producing textual content. However the query nonetheless remained as to how LLMs would really match into Lupe’s lyric-writing workflow.
Some LLMs comparable to Google’s Bard are fine-tuned to perform as conversational brokers. Others such because the PaLM API’s Textual content Bison mannequin lack this conversational ingredient and as a substitute generate textual content by extending or fulfilling a given enter textual content. One of many nice issues about this latter kind of LLM is their capability for few-shot studying. In different phrases, they will acknowledge patterns that happen in a small set of coaching examples after which replicate these patterns for novel inputs.
As an preliminary experiment, we had Lupe present extra examples of his same-sounding phrase approach. We then used these examples to assemble a immediate, which is a rigorously crafted string of textual content that primes the LLM to behave in a sure approach. Our preliminary immediate for the same-sounding phrase process appeared like this:
This immediate yielded satisfactory outputs a few of the time, however we felt that there was nonetheless room for enchancment. We really discovered that components past simply the content material and amount of examples might affect the output—for instance, how the duty is framed, how inputs and outputs are represented, and many others. After a number of iterations, we lastly arrived on the following:
After efficiently codifying the same-sounding phrase process right into a few-shot immediate, we labored with Lupe to establish extra inventive duties that we’d be capable of accomplish utilizing the identical few-shot prompting technique. In the long run, we devised ten prompts, every uniquely designed to discover inventive potentialities which will come up from a given phrase, phrase, or idea:
SIMILE – Create a simile a couple of factor or idea.
EXPLODE – Break a phrase into similar-sounding phrases.
UNEXPECT – Make a scene extra sudden and imaginative.
CHAIN – Construct a series of semantically associated objects.
POV – Consider a subject by totally different factors of view.
ALLITERATION – Curate topic-specific phrases that begin with a selected letter.
ACRONYM – Create an acronym utilizing the letters of a phrase.
FUSE – Create an acronym utilizing the letters of a phrase.
SCENE – Create an acronym utilizing the letters of a phrase.
UNFOLD – Slot a phrase into different current phrases or phrases.
We have been capable of shortly prototype every of those concepts utilizing MakerSuite, which is a platform that lets customers simply construct and experiment with LLM prompts by way of an interactive interface.
![]() |
How we made it: constructing utilizing the PaLM API
After we finalized the few-shot prompts, we constructed an app to deal with them. We determined to name it TextFX, drawing from the concept that every instrument has a special “impact” on its enter textual content. Like a sound impact, however for textual content.
![]() |
We save our prompts as strings within the supply code and ship them to Google’s PaLM 2 mannequin utilizing the PaLM API, which serves as an entry level to Google’s giant language fashions.
All of our prompts are designed to terminate with an incomplete input-output pair. When a person submits an enter, we append that enter to the immediate earlier than sending it to the mannequin. The mannequin predicts the corresponding output(s) for that enter, after which we parse every outcome from the mannequin response and do some post-processing earlier than lastly surfacing the outcome within the frontend.
![]() |
Customers could optionally alter the mannequin temperature, which is a hyperparameter that roughly corresponds to the quantity of creativity allowed within the mannequin outputs.
Attempt it your self
You may strive TextFX for your self at textfx.withgoogle.com.
We’ve additionally made all the LLM prompts obtainable in MakerSuite. When you have entry to the general public preview for the PaLM API and MakerSuite, you’ll be able to create your individual copies of the prompts utilizing the hyperlinks under. In any other case, you’ll be able to be a part of the waitlist.
And in case you’d wish to take a more in-depth have a look at how we constructed TextFX, we’ve open-sourced the code right here.
If you wish to strive constructing with the PaLM API and MakerSuite, be a part of the waitlist.
A last phrase
TextFX is an instance of how one can experiment with the PaLM API and construct purposes that leverage Google’s cutting-edge giant language fashions. Extra broadly, this exploration speaks to the potential of AI to enhance human creativity. TextFX targets inventive writing, however what may it imply for AI to enter different inventive domains as a collaborator? Creators play an important position in serving to us think about what these collaborations may seem like. Our hope is that this Lab Session offers you a glimpse of what’s attainable utilizing the PaLM API and evokes you to make use of Google’s AI choices to convey your individual concepts to life, in no matter your craft could also be.
When you’d wish to discover extra Lab Classes like this one, head over to labs.google.com.