What is groundedness checking?
Large Language Models (LLMs) are capable of generating detailed, information-rich content, but they are also prone to hallucinations—producing factually incorrect or ungrounded responses. One popular approach to address this limitation is to provide LLMs with reference text, often called "context," which helps generate more accurate outputs. This method is known as Retrieval Augmented Generation (RAG).
While RAG enhances the accuracy of LLM outputs by grounding them in provided context, it doesn't always guarantee truthfulness. Therefore, an additional verification step is necessary to ensure the model’s response aligns with the given context. The Groundedness check API is designed precisely for this purpose: it evaluates whether a model-generated response is grounded in the provided context. Based on this check, the API will classify the response as grounded, not grounded, or uncertain.
Incorporating the Groundedness Check API significantly improves the reliability of the system. By validating responses before they are delivered, it helps ensure factual accuracy, reducing the risk of hallucinations to nearly zero.
What models does Upstage provide?
The table below lists models currently available as an API. Upstage provides stable aliases that point to specific model versions, allowing you to integrate once and automatically benefit from future updates. We recommend using aliases instead of hardcoding model names, as models can be frequently updated.
| Alias | Currently points to | RPM / TPM (Learn more) |
|---|---|---|
| groundedness-check | groundedness-check-240502 | 100 / 100,000 |
With and without groundedness check
While RAG significantly addresses the hallucination issue in LLMs, Groundedness check acts as a safeguard to confirm the accuracy of the response. Reflecting on the example provided, RAG alone might not prevent an initial inaccurate response from being presented to the user as shown in the first case. However, Groundedness check allows for the response to be redirected to the LLM, offering a chance for correction.
This process of Groundedness check meticulously checks if the output aligns with the content from the reference document. By ensuring the answer is consistent with the retrieved data, it verifies that the model's output is firmly anchored in the provided context, thereby eliminating scenarios where the response is unmoored from the given information.
Parameters
-
The
messagesparameter should be a list of message objects containing two elements:- a user-provided context and
- an assistant's response to be checked.
-
Each message object must specify the type of message as either
user(context) orassistant(response) using theroleattribute, and set thecontentattribute with the corresponding text string.
The API response will be a string with a value of either grounded, notGrounded, or notSure. The notSure response is returned when the groundedness of the assistant's response to the provided context cannot be clearly determined.