---
# System prepended metadata

title: Google Cloud - Generative AI Development

---

# Google Cloud - Generative AI Development

[TOC]

###### copyright @ytseiung-tech 
---

## 一、Google Cloud Computing Foundations / 雲端運算基礎知識

### 1. 學習目標 (Learning Objectives)

- **Explore cloud computing.**
  探索雲端運算。
- **Compare and contrast physical, virtual, and cloud architectures.**
  比較與對比實體、虛擬和雲端架構。
- **Differentiate between Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS).**
  區分基礎設施即服務 (IaaS)、平台即服務 (PaaS) 和軟體即服務 (SaaS) 等雲端服務模式。
- **Be introduced to Google Cloud compute, storage, big data, and Machine Learning (ML) services.**
  認識 Google Cloud 的運算、儲存、大數據和機器學習 (ML) 服務。
- **Examine the Google network and how it powers cloud computing.**
  檢視 Google 網路及其如何推動雲端運算。

### 2. 雲端架構：從傳統到現代 (Cloud Architecture: From Traditional to Modern)

#### 雲端架構的演進 (The Evolution to Cloud Architecture)

**第一波：主機代管 (First Wave: Colocation)**
始於租賃實體空間而非投資資料中心，旨在提供經濟效益。
The trend toward cloud computing started with colocation, which offered businesses the financial advantage of renting physical space for their servers instead of investing in costly data center real estate.

**第二波：虛擬化 (Second Wave: Virtualization)**
如今的虛擬化資料中心，其組件（如伺服器、CPU、磁碟、負載平衡器）皆已虛擬化。雖然提升了資源利用率，但基礎設施仍由用戶管理。
Today's virtualized data centers represent the second wave. Their components—such as servers, CPUs, disks, and load balancers—are now virtual devices. While virtualization significantly improved resource utilization, enterprises still had to manage the underlying infrastructure.

**第三波：基於容器的雲端 (Third Wave: Container-Based Cloud (Google Cloud))**
Google 意識到虛擬化模型無法滿足快速發展的業務需求，轉向了完全自動化、彈性的基於容器的架構。這種模式由自動化服務和可擴展資料組成，服務自動佈建和配置基礎設施。Google Cloud 將這種先進的第三波雲端提供給客戶。
Several years ago, Google realized that the virtualization model couldn't keep pace with its rapidly evolving business needs. This led Google to transition to a container-based architecture, a fully automated, elastic third-wave cloud built on a combination of automated services and scalable data. Today, Google Cloud makes this advanced, third-wave cloud available to its customers.

#### 未來是數據驅動的 (The Future is Data-Driven)

Google 相信，無論規模或行業，未來所有公司都將透過高品質的軟體來脫穎而出，而高品質的軟體則建立在高品質數據之上。這意味著每家公司最終都將成為一家數據公司。
Google believes that in the future, every company, regardless of its size or industry, will differentiate itself through technology—specifically, through high-quality software. And great software, in turn, is built on high-quality data. This means that, eventually, every company will inherently become a data company.

#### Google 對永續發展的承諾 (Google's Commitment to Sustainability)

雲端運算對能源消耗巨大（全球資料中心約佔 2% 電力）。Google 致力於讓其資料中心高效運行，並在永續發展方面居於領先地位：
Cloud computing consumes vast amounts of energy (collectively, all existing data centers utilize roughly 2% of the world's electricity). Google is deeply committed to making its data centers run as efficiently as possible and is a leader in sustainability:
- **首批獲得 ISO 14001 認證的資料中心。**
  Google's data centers were the first to achieve ISO 14001 certification.
- **芬蘭哈米納資料中心（Hamina, Finland）**利用海水冷卻系統，顯著降低能耗，為全球首創。
  A prime example is Google's data center in Hamina, Finland, which uses a unique sea water cooling system to significantly reduce energy consumption, the first of its kind globally.
- **第一個十年實現碳中和。**
  In its first decade, Google became the first major company to be carbon neutral.
- **第二個十年實現 100% 再生能源。**
  In its second decade, Google was the first company to achieve 100% renewable energy.
- **目標在 2030 年前成為第一家實現無碳運營的主要公司。**
  By 2030, Google aims to be the first major company to operate carbon-free.

### 3. 了解 IaaS、PaaS 與 SaaS (Understanding IaaS, PaaS, and SaaS)

虛擬化資料中心的出現引入了新的雲端服務模式。隨著雲端發展，託管服務和無伺服器運算成為主流。
The advent of virtualized data centers introduced customers to new service models. As cloud computing evolved, managed services and serverless computing gained prominence.

#### 基礎設施即服務 (IaaS) (Infrastructure as a Service)

- **定義 (Definition)**：提供原始的運算、儲存和網路能力，虛擬化地組織成類似實體資料中心的資源。
  Definition: IaaS offerings provide raw compute, storage, and network capabilities, virtually organized into resources that resemble a physical data center.
- **計費 (Billing)**：客戶需預先支付所分配的資源，無論是否使用。
  Billing: Customers pay for the resources they allocate ahead of time, meaning you reserve and pay for the capacity whether you fully use it or not.

#### 平台即服務 (PaaS) (Platform as a Service)

- **定義 (Definition)**：簡化開發，將程式碼綁定到提供基礎設施存取權的函式庫，讓開發者專注於應用邏輯。
  Definition: PaaS offerings simplify development by binding your code to libraries that provide access to the necessary infrastructure applications, allowing developers to focus on application logic.
- **計費 (Billing)**：客戶只需支付實際使用的資源費用，是一種基於消費的模式。
  Billing: Customers pay for the resources they actually use, making it a more consumption-based model.

#### 轉向託管服務與無伺服器 (The Shift to Managed Services and Serverless)

雲端運算領域明顯轉向託管基礎設施與服務，使企業能更專注於業務目標，更快、更可靠地交付產品和服務。
The cloud computing landscape has seen a strong shift towards managed infrastructure and services, allowing companies to focus on business goals and deliver products more quickly and reliably.

**無伺服器運算 (Serverless computing)** 是雲端演進的重要一步，開發者只需專注於程式碼，無需管理伺服器，按實際運行付費。
Serverless computing represents another significant step in this evolution, enabling developers to focus solely on their code, eliminating the need for infrastructure management, and paying only when their code runs.

**Google 提供的無伺服器技術 (Google's Serverless Technologies)**：
- **Cloud Run**：用於在完全託管的環境中部署容器化微服務應用程式。  
  *Cloud Run: For deploying containerized microservices-based applications in a fully managed environment.*
- **Cloud Functions**：用於將事件驅動程式碼作為按用量付費服務進行管理。  
  *Cloud Functions: For managing event-driven code as a pay-as-you-go service.*

#### 軟體即服務 (SaaS) (Software as a Service)

- **定義 (Definition)**：應用程式不在本機電腦安裝，而是在雲端作為服務運行，終端用戶透過網際網路直接使用。  
  *Definition: SaaS applications are not installed on your local computer; instead, they run in the cloud as a service and are directly consumed over the internet by end users.*

- **範例 (Examples)**：Google 的 Gmail、Docs、Drive（統稱為 Google Workspace）均屬於 SaaS。  
  *Examples: Popular Google applications such as Gmail, Docs, and Drive—collectively known as Google Workspace—are all classified as SaaS.*

### 4. Google Cloud 的服務與基礎設施 (Google Cloud Services and Infrastructure)

您可以將 Google Cloud 基礎設施分為三個層次，旨在提供高效能、可擴展且可靠的服務。
You can think of the Google Cloud infrastructure in three layers, designed to provide high-performance, scalable, and reliable services。

#### Google Cloud 基礎設施層次 (Google Cloud Infrastructure Layers)

- **基礎層：網路與安全 (Base Layer: Networking and Security)**
  這是所有 Google 基礎設施和應用程式的基石，提供網路連接和安全措施。
  At the base layer is networking and security, which lays the foundation to support all of Google's infrastructure and applications。
- **中間層：運算與儲存 (Middle Layer: Compute and Storage)**
  Google Cloud 在技術上將運算和儲存分離（或稱「解耦」），以便它們可以根據需求獨立擴展。
  On the next layer sit compute and storage. Google Cloud separates, or decouples, compute and storage so they can scale independently based on need。
- **頂層：大數據與機器學習產品 (Top Layer: Big Data and Machine Learning Products)**
  這一層包含用於攝取、儲存、處理數據，交付商業洞察、數據管線和機器學習模型的產品，無需管理底層基礎設施。
  And on the top layer sit the big data and machine learning products, which enable you to perform tasks to ingest, store, process, and deliver business insights, data pipelines, and machine learning models, without needing to manage the underlying infrastructure。

#### Google Cloud 核心服務 (Core Google Cloud Services)

- **運算服務 (Compute Services)**：
    - **Compute Engine**：提供虛擬機器 (VM) 實例。
      Compute Engine: Provides virtual machine (VM) instances。
    - **Google Kubernetes Engine (GKE)**：用於部署、管理和擴展容器化應用程式。
      Google Kubernetes Engine (GKE): For deploying, managing, and scaling containerized applications。
    - **App Engine**：一個完全託管的平台，用於構建和運行可擴展的 Web 應用程式和行動後端。
      App Engine: A fully managed platform for building and running scalable web apps and mobile backends。
    - **Cloud Run**：用於在完全託管的環境中部署容器化微服務。
      Cloud Run: For deploying containerized microservices in a fully managed environment。
    - **Cloud Functions**：一個無伺服器執行環境，用於連接和擴展服務。
      Cloud Functions: A serverless execution environment for connecting and extending services。

- **儲存服務 (Storage Services)**：
    - **Cloud Storage**：物件儲存。
      Cloud Storage: For object storage。
    - **Cloud SQL**：託管的關聯式資料庫服務 (例如 MySQL, PostgreSQL, SQL Server)。
      Cloud SQL: Managed relational database service (e.g., MySQL, PostgreSQL, SQL Server)。
    - **Spanner**：全球分佈式、強一致性的關聯式資料庫服務。
      Spanner: Globally distributed, strongly consistent relational database service。
    - **Bigtable**：針對大規模分析和營運工作負載的 NoSQL 資料庫。
      Bigtable: NoSQL database for large analytical and operational workloads。
    - **Firestore**：用於行動、Web 和伺服器開發的彈性、可擴展的 NoSQL 文件資料庫。
      Firestore: Flexible, scalable NoSQL document database for mobile, web, and server development。
    - **備註 (Note)**：Cloud SQL 和 Spanner 是關聯式資料庫，而 Bigtable 和 Firestore 則是 NoSQL 資料庫。
      Note: Cloud SQL and Spanner are relational databases, while Bigtable and Firestore are NoSQL databases。

- **大數據與機器學習產品 (Big Data and Machine Learning Products)**：
    - **Cloud Storage**: 作為數據湖和數據存儲。
      Cloud Storage: As a data lake and data storage。
    - **Dataproc**: 用於運行 Apache Spark 和 Hadoop 集群。
      Dataproc: For running Apache Spark and Hadoop clusters。
    - **Bigtable**: 處理大規模、低延遲數據。
      Bigtable: For handling large-scale, low-latency data。
    - **BigQuery**: 完全託管、無伺服器、高度可擴展的數據倉儲。
      BigQuery: Fully managed, serverless, highly scalable data warehouse。
    - **Dataflow**: 用於統一數據流和批次處理服務。
      Dataflow: For unified data stream and batch processing service。
    - **Firestore**: 用於即時數據同步。
      Firestore: For real-time data synchronization。
    - **Pub/Sub**: 用於非同步訊息傳遞。
      Pub/Sub: For asynchronous messaging。
    - **Looker**: 商業智能 (BI) 和數據分析平台。
      Looker: Business intelligence (BI) and data analytics platform。
    - **Spanner**: 作為關鍵任務數據庫。
      Spanner: As a mission-critical database。
    - **AutoML**: 讓機器學習民主化。
      AutoML: For democratizing machine learning。
    - **Vertex AI**: 統一的機器學習平台。
      Vertex AI: The unified ML platform。

#### Google 網路基礎設施 (Google Network Infrastructure)

Google 網路是 Google Cloud 基礎設施的核心支柱，具備以下特點：
Google's network is a core pillar of Google Cloud's infrastructure, characterized by:

- **全球網路規模與效能 (Global Network Scale and Performance)**
  Google 的網路是同類中規模最大的，投入數十億美元打造。透過全球 100 多個內容快取節點，實現最高吞吐量和最低延遲，確保最快響應時間。
  Google's network is the largest of its kind, built with billions of dollars over years. It leverages over 100 content caching nodes worldwide to provide customers with the highest possible throughput and lowest possible latencies, ensuring the quickest response times。

- **地理位置、區域與可用區 (Geographic Locations, Regions, and Zones)**
  Google Cloud 基礎設施分佈在北美、南美、歐洲、亞洲和澳洲五個主要地理位置。選擇應用程式位置會影響可用性、耐久性和延遲。
  Google Cloud's infrastructure is based in five major geographic locations: North America, South America, Europe, Asia, and Australia. Choosing application locations affects qualities like availability, durability, and latency。

  每個位置分為多個區域 (Regions)，代表獨立地理區域，由可用區 (Zones) 組成。例如，倫敦 (europe-west2) 包含三個可用區。
  Each of these locations is divided into several regions, which represent independent geographic areas composed of zones. For example, London (europe-west2) currently contains three different zones。

  可用區是 Google Cloud 資源的實際部署地，確保資源冗餘。可用區資源在單一可用區內運行，若該可用區不可用，資源也將不可用。
  A zone is an area where Google Cloud resources are deployed to ensure redundancy. Zonal resources operate within a single zone; if a zone becomes unavailable, its resources won't be available either。

  Google Cloud 允許用戶指定服務和資源的地理位置（可用區、區域或多區域級別），便於拉近應用程式與用戶距離，並應對區域性災害。
  Google Cloud allows users to specify geographical locations for services and resources (zonal, regional, or multi-regional levels), useful for bringing applications closer to users and for protection against regional issues like natural disasters。

- **多區域配置 (Multi-Region Configurations)**
  少數服務（如 Spanner）支持多區域部署，允許在跨多個區域的多個可用區複製資料庫數據，從而實現多位置低延遲讀取。
  A few Google Cloud services support multi-region configurations (e.g., Spanner), allowing data replication across multiple zones in multiple regions for low-latency data reads from various locations。

- **持續擴展 (Continuous Expansion)**
  Google Cloud 目前支持 40 個區域中的 121 個可用區，且數量持續增長。最新資訊可於 `cloud.google.com/about/locations` 查詢。
  Google Cloud currently supports 121 zones in 40 regions, and this number is constantly increasing. The most up-to-date information can be found at `cloud.google.com/about/locations`。

---

## 二、Introduction of Generative AI / 生成式 AI 導論

隨著人工智慧技術的快速發展，生成式 AI 已成為當今科技領域最重要的突破之一。本章將深入探討生成式 AI 的核心概念、技術原理與實際應用。

### 1. AI and Machine Learning Basics / AI 與機器學習基礎

AI is a discipline in computer science focused on building intelligent agents that can reason, learn, and act autonomously. 人工智慧 (AI) 是計算機科學的一個分支，專注於建立可以推理、學習並自主行動的智慧系統。

Machine learning (ML) is a subfield of AI where models are trained from data to make predictions without explicit programming. 機器學習 (ML) 是 AI 的子領域，透過資料訓練模型，使其能在未經明確程式設計的情況下做出預測。ML models can be supervised (with labeled data) or unsupervised (without labels). 機器學習模型分為有監督學習 (帶標籤資料) 和無監督學習 (無標籤資料)。

**Example:** Supervised learning predicts tip amount based on order data; unsupervised learning clusters employees by tenure and income. 例如：有監督學習 根據訂單預測小費；無監督學習 則根據工齡和收入對員工分群。

Deep learning uses artificial neural networks inspired by the human brain, with many interconnected neurons and layers. 深度學習 使用類似大腦結構的人工神經網路，包含多層互聯的神經元。

Semi-supervised learning combines small labeled datasets with large unlabeled data to improve generalization. 半監督學習 結合少量標記資料和大量未標記資料，提升模型泛化能力。

### 2. Definition of Generative AI / 生成式 AI 定義

Generative AI is a subset of deep learning that can produce new content (text, images, audio, synthetic data) based on learned data. 生成式 AI 是深度學習的一部分，能根據學習到的資料創造新內容 (文字、圖像、音訊、合成資料)。

It uses statistical models trained on vast data to generate expected outputs given prompts. 它利用統計模型，根據大量資料訓練，在給定提示詞後產生預期輸出。

### 3. Generative vs Discriminative Models / 生成式模型與判別式模型

- **Discriminative models** classify or predict labels for input data (e.g., is this a dog or cat?). 判別式模型 對輸入資料進行分類或標籤預測 (例如判斷是狗還是貓)。

- **Generative models** learn joint probability distributions and can generate new data instances (e.g., generate a picture of a dog). 生成式模型 學習資料的聯合分布，能生成新資料 (例如生成狗的圖片)。

### 4. Transformer and Hallucinations / Transformer 與幻覺

Transformer is a foundational model in NLP from 2018, consisting of an encoder and a decoder. Transformer 是 2018 年自然語言處理 (NLP) 的基礎模型，由編碼器和解碼器組成。

**Hallucinations** are nonsensical or grammatically incorrect words or phrases generated by the model. 幻覺 是模型產生的無意義或語法錯誤的詞句。Causes include insufficient training data, noisy data, lack of context, or insufficient constraints. 原因可能是訓練資料不足、雜訊多、上下文不夠或限制條件不充分。

Hallucinations make the output hard to understand and may produce incorrect or misleading information. 幻覺會讓輸出難以理解，並可能產生錯誤或誤導性資訊。

### 5. Generative AI Model Types / 生成式 AI 模型類型

- **Text-to-Text:** Input text and output text (e.g., translation). 文字對文字 (Text-to-Text)：輸入文字，輸出文字 (如翻譯)。

- **Text-to-Image:** Input text to generate images, often using diffusion models. 文字對圖像 (Text-to-Image)：輸入文字生成圖像，常用擴散模型。

- **Text-to-Video & Text-to-3D:** Generate videos or 3D objects from text descriptions. 文字對影片 (Text-to-Video) 與文字對三維物件 (Text-to-3D)：從文字描述生成影片或三維模型。

- **Text-to-Task:** Perform specific actions based on text input, such as UI navigation or document editing. 文字對任務 (Text-to-Task)：根據文字執行特定任務，如操作介面或編輯文件。

### 6. Foundation Models / 基礎模型

Large pretrained models fine-tuned for tasks like sentiment analysis, image captioning, and object recognition. 大型預訓練模型，可微調用於情感分析、影像標註及物體識別。

Foundational to industries such as healthcare, finance, and customer service. 基礎模型對醫療、金融與客服等產業具有變革性影響。

Google Vertex AI Model Garden includes various foundation models for language and vision. Google Vertex AI Model Garden 提供多種語言與視覺基礎模型。

### 7. Code Generation Use Case / 程式碼生成應用案例

Gemini can generate, debug, and explain code, convert formats (e.g., Python to JSON), and create SQL queries. Gemini 能生成、除錯、解釋程式碼，轉換格式 (如 Python 轉 JSON)，並撰寫 SQL 查詢。

Integration with Google Colab enables easy code prototyping and sharing. 可與 Google Colab 整合，方便程式碼原型設計與分享。

### 8. Google Cloud Generative AI Tools / Google Cloud 生成式 AI 工具

- **Vertex AI Studio:** Explore, customize, and deploy generative AI models easily. Vertex AI Studio：輕鬆探索、客製化及部署生成式 AI 模型。

- **Vertex AI Agent Builder:** Build chatbots, assistants, custom search engines with little or no coding. Vertex AI Agent Builder：無需或少量編碼即可建立聊天機器人、數位助理及自訂搜尋引擎。

- **Gemini:** Multimodal AI capable of understanding text, images, audio, and code. Gemini：多模態 AI，能理解文字、影像、音訊及程式碼。

---

## 三、Introduction of Large Language Models / 大型語言模型 (LLMs) 導論

大型語言模型代表了自然語言處理領域的重大突破，其強大的理解與生成能力正在重塑各行各業的工作方式。本章將深入探討 LLMs 的核心技術與應用場景。

### 1. Basic Concepts of LLMs / LLMs 基本概念

LLMs are a subset of Deep Learning, intersecting with generative AI. Generative AI creates new content like text, images, audio, and synthetic data. LLM 是深度學習的一部分，也與生成式 AI 相關，生成式 AI 可以產生文字、影像、音訊及合成數據等新內容。

Large language models are large general-purpose language models that can be pre-trained on massive datasets and then fine-tuned for specific tasks. 大型語言模型 是經過大量數據預訓練的通用語言模型，之後可針對特定任務做微調。

- **"Large"** refers to two aspects: massive training datasets (up to PB scale) and a large number of parameters (the model's "memory" and "knowledge"). 「Large」指兩個面向：巨大的訓練資料集 (可達PB級) 與大量的參數 (即模型的「記憶」與「知識」)。

- **"General purpose"** means the model is versatile enough to solve many common language-related problems, and only a few large organizations have the capability to train such models. 「General purpose」意味著模型足夠通用，能解決許多語言相關的常見問題，並且只有少數大型組織有能力訓練這種模型。

- **"Pre-trained"** involves general pre-training with large datasets, followed by "Fine-tuning" with smaller datasets for specific tasks. 「Pre-trained」是用大資料集做通用預訓練，接著用較小的資料集「Fine-tune」做特定任務微調。

### 2. LLM Cases / LLMs 應用案例

One model can be used for various tasks, such as language translation, sentence completion, text classification, and question-answering systems. 一個模型可用於多種任務，例如語言翻譯、句子補全、文本分類、問答系統等。

Fine-tuning requires only a small amount of domain-specific data, supporting "few-shot" and even "zero-shot" learning. 微調時只需少量領域特定資料，支援「few-shot」甚至「zero-shot」學習。

Model performance continues to improve with increases in data and parameters. 模型性能會隨著資料和參數的增加持續提升。

### 3. PaLM Model / PaLM 模型

Google launched PaLM (Pathways Language Model) in 2022, featuring 540 billion parameters and leading performance in multilingual tasks. Google 於 2022 年推出了 PaLM (Pathways Language Model)，擁有 5400 億參數，具備領先的多語言任務表現。

PaLM is a Transformer-based model that leverages the Pathway architecture for efficient training across multiple TPU v4 Pods. PaLM 是基於 transformer 的模型，利用 Pathway 架構，能在多個 TPU v4 Pod 上高效訓練。

### 4. LLM vs Traditional ML / LLM 與傳統機器學習的比較

**Traditional ML** requires expert knowledge, labeled data, extensive computation, and hardware. 傳統 ML 需要專家知識、標註資料、大量計算與硬體。

**LLMs** do not require retraining; the focus is on Prompt Design, creating clear, concise, and informative inputs, which is central to Natural Language Processing (NLP). LLM 不必重新訓練模型，重點在提示詞設計 (Prompt Design)，打造清晰、簡潔、有資訊量的輸入，這是自然語言處理 (NLP) 的核心。

### 5. Question Answering Example / 問答系統範例

Traditional question-answering models require domain knowledge; Generative QA directly generates text based on context, without needing domain knowledge. 傳統問答模型需要領域知識；生成式問答 (Generative QA) 則直接根據上下文生成文本，無需領域知識。

Google's Gemini chatbot can provide answers to real-world problems (e.g., calculating profit, order volume, average sensor count) and explain the computation process. Google 的 Gemini 聊天機器人可針對實際問題 (如計算利潤、訂單量、平均感測器數量) 給出解答並說明計算過程。

### 6. Prompt Design & Engineering / 提示詞設計與工程

- **Prompt design:** Designing appropriate prompts for tasks, ensuring the model understands the requirements (e.g., "Please translate this from English to French"). Prompt design：針對任務設計適當的提示詞，讓模型明白任務要求 (例如，請用英文翻譯成法文)。

- **Prompt engineering:** Optimizing prompts using domain knowledge, examples, and keywords to improve accuracy and performance. Prompt engineering：利用領域知識、示例和關鍵詞優化提示詞以提升準確度和效能。

Design is a general concept, while engineering is a specialized process for high-precision requirements. 設計是通用概念，工程是針對高精度需求的專業流程。

### 7. Types of Large Language Models / 大型語言模型類型

- **Generic language models:** Predict the next word based on training data, like autocomplete in search bars. Generic language models：根據訓練資料預測下一個字詞，如搜尋欄自動完成。

- **Instruction-tuned models:** Generate corresponding responses based on instructional input, such as text summarization, classification, or poetry generation. Instruction-tuned models：依指令輸入生成相應回應，如文本摘要、分類、生成詩詞。

- **Dialog tuned models:** Tuned specifically for dialogue, suitable for multi-turn interactions and natural Q&A. Dialog tuned models：專為對話調校，適合多輪互動和自然問答。

### 8. Chain-of-Thought Reasoning / 思路鏈推理

The model is more likely to give correct answers after first explaining the reasons for the answer. 模型在先解釋答案原因後，更容易給出正確回答。

**Example:** Calculating the number of tennis balls, step-by-step explanations help improve accuracy. 範例：計算網球數量，分步解釋幫助提升準確度。

### 9. LLM Fine-tuning & Tuning / LLM 微調與調整

Specific tasks can optimize models using fine-tuning or Parameter-Efficient Tuning (PETM). 特定任務可用微調 (fine-tuning) 或參數高效調校 (Parameter-Efficient Tuning，PETM) 優化模型。

Fine-tuning requires significant computational resources, while PETM adjusts only a small number of additional layers, saving costs. 微調需大量運算資源，PETM 只調整少量附加層，更節省成本。

Vertex AI, Generative AI Studio, and other Google Cloud tools can help quickly invoke and deploy LLMs without coding. Vertex AI、Generative AI Studio 等 Google Cloud 工具可幫助無需編碼快速調用和部署 LLM。

### 10. Google Cloud AI Tools / Google Cloud AI 工具

- **Generative AI Studio:** Quickly explore, adjust, and deploy generative AI models. Generative AI Studio：快速探索、調整並部署生成式 AI 模型。

- **Vertex AI:** Suitable for users without coding backgrounds to build chatbots, knowledge bases, search engines, etc. Vertex AI：適合無編碼背景使用，打造聊天機器人、知識庫、搜索引擎等。

- **PaLM API:** Facilitates testing and integrating large language models via API and graphical interface. PaLM API：透過 API 和圖形介面方便測試和整合大型語言模型。

### 11. Gemini Multimodal Model / Gemini 多模態模型

**多模態能力 (Multimodal Capabilities)**
不僅理解文字，還能分析影像、音訊，甚至程式碼，支援更複雜的任務。
It not only understands text but also analyzes images, audio, and even code, supporting more complex tasks.

**先進架構 (Advanced Architecture)**
架構先進，具高擴展性與適應性，適合多元應用。
Advanced architecture, with high scalability and adaptability, suitable for diverse applications.

## 四、Introduction of Responsible AI / 負責任的 AI 導論


### 1. Key Points / 核心觀點

- AI is increasingly common in daily life, from traffic prediction to content recommendation. AI 已成為日常生活的一部分，從交通預測到推薦影視內容等。

- Despite rapid AI development, AI is not infallible and can reproduce societal biases. AI 雖快速發展，但並非完美，可能會複製社會中既有的偏見，甚至放大問題。

- No universal definition or checklist for responsible AI exists; organizations create their own AI principles based on their values. 負責任的 AI 沒有通用定義或標準，組織依據自身使命與價值建立專屬原則。

- Google's responsible AI approach emphasizes accountability, safety, privacy, and scientific excellence. Google 的負責任 AI 強調問責、安全、隱私保護與科學卓越。

- Humans, not machines, make all key decisions in AI design, deployment, and application, introducing their own values. AI 設計與運用中所有關鍵決策都是由人做出，決策帶有個人或組織的價值觀。

- Responsible AI is important not just for controversial cases but also to avoid ethical issues and unintended consequences. 負責任的 AI 不僅針對爭議性議題，也要避免日常使用中的倫理問題與意外結果。

- Building responsible AI builds trust and leads to better AI products. 負責任的 AI 建構能建立用戶信任，並促使 AI 產品更優質。

- Google uses a rigorous assessment and review process guided by its AI principles for all AI projects. Google 以嚴謹評估和審查流程，確保所有 AI 專案符合其 AI 原則。

### 2. Google's Seven AI Principles / Google 的七項 AI 原則

1. **AI should be socially beneficial.** AI 應造福社會，專案需確保整體利益明顯大於風險。

2. **AI should avoid creating or reinforcing unfair bias,** especially related to race, gender, etc. AI 應避免產生或強化不公平偏見，特別是在種族、性別、收入等敏感特徵上。

3. **AI should be built and tested for safety** to avoid unintended harm. AI 需被安全設計和測試，以避免意外傷害。

4. **AI should be accountable to people,** offering feedback and appeal mechanisms. AI 需對人負責，設計適當回饋與申訴機制。

5. **AI should incorporate privacy design principles,** ensuring notice, consent, and transparency. AI 應包含隱私設計原則，提供通知、同意及透明度控制。

6. **AI should uphold high standards of scientific excellence,** sharing knowledge responsibly. AI 需維持科學卓越標準，負責任地分享知識與最佳實踐。

7. **AI should be made available only for uses consistent with these principles,** limiting harmful uses. AI 僅應用於符合原則的用途，限制可能有害或濫用的應用。

### 3. Applications Google Will Not Pursue / Google 將不追求的應用

- Technologies that cause or directly facilitate physical harm, such as weapons. 武器或直接導致人身傷害的技術。
- Surveillance technologies that violate internationally accepted norms. 侵犯國際公認規範的監控技術。
- Technologies that violate international law and human rights principles. 違反國際法及人權原則的技術。

### 4. Core Concepts / 核心概念

- AI technology reflects societal values and must be carefully designed to avoid amplifying social issues. AI 技術反映社會價值，需審慎設計以避免放大社會問題。

- Humans play the role of decision-makers in AI systems and must make responsible choices. 人類在 AI 系統中扮演決策者角色，必須負責任地做決策。

- Responsible AI is the foundation for product success and user trust. 負責任的 AI 是產品成功與用戶信任的基礎。

- Processes and principles ensure decision transparency and trustworthiness, so that even if outcomes differ, the process is trusted. 透過流程與原則保障決策透明與可信，即使結果不同意，也相信過程。

### 5. Practical Implications / 實際應用

- Everyone involved in AI design, development, and deployment must make decisions responsibly. 任何參與 AI 設計、開發、部署的角色都需負責任地做決策。

- There must be ethical and responsible consideration for AI products' potential societal impacts. 對於 AI 產品的潛在社會影響要有倫理與責任感。

- Promote scientific rigor and interdisciplinary collaboration to enhance AI for the public good. 推動科學嚴謹與跨領域合作，提升 AI 公益性。

- Establish internal AI principles and review processes to ensure good governance within organizations. 建立企業內部 AI 原則及審核流程，推動良好治理。

---

## 五、Vertex AI Studio: From Prompt to Production / Vertex AI Studio：從提示詞到生產


### 1. What is Vertex AI Studio? / Vertex AI Studio 簡介

Vertex AI Studio is a gateway to generative AI, a development environment for both developers and non-developers. Vertex AI Studio 是生成式 AI 的入口，一個適合開發者及非開發者的開發環境。

It enables users to interact with Gen AI models, prototype ideas, and launch them into production. 用戶可以與生成式 AI 模型互動，快速原型設計，並部署產品。

:::info
💡 **Analogy:** Imagine it as an innovative workshop where Gen AI models are raw materials, you are the craftsman, and the Studio toolkit is your arsenal to create powerful AI solutions. 想像它是一個創新的工作坊，生成式 AI 模型是原料，你是工匠，Studio 工具箱是打造強大 AI 解決方案的武器。
:::

### 2. Idea to App: Quickly turn prompts into applications with no code / 想法到應用：無程式碼快速將提示詞轉化為應用

A **prompt** is a natural language input (question, instruction, task) given to an AI model to generate outputs like text, code, images, video, music, and more. 提示詞 是以自然語言輸入給 AI 模型的指令或問題，用來產生文字、程式碼、圖像、影片、音樂等輸出。

Effective communication with AI requires good prompt design: asking clear, concise questions to get desired results. 與 AI 有效溝通需設計良好提示詞：用清晰且簡潔的問題獲得預期回應。

### 3. Anatomy of a Prompt / 提示詞的構成

A good prompt typically includes:

| Component | Description |
|-----------|-------------|
| **Task** | The core of the prompt, what you want the model to do (e.g., conduct a risk analysis). 主要任務 (Task)：你希望模型執行的工作 (如風險分析)。 |
| **Context** | Background or system instructions that set the stage, helping AI understand the request better (e.g., "You are a business analyst..."). 背景資訊 (Context)：系統指令，讓 AI 明白任務環境 (如「你是一位商業分析師...」)。 |
| **Examples** | Step-by-step instructions, sample answers, or output formats to guide the AI response (few-shot prompting). 範例 (Examples)：逐步說明、範例答案或輸出格式，協助 AI 產生符合期望的回應 (少量示範提示詞)。 |

### 4. Prompt Design Tips / 提示詞設計技巧

- **Be direct and specific;** state your request clearly upfront. 直接且具體，明確說出你的要求。

- **Provide sufficient context** and use keywords. 提供足夠背景，並使用關鍵字。

- **Use structure and delimiters** (bullet points, dashes, headings) to separate sections like task, context, and examples. 使用結構化標記 (如項目符號、破折號、標題) 區分任務、背景和範例。

- **Break complex tasks** into actionable smaller steps. 將複雜任務拆解為可執行的小步驟。

- **Iterate and refine** prompts based on AI output. 根據 AI 回應反覆調整和優化提示詞。

- **Explore advanced techniques** like few-shot prompting, chain-of-thought prompting, or retrieval-augmented generation (RAG). 探索進階技巧，如少量示範提示詞、思路鏈提示詞或檢索增強生成 (RAG)。

### 5. Building a Prototype / 建立原型

B and Anne used Vertex AI Studio to interact with generative models, starting with prompts. B 和 Anne 使用 Vertex AI Studio 輸入提示詞，開始與生成式模型互動。

Vertex AI Studio offers AI assistant prompting features, helping to write and optimize prompts and decompose complex tasks. Studio 提供 AI 助理協助撰寫與優化提示詞，清楚分段並簡化複雜任務。

:::warning
**Example Prompt:** "Conduct a risk assessment in housing in southern Los Angeles. You are a business analyst for Symbol Insurance. Analyze articles from the internet and extract information on risk assessment, identify potential risks and rate severity from 1 to 5, categorize risks by geography, type and sentiment, impact analysis, and provide recommendations." 提示詞範例：「對洛杉磯南部地區的住房進行風險評估。您是 Symbol 保險公司的商業分析師。分析網路文章並提取風險評估資訊，識別潛在風險並將嚴重程度評級為 1 到 5，按地理、類型和情感分類風險，進行影響分析，並提供建議。」
:::

After several rounds of experimentation and adjustments, B and Anne clicked "build with code" to generate a web-based application prototype. 經過多次提示詞優化，他們使用「build with code」按鈕，快速產出網頁應用原型。

### 6. Components of a Good Prompt / 好的提示詞要素

A good prompt considers:
- **Content:** clear instructions, context, and examples. 內容：明確指令、背景資訊及範例。
- **Structure:** organized information using order, labels, and delimiters. 結構：資訊條理清晰，運用順序、標籤與分隔符。

### 7. Prompt Design Toolkit in Vertex AI Studio / Vertex AI Studio 中的提示詞設計工具包

- **Left side:** Writing area where you set the scene in system instructions and pose tasks/questions in the prompt section. 左側為撰寫區，設定系統指令及輸入任務或問題。

- **Right side:** Configuration area to adjust model parameters and settings. 右側為設定區，調整模型參數與配置。

- **Gemini, the built-in AI assistant,** helps create and polish prompts by clarifying content and formatting. 內建 AI 助理 Gemini 可協助撰寫並優化提示詞內容與格式。

- **Supports multimodal data inclusion:** Docs, images, videos from Google Cloud Storage, Google Drive, local files, URLs, and YouTube links. 支援多媒體資料嵌入：文件、圖片、影片，來源包含 Google Cloud Storage、Google Drive、本地端、網址及 YouTube 連結。

### 8. Prompt Templates / 提示詞範本

Allows developers like Anne to create reusable prompts with replaceable variables, similar to coding functions but in natural language. 提供可重複使用的提示詞範本，利用可替換變數，類似程式函數，但以自然語言表達。

Variables can be assigned values dynamically, enabling easy adjustment without rewriting the prompt. 變數可動態賦值，方便快速修改提示詞內容。

**Example:** Use the same prompt template to research different topics like "Los Angeles tenant vacancy rate" or "annual crime rate" by passing different variable values. 範例：同一提示詞範本，可透過變數替換研究不同主題，如「洛杉磯租屋空置率」或「年度犯罪率」。

### 9. Model Selection and Parameter Tuning / 模型選擇與參數調整

Vertex AI Studio offers Google's latest models (e.g., Gemini family) and third-party models (Anthropic Claude, Meta Llama, OpenAI GPT). 提供 Google 最新模型 (如 Gemini 系列) 及第三方模型 (Anthropic Claude, Meta Llama, OpenAI GPT)。

Choose model based on task and data type (general, multimodal, specialty models for images, code, video, semantic search). 根據任務與資料類型選擇模型 (一般、多媒體、專用影像、程式碼、影片、語意搜尋等模型)。

After selecting model, adjust parameters controlling randomness of output:

| Parameter | Description |
|-----------|-------------|
| **Temperature** | Controls the randomness of the generated output; lower temperatures produce more conservative, repetitive results; higher temperatures produce more innovative, diverse results. 控制生成結果的隨機程度，低溫度生成更保守、重複率高；高溫度生成更創新、多樣。 |
| **Top K** | Randomly selects words from the top K most probable words. 從機率最高的 K 個詞中隨機選詞。 |
| **Top P (nucleus sampling)** | Selects words from a set whose cumulative probability exceeds P, dynamically adjusting the vocabulary range. 從累積機率超過 P 的詞集合中選詞，動態調整詞彙範圍。 |

Adjusting parameters helps find a balance between predictability and diversity of outputs. 調整參數可以在結果的可預測性與多樣性之間找到平衡。
### 10. Evaluation and Refinement / 評估與優化

Vertex AI Studio supports side-by-side comparisons of multiple prompts, models, and parameter settings to observe how they affect the output.
Vertex AI Studio 支援多個提示詞、模型和參數設定的並排比較，以觀察它們如何影響輸出。

It allows adding ground truth answers to evaluate the accuracy of model responses.
它允許添加真實答案 (ground truth) 以評估模型回應的準確性。

Advanced optimization can be performed by adding labeled examples in Colab enterprise notebooks.
可透過在 Colab 企業版筆記本中添加帶標籤的範例來執行進階優化。

The prompt management feature enables saving, sharing, version control, and secure management of prompts.
提示詞管理功能支援提示詞的儲存、共享、版本控制和安全管理。

### 11. Application Scenarios / 應用場景

Beyond general prompts, prompt engineering techniques can be applied to real-time streaming, multimedia content generation, content translation, speech-to-text, and other specific tasks.
除了通用提示詞外，提示詞工程技術還可應用於實時串流、多媒體內容生成、內容翻譯、語音轉文字以及其他特定任務。

Anne learns how to leverage prompts and these tools using her own data to solve business problems.
Anne 學習如何利用提示詞和這些工具，使用自己的資料解決業務問題。

She looks forward to learning how to deploy prompts as executable code, which will be covered in the next lesson.
她期待學習如何將提示詞部署為可執行程式碼，這將在下一課中介紹。

### 12. From Prompt to Production: Deployment and Monitoring / 從提示詞到生產：部署與監控

We are now at the second half of the prompt-to-production life cycle: from build and test to monitor and optimize.
我們現在進入提示詞到生產生命週期的後半段：從建構和測試到監控和優化。

Vertex AI Studio provides this flexibility by automatically generating the code for you.
Vertex AI Studio 透過自動為您生成程式碼來提供這種靈活性。

Besides the user interface (UI), which requires no code to explore and test prompts, Vertex AI Studio also provides two other approaches to access AI models.
除了使用者介面 (UI) 不需要程式碼即可探索和測試提示詞之外，Vertex AI Studio 還提供了另外兩種存取 AI 模型的方法。

Simply click "build with code" and you'll find the code describing the prompt and its parameters.
只需點擊「以程式碼建構」，您就會找到描述提示詞及其參數的程式碼。

The first approach is through using predefined SDKs in different languages.
第一種方法是透過使用不同語言的預定義 SDK。

You can open a notebook with the SDK's code of your preferred programming languages like Python.
您可以打開一個包含您首選程式語言 (例如 Python) SDK 程式碼的筆記本。

The other approach is through using APIs together with command line tools like curl or client URL.
另一種方法是透過 API，結合命令列工具，例如 curl 或客戶端 URL。

The automated code generation simplifies application development.
自動化程式碼生成簡化了應用程式開發。

Additionally, the integrated development environment with Cloud Run and CloudShell streamlines production and removes the need to worry about the underlying cloud architecture that supports application deployment.
此外，與 Cloud Run 和 CloudShell 整合的開發環境簡化了生產流程，消除了對支援應用程式部署的底層雲端架構的擔憂。

### 13. Continuous Monitoring and Grounding / 持續監控與資料驗證 (Grounding)

After you build the application, it's important to continually monitor and optimize its performance.
建構應用程式後，持續監控並優化其效能至關重要。

But how can you do this and how can you ensure the GenAI models produce accurate results with updated information?
但您如何做到這一點？又如何確保生成式 AI 模型產生準確且更新的資訊呢？

One way is through grounding and RAG (Retrieval Augmented Generation).
一種方法是透過資料驗證 (Grounding) 和檢索增強生成 (RAG)。

Remember that GenAI models are pre-trained, so their answers depend on the training data which can be outdated and inaccurate.
請記住，生成式 AI 模型是預訓練的，因此它們的答案取決於訓練資料，而這些資料可能已過時或不準確。

But grounding links AI models to reliable external data sources, ensuring that their responses are checked against the most current information.
但是，資料驗證 (grounding) 將 AI 模型連結到可靠的外部資料來源，確保其回應是根據最新資訊進行驗證。

And RAG is one way to implement grounding. Simply put, grounding is the concept while RAG is the implementation.
而 RAG 是實現資料驗證的一種方式。簡單來說，資料驗證是概念，而 RAG 是實作。

Think of grounding as a fact checker that prevents outdated and wrong information.
將資料驗證想像成一個事實核對工具，可防止過時和錯誤的資訊。

### 14. Model Tuning and Fine-tuning / 模型調整與微調

What if you wanted to improve the article generation process itself, like data collection and writing methods? That's where model tuning comes in.
如果您想改進文章生成過程本身，例如資料收集和寫作方法，該怎麼辦？這就是模型調整的作用。

Model tuning enhances GenAI accuracy by providing the model with a training data set of specific downstream task examples.
模型調整透過為模型提供特定下游任務範例的訓練資料集，來提高生成式 AI 的準確性。

While fine-tuning refines the model's internal knowledge and abilities, grounding augments its knowledge with external, real-time, and reliable information.
微調 (fine-tuning) 精煉模型的內部知識和能力，而資料驗證 (grounding) 則透過外部、即時和可靠的資訊來增強其知識。

When constructing your prompt, you can opt to ground the results either through Google real-time search for the most current information or your own data to instruct the AI with field-specific knowledge.
在建構提示詞時，您可以選擇透過 Google 實時搜尋來驗證結果以獲取最新資訊，或者使用您自己的資料來為 AI 提供領域特定的知識。

### 15. Learning Resources and Model Customization / 學習資源與模型客製化

To further your knowledge of these advanced technologies, Google recommends courses like "Create Embeddings," "Vector Search and RAG with BigQuery," and "Vector Search and Embeddings with Vertex AI."
為了進一步了解這些進階技術，Google 推薦以下課程：「建立嵌入 (Create Embeddings)」、「使用 BigQuery 的向量搜尋和 RAG (Vector Search and RAG with BigQuery)」、以及「使用 Vertex AI 的向量搜尋和嵌入 (Vector Search and Embeddings with Vertex AI)」。

These courses introduce how to implement RAG pipelines with Google's widely used platforms BigQuery and Vertex AI.
這些課程介紹如何使用 Google 廣泛使用的平台 BigQuery 和 Vertex AI 實作 RAG 流程。

You have different options to customize and tune a generative AI model, ranging from less technical methods like prompt design to more technical methods like full fine-tuning.
您可以選擇不同的方式來客製化和調整生成式 AI 模型，從技術門檻較低的提示詞設計，到技術門檻較高的完整微調。

**Prompt design** lets you tune a GenAI model with examples and instructions in natural language without altering the model's parameters.
**提示詞設計**讓您可以使用自然語言的範例和指令來調整生成式 AI 模型，而無需更改模型的參數。

Prompt design enables rapid experimentation and customization, accessible to users without machine learning or coding expertise.
提示詞設計實現了快速實驗和客製化，適合沒有機器學習或編碼專業知識的使用者。

For complex tasks needing tailored results, consider parameter-efficient tuning or full fine-tuning.
對於需要客製化結果的複雜任務，請考慮參數高效調整或完整微調。

**Parameter-efficient tuning** updates a small subset of parameters for efficient adaptation.
**參數高效調整 (Adapter tuning)** 僅更新一小部分參數，以實現高效適應。

**Full fine-tuning** updates all parameters and is ideal for high-quality results but requires more computational resources.
**完整微調**更新所有參數，非常適合高品質的結果，但需要更多的運算資源。

### 16. Starting a Tuning Job in Vertex AI Studio / 在 Vertex AI Studio 中啟動調整任務

From the Vertex AI Studio menu, select tuning to create a tuned model.
從 Vertex AI Studio 選單中，選擇「調整 (tuning)」來創建一個調整後的模型。

Specify the model details and tuning data set.
指定模型詳細資訊和調整資料集。

Training data should be structured as a supervised training data set in a JSONL file, with each record containing a prompt (input) and expected response (output).
訓練資料應以 JSONL 檔案中的監督式訓練資料集結構化，每個記錄包含一個提示詞 (輸入) 和預期的回應 (輸出)。

For example, prompts like "This commercial building is architecturally interesting..." and expected sentiment labels like positive or negative.
例如，提示詞如「這棟商業大樓在建築上很有趣...」以及預期的情感標籤如「正面」或「負面」。

This structure teaches the model desired behavior.
這種結構教會模型所需的行為。

You can start the tuning job and monitor its status in the Google Cloud Console.
您可以在 Google Cloud Console 中啟動調整任務並監控其狀態。

When complete, the tuned model appears in the Vertex AI model registry and can be deployed to an endpoint or further tested in Vertex AI Studio.
完成後，調整後的模型將出現在 Vertex AI 模型註冊表中，可以部署到端點或在 Vertex AI Studio 中進一步測試。

---

## 六、Introduction to Diffusion Models / 擴散模型介紹


### 1. Diffusion Models Overview / 擴散模型概述

**擴散模型定義 (Diffusion Models Definition)**  
擴散模型是一系列在圖像生成方面展現潛力的模型。這些模型受熱力學和物理學啟發，將圖像轉換為純噪音，然後透過逆向過程生成新圖像。  
*Diffusion models are a family of models that have shown promise in image generation. These models, inspired by thermodynamics and physics, transform images into pure noise and then generate new images by reversing the process.*

**發展背景 (Development Background)**  
此前，諸如變分自編碼器 (VAEs)、生成對抗網路 (GANs) 和自回歸模型等方法在圖像生成領域中很受歡迎，每種方法都有其獨特的圖像生成方式。  
*Previously, methods like Variational Autoencoders (VAEs), GANs, and autoregressive models were popular in the image generation field, each with its own approach to generating images.*

### 2. Diffusion Process / 擴散過程

**前向擴散過程 (Forward Diffusion Process)**  
逐步向圖像添加噪音，將原始圖像轉換為純噪音。  
*The forward diffusion process gradually adds noise to the image, transforming the original image into pure noise.*

**逆向擴散過程 (Reverse Diffusion Process)**  
透過機器學習模型訓練，學習對圖像去噪，逐步從噪音中生成更清晰的圖像。  
*The reverse diffusion process, trained by machine learning models, learns to denoise the image, progressively generating clearer images from the noise.*

### 3. Key Components of Diffusion Models / 擴散模型的關鍵組件

**Forward Process**: Start with an image and add noise iteratively. With enough steps, the image becomes pure noise.  
**前向過程 (Forward Process)**：從圖像開始，迭代地添加噪音。經過足夠的步驟後，圖像將變成純噪音。

**Reverse Process**: The goal is to train a model to take noisy images and progressively remove noise to recover the original image.  
**逆向過程 (Reverse Process)**：目標是訓練模型從嘈雜的圖像中逐步去除噪音，以恢復原始圖像。

### 4. Types of Diffusion Models / 擴散模型類型

**Denoising Diffusion Probabilistic Models (DDPMs)**：基礎的擴散模型，透過逐步去噪過程生成高品質圖像。  
*Denoising Diffusion Probabilistic Models (DDPMs): Foundational diffusion models that generate high-quality images through step-by-step denoising.*

**Latent Diffusion Models**：在潜在空間中進行擴散，提高計算效率，如 Stable Diffusion。  
*Latent Diffusion Models: Perform diffusion in latent space for computational efficiency, such as Stable Diffusion.*

**Conditional Diffusion Models**：允許根據文字提示或其他條件生成特定圖像。  
*Conditional Diffusion Models: Enable generation of specific images based on text prompts or other conditions.*

### 5. Applications of Diffusion Models / 擴散模型應用

**圖像生成 (Image Generation)**
- 藝術創作與設計
- 數據增強
- 圖像修復與增強

**文字轉圖像 (Text-to-Image)**
- 創意設計自動化
- 內容創作
- 概念可視化

**圖像編輯 (Image Editing)**
- 風格轉換
- 圖像修復
- 局部編輯

### 6. Google Cloud Diffusion Model Tools / Google Cloud 擴散模型工具

**Vertex AI Imagen**：Google 的文字轉圖像擴散模型，支援高品質圖像生成。  
*Vertex AI Imagen: Google's text-to-image diffusion model supporting high-quality image generation.*

**Vertex AI Model Garden**：提供多種預訓練擴散模型，可直接使用或微調。  
*Vertex AI Model Garden: Offers various pre-trained diffusion models for direct use or fine-tuning.*

**自訂模型訓練 (Custom Model Training)**：支援使用自有資料集訓練特定領域的擴散模型。  
*Custom Model Training: Supports training domain-specific diffusion models using proprietary datasets.*

---

## 總結 / Summary

### 技術發展趨勢 (Technology Development Trends)

1. **雲端原生化 (Cloud-Native Evolution)**
   - 從傳統 IT 基礎設施向雲端原生架構轉型
   - 容器化、微服務與無伺服器運算成為主流

2. **AI 民主化 (AI Democratization)**
   - 透過 Vertex AI 和生成式 AI 工具降低 AI 應用門檻
   - 無程式碼/低程式碼解決方案普及

3. **多模態整合 (Multimodal Integration)**
   - Gemini 等多模態模型整合文字、影像、音訊處理能力
   - 支援更豐富的應用場景與使用者體驗

4. **負責任的 AI (Responsible AI)**
   - 建立 AI 倫理框架與評估機制
   - 確保 AI 系統的公平性、透明度與安全性

5. **擴散模型革命 (Diffusion Model Revolution)**
   - 圖像生成技術的重大突破
   - 文字轉圖像應用的廣泛普及

### 實踐建議 (Practical Recommendations)

- **循序漸進學習**：從雲端基礎概念開始，逐步深入 AI 技術
- **動手實作**：善用 Google Cloud 免費額度進行實際操作
- **關注最新發展**：持續追蹤 Google Cloud 與 AI 技術更新
- **重視 AI 倫理**：在開發 AI 應用時考慮社會責任與倫理影響
- **培養跨領域技能**：結合技術與領域知識，創造更有價值的解決方案

### 未來展望 (Future Outlook)

Google Cloud Platform 與生成式 AI 的結合將持續推動數位轉型，為企業和開發者提供更強大、更智慧的解決方案。從雲端運算基礎到前沿的擴散模型，這些技術正在重新定義我們與數位世界的互動方式。

掌握這些核心技術，將為您在 AI 時代的競爭中奠定堅實基礎，開啟無限的創新可能。

