LLM hallucination

AI hallucination is defined as when a generative model creates outputs that sound plausible but are in reality false, nonsensical, or unconnected to reality. LLM Modern generates text, for instance, via a probabilistic next-word prediction mechanism. At base, these models are merely autocompletion engines that look at a given sequence of words and guess the most likely sequence of words that would follow. Next words are selected based on a probability distribution.

This probability-driven process is powerful for producing fluent and diverse text, calling it generative. It generates what seems right statistically, not by verifying facts. Some call it perception, instead of factual. The distribution of the input sequence words, as base for the output e.g., next token sequence word, is defined by so-called heads.

A head is the learned decision-brain that gets the distribution. The distribution is a function of the relationship between tokens (e.g. words). It is the co called context windows that defines how many tokens are taken into account from the currently considered token. Think about the sentence: “The chicken is too spicy for the waiter”. 

Heads extract relationships on “Who finds the chicken too spicy?”. Is it, literally, a piece of spicy chicken, and the waiter (tasting it or handling it) thinks it’s too spicy? In common sense and context, a human reader would explain this as in various “heads” 1) the waiter finds the chicken dish too spicy to handle or 2) eat. Because waiters do not typically eat customers’ food (we know that), this sentence might imply a scenario like the waiter sampling a dish 3) or joking 4) with a chef.

These heads are not only about training, it is also the data deciding on the distribution as well as the transformation (aka Transformer) from input sequence words to the next token sequence, also after the training by injecting grounding facts e.g., via domain related documents through the RAG approach. 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *