KRR(知识表示与推理,Knowledge Representation and Reasoning)
Motivation动机
AI agent: intelligent behaviour achieved through computational meansAI智能体:通过计算手段实现智能行为
1.Requires access to knowledge需要访问知识
2.A way of representing this knowledge需要一种表示这些知识的方式
3.Finally, to be able to use the knowledge the agent will need to be able to reason about it (theoretical or epistemic reasoning)最后,为了能够使用这些知识,智能体需要能够对其进行推理(理论推理或认知推理)
Introduction(介绍)
- KRR(知识表示与推理,Knowledge Representation and Reasoning) 使用 知识表示 来描述世界的信息,然后应用 自动推理 以便查询这些知识并加以利用。 KRR uses knowledge representation to describe information about the world, and then applies automated reasoning to be able to query such knowledge and to put it to use。
- 知识表示形式的示例Examples of knowledge representation formalisms:
– 本体(Ontologies)、
– 形式逻辑(Formal Logics)、
– 规则(Rules)、
– 语义网络(Semantic Nets)等。 - 自动推理的示例Examples of automated reasoning:
– 推理引擎(Inference Engines)、
– 定理证明器(Theorem Provers)、
– 基于规则的系统(Rule-Based Systems)、
– 分类器(Classifiers)等。
- 知识表示形式的示例Examples of knowledge representation formalisms:
What is Knowledge? 什么是知识?
How can we express knowledge? 我们如何表达知识?
▶ Propositions are one way . 命题是一种方式
▶ Alice knows that Ubuntu is an operating system. Alice 知道 Ubuntu 是一个操作系统
Is knowledge always correct? 知识总是正确的吗?
▶ No, knowledge can be right/wrong, true/false 不,知识可以是对的/错的,真的/假的
Can discrete data be considered knowledge? For example, is the data
(4, 2, 9) knowledge? 离散数据可以被认为是知识吗?例如,数据 (4, 2, 9) 是知识吗?
▶ No, we need additional information that will turn the data into
knowledge不,我们需要额外的信息来将数据转化为知识
▶ In our example, we can say that (4, 2, 9) is the combination to our safe
deposit box 在我们的例子中,我们可以说 (4, 2, 9) 是我们保险箱的密码组合
How about beliefs?信念呢?
▶ Yes, beliefs are a form a knowledge. 是的,信念是一种知识形式
Therefore, knowledge associates some level of right/wrong or true/false to a piece of (semantic) information as viewed by one or multiple actors.
因此,知识将某种程度的对/错或真/假与某些(语义)信息相关联,而这些信息是由一个或多个行为者所看待的。
Why Knowledge? 为什么需要知识?
Complex systems require complex descriptions.复杂系统需要复杂的描述
▶ a chess playing program considering a move for the queen 一个国际象棋程序在为皇后考虑下一步时:
-
evaluation procedure using minimax returned a value of +7 for the position;
-
使用极小极大算法的评估过程为该局面返回了一个值 +7;
-
believes queen is in danger, but wants to keep control of the centre of the board
-
认为皇后处于危险中,但希望保持对棋盘中心的控制
▶ if these complex descriptions are not fully used by the system they can
be misleading and lead the user to think that system knows more than
it actually does
▶ 如果系统没有充分利用这些复杂的描述,它们可能会产生误导,让用户误以为系统知道的比实际更多。
What is Knowledge Representation? 什么是知识表示?
A symbolic way to represent knowledge and link relevant data 一种符号化的方法,用于表示知识并关联相关数据
Determined by a representation formalism 由表示形式主义决定
Why Representation? 为什么需要表示?
Knowledge needs to be formally represented in order to be used 知识需要被形式化表示才能被使用
It is integral for determining how the system behaves 它是决定系统行为方式的核心
What is Knowledge Reasoning?什么是知识推理?
Manipulation of knowledge symbols to produce new representations 通过操纵知识符号生成新的表示形式
No reason to list all existing knowledge if some of it can be inferred through reasoning
如果某些知识可以通过推理得出,就没有必要列出所有现有知识
Why Reasoning? 为什么需要推理?
Provides a link between knowledge and action 推理在知识与行动之间建立了联系
Simple database queries are not enough to inform actions in complex
systems 简单的数据库查询不足以为复杂系统中的行动提供信息
Thus we need a mechanism to manipulate symbols in order to arrive
at new ones 因此,我们需要一种机制来操纵符号,以得出新的符号
为什么需要推理?
- 推理提供了知识与行动之间的联系。
- 简单的数据库查询不足以为复杂系统中的行动提供信息。
- 因此,我们需要一种机制来操控符号,以得出新的结论。
推理的主要机制:推导和蕴涵(逻辑后果)Inferences and entailment (logical consequence) are usually the main reasoning mechanisms
-
推导(Inference)
描述如何从前提出发得出逻辑后果的步骤,通常以推导规则的形式描述。Inference describes the steps on how to move from the premises to logical consequences, usually described in the form of inference rules. -
蕴涵(Entailment)
描述当一个或多个陈述为真时,另一个陈述如何从它们推导出来的关系:Entailment describes the relationship between statements that are true when one statement follows from one or more statements:- 语法后果(Syntactic consequence,⊢): P 1 , P 2 , … , P n ⊢ P P_1, P_2, \dots, P_n ⊢ P P1,P2,…,Pn⊢P (当 P$ 对所有 P i P_i Pi 都可证明时成立)
- 语义后果(Semantic consequence,⊨): P 1 , P 2 , … , P n ⊨ P P_1, P_2, \dots, P_n ⊨ P P1,P2,…,Pn⊨P (当 P P P 对所有 P i P_i Pi 都为真时成立)
这在实际中有用吗?
AI与KRR的直接关联:AI is directly interconnected with KRR
- 语言理解(自然语言处理) understanding languages (natural language processing)
- 自动化规划 automated planning
- 认知/理性代理 cognitive/rational agents
- 游戏 games
- 图像识别 image recognition
- 专家系统 expert systems
知识 vs 数据,推理 vs 反应:Knowledge vs data, reasoning vs reacting
- 数据库中的数据缺乏语义意义,因此缺乏推理能力 Data in databases lack semantic meaning, and thus lack reasoning
- 基于知识的系统最适合处理开放式任务Knowledge-based systems are most suitable for open-ended tasks
- 可解释性(可解释的人工智能,Explainable AI) Explainability (Explainable AI)
- 调试 Debugging
- 添加新的知识关系变得容易 New knowledge relationships are easy to add
- 新的应用程序也更容易添加 New applications are also easy to add
题目
1. 知识表示与推理的基本概念
-
什么是知识表示(Knowledge Representation,KRR)?
知识表示是指使用符号或结构化的方法来描述世界中的知识,以便计算机能够存储、处理和推理。例如,知识可以通过命题逻辑、语义网、规则系统、或本体(Ontology)进行表示。 -
什么是知识推理(Knowledge Reasoning)?
知识推理是指基于已有知识推导出新的知识。它使用推理规则(如演绎推理、归纳推理、溯因推理)来生成结论。例如,给定事实“所有人都会死亡”和“苏格拉底是人”,推理系统可以得出结论“苏格拉底会死亡”。 -
知识表示和知识推理如何在人工智能(AI)系统中发挥作用?
AI 需要知识表示来存储信息,并通过推理来做出决策。例如,在专家系统中,AI 通过推理来诊断疾病或推荐解决方案。
2. 知识的定义与表达
-
什么是知识?如何与数据和信念区分?
- 数据(Data):原始的、未经解释的信息,如 “4, 2, 9”。
- 知识(Knowledge):赋予数据语义后形成的可解释信息,如 “4, 2, 9 是保险箱密码”。
- 信念(Belief):主体对某个事实的主观认知,它可能正确或错误,如 “我相信明天下雨”(但可能不是真的)。
-
以命题(Propositions)为基础的知识表达方式是什么?
命题是一种基本的知识表达方式,表示某个事实的真假。例如:- “Ubuntu 是一个操作系统”(正确)
- “太阳从西边升起”(错误)
-
知识是否总是正确的?如何判断知识的真假?
知识可以是正确的或错误的,真假取决于其与现实的对应关系。例如:- 事实:地球围绕太阳旋转 ✅
- 误解:太阳围绕地球旋转 ❌
3. 知识表示的形式与方法
-
目前有哪些主要的知识表示形式?请举例说明。
- 命题逻辑(Propositional Logic):使用逻辑符号表示知识,例如:
- “P → Q” 表示 “如果下雨(P),那么地面湿(Q)”。
- 谓词逻辑(Predicate Logic):扩展命题逻辑,如:
- “∀x Human(x) → Mortal(x)” (所有人都是会死的)
- 语义网(Semantic Network):使用图结构表示概念和它们的关系,如:
- “狗 → 是 → 哺乳动物”
- 规则系统(Rule-based System):如:
- “如果温度 > 30°C,则开启空调”。
- 本体论(Ontology):如医学本体,用于组织复杂领域的知识。
- 命题逻辑(Propositional Logic):使用逻辑符号表示知识,例如:
-
为什么知识需要以正式的方式进行表示?
- 便于计算机存储、查询和推理。
- 使知识可重用、可扩展,提高 AI 解释能力。
- 支持复杂系统中的自动推理,如医疗诊断或自动驾驶。
4. 知识推理的机制
-
知识推理如何通过符号操作生成新的知识?
知识推理使用推理规则,例如:- 演绎推理(Deduction):从一般原则推导具体事实(如 “所有人都会死 → 苏格拉底是人 → 苏格拉底会死”)。
- 归纳推理(Induction):从具体事实总结一般规则(如 “看到很多白天鹅 → 可能所有天鹅都是白色的”)。
- 溯因推理(Abduction):从结果推测原因(如 “地上是湿的 → 可能是因为下雨了”)。
-
何谓推理(Inference)与蕴涵(Entailment)?
- 推理(Inference):描述如何从已知知识推导新知识的过程,如使用归纳、演绎、溯因等方法得出结论。
- 蕴涵(Entailment):一种更严格的逻辑关系,表示当前知识库的所有情况都必须满足某个结论。
-
语法推理(Syntactic Consequence ⊢)和语义推理(Semantic Consequence ⊨)的区别是什么?
- 语法推理(⊢):基于规则和推导过程,比如通过公式转换得到结论。
- 语义推理(⊨):基于模型和事实,只要前提是真的,结论就必须是真的。
5. 知识表示与推理的实际应用
-
知识表示与推理在以下领域的应用有哪些?
- 自然语言处理(NLP)
- 语义解析:用于理解人类语言的含义,如 Google 搜索。
- 自动规划(Automated Planning)
- 机器人路径规划,如自动驾驶汽车选择最优路径。
- 专家系统(Expert Systems)
- 医疗诊断,如基于知识库的疾病分析系统(如 IBM Watson)。
- 认知/理性代理(Cognitive/Rational Agents)
- AI 助手(Siri, Alexa)使用知识库回答问题。
- 自然语言处理(NLP)
-
知识驱动系统相比于传统数据库系统的优势是什么?
- 数据库 仅存储数据,缺少语义关联,无法自动推理。
- 知识驱动系统 赋予数据语义,并通过推理自动生成新知识,增强 AI 的智能决策能力。
-
解释性人工智能(Explainable AI, XAI)如何与知识表示和推理相关?
- 传统 AI 算法(如深度学习)通常是黑箱模型,难以解释。
- 知识表示和推理提供了可解释的推理路径,使 AI 具备透明性和可审查性,如医疗和法律领域的 AI 需要解释决策过程。