NLP Learning Notes / NLP008

Open Issues in Large Language Models: Hallucination, Bias, Alignment and Interpretability

The last note ended with two challenges, data contamination and hallucination. This note, from the final lecture of the course, looks at what still goes wrong with large language models (LLMs) and what researchers do about it. It covers four problems: hallucination and stale information, unhelpful or toxic answers, bias, and the black-box problem. For each one, it shows a method that detects, reduces or explains the problem. None of these methods makes the problem go away completely.

  • section
  • key term
  • reading note
ELLE · READING COMPANION

Take a moment to connect the ideas

A few foundations, with Elle

Tap a concept to explore it, then try three short questions. You can change any answer.

Hallucination

Output that sounds plausible but is untruthful, nonsensical or unfaithful to its source. It can hide in the reasoning even when the final answer is right.

Atomic fact

One short claim that can be checked as true or false on its own. FActScore splits a text into atomic facts and checks each against a trusted source such as Wikipedia; DoveScore also checks their order.

RAG

Retrieve documents relevant to the question, combine them with it into a new prompt, then generate. The answer can be up to date and cite sources, and the model itself does not change.

RLHF

Fine-tuning with human feedback in three steps: people write ideal answers, people rank model answers to train a reward model, then the model is updated to earn higher reward scores.

Mechanistic interpretability

Opening up weights, neurons and activation paths to find the "circuits" behind a task, such as recalling the capital of Peru or adding two numbers.

1 / 3 · An LLM picks the right option on a medical exam question. Does that show its reasoning was sound?

2 / 3 · Every atomic fact in a generated clinical note is true. Can the note still be a hallucination?

3 / 3 · Does RAG change the model's weights?

The big picture: four problems and their solutions

Start at the top left with hallucinations: the three ways they show up, then the possible solutions in blue. FActScore and DoveScore detect hallucinations, and RAG helps prevent them. Below that are biases in LLMs, where they come from, and four ways to mitigate them. At the top right, unthoughtful or toxic answers lead to RLHF and its three steps. At the bottom right is interpretability, with why it matters and the two main ways researchers look inside the model. My takeaway is in the bottom-right corner.

Handwritten-style overview of open issues in large language models: hallucinations and stale information with FActScore, DoveScore and RAG; biases and four ways to mitigate them; RLHF in three steps for unhelpful or toxic answers; interpretability, why it matters and how researchers look inside the model ⤢ Enlarge

Tidied up from my handwritten page, with a few corrections and additions.

Tap a region to jump to that part of the note; use ⤢ Enlarge to see the full picture.

Watch this part

Hallucination: fluent, confident and wrong

An LLM hallucinates when it produces an answer that sounds plausible but is untruthful, nonsensical or unfaithful to its source. This is true even of the strongest models. The GPT-4 technical report says the model "is not fully reliable" and asks for great care in high-stakes contexts.

The course shows three forms:

Form Example from the lecture
Plausible but wrong Asked "Is 1 gram of iron heavier than 1 gram of feathers?", the model says yes and explains that iron is denser.
Inconsistent The same model gets it right when the question is rephrased as "What is heavier, 1 gram of iron or 1 gram of feathers?"
Right answer, wrong reasoning On a US Medical Licensing Examination question, the model picked the correct option, but its explanation contained incorrect reasoning steps. With other step-by-step prompts it gave a wrong answer, for a mix of reasons.

The third form matters most for health work. A correct final answer does not show that the reasoning behind it is sound, so checking only the answer is not enough.

Why does this happen? An LLM is trained to predict the next token from patterns in text. It can learn that a number should come next, and even what range of numbers sounds right, but nothing in that training guarantees the number is true. The text sounds right whether or not it is, so a reader without the background knowledge can easily be misled.

Watch this part

Stale information: stuck at the training date

A separate limitation: an LLM knows nothing that was not in its training data. A model trained in December 2024 cannot know who became Prime Minister of Canada in 2025, and without an external source it does not even know today's date. When it tries to answer anyway, the gap can turn into a hallucination.

Infographic: the unreliability trap, hallucinations and stale data in LLMs: plausible but unfaithful answers, the phrasing trap, right answer for the wrong reason in medical exams, stuck in the past after the training cutoff, blind to the present, and high-stakes risks
InfographicInfographic: the unreliability trap, hallucinations and stale data in LLMs: plausible but unfaithful answers, the phrasing trap, right answer for the wrong reason in medical exams, stuck in the past after the training cutoff, blind to the present, and high-stakes risksClick to open full size

Detecting hallucinations: FActScore and DoveScore

How can we tell whether a long answer contains hallucinations? A careful human would read it and check each fact, one after the other. FActScore (Factual precision in Atomicity Score; Min et al., 2023) automates that process in two steps:

  1. Break the text into atomic facts. Another LLM splits each generated sentence into short facts that can each be true or false. "Bridget Moynahan is an American actress, model and producer" becomes four facts: she is American, an actress, a model, and a producer.
  2. Check each fact against a trusted source. For each fact, relevant passages are retrieved from a source such as Wikipedia, and an LLM judges whether the passages support it. In the course example, "producer" is not supported, nor is the claim that she studied at the American Academy of Dramatic Arts (she studied acting elsewhere).

The score is the share of atomic facts that the source supports. Notice that the output of one LLM is being checked by another.

FActScore has a blind spot: an answer can be built entirely from true facts and still tell a false story.

Atomic facts Order
What happened The patient reported chest pain. The ECG was normal. The patient was discharged. Chest pain → ECG → discharge
Generated text The ECG was normal. The patient reported chest pain. The patient was discharged. ECG → chest pain → discharge

Every fact checks out, so FActScore gives the generated text a pass, even though it says something different from what happened. DoveScore (Zheng, Lapata and Pan, 2025) also checks the order between atomic facts when they describe events, so this text fails. Its authors report that misleading texts assembled from true statements push earlier fine-grained evaluators below an AUC of 65%.

FActScore and DoveScore measure hallucinations; they do not prevent them. As the lecture puts it, detecting hallucinations is not a solved problem.

Infographic: taming hallucinations, detect and prevent AI inaccuracies: FActScore breaks output into atomic facts checked against Wikipedia, DoveScore checks the order of events, automated verification with a second LLM, and the retrieval augmented generation cycle with live sources and citations
InfographicInfographic: taming hallucinations, detect and prevent AI inaccuracies: FActScore breaks output into atomic facts checked against Wikipedia, DoveScore checks the order of events, automated verification with a second LLM, and the retrieval augmented generation cycle with live sources and citationsClick to open full size

Reading note: "RAG/REG" in the right-hand heading is a slip; the method is RAG. RAG reduces hallucinations and stale information rather than solving them, and it can retrieve from any trusted document collection, not only the live web. "sequeuenced" should read sequenced.

Watch this part

Preventing hallucinations: retrieval-augmented generation (RAG)

Retrieval-augmented generation (RAG; Lewis et al., 2020) adds one step between the question and the answer:

Step Plain LLM With RAG
1 The user asks a question The user asks a question
2 (none) Retrieve documents relevant to the question from a knowledge source, and combine them with the question into a new prompt
3 The LLM generates an answer from what it learned in training The LLM generates an answer from the question plus the retrieved documents

Because the documents can be up to date and come from trusted sources, RAG addresses both problems at once. Asked who the current Prime Minister of Canada is, a RAG system first retrieves recent news, then answers from it. The documents also serve as citations, so the reader can check where each claim came from. The course's example is ChatGPT-enhanced Bing search, which breaks a complex question into simpler ones, retrieves answers to each, merges them and cites its sources.

In health care the same idea looks like this: before answering a question about a drug dose, the system retrieves the current clinical guideline and answers from that text, not from whatever version the model saw during training. RAG does not change the model, and it is only as good as what it retrieves. If the retrieved document is wrong or out of date, or the model misreads it, the answer can still be wrong.

Watch this part

Unhelpful or toxic answers: RLHF

LLMs can also produce answers that are true but unhelpful, unthoughtful or even toxic. Making models ever bigger is too expensive to be a scalable fix. Reinforcement learning from human feedback (RLHF; Ouyang et al., 2022) instead fine-tunes the model on human feedback, to align its behaviour with what users want. It has three steps:

Step What people do What is trained
1. Supervised fine-tuning Labelers write ideal answers to prompts, such as "Explain the moon landing to a 6-year-old" The LLM is fine-tuned to answer the way the labelers did
2. Reward model Labelers rank several model answers to the same prompt, from best to worst (in the course example, D > C > A = B) A separate reward model learns to give a score to any answer, reproducing those rankings
3. Reinforcement learning optimization (no new labels) The LLM generates answers, the reward model scores them, and the LLM is updated to earn higher scores

So human preferences enter through demonstrations in step 1 and rankings in step 2, and the reward model passes them on at scale in step 3. Unlike RAG, RLHF changes the model's weights. The lecture's supplementary slides also mention direct preference optimization (DPO), a simpler replacement for step 3 that learns from the preference pairs directly, without a separate reward model.

Infographic: RLHF, aligning AI with human intent: the scaling limit, then the three-step process of supervised fine-tuning with ideal answers, training a reward model from human rankings such as D greater than C greater than A equals B, and reinforcement learning optimization against the reward model
InfographicInfographic: RLHF, aligning AI with human intent: the scaling limit, then the three-step process of supervised fine-tuning with ideal answers, training a reward model from human rankings such as D greater than C greater than A equals B, and reinforcement learning optimization against the reward modelClick to open full size

Watch this part

Bias: the model reflects its training data

LLMs tend to reflect, and sometimes amplify, biases in their training data. The course names three common types:

Type What it looks like Example
Stereotyping and social bias Harmful stereotypes about gender, race, religion, age or other identities Linking certain professions with women or men
Toxicity and hate speech Offensive or hateful language echoed from the training data, especially on sensitive topics Slurs or offensive jokes
Representation bias Some groups overrepresented in the data, others underrepresented, leaving systematic blind spots Dominance of English and Western cultural contexts

The gender example works with word vectors. Each word is represented as a vector, and the similarity between two vectors (their cosine similarity) shows how closely the model associates them. The words closest to nurse are midwife, mother, wife and widower. Most of these are female terms, so the representation has absorbed the stereotype that nurses are women. (Widower, a man whose wife has died, is on the course's list too; the pull is toward family and caring roles as well as gender.) Bolukbasi et al. (2016) showed the same pattern in standard word embeddings.

What a model produces depends on the data it was fed. If English material dominates, or the data already contains biased or harmful content, the answers will carry that bias. The course lists four ways to mitigate it:

Method When it acts How
Data curation Before training Remove or balance biased data. Hard at the scale of billions or trillions of documents
Post-hoc filtering At inference, while answering Moderation layers, often classifiers, detect and block toxic or biased outputs; many commercial LLMs do this
RLHF During fine-tuning Human feedback steers the model away from amplifying bias
Transparency and interpretability After training Trace which parts of the model encode a bias, then modify those parts

Research continues on removing bias without losing accuracy on the target task.

Infographic: the bias challenge, navigating LLM social and representation risks: stereotyping and social bias with the nurse word-vector example, representation blind spots, toxicity and hate speech, and three fixes: data curation before training, post-hoc filtering at inference, and human feedback and alignment
InfographicInfographic: the bias challenge, navigating LLM social and representation risks: stereotyping and social bias with the nurse word-vector example, representation blind spots, toxicity and hate speech, and three fixes: data curation before training, post-hoc filtering at inference, and human feedback and alignmentClick to open full size

Reading note: "jakes" and "slars" in the toxicity box should read jokes and slurs. The fourth mitigation from the course, transparency and interpretability, is not shown.

Watch this part

Interpretability: opening the black box

An LLM is a neural network with billions of weights. Its knowledge and reasoning are stored implicitly in those weights, so we see the answer but not how it was reached. Interpretability tries to understand how and why the model produces its outputs, and what information it represents, how, and where.

It increases three things:

  • Trust and accountability: explaining a prediction to experts and non-experts, which is critical in fields such as medicine.
  • Debugging: finding out why the model made a mistake, such as a hallucination, so the responsible part can be fixed.
  • Bias and fairness auditing: locating where harmful patterns come from.

The course describes two main approaches:

Approach What it inspects Example
Analysing attention patterns The attention matrices, which show how much each word's meaning depends on the other words (and, aggregated, each sentence on the others) Extract tree-like structures from them and compare with known syntax or discourse structures: what is captured, what is missing, and how to inject it
Mechanistic interpretability Weight matrices, neurons, activation paths and "circuits" (sub-networks) Find the neurons that activate when the model recalls the capital of Peru; trace how information flows through the layers when it adds two numbers; find the circuit active when it translates Chinese into Tagalog

Mechanistic interpretability is the more ambitious of the two. Tracing information flow, finding important neurons and patching weights to test a hypothesis are all tools within it. The goal is a model that is more transparent, easier to debug and safer.

Infographic: opening the black box, a guide to LLM interpretability: why we need it (trust and accountability, debugging and error correction, auditing bias and fairness) and how we peek inside (analysing attention patterns, mechanistic interpretability with circuits, tracing information flow)
InfographicInfographic: opening the black box, a guide to LLM interpretability: why we need it (trust and accountability, debugging and error correction, auditing bias and fairness) and how we peek inside (analysing attention patterns, mechanistic interpretability with circuits, tracing information flow)Click to open full size

Reading note: tracing information flow is shown as a third method; the course treats it as one tool of mechanistic interpretability. Interpretability helps researchers find the parts behind hallucinations; reliably fixing them is still an open research goal.

Watch this part

My thoughts

Many people using ChatGPT, Gemini, Claude and similar tools have seen them make up answers that look completely real. That is AI hallucination. Recall how an LLM produces an answer: training links tokens to each other and learns probabilities, and the model predicts the next token. So the model may know that the next token should be a number, even a number in a reasonable range, but nothing guarantees it is the right number. That is why people without the relevant knowledge are so easily fooled.

This problem cannot be fully solved yet, only reduced. RAG is one way: the system first looks up current, trusted documents and answers from them, much as I would check the latest guideline before answering a question about a medication.

Another kind of hallucination gets every fact right but puts them in the wrong order, like a clinical note saying the ECG came before the chest pain. Each sentence looks reasonable on its own, and nothing in generation checks the sequence against what actually happened. FActScore and DoveScore find this kind of error: extract the atomic facts, check whether each fact is correct, then check the order between them. They measure the problem rather than prevent it, but you cannot fix what you cannot find.

LLMs can also be biased or give unthoughtful answers. Bias comes mainly from the data the model is fed. If the training data already carries biased or harmful content, the answers will too, so improving data quality comes first. Because cleaning data at web scale is very hard, filtering outputs, RLHF and interpretability are used alongside it.

In the end, the biggest consequence of all these problems is a question of trust: how much should we trust what an LLM generates? LLMs are developing quickly and really can save a lot of time. But in fields such as health care, and anywhere a technology affects people's lives and safety, we have to be careful and keep humans in charge of quality. An LLM is a black box. Until a step we can't see has been fully taken apart, we should stay cautious and sceptical, even when the result is correct.

Watch this part

Learning sources and resources

This note is based on my study notes from the University of British Columbia (UBC) micro-certificate program "Natural Language Processing to Improve Patient Care," in the course "Overview of NLP and Large Language Models" (the lecture "LLMs: Open Issues and Solutions" by Giuseppe Carenini). Technical details were checked against:

Try it yourself

  • FActScore on GitHub: the authors' code and data; the README shows how to score your own model's biographies against Wikipedia.
  • Illustrating RLHF (Hugging Face): a clear, diagram-led walk-through of the three RLHF steps.
  • BertViz: visualizes attention heads in Transformer models in a notebook, so you can look at attention patterns yourself.
  • Neuronpedia: an open platform for mechanistic interpretability; browse the features individual neurons respond to and test them with your own text.
  • Tracing the thoughts of a large language model (Anthropic): a readable example of tracing circuits inside a production model, including multi-step reasoning and made-up answers.
原图 / Original ↗