Skip to content
Pixel
العربية

Textbook answers: 7-3 Large Language Models (LLM) and Generative AI

Suggested answers by the site team, the book has no answer key.

try 1

1What is the term for the model that learns from large amounts of text and predicts which word is likely to come next in a sentence?

Show answer

A language model.

A language model learns patterns in token sequences; a generative one estimates the probability of the next token from the context.

Note: Arabic edition: The Arabic question speaks of tokens and the next token; the English one of learning from large amounts of text and predicting the next word. The answer is the same.

2What is the term for a language model based on a very large neural network trained using vast amounts of text from the Internet?

Show answer

A large language model (LLM).

It is a language model with a large number of parameters trained on broad data, often built on the Transformer architecture; there is no single official threshold for "large".

Note: Arabic edition: The English edition describes it as based on a very large neural network trained on vast Internet text; the Arabic as having many parameters and trained on broad data that may include text and code. The answer is the same.

3What is the term for the method that uses human feedback as a reward to tune a language model to return more desirable responses?

Show answer

RLHF (Reinforcement Learning from Human Feedback).

In its classic form, human preferences train a reward model, and reinforcement learning then tunes the model with that signal. It is one tuning method, not the only one.

4What is the term for the property of being able to handle multiple kinds of data text, images, audio, video, and so on with a single model?

Show answer

Multimodality.

Multimodality is the ability of a model or system to handle more than one modality, such as text, images and audio, in its inputs, outputs or both.

Note: Arabic edition: The English edition says "a single model" handling many kinds of data; the Arabic says "a model or a system". The answer is the same.

try 2

(1)From the following options (A–D), choose the one that most appropriately describes how a language model works.

  • A - It memorizes the input sentence as is and returns the same sentence.
  • B - It generates text by repeatedly predicting the next word in the sentence.
  • C - It selects and returns the closest match from prepared template sentences.
  • D - It fully understands the meaning of the sentence and returns the single correct response.
Show answer

B: It generates text by repeatedly predicting the next word in the sentence.

This describes the generation mechanism in the lesson. A and C describe memorising, retrieving and templates; D is an exaggeration: the model doesn't "fully understand" or guarantee the right answer.

Note: Arabic edition: Arabic option B speaks of adding a token according to a context-conditioned probability distribution; the English of repeatedly predicting the next word. The answer is B in both.

(2)From the following options (A–D), choose the one that most appropriately describes the cause of hallucination.

  • A - Because the language model always retrieves and returns sentences from the training data as is.
  • B - Because the language model selects and returns words that are statistically plausible rather than correct.
  • C - Because the language model avoids answering questions and returns unrelated text.
  • D - Because the language model is built to return only fact-based responses.
Show answer

B: Because the language model selects and returns words that are statistically plausible rather than correct.

The prediction goal picks what is likely, not what is guaranteed true, so there is no built-in checking. A is wrong because the model doesn't return sentences unchanged, C doesn't describe hallucination, and D is the opposite of reality. The Arabic edition adds that hallucination has several causes; B is still the best option.

(3)From the following options (A–D), choose the one that most appropriately describes RLHF.

  • A - A method of building a language model from scratch using a large amount of text.
  • B - A method of tuning a language model to return more desirable responses, using human evaluations as rewards.
  • C - A method that removes the neural network structure from a language model and simplifies the processing.
  • D - A method that has a language model solve math problems to improve its computational accuracy.
Show answer

B: A method of tuning a language model to return more desirable responses, using human evaluations as rewards.

RLHF is a tuning stage after pre-training, not building from scratch (A), not removing the neural network (C), and not maths training (D).

Note: Arabic edition: The Arabic speaks of human preferences, a reward signal and instruction-following; the English of human evaluations as rewards and more desirable responses. The answer is B in both.

(4)From the following options (A–D), choose the one that is NOT an appropriate application of multimodal AI.

  • A - Showing an image and having it described in text.
  • B - Listening to audio and transcribing it into text.
  • C - Giving instructions in text and generating an image.
  • D - Computing the result of input numerical values using only the rules of the four arithmetic operations and returning it.
Show answer

D: Computing the result of input numerical values using only the rules of the four arithmetic operations and returning it.

This is a single-modality task (numbers in, numbers out) with fixed rules, so it isn't a multimodal application. Describing an image in text, transcribing audio and generating an image from text all link two modalities.

exercise 1

1Cover the Point! section with a red plastic sheet and quiz yourself in your notebook in numerical order.

Show answer

Cover the Point! (key points) section, answer, then check: (1) What is a language model? A model that learns patterns in token sequences and estimates the probability of the next token. (2) What is a token? A word, part of a word or a punctuation mark. (3) How is text generated? By adding one token after another and updating the context until a stop point, using settings such as sampling and temperature. (4) What is hallucination and why does it happen? Incorrect, made-up or unsupported information worded convincingly, because the prediction goal doesn't guarantee truth; it has several causes. (5) What is an LLM? Many parameters and broad training, often on the Transformer; large = parameters, data and computing, with no official threshold. (6) Does size guarantee abilities? No fixed threshold guarantees a particular ability. (7) What is RLHF? Human preferences → reward model → reinforcement learning; it improves instruction-following but doesn't guarantee truth. (8) What is multimodality? Handling more than one modality, varying by system, with accuracy, privacy and rights still to check.

This exercise is a self-review instruction with no printed questions, so we suggest questions covering the key points in order, with their answers.

This question allows more than one reading

Note: Arabic edition: The English edition says to cover the Point! section with a red plastic sheet and quiz yourself in numerical order; the Arabic edition says to answer without looking at «ملحوظة مهمة» and then check.

exercise 2

1Read the following passage and answer each question.
A model that predicts which word is likely to come next in a sentence is called a ( a ). Text generation is achieved by repeating the prediction of the ( b ). A language model based on a very large neural network trained using vast amounts of text from the Internet is called a ( c ); when the number of ( d ) or the amount of training data exceeds a certain scale, qualitatively new abilities sometimes appear. Since just learning from vast text does not necessarily lead to responses desirable for humans, ( e ), a method of tuning by reinforcement learning using human evaluations as rewards, is used. Also, the property of being able to handle multiple kinds of data text, images, audio, video, and so on with a single model is called ( f ).
1. Fill in the blanks (a)–(f).

Show answer

Arabic passage: (1) a language model, (2) token, (3) a large language model (LLM), (4) parameters, (5) RLHF, (6) multimodality. English passage: (a) language model, (b) next word, (c) large language model (LLM), (d) parameters, (e) RLHF, (f) multimodality.

Each blank matches one key concept in order: the model that learns token sequences, the unit of generation, the large model and one aspect of its size, the tuning method, then handling more than one modality.

Note: Arabic edition: The passages differ: the Arabic talks about tokens and doesn't claim new abilities appear at a certain size; the English says "next word" and claims qualitatively new abilities appear beyond a certain scale.

exercise 3

(1)From the following options (A–D), choose the one that most appropriately describes the mechanism of text generation.

  • A - Text is generated by connecting the results of repeatedly predicting the next word.
  • B - Text is generated by selecting from thousands of prepared templates.
  • C - Text is generated by first deciding the length of the sentence and then deciding all words simultaneously.
  • D - Text is generated by machine-translating the input sentence.
Show answer

A: Text is generated by connecting the results of repeatedly predicting the next word.

Generation happens token by token with the context updated each time. Not ready-made templates (B), not deciding every word at once (C), not translating the input (D).

(2)From the following options (A–D), choose the one that most appropriately describes the background to large language models acquiring new abilities.

  • A - Because reducing the number of parameters below a certain level simplified the processing.
  • B - Because limiting training data to a small amount of high-quality text raised quality.
  • C - Because qualitatively new abilities appear when the number of parameters or the amount of training data exceeds a certain scale.
  • D - Because humans wrote down the rules of language one by one and taught them to the model.
Show answer

C (Arabic wording): Because some abilities may improve with suitable size and training, with no fixed threshold guaranteeing them.

This is what the Arabic lesson body says. A is wrong because reducing parameters doesn't guarantee new abilities, B because large models are trained on broad data, and D because the model learns from data, not from rules people write down.

Note: Arabic edition: Options A and C changed meaning: the English C says "qualitatively new abilities appear when the number of parameters or the amount of training data exceeds a certain scale"; the Arabic says some abilities "may improve… with no fixed threshold guaranteeing them". Letter C is right in both editions, but follow the Arabic reasoning: no fixed threshold guarantees an ability.

(3)From the following options (A–D), choose the one that most appropriately describes the purpose for which RLHF is performed.

  • A - To increase the number of words a language model can handle.
  • B - To make a language model's responses natural and aligned with the intent of the question.
  • C - To enable a language model to handle data other than text.
  • D - To reduce the number of parameters used in a language model's calculations.
Show answer

B: To make a language model's responses natural and aligned with the intent of the question.

RLHF aims to improve the model's behaviour and how well it follows the user's intent and instructions, although it doesn't guarantee truth or safety. Increasing vocabulary (A), handling non-text data (C, that is multimodality) or reducing parameters (D) are not its purpose.

Note: Arabic edition: Option D changed: English "to reduce the number of parameters used in calculations", Arabic "to reduce the number of parameters as a required goal of tuning". The answer is B in both, with the Arabic edition's caution that RLHF does not guarantee truth.

Exam-style question

Explain why a language model can produce a fluent answer that is factually wrong (hallucination). [6] Refer to: choosing statistically plausible words. [6]

Model answer

• A generative language model doesn't look up a ready-made answer; it generates text token by token: it computes a probability distribution for the next token from the context, the generation algorithm picks one, it is added to the context, and the process repeats. [1]
• What it picks is the token that is statistically likely or plausible in context, not one guaranteed to be factually correct. [1]
• The prediction goal itself contains no built-in fact-checking: there is no step that compares a claim with a reliable source. [1]
• Because the model has learned language patterns well, the text comes out fluent and confident even when it is wrong: that is hallucination, incorrect, made-up or unsupported information worded convincingly (such as a wrong date or a non-existent reference). [1]
• Hallucination has several causes, and neither a larger model nor RLHF tuning removes it, since neither guarantees truth. [1]
• So fluency is not truth: check important claims in reliable, independent sources, record the source, and have a responsible person review before publishing or deciding. [1]

Back to the lessonStart exercises