Back to Blog

Discover use cases for AI21 Studio and Jurassic-1

,
,
,
August 4, 2021
No items found.

Learn how to use Jurassic-1 to perform summarization, idea generation, classification and many other language tasks

In this blog post we showcase different ways of using AI21 Studio and Jurassic-1 to perform different language tasks. We hope these will help you kickstart your applications, and even inspire you to come up with ideas for new use cases. For convenience, the examples are grouped into categories, though this grouping doesn’t follow very strict rules. Make sure to check out the last group of fun examples for some laughs!

All of the examples below use prompts we crafted manually, and they are available in AI21 Studio as presets, so you can try them yourself, tinker with them and use them as a basis for your own prompts.

Prompt engineering, the process of composing a prompt to perform a specific task, is a fast, easy, and flexible way to build a demo or prototype. In fact, the prompts we’re sharing here are the product of one day's work, at most. To take your application beyond proof-of-concept, we recommend you train a custom model. Custom models in AI21 Studio can be trained on very small datasets with as few as 50-100 examples. They offer better precision and latency and can be more economically scaled-up to serve production traffic. Read our blog post to learn more about bootstrapping your own custom model.

Summarizing or simplifying text

Jurassic-1 is great at applying different transformations to existing text - consuming some text and then generating a piece of text that relates to it.

One common transformation is summarization. Summarization has many business use-cases, such as extracting the gist of online restaurant reviews:

Try it live in AI21 Studio

Note that the model successfully follows the style of the example provided in the prompt, and outputs a sequence of short 2-3 word phrases summarizing the review. In a practical setting, we can imagine this method being used to squeeze reviews for display on small mobile devices.

Another useful transformation is simplifying text to make it more readable and accessible. A useful application could be rephrasing a sentence to avoid business jargon:

Try it live in AI21 Studio

Or more explicitly, using Jurassic-1 to explain the meaning of a word in context:

Try it live in AI21 Studio

Ideation and copywriting

Jurassic-1 can be used to augment human creativity in content creation, marketing, ecommerce and even creative writing.

By priming our model with titles for blog posts about AI and tourism, we can generate plausible ideas for new blog posts about another topic of our choosing:

Try it live in AI21 Studio

Humor and sarcasm are nuanced and notoriously hard for AI models to produce. Nevertheless, it turns out you can feed article topics into the model and get it to generate funny headlines:

Try it live in AI21 Studio

Another useful application is writing one-sentence product descriptions for marketing and ecommerce. In the following example, Jurassic-1 generates a short description based on a product name and a list of features:

Try it live in AI21 Studio

Generating code

Jurassic-1 models can process not only English text but also code in a variety of programming languages. We can use this to translate plain English descriptions into correct Python one-liners:

Try it live in AI21 Studio

Or even translate entire functions from one programming language to another:

Try it live in AI21 Studio

Working with tables

Text often comes in a structured format, like a table. Below are two examples that show how Jurassic-1 can both extract information from a table and generate a properly formatted table from natural language:

Try it live in AI21 Studio
Try it live in AI21 Studio

These two examples highlight the flexibility of Jurassic-1’s universal “text-in, text-out” interface. The model properly handles various forms of text data out of the box, freeing developers to focus on core functionality instead of worrying about format conversions.

Classification

Most use-cases above were generative in nature, meaning they involve generating a phrase, sentence, line of code etc. Another important subset of language tasks are text classification tasks, where the goal is to label a piece of text.

For instance, consider topic classification. The following example demonstrates classifying news articles based on their title and their summary:

Try it live in AI21 Studio

Note there are four categories - “World”, “Sports”, “Business” or “Science and Technology” - and we specify them explicitly in the prompt. The model then outputs these as the classification labels.

We can use the same idea to perform binary classification. In this example the model determines whether a certain attribute indicates a high or low level of openness (one of the Big Five personality traits in psychology):

Try it live in AI21 Studio

This time, the two possible labels (“High” and “Low”) aren’t spelled out in the prompt, and the model picks them up from the examples.

World knowledge

Because it was trained on a massive amount of text, Jurassic-1 acquired knowledge about different topics. By composing a suitable prompt, we can retrieve facts encoded in the model in natural language form. It’s often a good idea to build a Q&A or “interview” style prompt for this, like the one we use in the following example to answer sports trivia questions:

Try it live in AI21 Studio

A different kind of knowledge is common sense knowledge. In this example we probe the model’s ability to predict outcomes of different actions according to common sense:

Try it live in AI21 Studio

It’s important to keep in mind that the coverage and accuracy of knowledge encoded in Jurassic-1 may vary depending on factors such as time, topic and geography, and may also reflect bias found in the human-written texts the model was trained on. In particular, don’t expect the model to possess highly domain-specific knowledge. Furthermore, note that the model doesn’t have any knowledge of current events, since it was trained on texts dated up to year 2020.

Other fun examples

Finally, we’d like to share a few fun examples, built by members of our team on a one-day internal hackathon. These projects were primarily designed to make you laugh, but we hope they also help you imagine the opportunities that AI21 Studio unlocks for media, content creation, human-computer interaction and many other industries.

Jurassic-1 write rap lyrics

The team used Jurassic-1 to generate lyrics for rap songs about historical figures. The inspiration is, of course, the musical Hamilton. They primed the model with lyrics about Alexander Hamilton, George Washington (both from “Hamilton”) and Eva Perón (from “Evita”). Then they had the model generate new lyrics about Barack Obama. Note that they didn’t explicitly provide the model with any of the biographical information about Obama, so all the knowledge (Harvard Law, Michelle, Chicago etc.) is encoded within the model itself. Once they had the lyrics, they packaged them nicely in a video using an off-the-shelf deep fake engine that supports rap, added a beat, et viola.

Jurades: AI charades powered by Jurassic-1

In this game, players take turns trying to communicate the identity of random famous characters, without stating their names, following the standard rules of charades. Unlike a normal game of charades, the one responsible for guessing the the characters' identities is not a human, but a language model... Jurassic-1!

The model is fed with a few-shot prompt that taps into its world knowledge and text comprehension capabilities. Jurassic-1 is surprsingly good at understanding non-coherent, associative descriptions that humans make under pressure. The prompt is set up to allow the model to self-correct based on failed guesses and follow up hints.

JurassiChess

Continuing our games theme, JurassiChess uses Jurassic-1 to give you verbal feedback on your chess moves, by integrating it with Stockfish, an open-source chess AI. When you play against Stockfish, it provides a score that represents the strength of your position as well as the AI’s suggestions for the best alternative move (in chess notation). We feed this information into Jurassic-1 and use specific prompts to generate relevant positive, negative or neutral feedback, resulting in a responsive AI chess tutor experience. And if you don’t mind a little trash-talking, a different set of prompts gives your AI opponent a way to taunt you.

Discover more

What is a MRKL system?

In August 2021 we released Jurassic-1, a 178B-parameter autoregressive language model. We’re thankful for the reception it got – over 10,000 developers signed up, and hundreds of commercial applications are in various stages of development. Mega models such as Jurassic-1, GPT-3 and others are indeed amazing, and open up exciting opportunities. But these models are also inherently limited. They can’t access your company database, don’t have access to current information (for example, latest COVID numbers or dollar-euro exchange rate), can’t reason (for example, their arithmetic capabilities don’t come close to that of an HP calculator from the 1970s), and are prohibitively expensive to update.
A MRKL system such as Jurassic-X enjoys all the advantages of mega language models, with none of these disadvantages. Here’s how it works.

Compositive multi-expert problem: the list of “Green energy companies” is routed to Wiki API, “last month” dates are extracted from the calendar and “share prices” from the database. The “largest increase“ is computed by the calculator and finally, the answer is formatted by the language model.

There are of course many details and challenges in making all this work - training the discrete experts, smoothing the interface between them and the neural network, routing among the different modules, and more. To get a deeper sense for MRKL systems, how they fit in the technology landscape, and some of the technical challenges in implementing them, see our MRKL paper. For a deeper technical look at how to handle one of the implementation challenges, namely avoiding model explosion, see our paper on leveraging frozen mega LMs.

A further look at the advantages of Jurassic-X

Even without diving into technical details, it’s easy to get a sense for the advantages of Jurassic-X. Here are some of the capabilities it offers, and how these can be used for practical applications.

Reading and updating your database in free language

Language models are closed boxes which you can use, but not change. However, in many practical cases you would want to use the power of a language model to analyze information you possess - the supplies in your store, your company’s payroll, the grades in your school and more. Jurassic-X can connect to your databases so that you can ‘talk’ to your data to explore what you need-  “Find the cheapest Shampoo that has a rosy smell”, “Which computing stock increased the most in the last week?” and more. Furthermore, our system also enables joining several databases, and has the ability to update your database using free language (see figure below).

Jurassic-X enables you to plug in YOUR company's database (inventories, salary sheets, etc.) and extract information using free language

AI-assisted text generation on current affairs

Language models can generate text, yet can not be used to create text on current affairs, because their vast knowledge (historic dates, world leaders and more) represents the world as it was when they were trained. This is clearly (and somewhat embarrassingly) demonstrated when three of the world’s leading language models (including our own Jurassic-1) still claim Donald Trump is the US president more than a year after Joe Biden was sworn into office.
Jurassic-X solves this problem by simply plugging into resources such as Wikidata, providing it with continuous access to up-to-date knowledge. This opens up a new avenue for AI-assisted text generation on current affairs.

Who is the president of the United States?

T0
Donald Trump
GPT-3
Donald Trump
Jurassic-1
Donald Trump
Google
Joe Biden
Jurassic-X
Joe Biden is the
46th and current
president
Jurassic-X can assist in text generation on up-to-date events by combining a powerful language model with access to Wikidata

Performing math operations

A 6 year old child learns math from rules, not only by memorizing examples. In contrast, language models are designed to learn from examples, and consequently are able to solve very basic math like 1-, 2-, and possibly 3- digit addition, but struggle with anything more complex. With increased training time, better data and larger models, the performance will improve, but will not reach the robustness of an HP calculator from the 1970s. Jurassic-X takes a different approach and calls upon a calculator whenever a math problem is identified by the router. The problem can be phrased in natural language and is converted by the language model to the format required by the calculator (numbers and math operations). The computation is performed and the answer is converted back into free language.
Importantly (see example below) the process is made transparent to the user by revealing the computation performed, thus increasing the trust in the system. In contrast, language models provide answers which might seem reasonable, but are wrong, making them impractical to use.

The company had 655400 shares which they divided equally among 94 employees. How many did each employee get?

T0
94 employees.
GPT-3
Each employee got 7000 stocks
Jurassic-1
1.5
Google
(No answer provided)
Jurassic-X
6972.3
X= 655400/94
Jurassic-X can answer non-trivial math operations which are phrased in natural language, made possible by the combination of a language model and a calculator

Compositionality

Solving simple questions might require multiple steps, for example - “Do more people live in Tel Aviv or in Berlin?” requires answering: i. What is the population of Tel-Aviv? ii. What is the population of Berlin? iii. Which is larger? This is a highly non-trivial process for a language model, and language models fail to answer this question (see example). Moreover, the user can’t know the process leading to the answers, hence is unable to trust them. Jurassic-X can decompose such problems into the basic questions, route each to the relevant expert, and put together an answer in free language. Importantly, Jurassic-X not only provides the correct answer but also displays the steps taken to reach it, increasing the trust in the system.

Do more people live in Tel Aviv or in Berlin?

T0
Berlin
GPT-3
There are more people living in Tel Aviv than in Berlin.
Jurassic-1
Berlin and Tel Aviv are roughly the same size
Google
(First hit is a comparison between Tel Aviv and Berlin)
Jurassic-X
More people live in Berlin than in Tel-Aviv

[‘Return population of Tel Aviv’; Return population of Berlin’; Return which is bigger between #1 and #2’]
Step 1: Population of Tel Aviv. Result - 451523.
Step 1: Population of Berlin. Result - 3664088.
Step 3: Which is bigger,  #1 or #2. Result - Berlin.

Jurassic-X breaks down compositional questions, answers the basic sub-questions, and puts together the answer. Importantly, this process is transparent to the user greatly increasing the trust in the system

Dynamic information (like weather and currency exchange rates)

Certain types of information change continuously - weather, currency exchange rates, share values and more. Such information will never be captured by language models, yet can easily be handled by Jurassic-X by integrating it with a reliable source of information. We performed a proof-of-concept on two such features - weather and currency exchange rates, and the design enables quick integration with more sources to solve your use-case.
Weather - a loosely phrased question about the weather elicits an answer from all language models, where language models always return the same answer, regardless of when the question was asked (funny, right?), while Jurassic-X provides an answer based on the actual weather prediction.

I’m going to be in New-York in 3 days. Should I pack my umbrella?

T0
No
GPT-3
Yes, you should pack your umbrella.
Jurassic-1
Yes, you should. The weather forecast is rain.
Google
(Links to weather websites)
Jurassic-X
Yes, you should pack your umbrella, because in New York in 3 days there will be broken clouds and the temperature will be -2 degrees.

Currency exchange rates change much faster than weather predictions, yet the Jurassic-X concept - a language model connected to a reliable source of information - easily solves this problem as well.

How much Moroccan money will I get for 100 bucks?

T0
125 dirhams
GPT-3
100 moroccan dirhams is about 27$.
Jurassic-1
How much is 100 dollars in moroccan money?
Google
100 dirhams = 10.75 dollars
Jurassic-X
100 USD = 934.003 MAD
Jurassic-X combines a language model with access to APIs with continuously changing information. This is demonstrated for weather forecasts and currency exchange rates, and can easily be extended to other information sources

Transparency and trust

Transparency is a critical element that is lacking in language models, preventing a much wider adoption of these models. This lack of transparency is demonstrated by the answers to the question - “Was Clinton ever elected as president of the United States?”. The answer, of course, depends on which Clinton you have in mind, which is only made clear by Jurassic-X that has a component for disambiguation. More examples of Jurassic-X’s transparency were demonstrated above - displaying the math operation performed to the user, and the answer to the simple sub-questions in the multi-step setting.

Was Clinton ever elected president of the United States?

T0
Yes
GPT-3
No, Clinton was never elected as president of the United States.
Jurassic-1
No
Google
Clinton was elected president in the 1992 presidential elections…
Jurassic-X
Bill Clinton was elected president.
Jurassic-X is designed to be more transparent by displaying which expert answered which part of the question, and by presenting the intermediate steps taken and not just the black-box response

Your Turn

That's it, you get the picture. The use cases above give you a sense for some things you could do with Jurassic-X, but now it's your turn. A MRKL system such as Jurassic-X is as flexible as your imagination. What do you want to accomplish? Contact us for early access

Contact us below and we will get back to you shortly.

Thank you!

Your submission has been received!
Oops! Something went wrong while submitting the form.