Plan for Explaining Task Execution in CALO Introduction Questions ...

4 downloads 25704 Views 3MB Size Report
In order to buy a laptop, we will assume a very simple three step process. The first task ... Example Answer: I am trying to buy a laptop and I have completed the.
Plan for Explaining Task Execution in CALO Deborah McGuinness Paulo Pinheiro da Silva Knowledge Systems Laboratory Stanford University Stanford, CA 94305

Michael Wolverton Artificial Intelligence Center SRI International Menlo Park, CA 94025

Introduction The CALO system will include an end to end system capability that will allow CALO to provide explanations for its answers. This document focuses on explanations for taskoriented processing within the CALO system and describes a set of types of questions and answers. We include a set of general categories of task-oriented questions and answers. The questions and answers are instance of more general patterns which are also described. In order to provide concrete examples, we introduce a demo scenario concerned with laptop purchasing. Our specific example questions and answers utilize this scenario. We also include alternative answers so that we can describe a spectrum of answers and our approaches to providing these answers. We present an architecture for task-oriented explanation generation within CALO. Next we describe our strategy for interacting with the SPARK system in order to obtain the required information. Finally, we provide a view of task execution as inference.

Questions and Answers This document contains a categorization of questions and answers that are expected to be asked of CALO concerning task-oriented processing. The document has attempted to gather input from all of the concerned CALO teams and attempts to provide a structuring of the types of questions. The descriptions of the questions include: • a general question pattern • a set of answer strategies • an example question for each answer strategy • an example explanatory answer for each answer strategy In areas where we have engaged in more discussion, we have included graduated answer strategies that include more information and variations in answers. For example, one explanation might take the form of an abstraction of the plan being executed and another (more detailed) explanation may include more detail about the particular point in a plan and the particular task being executed. Choices between which strategy to use is made

either by specification from the user or system, or in the absence of such a specification, we consult a user model. For general reference, another document is in process with a broader collection of classes of questions expected to be asked of the entire end to end CALO system. This collection includes questions concerning descriptions and definitions, property information, location information, meta information/provenance, query plans, hypotheticals, comparisons, and summarizations.

Scenario The subject matter for the specific examples in the document has been chosen to be the laptop domain and our initial demos will be in this area. The top level task is that of buying a laptop. It is worth noting that we will use task and goal as synonyms in this document. We will not typically distinguish between high level (root) tasks, leaf tasks (no defined tasks that are more specific) and intermediate tasks (tasks that have a more general task defined in the task hierarchy and also more specific tasks defined). In order to buy a laptop, we will assume a very simple three step process. The first task is to get quotes. There is nothing that the system has to do before it is allowed to start getting quotes. The process requires three quotes (from three different sources) to be obtained. Thus, this subtask is only completed after three quotes are obtained. The second task is called “Get Laptop Approval”. Before this task can be started, the system needs to know that three quotes have been obtained. This task is completed when a particular form is signed (by a particular approval organization representative). The final task is called “Send Laptop Order to Purchasing”. Before this task can start, the system needs to know that the correct form was signed completing the “Get Approval” task. This task is terminated when a particular requisition form has been sent to purchasing. One can also not that typically the postcondition of a previous task is a precondition to the next task. A summary of this scenario is shown in Figure 1 below: Task: Buy a laptop Three subtasks required: • Get Laptop Quotes a. Precondition: --------------------------b. Postcondition: Three quotes obtained • Get Laptop Approval a. Precondition: Three quotes obtained. AND One quote is under $2500 OR special approval from manager of level 3 or higher must be obtained AND Laptop is not needed in a rush. b. Postcondition: Form XYZ signed • Send Laptop Order to Purchasing a. Precondition: Form XYZ signed

b. Postcondition: Requisition W sent to purchasing Figure 1: Laptop Scenario with subtasks, pre- and post-conditions Time-oriented questions will assume that calo can determine a time point for the beginning of tasks and the end of tasks. Some also assume that calo can infer time periods from time points.

Task-Oriented Questions and Answers This section has a categorization of questions that was useful for our grouping and structuring of questions. Note that these categories are not hard and fast and many questions could be placed in multiple categories. 1. Motivations for Tasks (Initial Focus Area) Question A: Why are you doing ? Answer Strategy 1: Identify requestor Example Question: Why are you trying to buy a laptop? Ex. Answer: Sally told me to. Note: This strategy may be most useful when task is a root task and thus not in service of other tasks. Answer Strategy 2 Provide an abstraction of the task plan. Specifically, state I am trying to do and is required to accomplish that. Variation: mention all the subtasks at the current subtasks level required to accomplish the supertask. Example Question: Why are you doing ? Example Answer: I am trying to by a laptop and get approval is one subtask in the process. Answer Strategy 3: Expose precondition. Specifically, the reason CALO is doing some task is that its preconditions have already been met so identify the precondition tasks that have been completed. Example Question: Why are you doing ? Example Answer: I am trying to buy a laptop and I have completed the previous requirement to get quotes so I am now working on get approval. Alternative Answer: (expose more information). I am trying to by a laptop and I have gotten approval from the system admin to obtain quotes.

Answer Strategy 4: Identify termination conditions not yet met. Specifically, bind any termination requirements not yet satisfied and reveal them to the user. Example Question: Why are you doing ? Example Answer: I am trying to by a laptop computer and I can only do it if I have a form signed by the contracts office and I do not have it. Example Question: Why are you (still) doing ? Example Answer: I am trying to buy a laptop computer and I can only stop after obtaining three quotes. I only have 2 quotes. Example (Verbose) Answer: I am trying to buy a laptop computer and I can only stop after obtaining three quotes. I only have two quotes (from Dell and Sony) and I have asked for quotes from Toshiba and IBM and have not received a response. Issues for Answer/Explanation presentation: How to prune? • Do you give all of the failed termination conditions? Probably yes if small number • Do you give all of the preconditions met? maybe yes if small number • How much detail do you provide How to exploit user context in combination with preferences? • Variations on Task Motivation Questions: a. Question: What goal or goals is this in service of? Answer strategy: Abstract up the task hierarchy (answer strategy 2 above) Example: Why are you getting a quote for a laptop? Example Answer: I am trying to purchase a laptop. Example Follow-up question: Why are you doing the next most general task? Answer strategy 1: Keep abstracting up the hierarchy one step at a time Answer strategy 2: Move up the hierarchy to previously annotated tasks that are known to be typically important, or important to users in some context. b. Question: What conditions exist that allow you to do some task? Answer Strategy: List preconditions and state that they are met (answer strategy 3 above,) Example Follow-up question: “why are those the preconditions?” Answer strategy 1: expose meta information on preconditions. Answer strategy 2: expose dependencies between preconditions c. Question: Why do the conditions not exist to terminate this task?

Or why are you still doing this task? Answer Strategy: identify the termination conditions that are not met yet (answer strategy 4 above). Example Follow-up questions: How can I achieve the termination conditions? What preconditions of the termination conditions are not met? 2. Task Status a. Question: What are you (CALO) doing? Answer Strategy1: Name the current task Example 1: I am getting laptop quotes Answer Strategy 2: Describe the current task by stating what it is in service of. Example 2: I am getting quotes for a laptop in an effort to buy a laptop for Deborah. Answer Strategy 3: State top level task highlighting any stalled goals (or any goals taking longer than expected) Example 3a: I am trying to buy a laptop and get laptop quotes is stalled. Example 3b: I am trying to buy a laptop and get laptop quotes was expected to complete 2 days ago. Follow-up should take directional changes (stop trying to get a quote from Toshiba) as well as getting finer granularity on goal or subgoal. b. Question: What is the status of task ? Answer Strategy 1: Return an answer from a predefined set of values (Done, in process, waiting (for completion of task y)). Example Question: What is the status of get laptop quotes? Example Answer 1: In process Answer Strategy 2: Provide details relative to progress meeting termination condition. Example Answer 2: I have quotes from Toshiba and IBM and have asked for a quote from Sony. c. Question: Are you having trouble completing task ? Answer Strategy: Check duration on current task with anticipated length of current task, and if duration exceeds anticipation, report it. Example Question: Are you having trouble completing ? Example Answer: I asked for a quote from IBM which usually takes 10 minutes and I have been waiting 2 hours. d. Question: Are you having trouble completing any task? Answer Strategy: Check all current tasks in process and compare current length with anticipated length. Report tasks that are not completed yet that are over the expected time requirement.

Example Answer: On the laptop purchase for Paulo, I am waiting longer than anticipated for a quote from Dell. On the laptop machine for Michael, I am waiting longer than anticipated for approval from Ray. 3. Task History a. Question: What have you done? (Paraphrase: What tasks have you finished recently? Where recently is user definable either in terms of number of tasks or in terms of time.) Answer Strategy 1: List recent top level completed tasks. Example Question: What have you done recently? Example Answer: I purchased a laptop for Paulo. Answer Strategy 2: List current top level task and completed subtasks within that task. Example Question: What have you done recently? Example Answer 2: In trying to purchase a laptop for Deborah, I got quotes and have not finished get approval yet. Answer Strategy 3: Summarize top level tasks completed. Example Answer 3: I purchased 3 laptops (for Paulo, Michael, and Deborah) and I scheduled 2 meetings (one for Deborah and one for Michael). Answer Strategy 4: Provide a report of completed tasks. Example Answer 4: Customizable table including main tasks Task Subtask Laptop purchase for Paulo Quotes from Dell, Toshiba, IBM Task (purchase laptop) Differentiator (for Paulo) Date completed (October 25, 2004) b. Question: What have you started recently? Answer Strategy 1: List top level tasks started. Example Answer 1: I am trying to buy 2 laptops (for Paulo and Michael). Answer Strategy 2: List top level tasks and subtasks. Example Answer 2: I am trying to buy a laptop for Paulo and have obtained quotes and have not received approval and I am trying to buy a laptop for Deborah and I have not obtained three quotes yet. c. Question: Why did you do ? Comment: Often the implicit translation of this question is “Why did you do X instead of the (more commonly done) Y?” System needs to infer

when the user is likely not asking for a description of the goal dependencies and precondition dependencies. Answer Strategy 1: Check a statement for anything that is not typical and report differences. Example Question: Why did you get approval from David Israel? Comment – note that David Israel is not the “normal approver” Bad Answer: I am trying to buy a laptop, and approval is required for buying a laptop, and the approval process follows the quotes process, and the quotes process was complete. Example Answer: The typical approver (Ray Perrault) was unavailable and David Israel was a substitute approver. Answer Strategy 2: Identify failure modes and report failures and workarounds. Example Answer 2: I tried to get approval from Ray Perrault (for xx time duration) and failed. I succeeded in getting approval from David Israel. d. Question: Why didn’t you do in the context of task ? Answer Strategy: Trace back to the condition that would have allowed , and explain why it wasn’t met. Example Question: Why didn’t you get a quote on an IBM Thinkpad? Example Answer: I received a response from the IBM web site (in response to my request for a quote), but I was unable to interpret it. Example Question: Why didn’t you get approval from Ray Perrault? Example Answer: He failed to respond within my time limit of two days (Calo may also know that he was on vacation and could report this). e. Question: How did you do ? Answer Strategy: State the sequence of subtasks performed to achieve . Example Question: How did you do get quotes? Example Answer: I sent quote requests to the vendor websites for: Toshiba, Sony, Dell, and Gateway. I received responses from all of vendors. I was able to extract a quote from all but Gateway. f. Question: How did you circumvent the typical constraint

? Answer Strategy: State the conditions that must be met to avoid

, and the sequence of subtasks taken to establish those conditions. Example Question: How did you circumvent the constraint that laptop cost should be under $2500? Example Answer: I obtained a signed budget approval form (for the IBM TL1300 cost of $3200).

g. Question: Which task could you not complete on ? Answer Strategy: list subtasks not completed at end of time period or time point. Example Question: Which task could you not complete yesterday? Example Answer: I was trying to complete the following tasks: Get a second quote for laptop Sony Vaio Get a first quote for laptop IBM ThinkPad h. Question: Why could you not complete on ? Answer Strategy 1: Expose postcondition Example Question: Why could you not get laptop quotes for Paulo’s laptop purchase yesterday? Example Answer: I could only buy a laptop if I had a form signed by the contractors office and I did not have it. 4. Task Plans a. Question: What are you doing next? Answer Strategy1: Identify tasks supporting the same higher level task type that have the current task as a precondition. Assume that you are getting quotes which is a subtask of purchase a laptop. Example Question: What are you doing next (or what are you doing after getting quotes)? Example Answer: I will be getting approval to purchase the laptop. b. Question: When will you start task ? Answer Strategy 1: Provide a relative answer identifying the precondition(s) needed to complete prior to task Example Question: When will you send the laptop order to purchasing? Example Answer: After I have approval to purchase. (I have obtained three quotes). Answer Strategy 2: Provide a time estimate based on meta information or statistical information about time required to complete preconditions not yet satisfied. Example Question: When will you send the laptop order to purchasing (for Deborah’s laptop)? Example Answer 2: I still have to obtain approval to purchase which typically takes 2 days. (after three quotes are obtained, one of which is under $2500). c. Question: Why do you expect to do task next? (This is most likely a follow-up to question a., “What are you doing next?”.)

The answer here will depend on CALO’s planning approach, if any. Some possibilities: Answer Strategy 1: Assumes CALO is using a classical AI planning approach. The answer traces through expected effects and preconditions in the next portion of the plan. Example Question: Why are you getting approval next? Example Answer: At the end of my current task, I expect to have three quotes for laptops. Once we have the quotes, the only remaining requirement before sending the purchase order is getting approval from management. Answer Strategy 2: Assumes CALO has no explicit planning capability aside from a procedural reasoning system such as SPARK. The answer is based on determining the usual course of action from situations similar to the current one. Example Question: Why are you getting approval next? Example Answer: I’m currently finishing obtaining quotes. In purchases of laptops less than $2500 and which require no rush, the typical next step is to obtain approval from management. d. Question: How will you do task ? Answer Strategy 1: Regardless of whether CALO is using a planner or whether we construct an expected “plan” by analyzing past examples, the approach here is to describe the subtasks below in the plan, possibly including the distinguishing conditions that lead to that particular expansion. Assume that laptops needed in a rush and being purchased with project funds require only the approval of the project PI. Example Question: How will you get approval? Example Answer: (Because this laptop is being purchased with project funds, and because it is needed in a rush, approval from management is not required.) I will request approval from the project PI, Michael Wolverton.

5. Task Ordering a. Question: Why are you doing task before task ? Answer Strategy 1: Identify if there is a direct precondition relationship between the tasks and if so, note it. Example Question: Why are you doing get laptop quotes before get laptop approval? Example Answer: Get Laptop Approval requires three quotes to be obtained before the process can start.

Answer Strategy 2: Identify if there is an transitive precondition relationship between the tasks and if so note it. Example Question: Why are you doing get quotes before sending the order to purchasing. Example Answer: Sending a request to purchasing requires obtaining approval which requires getting laptop quotes. b. Question: Why have you not started task yet? Answer Strategy: Identify unmet preconditions Example Question: Why have you not sent the request to purchase Deborah’s laptop to purchasing? Example Answer: I am waiting for approval. (Quotes have been obtained and the request for approval was sent yesterday.) c. Question: What do you still need to do before completing task ? Answer Strategy 1: Identify direct preconditions not yet completed and report them. Example Question: What do you still need to do before sending the laptop order over to purchasing? Example Answer: I need to get approval to order it (from xxx). Answer Strategy 2: Identify direct and transitive preconditions not yet completed and report them. Example Answer 2: I need to get approval to order it and prior to that I need to obtain three quotes. 6. Explicit Time Questions a. Question: When will task y begin? Answer Strategy 1: Provide a relative answer that is after the preconditions are completed: Example Question: When will get laptop approval begin (for the purchase of Deborah’s laptop)? Example Answer 1: After I have obtained three quotes where one costs under $2500 or I have approval to spend more from a manager of level 3 or above. Answer Strategy 2: Provide a time estimate based on meta information or statistical information about time needed to complete tasks. Example Question: When will get laptop approval begin (for the purchase of Deborah’s laptop)? Example (abstracted) Answer: Probably in 2 days. Example detailed answer: Required tasks uncompleted of getting laptop quotes typically take 2 days. (However, if this process requires special approval for a laptop costing more than $2500, it may take 4 days.) b. Question: When will task end?

Answer Strategy 1: Provide a time estimate based on meta information or statistical information about time needed to complete tasks. Example Question: When will get laptop quotes end? Example Answer: Typically one can obtain three quotes in two days. Alternative Answer: Typically one can obtain three quotes in two days, but since you asked for a quote from IBM and I have had trouble on the last two quotes from IBM, it may take longer. Answer Strategy 2: If termination condition is non-obvious and not met, expose the termination condition. No examples in this scenario expose this since all termination conditions are basically the same as the task. c. Question: When did task happen? Answer Strategy 1: Locate task x on the timeline and report time point: Example Question: When did you send the laptop request for Deborah’s laptop purchase to purchasing? Example Answer: On October 31, 2004 at 10am. Answer Strategy 2: Provide a relative answer identifying the preconditions that were completed before this task. Example Answer 2: After I obtained three quotes (completed on October 29), and received approval (on October 30), I sent the laptop request to purchasing (on October 31). d. Question: How long did it take you to complete task ? Answer strategy 1: Take time point associated with initial request for task y and time point associated with (the last) termination condition for task y and subtract. Example Question: How long did it take you to order Deborah’s laptop. Example Answer: 4 days. Answer strategy 2: Same as strategy 1 but expose time points in answer. Example Answer: I received the request on Monday and completed the purchase on Friday. e. Question: Why did task take so long? Answer Strategy: Find among ’s ancestors the subtasks that took longer than expected (based on meta-information or statistical information), and describe the discrepancy. Example Question: Why did getting approval take so long? Example Answer: To get approval, I need an assistant to fill out the approval form and a member of management to sign it. Filling out the approval form is

normally completed within 1-4 hours of my sending of the request, but in this case, it took two days. (Ideally, CALO could explain the reason for the discrepancy as well – e.g., “Valerie Valdez was sick” – but it’s not clear whether or where it would get such information.) f. Question: Why are you doing task already? Answer strategy: This is the flip side of d. above. Find among past subtasks the one(s) that took shorter than expected and describe the discrepancy. Example Question: Why are you sending the purchase order already? Example Answer: An earlier task, Get Approval, took much less time than expected. Normally, Obtain Management Signature takes 24 hours; with this purchase, however, it took only 10 minutes.

Architecture The CALO Query Manager, KSL’s IW Explainer, and SRI’s SPARK engine are the three main building blocks for explaining task-related questions, as presented in Figure 1. User questions are received through the CALO Question Understanding Dialog component in the form of queries. Query explanations are delivered to users as answers through the CALO Answer Presentation component. CALO may accept a broad range of question types including task-related questions, i.e., “what are you doing now”. We will provide a specification of questions related to task explanation that the Explanation Planning component will be able to handle. From this specification, the Query Manager would forward explanation-related queries to the Explanation Planning component. Inside the Explanation Planning, the Explainer Dispatcher will forward task-related queries to the “Task-oriented Explainer” which is an extended version of Inference Web’s Explainer.

Figure 1 - Task explanations in CALO

By analyzing the type of a new question and inspecting its log of questions, Taskoriented explainer can figure out whether task-related questions are or not related to previous questions. If the question is unrelated to previous questions, it is called a starting question. Otherwise, it is a follow-up question in the context of the last starting question submitted to the Explainer. The raw content that is required for explanations for task-related questions is generated from information coming from SPARK. Thus, a new wrapper based on SPARK’s internal methods is proposed to extract task data and to store the data in some persistent format, as shown in Figure 1. The process of generating new task data is triggered by an initial question, which results in the Task-related explainer submitting a data request to SPARK. For follow-up questions, the Task-related explainer may not need to send new data requests to SPARK since explanations for follow-up questions are produced from existing task data. The Task-oriented explainer process of producing answers may consider a number of explanation strategies and make its selection according to user preferences. The explainer and other CALO components learning user preferences constantly maintain a repository of user models. Explanations are then forwarded to the answer presentation.

Strategies and Execution System Starting Point This section describes a first cut, high-level design for the portion of Figure 1’s SPARK Wrapper that is concerned with Task Motivation questions – i.e., question area 1 from the “Task-Oriented Questions and Answers” section above. The wrapper is designed to

convert the current internal state of SPARK into an explanation-friendly set of inference steps. We only outline the high-level problem here; a more detailed design is outlined in the working document “Generating Explanatory Proofs from SPARK: A Preliminary Design.” The general approach is to break down the answer to a “Why are you doing X?” question into three complementary strategies: • • •

Abstraction-based: Demonstrate that fulfilling X will further one of CALO’s high-level goals, which the user already knows about and accepts Precondition-based: Demonstrate that the conditions necessary to start X were met at the time X started Termination-condition-based: Demonstrate that one or more of the conditions necessary to terminate X has not currently been met.

This list is not exhaustive; there are other possible strategies that may prove useful in the future. For example, a control-based strategy could be used to justify why the execution system has chosen a particular branch of the abstraction tree over other candidates. More concretely, here is the problem: Goal: Answer the user question “Why are you doing CUR_TASK?” Inputs: 1. CUR_TASK, the currently executing task that is to be explained. CUR_TASK doesn't have to be at the lowest level of abstraction, but can be at whatever level of abstraction that the user wants. Outputs: 1. Sequence of inferences that "proves" that CUR_TASK is supposed to be executing now. The basic approach here -- i.e., the last step in the "proof" -- is the implication a) CUR_TASK is in service of one of CALO's top-level goals, and b) All the preconditions of CUR_TASK have been met, and c) CUR_TASK's termination conditions have not been met Implies CALO should be performing CUR_TASK. Producing the proof of a), b), and c) in the outputs requires a) traversing the goal tree in SPARK’s intention structure to extract a path of task/subtask relationships between CUR_TASK and one of CALO’s top-level goals; b) returning the preconditions of the

SPARK procedure that created CUR_TASK, as well as all the tasks that were ordered before CUR_TASK through seq relations; and c) returning the unmet preconditions (if applicable) of the procedure that created CUR_TASK.

Suggest Documents