透過本文,您將了解 Transformer 的基本概念,我們將透過 Hugging Face 的 Transformer 套件手把手操作深入瞭解。
課程規劃演練的部分,將以 Google Colab 為主要環境,並使用 Hugging Face 的 Transformer 套件進行操作。
關於 Colab 的申請及使用,請參考 Google Colab。
分別以 Token Classification、Zero-Shot Classification 及 Image Classification 三個任務,示範如何使用 Hugging Face 的 Transformer 套件。
初探 Transformer 架構,介紹 Input Embedding 及 Positional Encoding。
進一步探討 Transformer Encoder 的運作原理。包含 Self-Attention、Multi-Head Attention 及 Feed-Forward Neural Network。
介紹 Transformer Decoder 的運作原理。包含 Masked Self-Attention、Multi-Head Attention 及 Feed-Forward Neural Network。最後簡單說明 Encoder, Decoder, Encoder-Decoder 三者的相關應用。
基於 Encoder-Only 預訓練模型,微調一個 PII (Personal Identifiable Information) 偵測模型。
基於 Decoder-Only 預訓練模型,微調一個 QA 問答模型。
這個章節也會介紹半精度訓練及 LoRA 訓練技巧。以此降低 GPU 記憶體需求,提升訓練效率。
基於 Encoder-Decoder 預訓練模型,微調一個 PII 遮掩模型。
- Introduction to Transformer Models for NLP
- Transformers: how do they work internally?
- A Comprehensive Overview of Transformer-Based Models: Encoders, Decoders, and More