VOOZH about

URL: https://thenewstack.io/how-ai21s-new-tool-reduces-llm-hallucinations/

⇱ How AI21's New Tool Reduces LLM Hallucinations - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-07-21 08:14:09
How AI21's New Tool Reduces LLM Hallucinations
sponsor-promptops,sponsored-topic,
AI / Large Language Models / Software Development

How AI21’s New Tool Reduces LLM Hallucinations

Find out how a new solution from AI21 reduces hallucinations from large language model-powered artificial intelligence in business domains.
Jul 21st, 2023 8:14am by Loraine Lawson
👁 Featued image for: How AI21’s New Tool Reduces LLM Hallucinations
Photo by Kathrine Birch via Pexels

No one really knows why artificial intelligence that use large language models hallucinates — but they do.

This flaw has led some organizations to ban the use of AI. A majority of leaders expressed concerns about the risk related to functional accuracy, according to a KPMG survey of 225 executives at U.S. companies with revenues in excess of $1 billion annually. The survey found that 90% had “moderate to highly significant” concerns about the risks of using generative AI and doubts about how to mitigate those risks, Forbes reported in April. Sixty percent also said they were probably still two years away from their first generative AI solution.

AI21 Labs is hoping to mitigate those concerns with a new engine called Contextual Answers. Released Wednesday, the solution significantly reduces hallucinations, according to Tal Delbari, who led the AI21 team that created the tool.

“We don’t really understand all the the internal mechanisms of these large language models. It’s almost like magic,” Delbari said. “But what we do know is that when we train these models — and it’s true for AI21 Labs’ large language models, OpenAI and Entropik and all of these players — the main part of the model training is not about making sure that the answers or the outputs of the models are correct.”

It’s a language model, not a knowledge model, as ethicist, author and philosophy professor Reid Blackman said at Rev4. It’s trained to predict the next word in a sentence, Delbari explained, so it will try to generate a sentence that a looks right structurally and grammatically — but the AI doesn’t understand the concept of factuality.

“If a customer asked about the return policy of a specific website, the company wants the model to generate an answer that is grounded, truthful and correct based on the specific policy and not based on the general case,” Delbari said. “This is the reason that we started this technology.”

PromptOps, powered by advanced machine learning and Large Language Models (LLMs), streamlines operational data access, team coordination, and process automation. PromptOps enables DevOps teams to maintain superior platform performance and deliver an unparalleled customer experience.
Learn More
The latest from PromptOps

How AI21’s Engine Handles Hallucinations

Contextual Answers deals with hallucinations in two ways: First, it operates on Jurassic II, AI21’s large language model. Delbari’s group trained a specific variant of Jurassic II on business domains such as finance, medicine, insurance, pharmaceuticals and retail.

“We train the model with triplets of documents, questions about the documents and answers that came specifically from the documents, and this is part of the technique that we use to make sure that the model learns that in this specific task, it should only retrieve information from a single document or a library of documents,” he said.

Some organizations have attempted a similar process with models already generally trained on the internet, he said, but that approach is flawed. For one thing, when a model is trained with new information, it tends to forget what it had learned previously, he explained. Organizations using open source projects such as LangChain also have tried similar approaches, he said. These approaches “are not great in fighting hallucinations and still the organization needs to invest in AI practitioners, NLP (natural language processing) experts, engineers,” Delbari added. “With our solution, it’s just plug and play. You don’t need to do any engineering work to implement this architecture.”

Another key difference between Context Answers and internet-trained large language models like GPT is that in many cases, the context window for inputting information is 8,000 to 32,000 tokens, which roughy equates to the same amount of words. That can be a problem for organizations, which may have a single document of 50 pages or more. Contextual Answers supports any size document length and any number of documents, Delbari said.

With Contextual Answers, organizations train the model on their own documents library via AI21’s website or an API, he said.

A Backup Plan

Second, AI21 added filters and rails to detect hallucinations and remove them or ask the main model to generate an output until there are no hallucinations.

“From a single document or from millions of internal documents, whatever corpus of information you load to the model, we put an entire architecture of models that are making sure that the model doesn’t go off [the] rails,” he said.

It is still possible to trigger hallucinations, but a user has to work pretty hard to do so, he added.

“Our models are much more reliable, truthful, to the real data, and it’s very rare that they’re answering something that is is not true,” Delbari said. When companies see that hallucinations are almost zero, it emboldens them to bring these technologies into production, he added.

There are two ways organizations can implement Contextual Answers: It can run as a SaaS on AWS, or it can run on the organization’s own virtual private cloud. The latter ensures the data will never leave the virtual walls of the organization, he said.

Coding and Contextual Answers

But what about coding? It can be asked about coding, but at this time the solution is not optimized to help with writing code at this time. The roadmap does include a plan to train it so that it will be able to write code, Delbari said.

For those interested, there is a tutorial published by AI21 Labs partner Lab Lab AI on how to create Contextual Answer apps. It was written for a hackathon when it was still in beta and had limited the document size of submissions.

PromptOps, powered by advanced machine learning and Large Language Models (LLMs), streamlines operational data access, team coordination, and process automation. PromptOps enables DevOps teams to maintain superior platform performance and deliver an unparalleled customer experience.
Learn More
The latest from PromptOps
TRENDING STORIES
Loraine Lawson is a veteran technology reporter who has covered technology issues from data integration to security for 25 years. Before joining The New Stack, she served as the editor of the banking technology site Bank Automation News. She has...
Read more from Loraine Lawson
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Pragma, OpenAI.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.