Skip to content
Wegenty
Module 2 of 6 · Fundamentals of Generative AI

Generative AI & foundation models: tokens, embeddings and hallucination

Tokens, prompts, embeddings, temperature and hallucination — the working vocabulary of generative AI, and the failure mode (confident wrong answers) that governance exists to contain.

12 min read · free
In this module you’ll learn to
  • Explain tokens, prompts and foundation models
  • Understand what hallucination is and why it happens
  • Know what embeddings are and what they enable
  • Recognise the levers (e.g. temperature, grounding) that shape output

In the previous module we drew the map: AI, machine learning, and the large language models inside today's assistants. This module zooms in on the kind of AI everyone is talking about — generative AI — and gives you the working vocabulary to discuss it with confidence. None of this requires maths. It does require getting a few words right, because those words are where most confusion (and most risk) lives.

Predictive vs. generative AI

For years, business AI was mostly predictive: it produced a label or a number. Will this customer churn? Is this transaction fraud? What will sales be next quarter? You feed in data, you get an answer drawn from a fixed set of possibilities.

Generative AI is different. It produces something new — a paragraph, an email reply, a summary, a draft contract clause — one piece at a time. It is not picking from a menu; it is composing. That flexibility is exactly why it feels so capable, and also why it can go wrong in ways predictive systems never could.

Predictive AI answers a closed question. Generative AI writes an open-ended response. The freedom that makes it useful is the same freedom that lets it be confidently wrong.

What a foundation model is

A foundation model is a single, very large model that has been broadly pre-trained on enormous amounts of general text (and sometimes images or code) — and can then be adapted to many different tasks. The same underlying model can draft an email, answer a question, classify a document, or summarise a report.

The word "foundation" is the point. You don't build a new model for each task. You start from one general-purpose foundation and steer it. A modern large language model is the most familiar example. This is what makes generative AI economical: the expensive, general learning happens once, and everyone builds on top.

The working vocabulary

A handful of terms come up constantly. Learn these five and you can follow almost any vendor conversation.

Tokens

A model does not read whole words — it breaks text into tokens, small chunks roughly the size of a word or a word-piece ("walking" might be "walk" + "ing"). Both what you type in and what the model writes out are measured and billed in tokens. When you hear "this model has a 128k context," that 128k is a token count.

Prompts

A prompt is simply the instruction and information you give the model — the question, plus any context you include. Generative AI takes your prompt and continues it, predicting plausible next tokens until it has produced a full answer. Clearer prompts with relevant context produce better, more reliable output. There is no hidden intelligence reading your mind; there is only the text you provide.

The context window

The context window is the model's short-term working memory: the maximum amount of text (in tokens) it can consider at once — your prompt plus its own answer. Anything outside that window is invisible to the model. This matters in practice: an assistant cannot reason over a 200-page handbook if only a few pages fit in the window. That limit is one reason we retrieve the few relevant passages instead of pasting everything in — the subject of the next module on grounding.

Embeddings

An embedding turns a piece of text into a list of numbers — a numeric vector that represents its meaning. Texts with similar meaning end up with similar vectors, sitting close together in this mathematical "meaning space." That's what makes similarity search possible: ask "how do I reset my password," and the system can find a document that says "recovering account access" even though it shares no words with your question. Embeddings are the quiet engine behind semantic search and behind grounding an AI in your own documents.

Temperature

Temperature is a dial for randomness. A low temperature makes output more focused and deterministic — the model plays it safe and gives consistent, predictable answers. A higher temperature makes it more varied and creative. For brainstorming taglines you might turn it up; for answering factual support questions you want it low, so the same question reliably yields the same dependable answer.

Hallucination — and why governance follows from it

Here is the most important idea in this module. A generative model has no built-in notion of truth. It was trained to predict plausible-sounding text, not to verify facts. So when it doesn't actually know something, it does not stay silent — it produces the most plausible-looking continuation. The result can be fluent, confident, and completely wrong.

This failure mode is called hallucination: output that sounds authoritative but is not supported by any real source. The model will happily invent a policy number, a price, or a citation, because inventing plausible text is precisely what it was built to do.

A hallucination is not a bug you can fully "patch out." It is a direct consequence of how the technology works — the model predicts likely text, it does not check facts. Telling it to "be accurate" does not give it a way to know whether it is.

That single fact reshapes everything. If a model cannot tell truth from plausible fiction on its own, then accuracy about your business — your prices, your policies, your products — cannot come from the model's memory. It has to come from outside: from your real documents, supplied to the model at the moment it answers, with citations so a human can check each claim.

This is exactly why grounding and governance exist. Grounding constrains the model to answer from approved, retrieved sources instead of guessing. Governance decides which sources, who approves them, and what happens when the model is unsure — for example, handing off to a person rather than inventing an answer. In the Wegenty model, the internal knowledge base is the trusted superset and the public-facing agent only ever answers from a governed projection of it, never from the open internet. You can see that in the live demo or explore the platform it runs on.

The next module shows the mechanism that makes this work in practice: retrieval-augmented generation. Generative AI gives you a remarkably capable writer. Grounding and governance are what turn that writer into something an SME can actually trust.

Knowledge check

Test what you learned

You need 5 of 6 correct to pass.

0/6 answered
  1. 1. A "token" in a language model is…
  2. 2. In generative AI, "hallucination" means…
  3. 3. A "foundation model" is…
  4. 4. Lowering a model’s "temperature" generally makes its output…
  5. 5. An embedding is…
  6. 6. Which most reliably reduces hallucination about *your* facts?