CMSI 485 - Preparation for the Final ======================================================================= First, an overview of AI. After that, well, maybe we'll talk about the kinds of questions you will see on the exam. *********************************************************************** * * * OVERVIEW OF ARTIFICIAL INTELLIGENCE * * * *********************************************************************** AI is the study of intelligent agents AI is both - science (what is intelligence?), and - engineering (how do we build intelligent systems?) AI is an incredibly interdisciplinary field AI has excited, or at least given work to, philosophers Agents can be animals, robots, softbots, etc. An agent senses and acts An agent may think (deliberate, plan, etc.) before acting Acting without thinking is called reacting Agents can be deliberative and reactive at different times Acting is often done to achieve a goal, or at least maximize the value of a utility function Some agents have a knowledge base in which they build models of the world as they perceive it Some agents can learn An intelligent agent can be defined as one that might - do tasks commonly associated with human "intelligence" - solve (some) problems the way a human would - do things at which humans are better than computers - act kind of like a human - do things that appear to come from thoughtful contemplation - act based on what it knows in such a way as to do the best thing for itself - cleverly find good approximations to intractable problems - make someone believe (even fleetingly) that he or she is dealing with a sentient being - respond to sensory inputs in a life-like way - exhibit characteristics such as learning, decision-making, and planning Intelligent systems have been built for Game playing, handwriting recognition, data mining, text and image search, theorem proving, driving cars, flying aircraft (planes, helicopters, drones), landing planes, diagnosing diseases, answering questions, writing stories, composing music, correcting spelling and grammars, exploring planets, exploring the deep sea, removing landmines (and biohazards and nuclear waste), investing, scheduling, underwriting insurance, detecting credit card fraud, helping the handicapped, giving legal advice, grading essays, finding new drugs, analyzing consumer behavior, finding criminals, optimizing factory performance, optimizing inventories, performing surgeries, monitoring the environment, detecting steganography, detecting spam, cracking ciphers, translating language, planning military operations, spying, controlling traffic. +------------------------------------------------------------------+ | Rational agents act in a way that maximizes the expected value | | of their utility function | +------------------------------------------------------------------+ The design of a rational agent requires * A well-defined performance measure (a.k.a. utility function) whose average expected value can be maximized over possible outcomes of an action * A knowledge base, with operations to add knowledge to it and ask questions of it * An algorithm to choose actions based on sensory inputs, augmented with planning (deliberative decision-making) and learning capabilities * A communication mechanism for actually receiving percepts and controlling actuators; this may include vision, robotics, and speech recognition and synthesis AI can be organized into several areas 1. Study of task environments (PEAS) 2. Formulation of problems (nodes are states, edges are actions) 3. Solution of problems (by search or constraint satisfaction) 4. Representation of knowledge 5. Use of logical and/or probabilistic inference 6. Making of decisions based on utility 7. Learning 8. Communication 9. Perception 10. Robotics 11. Philosophy, ethics, and the future of AI 1. AGENTS AND THEIR ENVIRONMENTS -------------------------------- Agent has sensors, actuators, knowledge base, agent program Agent program implements the agent function Agent function maps percept history to action PEAS (P)erformance measure (E)nvironment (A)ctuators (S)ensors Environment metrics fully observable - partially observable deterministic - stochastic episodic - sequential static - dynamic discrete - continuous single agent - multi agent 2. PROBLEM SPACES ----------------- Almost any task can be defined as finding a solution in a problem space Problem defined by six things: 1. Set of all states 2. Set of all actions 3. Successor function: state -> (action x state)* 4. Start state 5. Goal test function 6. Path cost function Examples: Vacuum world Water jug Eight puzzle Fifteen puzzle Twenty-four puzzle Chess Kalah Road navigation in Romania Robot navigation ...zillions more 3. BASIC PROBLEM SOLVING ------------------------ The solution to a problem is almost always - a path to a goal state (when we know exactly what the goal states are) - a goal state (when we don't) Offline vs. online problems Belief states and sensorless problems Contingencies Satisficing vs. optimizing Search Trees Nodes have five attributes state action parent depth cost How search trees are built difference between generation and expansion How to describe the complexity of a search algorithm branching factor (b) depth (d) maximum depth (m) What makes search algorithms faster pruning not revisiting states Uniformed algorithms Breadth-first Depth-first with cutoff with iterative deepening Uniform-cost Backtracking vs. depth-first expansion Completeness Optimiality Checking goals at expansion time is sometimes necessary for optimality Heuristic search algorithms Algorithms Best-first Greedy A* Memory issues IDA* RBFS MA* SMA* Local Hill climbing Beam Simulated Annealing Genetic Algorithms Constraint Satisfaction Defining them Incremental vs. complete state formulations Specification of each Complexity The importance of variable ordering Minimum Remaining Values Least Constraining Value Forward Checking Constraint Propagation Local Search for CSPs Adversarial Search Games Simple two-player, turn-taking, zero-sum games Why games are worthy of study deterministic vs. non-deterministic perfect vs. imperfect information Minimax Alpha-beta pruning Weighted evaluation functions How to make search efficient in practice - ordering - learning - no repetition - opening books - endgame solutions - iterative deepening when timed 4. KNOWLEDGE REPRESENTATION --------------------------- We need a nice concise language Natural language ill-suited to this task - ambiguity - problematic pronouns - elided context - needs massive preexisting database of commonsense information First order logic is good Other representations exist (semantic nets, etc.) Syntax and semantics of propositional logic Syntax and semantics of predicate (first-order) logic FOL adds individuals, functions, predicates, quantification Need to be able to talk about ontology, categories, objects, composition, aggregation, inheritance, actions, situations, events, states, time (tenses, intervals), belief, processes, relationships, fluents, possible worlds, modalities, etc. Upper ontology: hierarchy (taxonomy) of categories Predicates on categories Member Subset Natural Kinds Physical Composition Measurements ** Things vs. Stuff ** Events: chunks of space time Situation Calculus Event Calculus Frame problem, qualification problem, ramification problem Mental Events and Objects Knowledge, Belief, Time, and Action Reification - turning propositions into beliefs 5. INFERENCE ------------ Inference is the use of knowledge to gain new knowledge It can also be defined as the computation done to answer questions posed to a knowledge base Logical Inference - when in a certain world Probabilistic Inference - when there is uncertainty Logic - the study of reasoning, primarily, of inference. It also covers entailment, causality, consequence, induction, deduction, truth, falsity, belief, fallacies, paradoxes, probabilities, analysis, tense, modality, necessity, sufficiency, possibility, justification, tolerance, obligation, permission, relevance, assertion, validity, contradiction, provability, and argumentation. - has syntax, semantics, inference rules - soundness, completeness, consistency, decidability - Kinds: classical, intuitionistic, relevance, modal, non-monotonic Logical Inference Model Checking Resolution requires conversion to CNF FOL resolution involves unification and skolemization Forward Chaining Backward Chaining Closed worlds vs. open worlds Negation as failure Probability - the best way to deal with uncertainty - partially observable environments - noisy sensors - uncertain outcomes - logic doesn't do well with uncertainty - allows us to formalize "highest expected utility averaged over all possible outcomes" Random variables, domains, propositions, atomic events, Prior vs. Posterior Probability (a.k.a unconditional vs. conditional) Definition of conditional probability P(a /\ b) P(a|b) = ---------------- P(b) Axioms of probability 0 <= P(a) <= 1 P(true)=1 /\ P(false)=0 P(a \/ b) = P(a) + P(b) - P(a /\ b) ** The full joint distribution can be used to infer the probability of anything in the world ** But it's generally space prohibitive So look for independence! If you can't get full independence, conditional independence is usually good enough anyway Bayes' Rule P(a|b)P(b) P(b|a) = -------------- P(a) Super useful in AI. Good for diagnostics! Diagnostic knowledge is very brittle, but causal knowledge is good. This allows you to compute diagnostic probabilities from causal ones. When combined with conditional independence, we get powerful strategy. Bayesian Network (a.k.a. Belief Network, Causal Network) A DAG in which each node is a random variable A points to B if A can be considered a cause of B Each node contains a conditional probability distribution P(n|parents(n)) See text, Ch. 14.1, 14.2 6. DECISION MAKING ------------------ One-shot (episodic) vs. Multi-step (sequential) decision making Ch. 16 is episodic, simple, decision making Ch. 17 is sequential, complex, decision making Utility Theory +----------------------+ | TODO: Chapters 16-17 | +----------------------+ 7. LEARNING ----------- The use of percepts to improve the agent's ability to act in the future. Range of learning From "Trivial memorization of experience" to "Creation of entire scientific theories" Four kinds of learning covered in text: Ch 18: Inductive Learning (from observations) Construct a function that matches the I/O behavior observed in the data Ch 19: The use of knowledge in learning - How should prior knowledge be used? Ch 20: Statistical Learning - How do we learn the probabilistic theories of the world from experience? In other words, where did those probabilities come from? Ch 21: Reinforcement Learning - How do agents learn from success and failure? - From reward and punishment? 8. COMMUNICATION ---------------- The intentional exchange of information via the production and perception of signs, drawn from a shared system of conventional signs Language: complex system of structured messages Speech Acts - Query - Inform - Request - Acknowledge - Promise Steps in Communication 1. Intention 2. Generation 3. Synthesis 4. Perception 5. Analysis 6. Disambiguation 7. Incorporation +----------------------+ | TODO: Lots more here | +----------------------+ 9. PERCEPTION ------------- Main forms are speech recognition and computer vision +----------------------+ | TODO: Lots more here | +----------------------+ 10. ROBOTICS ------------ Robots are working today in industry, agriculture, hazardous environments, transportation, hospitals, transportation, entertainment Sensors: one-bit, n-bit, dirt detector, eye, ear, microphone, tactile (skin, whiskers), range finders, bump sensors, GPS, radar feedback, ultrasound feedback, radio, infrared, camera.... Effectors: legs, wheels, joints, grippers, tracks, thermal effectors, propellers, turbines, thrusters Robot types - manipulators - mobile - hybrid Structural Issues: Types and placement of sensors, effectors, processing units Physical composition Degrees of freedom Holonomic vs. non-holonomic Differential vs. synchro drives Dynamic vs. static stability Other Issues: noisy sensors, uncertainty, mechanical breakdown Three sensor types - Range finders - Imaging sensors - Proprioceptive sensors (measurements on the robot itself) shaft decoders, odometers, inertial, force, torque Perception - Localization - Mapping - Other sensing: hearing, smelling, measuring temperature Localization Where things are Tracking, global localization, kidnapping problem Monte Carlo localization (particle filterning) Workspace vs. Configuration Space Workspace has unattainable coords (from linkage constraints) Configuration space good for planning Kinematics and inverse kinematics Configuration space divided into free space and occupied space Motion planning - two approaches 1. Cell decomposition methods - regularly spaced grid: simple but incomplete - further decomposition (maybe octree): doesn't scale - exact cell decomposition: very hard - potential fields: avoid bumps 2. Skeletonization - Vornoi graph - Probabilistic roadmap Uncertain motion planning Motion dynamics controllers P PD PID Potential Field control Reactive control Architecture Subsumption (historical) Three-layer (modern) Recent improvements in technology: low-cost, hi-res cameras MEMS (micro-electromechanical systems) mini accelerometers gyroscopes flying insects 11. PHILOSOPHY, ETHICS, AND FUTURE OF AI ---------------------------------------- Weak AI: agents acting as if they were intelligent (simulating thinking) Strong AI: agents that actually *are* thinking, agents that actually have minds Weak AI has been demonstrated Most engineers don't care about strong AI; philosophers do "Can machines think?" is not a well-defined question! - "Can machines fly?" -- yes - "Can machines swim?" -- prolly not, boats and submarines don't move that way - What does it mean to think, anyway? Arguments against machine intelligence Disability Turing foresaw 16 claims of "computers could never do X" but many aren't true. See text, problem 26.1. Mathematical - some people think machines are subject to the limits of Godel's incompleteness theorem but humans are not - this objection has three flaws - computers are finite anyway - who cares if something can't prove something that others can? (Lucas can't prove this: "Lucas cannot consistently assert this sentence is true" but everyone else can!) - no way to prove humans aren't limited by Godel's theorem! (text, page 950) Informality "Humans are far too complex" Dreyfus makes these kinds of arguments - Dennett has good counter arguments - Text, p. 952 also counters Strong AI: Is a machine really thinking? Does it have real experiences? Real intentions? Is it conscious? Do we care? Is artificial insemination insemination? Is artificial urea urea? Are artificial sweeteners sweeteners? Is an artifical leg a leg? Is an artificial Monet a Monet? Is artificial Chateau Latour wine Chateau Latour wine? Is an artificial flower a flower? The point seems to be functionality vs. pedigree Not sure about how intelligence fits in there What about artificial minds? Searle's objection: computer simulation of a storm doesn't make you wet so why should simulated mental processes be mental processes? But: - computer simulation of a chess game *is* a chess game - fake storm on a movie set does make you wet More fun with Strong AI - Mind-body problem - Brain in a Vat - Bran Prosthesis Experiment - Chinese Room Ethics - Loss of jobs due to automation - Too much leisure time - Too little leisure time - Loss of sense of uniqueness - Loss of privacy rights - Loss of accountability - End of human race; machines take over: transhumanism Future Is a truly general purpose intelligent agent possible? They would need - phenomenal sensory capabilities - powerful knowledge representation schemes - ability to handle uncertainty - powerful learning algorithms (hierarchical reinforcement) - reliable actuators and effectors Hot topics Hybrid agent architectures Compilation of deliberation into reflex Real-time AI Anytime algorithms Decision-theoretic metareasoning Reflexive architectures Benefits and Risks Will AI have a big impact? like printing sewers indoor plumbing internal combustion engine nuclear power genetic engineering nanotechnology space travel mass communication (Internet, cellphones) So far benefits seem to have outweighed the risks inventory control hazardous waste cleanup support for the handicapped more accurate surgeries worker displacement from low paying jobs creation of high paying jobs Risks Autonomous weapons Total surveillance