Posted by Aaron Wade, Inventive Technologist
Google Lab Classes is a collection 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 look at and find out about his inventive course of. This course of was invariably marked by a kind of linguistic “tinkering”—that’s, deconstructing language after which reassembling it in novel and revolutionary methods. A few of Lupe’s strategies, resembling simile and alliteration, draw from the canon of conventional literary units. However lots of his techniques are solely distinctive. Amongst them was a intelligent means of making phrases that sound an identical 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 exhibit affect)
ex-press means (path with out information media)
These types of operations performed a essential function in Lupe’s writing. In gentle of this, we started to marvel: How may we use AI to assist Lupe discover inventive prospects with textual content and language?
In the case of language-related functions, giant language fashions (LLMs) are the plain alternative 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 truly match into Lupe’s lyric-writing workflow.
Some LLMs resembling 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 factor and as an alternative generate textual content by extending or fulfilling a given enter textual content. One of many nice issues about this latter sort of LLM is their capability for few-shot studying. In different phrases, they’ll 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 fastidiously crafted string of textual content that primes the LLM to behave in a sure means. Our preliminary immediate for the same-sounding phrase activity appeared like this:
This immediate yielded satisfactory outputs a number of the time, however we felt that there was nonetheless room for enchancment. We truly 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 so on. After a number of iterations, we lastly arrived on the following:
After efficiently codifying the same-sounding phrase activity right into a few-shot immediate, we labored with Lupe to establish further inventive duties that we would be capable to accomplish utilizing the identical few-shot prompting technique. In the long run, we devised ten prompts, every uniquely designed to discover inventive prospects 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 sequence of semantically associated gadgets.
POV – Consider a subject by way of 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 accommodate them. We determined to name it TextFX, drawing from the concept every instrument has a distinct “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 end result from the mannequin response and do some post-processing earlier than lastly surfacing the end result 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’ll be able to attempt TextFX for your self at textfx.withgoogle.com.
We’ve additionally made all the LLM prompts out there in MakerSuite. In case 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 beneath. In any other case, you’ll be able to be part of the waitlist.
And in case you’d prefer 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 attempt constructing with the PaLM API and MakerSuite, be part of the waitlist.
A last phrase
TextFX is an instance of how one can experiment with the PaLM API and construct functions that leverage Google’s state-of-the-art 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 a vital function in serving to us think about what these collaborations may appear like. Our hope is that this Lab Session offers you a glimpse of what’s attainable utilizing the PaLM API and conjures up you to make use of Google’s AI choices to carry your individual concepts to life, in no matter your craft could also be.
Should you’d prefer to discover extra Lab Classes like this one, head over to labs.google.com.