前面提過,時下流行的 DNN 模型的訓練過程,是試圖「記住」或「趨近」訓練資料的機率分布,這個方式是不容易得到一個值得信賴的模型。要解決這個問題,讓系統擁有「結構化的固有知識框架」是一個重要的解決方案。然而,僅僅有固有的知識框架(以及藉由這個框架所學得的知識庫)還不夠,新的 AI 系統還必須具有邏輯推論的能力。也就是說,需要一個「推論引擎」的元件,利用知識庫內的知識,找出問題的答案。
此「推論引擎 (reasoning engine)」的實作方法,目前看來 CYC 的推論引擎是一個值得參考的例子。在 2019 年,CYC 的創辦人 Doug Lenat 發表了「What AI Can Learn From Romeo & Juliet」(註一)一文,描述了在 CYC 下如何經由一個「故事 (story)」、「故事內的知識 (即是事件的描述)」、「常識 (common sense knowledge)」、以及 CYC 的推理機制可以導出的結果。
來看這一段故事(事實上它是維基百科中的一段對於小說「羅蜜歐與茱莉葉」的描述:
Juliet visits Friar Laurence for help [avoiding being forced by her father to marry Paris], and he offers her a potion that will put her into a deathlike coma for hours. The Friar promises to send a messenger to inform Romeo of the plan so that he can rejoin her when she awakens. …... she takes the drug and, when discovered apparently dead, she is laid in the family crypt.
The messenger, however, does not reach Romeo and, instead, Romeo learns of Juliet's apparent death …...Heartbroken, Romeo buys poison from an apothecary and goes to the Capulet crypt. ...believing Juliet to be dead, he drinks the poison [and dies]. Juliet then awakens and, discovering that Romeo is dead, stabs herself with his dagger and joins him in death.
這一段故事可以表示為以時間軸為主的故事描述序列:
T0 – just before Act IV starts.
T1a – the start of Juliet’s visit with Friar Lawrence
T1b – the end of that visit
T2 – what the Friar and Juliet both believes about T4 and T5
T3 – Juliet drinks the feign death potion
T3b – Juliet’s body is discovered and taken to the crypt
T4 – Romeo hears from the Friar’s messenger about the planned trickery
T5 – Romeo hears (from someone else) that Juliet has died
T6 – Romeo goes to the crypt and finds Juliet’s inert body.
T7 – Juliet awakens from her feigning of death.
T8 – Romeo and Juliet secretly flee Verona
T9 – Romeo and Juliet live happily ever after
T10 – Romeo buys poison
T11 – Romeo drinks poison
T12 – Romeo dies
T13 – Juliet discovers Romeo’s dead body
T14 – Juliet drinks poison
你可以看出來,有些描述只是故事主人翁的預期及主觀想法,隨著故事的進行,最後有的會發生,而有的不會發生。而在每一個時間點,皆會有一些存在的事實,例如時間點 T0 有下列事實:
- Lord Capulet wants and expects Juliet and Paris to marry.
- Juliet knows that Lord Capulet wants and expects Juliet and Paris to marry.
- Romeo believes that Juliet is alive.
- Romeo, Juliet, and the Friar do not want Juliet to marry Paris.
- All three of them know that all three of them do not want that to happen.
要對故事做推論,僅僅只有故事的時間軸序列及每一時間點的事實是不夠的,勢必需要一些常識,例如:
- Of course if a person were dead, they would not have to marry anyone.
- Of course a person often asks another for help accomplishing something that they both want.
- Of course if someone drinks an instantly fatal dose of poison, they immediately die.
- Of course if a trusted friend of yours tells you something, and you don’t have a better reason not to believe it, then you are very likely to believe what they say.
- Of course when someone newsworthy is believed to be dead, news of their death will spread quickly. The scale and speed depend on the information technology available and the dead person’s level of fame. In particular, in a small medieval European town, the news of a local noble’s demise would spread by word of mouth throughout that town over a period of hours but in less than 24 hours.
- Of course if one believes that the love of his/her life has just died, then he/she is likely to feel overwhelming sadness and hopelessness.
- Of course if someone dies, they stay dead.
- Of course an object at rest will stay at rest until moved by some person or some force acting on that object.
- Of course while anyone is unconscious or dead they are an object at rest.
具備了以上的相關知識常識,SYS 就可進行「巢狀的意見推理 (Nested belief reasoning)」,例如:
問題:When she takes the feign-death potion, does Juliet believe Romeo will believe she is alive during the time she is in suspension?
回答: Yes
常識規則:
If, at time T1, an agent’s model of a subject’s beliefs at time T2 includes a proposition, then the agent believes at T1 that the subject believes the proposition at T2知識推論:
*At the time of Juliet’s taking of the feign-death potion, Juliet has a model of Romeo’s beliefs at the time of Juliet’s being in suspension after taking the feign-death potion that includes the proposition that Juliet is a living thing.
*Juliet believes that if an agent receives information from a trusted source, they will believe that information.
*Juliet believes that Friar Laurence is a trusted source for Romeo.
*Friar Laurent and Juliet plan for Romeo to receive Friar Laurence’s message while Juliet is in suspension.
*Friar Laurence and Juliet plan for Friar Laurence’s message to Romeo to convery the information that while Juliet is in suspension, she will be alive.
*Juliet believes the events she and Friar Laurence have planned will occur.
從以上的例子來看,要讓 CYC 式的邏輯推理能進行,必須有:
第一項和第二項即是稍後要討論的「豐富認知模型 (rich cognitive model) 」,這個模型能將複雜的場景(如羅蜜歐與茱莉葉的小說情節)擷取出來,結構化地表達每一個時間點、在每一個空間下的每一位主人翁在做什麼、知道什麼、想要什麼、以及期待什麼;同時也要表達出每一時間點存在的事實是什麼等等。
第三項涉及龐大的常識庫,目前看起來,現行的深度學習模型是無法建立這類的常識庫的。這個常識庫應有基本的邏輯敘述(如:喝下劇毒藥物會造成立即死亡),並能動態組合若干基本敘述得到更高階的常識(如:基本邏輯「人區分為活人及過世的人」、「婚姻關係只存在於活人之間」、「透過結婚這個程序可建立婚姻關係」,可以導出「已過世的人不應與其他人結婚」),擁有這個知識庫可以使得 AI 系統所推理出來的結論具有「可解釋性 (interpretability)」並更值得信任。
目前這類的常識庫(如 CYC 專案)都是以手動來建立的,之前分析過,Marcus 認為必須找到一個自動的機制,讓這個常識庫有自我學習、自我擴展的能力。
第四項有關推理引擎,它必須有效率的使用第一、二項的認知模型,及第三項的常識庫,並能在資訊不足的時候找到可能性最高的答案,畢竟這個世界太複雜,變化太快,我們永遠無法建立一個有100% 涵蓋面的模型及常識庫。
DeepMind 強化學習的 DQN 演算法是一個無模型 (model-free) 架構,雖然它在特定的 Atari 遊戲中,能表現出超越人類的訓練結果,但是只要把環境稍作變化,它的效能馬上大打折扣。例如打磚塊遊戲,只要把打擊用的橫棒稍微向上移一點,先前的訓練好的模型就不適用了,表現得一塌糊塗。
要創造一個強固型 AI ,認知模型是系統內的必要元件。在認知心理學上,所謂的認知模型 (cognitive model) 是對於某一個對象 (object) 現況的了解,或者是說擁有了解這一個對象的相關知識,把這個知識表達出來,就是認知模型。一般來說,認知模型是隨著時間及事件的發生逐步發展的,例如有人告訴你在書房裏有一個空的書架,對於這個書架,你有了「它是空的」這個知識,存在於你的腦中的內在模型裏。接著又被告知「某人放了一本書在架上」,你的內在模型隨即修正,知道了它現在有兩本書。以此類推,這個模型隨著「上架」、「下架」等事件的發生,你的模型隨之變化。
如前節所述,對於強固型 AI 系統最需要的突破,是能夠藉由自動閱讀如維基百科等自然語言文字段落,產生對應的認知模型(而非像 CYC 一般用手工打造)。然而目前投入在這方面的研究人員並不多,進展也非常有限。
最終,Marcus 希望(豐富的)認知模型能和邏輯推論引擎結合,創造出各式各樣的推理行為。
「AI 的未來十年」就介紹到此,這裏也是此次鐵人發文的最後一篇。第一次嘗試參加鐵人賽,連續 30 天發表確實是個很大的挑戰,整個過程中「完賽」成了第一個最重要的目標,而發文的品質及深度,就無暇兼顧了,這是要好好檢討的地方。老頭會抽空把這一段時間的發文再看一遍,把不詳細或不夠清楚的地方做些補強,以期這些發文,能真正的對有緣的 AI 人有實質的幫助。