[铁人12:Day 30] 「AI 的未来十年」摘要 6:逻辑推论及认知模型

逻辑推论 (Reasoning)

前面提过,时下流行的 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 式的逻辑推理能进行,必须有:

  1. 时间轴为主的故事描述序列。
  2. 每一个时间点的事实。
  3. 涵盖面够大的常识。
  4. 推论引擎,以上面三个要素进行推论。

第一项和第二项即是稍後要讨论的「丰富认知模型 (rich cognitive model) 」,这个模型能将复杂的场景(如罗蜜欧与茱莉叶的小说情节)撷取出来,结构化地表达每一个时间点、在每一个空间下的每一位主人翁在做什麽、知道什麽、想要什麽、以及期待什麽;同时也要表达出每一时间点存在的事实是什麽等等。

第三项涉及庞大的常识库,目前看起来,现行的深度学习模型是无法建立这类的常识库的。这个常识库应有基本的逻辑叙述(如:喝下剧毒药物会造成立即死亡),并能动态组合若干基本叙述得到更高阶的常识(如:基本逻辑「人区分为活人及过世的人」、「婚姻关系只存在於活人之间」、「透过结婚这个程序可建立婚姻关系」,可以导出「已过世的人不应与其他人结婚」),拥有这个知识库可以使得 AI 系统所推理出来的结论具有「可解释性 (interpretability)」并更值得信任。

目前这类的常识库(如 CYC 专案)都是以手动来建立的,之前分析过,Marcus 认为必须找到一个自动的机制,让这个常识库有自我学习、自我扩展的能力。

第四项有关推理引擎,它必须有效率的使用第一、二项的认知模型,及第三项的常识库,并能在资讯不足的时候找到可能性最高的答案,毕竟这个世界太复杂,变化太快,我们永远无法建立一个有100% 涵盖面的模型及常识库。

认知模型

DeepMind 强化学习的 DQN 演算法是一个无模型 (model-free) 架构,虽然它在特定的 Atari 游戏中,能表现出超越人类的训练结果,但是只要把环境稍作变化,它的效能马上大打折扣。例如打砖块游戏,只要把打击用的横棒稍微向上移一点,先前的训练好的模型就不适用了,表现得一塌糊涂。

要创造一个强固型 AI ,认知模型是系统内的必要元件。在认知心理学上,所谓的认知模型 (cognitive model) 是对於某一个对象 (object) 现况的了解,或者是说拥有了解这一个对象的相关知识,把这个知识表达出来,就是认知模型。一般来说,认知模型是随着时间及事件的发生逐步发展的,例如有人告诉你在书房里有一个空的书架,对於这个书架,你有了「它是空的」这个知识,存在於你的脑中的内在模型里。接着又被告知「某人放了一本书在架上」,你的内在模型随即修正,知道了它现在有两本书。以此类推,这个模型随着「上架」、「下架」等事件的发生,你的模型随之变化。

如前节所述,对於强固型 AI 系统最需要的突破,是能够藉由自动阅读如维基百科等自然语言文字段落,产生对应的认知模型(而非像 CYC 一般用手工打造)。然而目前投入在这方面的研究人员并不多,进展也非常有限。

最终,Marcus 希望(丰富的)认知模型能和逻辑推论引擎结合,创造出各式各样的推理行为。

後话

「AI 的未来十年」就介绍到此,这里也是此次铁人发文的最後一篇。第一次尝试参加铁人赛,连续 30 天发表确实是个很大的挑战,整个过程中「完赛」成了第一个最重要的目标,而发文的品质及深度,就无暇兼顾了,这是要好好检讨的地方。老头会抽空把这一段时间的发文再看一遍,把不详细或不够清楚的地方做些补强,以期这些发文,能真正的对有缘的 AI 人有实质的帮助。 

(注一):请参考 https://www.forbes.com/sites/cognitiveworld/2019/07/03/what-ai-can-learn-from-romeo--juliet/#6a7889411bd0


<<:  [Day 30] 颜色APP操作与结语

>>:  [day-29] U-net code 说明

网页盒子-30天学会HTML+CSS,制作精美网站

Box Model定义 每个html的元素都是一个Box Model,由外而内为外边距(Margin...

Day25 工具介绍:Bootstrap(一)

Bootstrap初学介绍 Bootstrap是目前响应式及行动装置网页设计,最知名的框架,提供了包...

如何把Spotify搜寻框加到自己网站?

请教各位高手,如这个卖纪念品的网站 https://myspotifyplaque.com/ 他可以...

DAY 13 资料库-建立并操作Heroku PostgreSQL

Heroku PostgreSQL是一种Heroku提供的PostgreSQL服务,可免费使用,免费...

【左京淳的JAVA WEB学习笔记】第十六章 分页功能(查询用户购买纪录)

後台 管理员能在後台页面查询用户购买纪录及明细 第一次进入此页面时无参数,在表单填入以下资讯後返回结...