Over the past few years, large language models (LLMs) have evolved from emerging to mainstream technology. In this blog post, we’ll explore some of the most common natural language processing (NLP) use cases that they can address.
What is a large language model?
A large language model (LLM) is a type of machine learning model that can handle a wide range of natural language processing (NLP) use cases. But due to their versatility, LLMs can be a bit overwhelming for newcomers who are trying to understand when and where to use these models.
There are seven broad categories of use cases where you can apply them.
Classify
Text classification is a widely used application of Natural Language Processing. It is a supervised learning algorithm which requires prior knowledge of the classes it needs to classify text into. It can be done using text embeddings or through “few-shot” classification.
The number of training examples needed is dependent on the task, but typically ranges from hundreds to thousands. “Few-shot” classification can work with as little as five training examples per class.
Areas where text classification can be usefu:
- Content moderation for toxic comments on online platforms
- Intent classification in chatbots
- Sentiment analysis on social media activity
- eCommerce product categorization
- Assigning customer support tickets to the right teams
Generate
LLMs are pre-trained models that generate original and coherent text, and prompt engineering is a field dedicated to getting the best out of these models. Prompt engineering involves providing the model with contextual information to produce a specific type of text.
Here are some other examples:
- Writing product descriptions, given the product name and keywords
- Writing chatbot/conversational AI responses
- Developing a question-answering interface
- Writing emails, given the purpose/command
- Writing headlines and paragraphs
The second use case category, which also leverages prompt engineering, is text summarization. Think about the amount of text that we deal with on a typical day, such as reports, articles, meeting notes, emails, transcripts, and so on.
Search/Similarity
LLMs are known for their text generation capabilities, but their text representation capabilities are equally powerful. Text representation is about making sense of existing text and is useful for massive amounts of unstructured data.
An example of this is similarity search, which is used in search engines to match a query with relevant results. Text representation models generate text embeddings, which are long sequences of numbers that store information about the text.
Use cases:
- Retrieval of related and useful documents within an organization
- Similar product recommendations
- eCommerce product search
- Next article recommendations based on reading history
- Selecting chatbot responses from an available list
Summarize
We can have an LLM summarize a piece of text by prompting it with a few examples of a full document and its summary.
Here are some example documents where LLM summarization:
- Customer support chats
- Environmental, Social, and Governance (ESG) reports
- Earnings calls
- Paper abstracts
- Dialogues and transcripts
Cluster
Clustering is a way of organizing a set of documents into groups, based on their similarity and relevance to each other. This can be done via k-means clustering, where the number of clusters is specified.
This technique can be applied to number of different tasks, such as:
- Organizing customer feedback and requests into topics
- Segmenting products into categories based on product descriptions
- Turning ESG reports and news into themes
- Organizing a huge corpus of company documents
- Discovering emerging themes in survey responses analysis
Rewrite
This is another of those tasks that we do every day and spend a lot of time on, and if we could automate them, it would free us up to work on more creative tasks.
Rewriting text can mean different things and take different forms, but one common example is text correction.
We prepare the prompt with a short bit of context about the task, followed by examples of incorrect and corrected transcriptions.
Example use cases for using an LLM to rewrite text:
- Paraphrase a piece of text in a different voice
- Build a spell checker that corrects text capitalizations
- Rephrase chatbot responses
- Redact personally identifiable information
- Turn a complex piece of text into a digestible form
Extract
Text extraction is another use case category that can leverage a generation LLM. The idea is to take a long piece of text and extract only the key information or words from it.
Use cases in this category include:
- Extract named entities from a document
- Extract keywords and keyphrases from articles
- Flag for personally identifiable information
- Extract supplier and contract terms
- Create tags for blogs