緣起:
我在公司負責導入AI技術與治理規範,做了一些研究。邀請大家一起閱讀與討論,以了解目前AI目前真實的能力與限制!
才不會被賣AI的人搞得很焦慮!
我試過了Microsoft Copilot
Chat、Claude、Gemini、ChatGPT,
我最喜歡Microsoft Copilot 的答案,更可貴的它提到引發AI熱潮,Google 無私公開的論文:Attention Is All You Need
我的指令(Prompt):
下面句子的 it 代表什麼?
你是怎麼知道的,會不會有出錯的時候?
The animal didn't cross the street because it was too tired.
請說明清楚技術,如過出現專有名詞請說明清楚:
包含但不僅限於Large Language modle,Natural
Language Processing
Microsoft Copilot chat:
這個問題其實碰到了
大型語言模型(Large
Language Model, LLM)最核心的能力之一:指代消解(Coreference Resolution)。
先說結論:
在句子 "The
animal didn't cross the street because it was too tired."
大部分人類以及大部分
LLM,都會判斷:
it = the animal(那隻動物)
也就是:
那隻動物沒有穿越馬路,因為牠太累了。
但重點是:
AI 並不是「真的知道」it 是 animal,而是根據語言模式、機率、語意關聯去推斷,因此有可能出錯。
一、人類為什麼知道 it 是 animal?
句子:
|
1 The
animal didn't cross the street because it was too tired. |
拆解:
|
1 主詞: 2 The
animal 3 4 動作: 5 didn't
cross the street 6 7 原因: 8 because
it was too tired |
如果翻譯成中文:
|
1 那隻動物沒有穿越馬路, 2 因為牠太累了。 |
人類會自然推論:
|
1 太累 → 無法移動 2 無法移動 → 沒有過馬路 |
所以:
|
1 it =
animal |
這是一種:
語意推理(Semantic Reasoning)
而不是單純文法分析。
二、如果是 NLP 時代,是怎麼做的?
在 ChatGPT 出現以前,Natural Language Processing(NLP,自然語言處理)通常會用:
Coreference Resolution(指代消解、代詞解析)
目的:
|
1 John
bought a car. 2 He loves
it. |
找出:
|
1 He =>
John 2 3 it =>
car |
傳統 NLP 的作法
會看很多特徵:
1. 距離
靠近代詞的名詞比較可能,例如:
|
1 Tom
talked to Jack. 2 He
smiled. |
可能:
|
1 He =>
Jack |
因為比較近。
2. 文法角色
主詞優先。例如:
|
1 Tom met
Jack. 2 He was
happy. |
比較可能:
|
1 He =>
Tom |
因為 Tom 是主詞。
3. 性別
例如:
|
1 Lisa met
Tom. 2 She
smiled. |
|
1 She
=> Lisa |
4. 單複數
|
1 The dogs
ran away. 2 They
were frightened. |
|
1 They
=> dogs |
但這些方法都有極限。
三、真正困難的地方:Winograd Schema
AI 研究界有個非常有名的測試:
Winograd Schema
Challenge
由 Terry Winograd 提出。
例如:
|
1 The
trophy didn't fit in the suitcase 2 because
it was too big. |
it 是誰?可能有兩個:
|
1 trophy 2 suitcase |
但是:
|
1 獎盃太大 2 → 放不進去 |
所以:
|
1 it =
trophy |
換一句:
|
1 The
trophy didn't fit in the suitcase 2 because
it was too small. |
突然變成:
|
1 it =
suitcase |
因為:
|
1 行李箱太小 2 → 裝不下 |
注意:文法完全一樣。
只有:
|
1 big 2 small |
不同。但答案相反。
因此:傳統 NLP 經常做不好。
因為需要:Common Sense(常識推理)
四、Large Language Model 怎麼做?
例如: GPT-5、 Copilot、Claude、 Gemini並不是用規則。
而是:
Transformer
2017
年 Google 提出的論文:Attention Is All You Need
核心技術:Self-Attention(自注意力機制)
五、什麼是 Self-Attention?
當模型讀到:
|
1 The
animal didn't cross the street 2 because
it was too tired. |
不會像人類逐字閱讀。而是建立一個關聯網路。
例如:
|
1 it 2 ↑ 3 ↑ 4 ↑ 5 6 animal 7 street 8 cross 9 tired |
模型會計算:
|
1 it 與誰最有關聯? |
可能得到:
|
1 animal = 0.82 2 3 street = 0.05 4 5 cross = 0.03 6 7 其他 = 0.10 |
因此:
|
1 it →
animal |
機率最高。
六、Copilot 真的理解了嗎?
其實這是 AI 研究的大問題。
很多學者認為:LLM 並沒有真正理解。
而是:
換句話說:它看過數十億句語料。知道:
|
1 too
tired 2 ↓ 3 通常形容人或動物 4 5 很少形容
street |
所以預測:
|
1 it =
animal |
七、它會不會出錯?
一定會。例如:
|
1 The
animal didn't cross the street 2 because
it was blocked. |
這時候:
|
1 it = ? |
可能:
|
1 animal 2 street |
都合理。
如果改成:
|
1 The
animal didn't cross the street 2 because
it was closed. |
人類知道:
|
1 it =
street |
但模型不一定百分之百判對。
八、LLM 內部實際流程
當 Copilot 看到一句話時,大致會經過:
Step 1 Tokenization(詞元化)
把文字切成 Token。例如:
|
1 The 2 animal 3 didn't 4 cross 5 the 6 street 7 because 8 it 9 was 10 too 11 tired |
變成:
|
1 [The] 2 [animal] 3 [didn't] 4 [cross] 5 ... 6 [it] 7 [tired] |
Step 2 Embedding(向量化)
每個 Token 變成數百或數千維數字。例如:
|
1 animal 2 = 3 [0.25,
-0.63, ...] |
這稱為:
|
1 Word
Embedding |
詞向量。
Step 3 Attention
計算:
|
1 it 2 應該參考誰? |
形成 Attention 權重。例如:
|
1 it →
animal 0.81 2 3 it →
street 0.07 4 5 it →
cross 0.02 |
Step 4 多層 Transformer
不像只算一次。而是:
|
1 Layer 1 2 Layer 2 3 Layer 3 4 ... 5 Layer N |
一層層修正。最後得到:
|
1 it =
animal |
機率最高。
九、這和「理解」有什麼差別?
人類可能建立因果鏈:
|
1 動物 2 ↓ 3 很累 4 ↓ 5 走不動 6 ↓ 7 無法過馬路 |
而 LLM 比較像:
|
1 在數十億句語料中 2 3 「too
tired」 4 5 與 6 7 「animal」 8 9 共同出現機率極高 |
所以推測:
|
1 it =
animal |
十、如果在 Copilot Chat 中嘗試
你可以直接問:
|
1 The
animal didn't cross the street because it was too tired. 2 3 What
does "it" refer to? 4 Explain
your reasoning step by step. |
再進一步問:
|
1 Could
there be another interpretation? 2 What
confidence level do you assign? |
通常 Copilot 會回答:
|
1 it = the
animal |
原因:
|
1 being
tired explains why the animal 2 didn't
cross the street. |
而不是:
|
1 street
was tired |
因為語意不合理。
關鍵觀念總結
|
名稱 |
中文 |
在這句話中的作用 |
|
Natural Language Processing (NLP) |
自然語言處理 |
處理人類語言的技術總稱 |
|
Coreference
Resolution |
指代消解 |
判斷 it 指向誰 |
|
Semantic Reasoning |
語意推理 |
利用句意判斷原因與結果 |
|
Common Sense
Reasoning |
常識推理 |
知道「累了就不想走路」 |
|
Tokenization |
詞元化 |
將句子切成 Token |
|
Embedding |
詞向量 |
將文字轉成數學向量 |
|
Transformer |
轉換器架構 |
現代 LLM 的核心架構 |
|
Self-Attention |
自注意力機制 |
找出 it 最可能關聯的詞 |
|
Large Language Model (LLM) |
大型語言模型 |
透過龐大語料學習語言模式 |
|
Hallucination |
幻覺 |
推論錯誤時可能發生 |
最重要的一句話:
Copilot、ChatGPT、Claude 並不是利用「文法規則」判斷 it,而是在 Transformer 的 Attention 機制下,結合大量語言統計模式與語意關聯,推論出 "it" 最可能指向 "animal"。大多數情況判斷正確,但遇到語意模糊、缺乏常識或上下文不足時,仍然可能出錯。

留言