生成AIパスポート · LESSON 2

Chapter 2: Generative AI19%(当サイト設定) · 6 topics

Learn the technologies behind generative AI, the training and inference processes, LLM basics, trends in major models, and generative AI for each modality.

2.1Technical innovations behind generative AI

Technical innovations behind generative AI (Transformer onward, diffusion models, foundation models and multimodality)

Concept

The 2017 Transformer computes relationships among words in parallel with attention and became the basis of large language models. Diffusion models restore images step by step from noise and are the mainstream for image generation. Foundation models are large models pre-trained on vast data that adapt to many tasks; multimodal means handling several types of data such as text, images and audio.

How it works / steps

  1. Text generation: Transformer-based LLMs
  2. Image generation: diffusion models are mainstream
  3. Handling images and text together: multimodal models

Workplace example

Take a photo of a meeting whiteboard and ask multimodal generative AI to summarize it and extract to-dos.

Common confusions and exam tips

Mini quiz

Q1. Which best describes the Transformer's self-attention mechanism?

  1. A mechanism that computes, with Query, Key and Value, how much each token in a sentence should attend to every other token
  2. A mechanism that reads a sentence one token at a time from the start, carrying the previous state into the next computation
  3. A mechanism in which another model scores generated text and only text meeting the criteria is output
  4. A mechanism that slides a small filter over the input and extracts only local features of nearby tokens
Show answer and explanation

Answer: A A mechanism that computes, with Query, Key and Value, how much each token in a sentence should attend to every other token

Self-attention computes the strength of relationships between tokens and also captures relationships between distant words. Reading in order is an RNN; filters are a CNN.

Q2. Which best describes how a diffusion model generates images?

  1. It pits a generator against a discriminator and creates images the discriminator cannot tell apart
  2. It generates new images by searching large image collections for similar images and cutting and pasting them
  3. It registers rules for line drawings made by people and draws images according to the rules
  4. It learns the process of adding noise to images, then reverses it, removing noise little by little to create an image
Show answer and explanation

Answer: D It learns the process of adding noise to images, then reverses it, removing noise little by little to create an image

Diffusion models use a diffusion process (adding noise) and a reverse diffusion process (removing noise). Latent diffusion models work in a compressed latent space to reduce computation.

Reference links

2.2How generative AI is trained

Generative AI training process (pre-training, fine-tuning, RLHF, scaling laws)

Concept

LLMs are pre-trained to predict the next word on vast text, fine-tuned for specific uses, and adjusted with reinforcement learning using human ratings as reward (RLHF) to respond helpfully and safely. Scaling laws are the empirical rule that performance improves as parameters, data and compute increase.

How it works / steps

  1. Pre-training gives general language ability
  2. Fine-tuning adapts it to specific tasks or formats
  3. RLHF aligns responses with human preferences and safety

Workplace example

For internal inquiries, fine-tune a general LLM on your own Q&A examples to standardize answer format.

Common confusions and exam tips

Mini quiz

Q1. What is the empirical rule that performance improves predictably as parameters, data and compute grow?

  1. Moore's law
  2. Overfitting
  3. Emergent abilities
  4. Scaling laws
Show answer and explanation

Answer: D Scaling laws

Scaling laws became the basis for pushing scale. Abilities that suddenly appear as scale grows are called emergent abilities. [Other options] Emergent abilities appear suddenly with scale. Overfitting is fitting training data too closely. Moore's law concerns chip density.

Q2. Which statement about generative AI training is NOT appropriate?

  1. With RLHF, the model never hallucinates at all
  2. If training data is biased, bias may appear in the output too
  3. Fine-tuning is additional training for a specific use or domain
  4. Pre-training learns next-token prediction on large amounts of text
Show answer and explanation

Answer: A With RLHF, the model never hallucinates at all

RLHF moves responses in a preferable direction but does not eliminate hallucination entirely. Checking output is always necessary.

Reference links

2.3How generative AI generates output

Generative AI generation (inference) process (tokenization, embeddings, next-token prediction, hallucination, Temperature and Top-p, context window)

Concept

Input text is split into tokens (fragments of words or characters) and converted to embeddings (vectors). The LLM predicts probabilities of the next token and picks one at a time to build text. Temperature and Top-p adjust randomness: low gives consistent output, high gives varied output. The context window is how many tokens can be handled at once. Hallucination is output that is plausible but untrue.

How it works / steps

  1. Set Temperature lower for uses where accuracy matters
  2. Check long documents fit in the context window
  3. Back up content needing fact-checking with sources

Workplace example

For summarizing minutes, lower Temperature for faithfulness; for tagline ideas, raise it for variety.

Common confusions and exam tips

Mini quiz

Q1. Which best describes the main reason generative AI hallucinates?

  1. Because when user input is too long, the model ignores it and returns a fixed sentence
  2. Because it creates text by predicting the probabilistically plausible next token rather than looking up facts
  3. Because it is thought to always reference the latest information on the internet and take in wrong information too
  4. Because setting Temperature to 0 always outputs content that differs from the facts
Show answer and explanation

Answer: B Because it creates text by predicting the probabilistically plausible next token rather than looking up facts

LLMs create text by next-token prediction, so they may output plausible content even without basis. Checking primary sources and RAG are countermeasures.

Q2. Which best describes tokenization?

  1. Summarizing a text and keeping only the important sentences
  2. Replacing personal information in a text with symbols to anonymize it
  3. Encrypting a text so it cannot be read if leaked, preventing information leaks
  4. Splitting a text into the units the model handles (words, subwords, etc.)
Show answer and explanation

Answer: D Splitting a text into the units the model handles (words, subwords, etc.)

LLMs process input in tokens and predict the next token. Pricing and limits (context window) are also often counted in tokens.

Reference links

2.4LLM basics

LLM basics (LMs and LLMs, on-premises/open-source LLMs)

Concept

A language model (LM) handles probabilities of word sequences; scaling up its parameters and training data gives an LLM (large language model). Besides LLMs used via cloud APIs, you can run open models with published weights (open source / open weight) on your own servers (on-premises) or your own cloud environment.

How it works / steps

  1. Check data confidentiality, cost, performance and operations setup
  2. For ease and high performance: cloud APIs
  3. If data can't leave the company, consider running an open model in your own environment

Workplace example

A department handling confidential design documents runs an open model on internal servers, while general writing uses a cloud generative AI service.

Common confusions and exam tips

Mini quiz

Q1. In large language models, what is the phenomenon called where, as scale grows, tasks that smaller models could not do suddenly become possible?

  1. Emergent abilities
  2. Hallucination
  3. Overfitting
  4. Vanishing gradient
Show answer and explanation

Answer: A Emergent abilities

Emergent abilities are known as the phenomenon where abilities such as reasoning and understanding instructions appear beyond a certain scale.

Q2. Which best describes the relationship between language models (LMs) and large language models (LLMs)?

  1. An LLM is a language model scaled up in parameters and training data, able to handle a wide range of tasks
  2. An LM is a model handling images; an LLM is a model handling text
  3. An LLM works differently from language models and does not deal with text probabilities
  4. They are distinguished by LMs running in the cloud and LLMs running on-premises
Show answer and explanation

Answer: A An LLM is a language model scaled up in parameters and training data, able to handle a wide range of tasks

A language model deals with the probability of text occurring; an LLM is a scaled-up version. Scaling up gave it general-purpose abilities.

Reference links

2.5Trends in major generative AI models

ChatGPT and trends in major generative AI models (reasoning models, Gemini, Claude, Copilot)

Concept

Major services include OpenAI's ChatGPT, Google's Gemini, Anthropic's Claude and Microsoft's Copilot. Recently, reasoning models that think step by step before answering have appeared, improving performance on complex problems such as math and programming. Services differ in strengths and integrations, such as search, file analysis and agent features.

How it works / steps

  1. Check integration with the tools you use at work (Microsoft 365, Google Workspace, etc.)
  2. Use reasoning models for complex analysis or reasoning
  3. Check data handling terms (training use, retention period)

Workplace example

Leave checking complex budget calculations to a reasoning model and use a fast model for everyday email drafts.

Common confusions and exam tips

Mini quiz

Q1. You will use generative AI for math proofs and finding the cause of program bugs. Which is the best reason to choose a reasoning model?

  1. Its training data is newer, so it answers from the latest information
  2. It spends more compute at inference and thinks step by step to raise accuracy
  3. It guarantees exact calculation results without external tools
  4. It takes less time and cost per answer than standard models
Show answer and explanation

Answer: B It spends more compute at inference and thinks step by step to raise accuracy

Reasoning models think through steps like chain-of-thought. As a result, time and cost to answer tend to increase. [Other options] Reasoning models tend to take more time and cost. Data freshness is a separate trait. They do not guarantee correct calculations.

Q2. Which statement about generative AI services such as ChatGPT is NOT appropriate?

  1. Some models, like reasoning models, use compute on thinking to raise accuracy
  2. Multimodal models handling images and audio as well as text are increasing
  3. Agent features for writing code or operating browsers are offered
  4. Models never change after release, so there is no need to follow updates once learned
Show answer and explanation

Answer: D Models never change after release, so there is no need to follow updates once learned

Generative AI models and services change fast, so continuous information gathering is needed. The syllabus is also revised every year. [Other options] The other three are correct. Models and services change fast and need ongoing tracking.

Reference links

2.6Generative AI for each modality

Generative AI for each modality (images, music, voice, video; C2PA and digital watermarks)

Concept

Generative AI can create not just text but images, music, voice and video. Technologies showing the provenance of generated content include C2PA (a technical standard recording content provenance and authenticity) and digital watermarks (embedding invisible information). Voice generation can be misused for impersonation and fraud, so care is needed.

How it works / steps

  1. Choose generative AI for the modality that fits the use
  2. Check rights and terms of use for generated content
  3. Attach provenance information and AI-generated labels appropriately

Workplace example

PR creates a new product image with generative AI, publishes it keeping C2PA provenance data and states that it was AI-generated.

Common confusions and exam tips

Mini quiz

Q1. Which best describes a multimodal model?

  1. A model that can handle multiple types (modalities) of data such as text, images and audio
  2. A model specialized only in translating between multiple languages
  3. A model jointly owned by several companies that share its usage fees
  4. A model that calls several small models in sequence and decides the result by majority vote
Show answer and explanation

Answer: A A model that can handle multiple types (modalities) of data such as text, images and audio

Multimodal models can process across modalities, such as describing an image or summarizing audio.

Q2. Which best describes an embedding?

  1. An example specifying the output format embedded in a prompt
  2. A component embedded in HTML to display AI answers on a web page
  3. A token or text converted into a numerical vector that reflects closeness of meaning
  4. Information embedded invisibly in an image to show it was made with generative AI
Show answer and explanation

Answer: C A token or text converted into a numerical vector that reflects closeness of meaning

With embeddings, texts closer in meaning have closer vectors. They are used for semantic search in RAG. Embedding information in an image is a digital watermark.

Reference links

Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.

Notes (unofficial, original questions, no pass guarantee)