What is an LLM? Next-token prediction for testers

Study time
≈ 2.5 h (estimate)
Updated
2026-11-06

Progress is saved in this browser only. No account, nothing is sent to a server.

Draft · reviewed by AI, not yet by a person. Content may change. English translation: AI-assisted, not human-reviewed.
On this page

Module: L1-M01 AI and LLM Fundamentals for QA · Duration: ~150 min (estimate, including the independent exercise; L01 also includes first-time setup) · Previous: none · Next: L02 - Tokens and the context window

1. Introduction

A traditional application, such as a function that computes shipping fees, is deterministic: the same input always gives the same result. A tester compares the actual result with the expected result, and a single mismatch is enough to log a bug.

A feature that uses an LLM (Large Language Model) works differently. It generates its answer by repeatedly guessing the most likely next piece of text. That is why an answer can be fluent and confident and still be wrong.

This lesson explains that mechanism at a level that lets you predict the kinds of defects an LLM feature will have. It is the foundation for every later skill of an AI QA Engineer: designing test cases, choosing an oracle (the way you decide pass/fail) and writing bug reports for AI.

2. Learning objectives

After this lesson you can:

  1. Explain in your own words the mechanism of next-token prediction and why an LLM can produce a sentence that is wrong but fluent.
  2. Distinguish pretraining, fine-tuning and RLHF, each in one sentence.
  3. Run the demo bigram model and read the next-word probability table it prints.
  4. Identify at least three differences between testing an LLM feature and testing deterministic software.
  5. Run and explain a pytest test that records that the model's fluent output is factually false, then write a new test following the same pattern.

3. Prerequisites and tools

  • Knowledge: you can write a test case (precondition, steps, expected result). You do not need to know Python or AI.
  • Tools: a computer with Python 3.10 or later and a terminal. Setup is in section 8.
  • Cost: 0 VND. The lab runs offline and needs no API key. (An API, Application Programming Interface, is the gateway through which one program calls the services of another. An API key is a secret code used to authenticate when calling a model provider's API.)

4. Concepts

4.1 Language model: a model that guesses the next piece of text

A language model is a program that takes a piece of text and works out what the next piece of text is likely to be. Try it with the sentence:

"Hà Nội là thủ đô của ..." ("Hanoi is the capital of ...")

The input text we give the model is called the prompt.

You immediately guess "Việt Nam". You can guess it because you have seen similar sentences many times, not because you just looked it up. A language model does the same thing at a much larger scale. It learns from a huge amount of text which words usually follow which words, and in which context.

Analogy: picture the word-suggestion feature of your phone keyboard, scaled up many times over. The keyboard guesses one word; an LLM keeps guessing, one piece at a time, until it has formed a whole answer.

Everyday example. You phone your regular rice shop and have only said "the usual, please" when the owner answers "grilled pork rice with an extra egg". She guesses from many past orders; she does not open a notebook. If today you want something else, she still guesses wrong, and sounds just as sure. An LLM is the same: it guesses what is common, and a confident tone does not tell you whether this guess is right.

4.2 What does "Large" mean?

According to Anthropic's glossary, LLMs are language models with a very large number of parameters, trained on a very large amount of text, that can generate human-like text, answer questions and summarise information [R1]. Parameters are the numbers inside the model that are adjusted during training. For now you can think of them as the model's "statistical memory".

Today's LLMs are based on the Transformer architecture, introduced in the paper "Attention Is All You Need" in 2017 [R2]. You do not need to understand the Transformer to test an LLM. Remember just one idea: the model looks at all the text it already has (within the limit of the context window, see lesson L02) to guess what comes next.

Everyday example. Someone learning to ride a motorbike, after thousands of rides, has reflexes in their hands and feet, not in a notebook. Parameters are like those reflexes: they are the result of practice, not a list of facts. That is why you cannot open the model and "fix the one wrong line", and why a tester has to check behaviour from the outside.

4.3 Three stages that produce an AI assistant

Stage Short explanation Consequence for testers
Pretraining The model learns to guess the next word on a large body of text that has not been labelled [R1]. The model "knows" what is common in its training data, including falsehoods and biases. Its knowledge stops at the time the data was collected.
Fine-tuning Further training on selected data so that the model imitates a type of behaviour, for example being an assistant [R1]. The "assistant" behaviour is a result of training, not a hard rule. It can be broken (see prompt injection in lesson L05).
RLHF (Reinforcement Learning from Human Feedback) Humans rank answers. Training encourages the model to produce answers like the ones ranked highly [R1]. The model is optimised to be liked by the raters. An answer that "sounds good" is not the same as a correct answer.

Anthropic's glossary also notes that a model that has only been pretrained is "not good" at answering questions or following instructions. Fine-tuning and RLHF are the steps that make it more useful [R1].

Everyday example. Picture a new barista at a coffee shop. Pretraining is like the years that person spent overhearing millions of conversations everywhere: they speak fluently but do not yet know how to serve. Fine-tuning is the shop's training course with its service script. RLHF is the manager standing next to them, scoring "which answer did the customer like better". A barista praised for keeping customers happy may promise "your drink in 10 minutes" even when the kitchen is swamped: it sounds good, but it is not true.

4.4 From guessing text to an answer

Loop diagram: the prompt 'Hà Nội là thủ đô của' → the LLM computes a probability for every possible next piece of text → it picks one piece (for example 'Việt') → appends it to the text; repeat until it stops, then the full answer comes out.
Diagram: From guessing text to an answer

Each loop produces one token (a piece of text, see lesson L02). The model stops when it produces an end signal, when it hits a length limit, or when it meets a stop sequence (see lesson L04).

Worked example. The lab for this lesson (section 8) has a toy model that looks at only one previous word. Follow it as it continues the prompt "hanoi is the capital". Save the code below as trace.py in the code-labs/l1-m01 folder (with the venv active, as in section 8.1) and run python trace.py:

from lab.bigram import CORPUS, next_word_probs, train

model = train(CORPUS)
for word in ["capital", "of", "france"]:
    print(word, "->", next_word_probs(model, word))

Actual output (run on 2026-11-06 on Python 3.14.6 and 3.12.3, Linux; both versions gave identical results):

capital -> {'of': 1.0}
of -> {'france': 0.6, 'japan': 0.2, 'vietnam': 0.2}
france -> {'</s>': 0.6666666666666666, 'is': 0.3333333333333333}
Round Last word of the text Probability table Pick (greedy: highest) Text after this round
1 capital of 1.00 of hanoi is the capital of
2 of france 0.60; japan 0.20; vietnam 0.20 france hanoi is the capital of france
3 france </s> 0.67; is 0.33 </s> (end of sentence) stop

Three rounds, and each round is just one table lookup followed by picking the largest number. No round asks "which country is Hanoi the capital of?". That is why the answer is fluent and false.

4.5 Common misconceptions

Misconception Reality
"The LLM looks the answer up in a database." An LLM on its own only generates text from what it has learned. For it to use external data, the application must put that data into the prompt, for example with RAG (Retrieval-Augmented Generation) [R1]. You will learn RAG in Level 2.
"A confident answer is a correct answer." How confident the wording sounds does not measure correctness. NIST calls this phenomenon confabulation: false content stated confidently, often called "hallucination" [R3].
"Ask the same question again and you get the same result." Usually not, because of sampling (lesson L03).
"The model understands like a human." For a tester, the safer way to think is: the model produces a likely continuation based on data. Test the behaviour; do not assume the model understands.

Good vs bad: writing the expected result for the same capital-city Q&A feature.

Weak expected result Good expected result
"The bot answers capital-city questions accurately." "For the 10 questions in capitals.csv, the answer contains the exact capital in column capital. For a city not in the file, the bot says it has no information."

The left column depends on how the person running the test feels. With the right column, two different testers reach the same verdict.

5. Technical deep dive

5.1 Conditional probability

The model computes the probability of each possible next piece of text given what comes before it. In short: P(next piece | context). In the lab we use a toy model called a bigram. It looks at only one word before: P(next word | previous word).

Real LLMs look at thousands to millions of tokens of context depending on the model (see L02), and they learn with a neural network (a mathematical model made of a very large number of parameters adjusted through training) instead of by counting. That is why they are far more powerful. But they share one property with the toy model: what is optimised is "likelihood", not "truth".

Worked example: computing a probability table by hand. In CORPUS the word "is" appears 5 times. The word right after it: "the" 3 times (paris, hanoi, tokyo), "a" 1 time (lyon), "famous" 1 time (the wine of france is famous). Divide by the total of 5: P(the | is) = 3/5 = 0.6; P(a | is) = 0.2; P(famous | is) = 0.2. Check it with the lab:

python -c "from lab.bigram import *; print(next_word_probs(train(CORPUS), 'is'))"
{'the': 0.6, 'a': 0.2, 'famous': 0.2}

Computing by hand before running is a tester's habit: when the two numbers differ, you have just found a bug in the code or in the way you understood the requirement.

5.2 Greedy and sampling

With a probability table in hand, there are two ways to choose the next word:

  • Greedy decoding: always choose the word with the highest probability. Same input, same output.
  • Sampling: draw at random in proportion to the probabilities. The output changes between runs.

Everyday example. A bubble-tea shop sells 60% pearl milk tea, 20% matcha and 20% taro. Greedy is the customer who always orders the best seller: 10 visits, 10 pearl milk teas. Sampling is the customer who draws lots weighted by sales: 10 visits might give about 6 pearl, 2 matcha and 2 taro, and on any single visit you cannot know in advance which cup it will be.

Lesson L03 goes deeper into sampling and temperature.

5.3 Why output is fluent yet false

The bigram model in the lab learns from five sentences. In them, "france" follows "of" three times, while "vietnam" and "japan" appear only once each. When it continues "hanoi is the capital ...", the model looks only at the last word ("of") and picks "france". The generated sentence is grammatical and natural-sounding, but factually false, even though the training data contains the correct sentence.

Real LLMs do not go wrong in exactly this way, because they look at the whole context. But the root cause is similar: when a wrong answer has a high probability in that context, the model can still generate it. The survey by Ji et al. reports that text generation systems based on deep learning are prone to "hallucinate unintended text", that is, to generate text that was not intended [R4].

Good vs bad: a test for "hanoi is the capital ...".

# Weak: passes even for a false sentence, because it only checks "there is an answer"
assert len(generate(model, "hanoi is the capital")) > 0

# Good: compares with a known fact; this test FAILS and becomes evidence for a bug report
assert generate(model, "hanoi is the capital") == "hanoi is the capital of vietnam"

The weak test measures that the system runs; the good test measures that the answer is right. With LLM features, most defects live in the second place.

6. The QA perspective

Question Answer for an LLM feature
What to test? Correctness of the content (factuality), instruction following, output format, scope (no off-topic answers), stability across runs, safety.
Why? The model optimises for "likelihood", so nothing guarantees correctness. Correctness has to be verified from outside.
What can go wrong? Invented information (confabulation); outdated knowledge; following harmful instructions in the input; different answers to the same question; wrong format.
Risks? Users trust false information, data leaks, the application breaks when parsing the output, the business suffers reputational damage.
Expected behaviour? Must be written as verifiable acceptance criteria, for example: "For questions about the capitals of 10 countries in dataset X, the answer must contain the correct capital." Do not write "answers accurately".
How to detect defects? Compare with a reference answer when one exists; use rule checks; use human raters when automation is not possible (lesson L05 and Level 2).
How to report? Record the full prompt, the output, the configuration (model, temperature), the number of reproductions out of the total number of runs, and why the output is wrong (cite the source of truth).

Differences from testing traditional software:

  1. Oracle: there is often no "single correct value". Many different answers can be equally valid.
  2. Repetition: one pass proves nothing if the output changes between runs. You need to run repeatedly and report a rate.
  3. Root cause: the defect usually does not sit in one line of code. It comes from the model's statistical behaviour, from the prompt, or from the data fed into it.

Good vs bad: a bug report for the same defect of the toy model.

Weak bug report Good bug report
"Bot gives the wrong capital, sometimes." Title: Greedy says Hanoi is the capital of France. Input: hanoi is the capital. Output: hanoi is the capital of france. Configuration: lab/bigram.py, greedy (rng=None), original CORPUS. Frequency: 3/3 runs. Expected: ... of vietnam (source: CORPUS itself contains "hanoi is the capital of vietnam"). Impact: users receive false information in a confident tone.

The weak one does not tell a developer what to run to see the defect. The good one lets anyone reproduce it in 1 minute.

7. Real-world scenarios

Scenario 1 - An English-learning app (fictional). A grammar Q&A app uses an LLM to explain mistakes. A learner asks about "since" and "for". The app answers fluently and quotes a "Cambridge rule no. 12" that does not exist. If the tester only checks "there is an answer and no HTTP error", this defect slips through. Tests needed: check every cited source against a list of sources that really exist, and send the explanation to an expert reviewer.

Scenario 2 - A chatbot for booking long-distance bus tickets (fictional). A customer asks "Are there seats left on the 7 am bus to Đà Lạt tomorrow?". The system returns no data for this trip, but the chatbot still answers "5 seats left". The answer sounds plausible because most questions of this kind have an answer of that shape. Tests needed: ask about a trip that has no data, and check that the bot says "no information" instead of guessing.

8. Hands-on tutorial

Goal: run the bigram model, read the probability table, observe greedy and sampling, and write a test that proves the output is fluent but false.

8.1 Setting up the environment

Step 0 - preparation (do it only once):

  1. Get the course folder onto your computer (download the zip file or git clone, as your class instructs).
  2. Check Python: run python3 --version (Windows: py --version). You need version 3.10 or later. If you do not have it, install it from https://www.python.org/downloads/.

Step 1 - create a virtual environment (venv: a folder holding Python and libraries for this project only, without affecting the rest of the computer):

cd academy-content/code-labs/l1-m01
python3 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
python -m pip install -r requirements.txt

requirements.txt pins pytest==9.2.0, the version used to run this lab.

8.2 Minimal Python for testers

You do not need to know Python before this module, but you need to be able to read a short test file. Here is a complete test file that you can copy and run right away:

from lab.bigram import CORPUS, generate, train


def test_vi_du():
    model = train(CORPUS)
    assert generate(model, "hanoi is the capital") == "hanoi is the capital of france"
Line Meaning
from lab.bigram import ... Takes the functions and variables from the file lab/bigram.py for use in this file
def test_vi_du(): Defines a function. pytest automatically runs every function whose name starts with test_ in a file named test_*.py
Indentation of 4 spaces In Python, indented lines belong to the function above them. Wrong indentation causes an error
model = train(CORPUS) Calls the function train and stores the result in the variable model
assert A == B Asserts that A equals B. If not, the test FAILS and pytest prints both values

Save the file as tests/test_vi_du.py and run python -m pytest tests/test_vi_du.py -v. You will see 1 passed. Try changing "france" to "vietnam" and run it again to see what a FAILED test looks like.

About pytest fixtures: in tests/test_bigram.py, many tests take a model parameter, for example def test_...(model):. That value is created by the function marked @pytest.fixture in the same file. If you copy a test that takes a model parameter into another file, you will get the error fixture 'model' not found. In that case, create the model inside the test, as in the example above.

8.3 Project structure (the part used in this lesson)

code-labs/l1-m01/
├── requirements.txt
├── pytest.ini            # cho pytest biết thư mục test và import path
├── lab/
│   └── bigram.py         # mô hình bigram đồ chơi
└── tests/
    └── test_bigram.py    # test cho mô hình

pytest.ini tells pytest the test folder and the import path; lab/bigram.py is the toy bigram model; tests/test_bigram.py holds the tests for the model.

8.4 Reading the code

Open lab/bigram.py. The three main functions:

def train(sentences):
    """Count next-word frequencies: model[word][next_word] -> count."""
    model = defaultdict(Counter)
    for sentence in sentences:
        words = [START] + sentence.lower().split() + [END]
        for current, following in zip(words, words[1:]):
            model[current][following] += 1
    return model
  • START (<s>) and END (</s>) mark the start and the end of a sentence.
  • def defines a function; sentences is the input parameter; return hands the result back.
  • zip(words, words[1:]) produces each pair (current word, next word).
  • Counter counts how many times each next word appears. This is the "training" of the toy model.

next_word_probs(model, word) divides each count by the total to get probabilities, then sorts them from highest to lowest. generate(model, prompt, rng=None) repeats the next-word choice: rng=None is greedy, and passing random.Random(seed) makes it sampling. The demo at the end of the file sets the seed with the line rng = random.Random(11).

8.5 Running the demo

python -m lab.bigram

Actual output (run on 2026-10-31 on Python 3.14.6 and 3.12.14, identical results):

P(next | 'of'):
  france   0.60
  japan    0.20
  vietnam  0.20

greedy  : hanoi is the capital of france
sample 0: hanoi is the capital of france is the capital of france
sample 1: hanoi is the capital of japan
sample 2: hanoi is the capital of france is a city of vietnam

Reading the result:

  • The training data does contain the sentence "hanoi is the capital of vietnam", yet greedy still produces "...of france", because the model only looks at the word "of".
  • Sampling produces different sentences, some of them looping ("france is the capital of france"). Each pair of neighbouring words sounds natural, but none of the sentences can be trusted.
  • Seed 11 makes the demo reproducible. In lesson L03 you will see why a real API does not give you this guarantee.

8.6 Running the tests

python -m pytest tests/test_bigram.py -v

You will see 6 tests pass. The most important test:

def test_greedy_output_is_fluent_but_false(model):
    # The toy has seen "hanoi is the capital of vietnam", yet greedy decoding
    # only looks at the previous word, so it continues with the most common one.
    assert generate(model, "hanoi is the capital") == "hanoi is the capital of france"

This test records a known defect: it asserts the model's current (wrong) behaviour. This is a "characterization test". It is useful when you need to detect the moment the behaviour changes. It is not a test of the correct behaviour. For a real product you would write a test that expects "vietnam" and let that test FAIL, with a bug report attached.

8.7 Troubleshooting

Error Cause Fix
No module named 'lab' The command is run in the wrong folder cd academy-content/code-labs/l1-m01
No module named pytest The venv is not activated or pytest is not installed source .venv/bin/activate, then install again
KeyError: word never seen The prompt ends with a word that is not in the data This is the designed behaviour. Try a word that is in CORPUS

9. Independent exercise

Problem: A colleague proposes to "fix" the Hanoi defect by adding data about Vietnam to the corpus.

Requirements:

  1. Copy the starter file exercises/test_l01_my_fix.py into tests/ and fill in the TODO places. Create a new corpus made of CORPUS plus exactly three new sentences containing the phrase "of vietnam", where "vietnam" must be the last word of the sentence (for example "hue is a city of vietnam"). If another word follows "vietnam", the model can generate looping sentences; try it to see.
  2. Write a test proving that greedy now produces "hanoi is the capital of vietnam".
  3. Write a second test that checks "paris is the capital". Predict the result before you run it.
  4. Write 3-5 sentences of commentary: what does this "fix" say about fixing LLM defects with data?

Test data: CORPUS in lab/bigram.py, plus the three sentences you write yourself.

Deliverable: the test file and the commentary.

Acceptance criteria: both tests run and assert the observed behaviour correctly. The commentary names the phenomenon of fixing one place and breaking another (regression).

Hint: train(CORPUS + my_sentences). Look at the P(next | 'of') table again after adding the sentences.

9.1 Extra exercise: a fact oracle for the toy model (20-30 minutes)

Problem: the test in section 8.6 only records the wrong behaviour. Now you write an oracle: a function that decides whether the sentence "<city> is the capital of <country>" is true or false, based on a small fact table.

Requirements:

  1. Copy exercises/test_l01_extra_verdict.py into tests/ and run python -m pytest tests/test_l01_extra_verdict.py once. All 6 tests fail with a message that starts with TODO. That is expected.
  2. Write the function capital_verdict(sentence, facts), which returns one of three values:
    • "UNKNOWN" when the first word (the city) is not in facts. The oracle must not guess, exactly what we demand from the bus-ticket chatbot (section 7).
    • "PASS" when the whole sentence is exactly <city> is the capital of <facts[city]>.
    • "FAIL" in every other case, including a correct sentence that keeps going.
  3. At TODO 2, write your prediction for the greedy sentence about Tokyo before running.

Acceptance criteria: 6 passed. You can explain why the test test_correct_country_later_in_the_sentence_still_fails exists: the sample 2 sentence in section 8.5 contains the word "vietnam", so a check like "vietnam" in sentence would let it pass.

Hint: words = sentence.lower().split(), then compare the whole list [city, "is", "the", "capital", "of", facts[city]].

9.2 Real-world scenario: a money-transfer fee assistant (fictional)

Context. The fictional SaoMai Bank launches a chatbot that answers questions about fees. The official fee table (the source of truth) has only three rows: transfer within SaoMai: 0 VND; interbank transfer under 500,000 VND: 0 VND; interbank transfer of 500,000 VND or more: 5,000 VND per transaction. The table has no row about international transfers. During the demo, a customer asks "How much does it cost to send money abroad?" and the bot replies fluently: "International transfers at SaoMai Bank are completely free."

Task:

  1. Write 4 test cases (precondition, input, verifiable expected result).
  2. Write a bug report for the answer about international transfers.

A good answer has:

  • Expected results that point to the exact row of the fee table, never "the bot answers correctly"
  • At least one test case at the 500,000 VND boundary (499,999 and 500,000)
  • At least one test case for a question outside the fee table, whose expected result is "the bot says it has no information or hands over to staff", not a number
  • One test case that repeats the same question several times and reports a rate (for example x/10)
  • A bug report with the exact prompt, the exact output, the time and bot version, frequency x/N, the source of truth, and a severity with its reason

10. Knowledge check

0/20 done · Results are kept in this browser only.

P02 · True or false

If an LLM answers in a very confident tone, the answer can be considered correct.

P03 · Short answer

Explain in 1-2 sentences the difference between pretraining and RLHF.

P04 · Short answer

Give two reasons why one passing test of an LLM feature is not enough to conclude that the feature works correctly.

P05 · Short answer

A bank's chatbot fluently answers "The 12-month savings interest rate is 7.2%". What do you need to decide whether this answer passes or fails, and what would you write in the bug report if it is wrong?

P06 · Match

Match each training stage with its consequence for testers in the §4.3 table.

P07 · Fill in the blank

The bigram model in the lab looks only at ___ before. Both the toy model and real LLMs optimise "___", not "truth".

P08 · Multiple choice

The demo python -m lab.bigram prints the table P(next | 'of'): france 0.60, japan 0.20, vietnam 0.20. What does greedy decoding give for the prompt "hanoi is the capital"?

P09 · True or false

Calling generate(model, prompt) with rng=None many times on the same prompt always gives the same output.

P10 · Spot the bug

The train function below was copied from lab/bigram.py but has one defect. Find it.

def train(sentences):
    """Count next-word frequencies: model[word][next_word] -> count."""
    model = defaultdict(Counter)
    for sentence in sentences:
        words = [START] + sentence.lower().split() + [END]
        for current, following in zip(words, words[2:]):
            model[current][following] += 1
    return model

P11 · Put in order

Put in order the steps an LLM goes through from the prompt to the answer, following the §4.4 diagram.

  1. Repeat until an end signal, a length limit or a stop sequence is reached
  2. Receive the prompt "Hà Nội là thủ đô của"
  3. Pick one piece of text, for example "Việt"
  4. Compute a probability for every possible next piece of text
  5. Append that piece to the text

P12 · Select all that apply

Which statements are misconceptions according to the §4.5 table? Select all that apply.

P14 · Multiple choice

Scenario 2 in §7: the system has no data for the 7 am bus to Đà Lạt tomorrow, but the chatbot still answers "5 seats left". Which test catches this defect?

P15 · True or false

test_greedy_output_is_fluent_but_false in tests/test_bigram.py is a test of the model's correct behaviour.

P17 · Multiple choice

In round 2 of the worked example in §4.4, the last word is "of" and the probability table is france 0.60; japan 0.20; vietnam 0.20. Which word does greedy decoding pick?

P18 · Fill in the blank

According to the hand calculation in §5.1, the word "is" appears ___ times in CORPUS, and "the" comes right after "is" 3 times, so P(the | is) = ___.

P19 · True or false

The oracle in the extra exercise §9.1 must judge the sentence "hanoi is the capital of france is a city of vietnam" as "FAIL", even though it contains the word "vietnam".

P20 · Apply now

In code-labs/l1-m01, copy exercises/test_l01_extra_verdict.py into tests/, run python -m pytest tests/test_l01_extra_verdict.py once before changing anything, then do the extra exercise in §9.1 and run it again.

Checklist

11. Summary

  • Key concepts: an LLM generates text by guessing a likely continuation. What is optimised is likelihood, not truth. Pretraining, fine-tuning and RLHF create the "assistant" behaviour, but they do not turn that behaviour into a hard rule.
  • Practical skills: run a model, read a probability table, write a test that records behaviour.
  • Common traps: trusting a confident tone; testing once and drawing a conclusion; writing a vague expected result such as "answers correctly".
  • You can now: explain to a colleague why an LLM feature needs a different test strategy, and point out the confabulation type of defect.

12. References

ID Title Publisher URL Accessed Relevance
R1 Glossary (LLM, Pretraining, Fine-tuning, RLHF, RAG) Anthropic https://platform.claude.com/docs/en/about-claude/glossary 2026-10-31 Definitions of the foundational terms
R2 Attention Is All You Need (Vaswani et al., 2017) arXiv https://arxiv.org/abs/1706.03762 2026-10-31 The original paper of the Transformer architecture
R3 NIST AI 600-1: AI RMF Generative AI Profile (July 2024) NIST https://doi.org/10.6028/NIST.AI.600-1 2026-10-31 Definition of the "Confabulation" risk
R4 Survey of Hallucination in Natural Language Generation (Ji et al.) arXiv https://arxiv.org/abs/2202.03629 2026-10-31 Academic survey of hallucination

Key terms (English ↔ Vietnamese)

English Tiếng Việt
Large Language Model (LLM) Mô hình ngôn ngữ lớn
Next-token prediction Dự đoán token tiếp theo
Parameter Tham số của mô hình
Pretraining / Fine-tuning Huấn luyện trước / Tinh chỉnh
RLHF Học tăng cường từ phản hồi của con người
Confabulation / Hallucination Tạo ra nội dung sai một cách tự tin
Greedy decoding / Sampling Luôn chọn khả năng cao nhất / Bốc ngẫu nhiên theo xác suất
Oracle Cơ chế quyết định một test pass hay fail
Characterization test Test ghi lại hành vi hiện tại của hệ thống