ダブルクリックで英日反転
Applied Sciences · Engineering
What Is an LLM? How It Works in One Go
An LLM (Large Language Model) is the brain behind ChatGPT and Claude — a giant probability machine that generates text by repeatedly predicting the most likely next token.
Core Mechanism
- Predicts the next token (word or sub-word chunk) given all preceding text.
- Repeats one token at a time to produce fluent, extended output.
- "Token" = the atomic unit the model operates on (e.g. "東京都" → "東京" + "都").
Why It Got So Clever — Transformer & Attention
- The 2017 Transformer architecture was the turning point.
- Attention mechanism: weighs relationships between all words simultaneously, regardless of distance.
- Enables long-context understanding by linking pronouns, references, and far-apart words.
Training: Two Stages
- Pre-training: reads internet-scale text, solves "next-word prediction" billions of times.
- Post-tuning (fine-tuning / RLHF): aligns outputs with human preferences via reward signals.
- RLHF (Reinforcement Learning from Human Feedback) is where safety and helpfulness are instilled.
Power & Weakness
- Parameters (billions–trillions of learned weights) determine expressive capacity — but data quality matters more than sheer count.
- Hallucination: the model picks "plausible" words, not necessarily true ones — confident errors are possible.
- RAG (Retrieval-Augmented Generation) is a common mitigation: attach authoritative sources at query time.
→ An LLM is a probabilistic next-token predictor; Transformer attention gives it context, RLHF gives it manners — but fact-checking stays on the human side.
Applied Sciences · Engineering
LLMとは何か — 仕組みを一気に理解する
LLM(大規模言語モデル)はChatGPTやClaudeの中枢。「次に来るトークンを確率的に予測し続ける」ことでテキストを生成する巨大な確率機械だ。
中核の仕組み
- 直前までの文脈を受け取り、次のトークン(単語や単語の一部)を確率で選ぶ。
- これを1トークンずつ繰り返して文章を伸ばす。
- 「トークン」=モデルが扱う最小単位(例:「東京都」→「東京」+「都」に分割)。
飛躍の理由 — Transformer(トランスフォーマー)とAttention(注意機構)
- 2017年登場のTransformerアーキテクチャが転換点。
- Attention(注意機構):文中のすべての語の関係を距離に関わらず一度に計算する。
- 離れた語の参照関係も保持でき、長いコンテキストの理解が可能になった。
学習の2段階
- 事前学習(Pre-training):インターネット規模のテキストで「次の単語予測」を大量に解く。
- 後調整(RLHF):人間の評価を報酬として使い「望ましい答え方」を教え込む。
- RLHF(人間フィードバックによる強化学習)で安全性・丁寧さ・有用性が身につく。
強みと弱み
- パラメータ(数十億〜数兆の学習済み重み)が表現力を決めるが、データ品質の方が重要。
- ハルシネーション(幻覚):「もっともらしい」語を選ぶため、自信満々に誤情報を出力する。
- 対策の定番はRAG(検索拡張生成):外部の信頼情報を検索してモデルに添付する手法。
→ LLMは確率的な次トークン予測器。Transformerのattentionが文脈を保ち、RLHFが礼儀を与えるが、ファクトチェックは人間の役割のまま。
Applied Sciences · Engineering
What Is an LLM? How It Works in One Go
An LLM (Large Language Model) is the brain behind ChatGPT and Claude — a giant probability machine that generates text by repeatedly predicting the most likely next token.
Core Mechanism
- Predicts the next token (word or sub-word chunk) given all preceding text.
- Repeats one token at a time to produce fluent, extended output.
- "Token" = the atomic unit the model operates on (e.g. "東京都" → "東京" + "都").
Why It Got So Clever — Transformer & Attention
- The 2017 Transformer architecture was the turning point.
- Attention mechanism: weighs relationships between all words simultaneously, regardless of distance.
- Enables long-context understanding by linking pronouns, references, and far-apart words.
Training: Two Stages
- Pre-training: reads internet-scale text, solves "next-word prediction" billions of times.
- Post-tuning (fine-tuning / RLHF): aligns outputs with human preferences via reward signals.
- RLHF (Reinforcement Learning from Human Feedback) is where safety and helpfulness are instilled.
Power & Weakness
- Parameters (billions–trillions of learned weights) determine expressive capacity — but data quality matters more than sheer count.
- Hallucination: the model picks "plausible" words, not necessarily true ones — confident errors are possible.
- RAG (Retrieval-Augmented Generation) is a common mitigation: attach authoritative sources at query time.
→ An LLM is a probabilistic next-token predictor; Transformer attention gives it context, RLHF gives it manners — but fact-checking stays on the human side.
Applied Sciences · Engineering
LLMとは何か — 仕組みを一気に理解する
LLM(大規模言語モデル)はChatGPTやClaudeの中枢。「次に来るトークンを確率的に予測し続ける」ことでテキストを生成する巨大な確率機械だ。
中核の仕組み
- 直前までの文脈を受け取り、次のトークン(単語や単語の一部)を確率で選ぶ。
- これを1トークンずつ繰り返して文章を伸ばす。
- 「トークン」=モデルが扱う最小単位(例:「東京都」→「東京」+「都」に分割)。
飛躍の理由 — Transformer(トランスフォーマー)とAttention(注意機構)
- 2017年登場のTransformerアーキテクチャが転換点。
- Attention(注意機構):文中のすべての語の関係を距離に関わらず一度に計算する。
- 離れた語の参照関係も保持でき、長いコンテキストの理解が可能になった。
学習の2段階
- 事前学習(Pre-training):インターネット規模のテキストで「次の単語予測」を大量に解く。
- 後調整(RLHF):人間の評価を報酬として使い「望ましい答え方」を教え込む。
- RLHF(人間フィードバックによる強化学習)で安全性・丁寧さ・有用性が身につく。
強みと弱み
- パラメータ(数十億〜数兆の学習済み重み)が表現力を決めるが、データ品質の方が重要。
- ハルシネーション(幻覚):「もっともらしい」語を選ぶため、自信満々に誤情報を出力する。
- 対策の定番はRAG(検索拡張生成):外部の信頼情報を検索してモデルに添付する手法。
→ LLMは確率的な次トークン予測器。Transformerのattentionが文脈を保ち、RLHFが礼儀を与えるが、ファクトチェックは人間の役割のまま。
Related notes
- Agentic Commerce — ACP and Visibility into Being 'Bought by AI'
- AI Search Evaluation: The 12 Metrics — Gateway
- AI Search Evaluation ①Citation Rate — How Many URLs Are Pulled In Per Answer
- AI Search Evaluation ②Source Diversity — How Unskewed the Cited Sources Are
- AI Search Evaluation ③Accuracy Score — How Often It Answers Factual Questions Correctly
- AI Search Evaluation ④Answer Length — How Many Characters It Returns to the User on Average