From: AAAI-84 Proceedings. Copyright ©1984, AAAI (www.aaai.org). All rights reserved. LEARNINGPROBLEM CLASSES BY MEANS OF EXPERIMENTATION AND GENERALIZATION AgustlnA. Araya Departamentode Cienciade la Computacibn P. UniversidadCatolicade Chile Casilla 114-D,Santiago, Chile ABSTRACT We discuss a method of learning by practice based on the idea of determining classes of problemsthat can be solved in simplifiedways, A description of a class is obtainedby processes that hypothesize descriptions, generate and classify problem variations, and test the hypothesesagainstthem. The approach has been implementedin a system that learns by practicein a domain of elementaryphysics. The system has two main components, a Problem Solver and a LearningAgent. The Problem Solver handles the problemsin the domain and the LearningAgent does the actual learning. To perform its tasks the Learning Agent utilizes algorithms,heuristics, and domain knowledge,and for this reason it can be regarded as an expert system whose expertise resides in being able to learn by experimentation and generalization. 1. We report researchon a method of learningby practice that provides these capabilitiesto a certaindegree. The method is embodied in a system called DARWIN that functionsin a domain of elementary physics in which interacting ideal rigid bodies are in equilibrium. Startingwith a generalmethod of solving problemsin the domain, the system learns problem classes and their correspondingspecializedmethods of solution by means of experimentationand generalization. This presentation is organized as follows: after characterizingthe problem under study an overview of the learningapproachis given, the processes used to obtain a descriptionof a problem class are explained,and some of the limitations and difficultiesencounteredare discussed. 2. THE PROBLEM In the descriptionof the ISAAC system [IO], that solves physics problems stated in natural language,it was noted that for some of the problems that it solved a human expert would have produceda simpler solution. This observation lead us to considerthe followingsituation. Let us suppose that a system has a generalmethod for solvingproblemsin its domain. One of the things it can learn by practice is that there are problems that can be solved in simplifiedways, that is: INTRODUCTION In recent years learning has been increasingly recognized as an importantarea for Artificial Intelligence research ([61,[11lL While human expert behavior is characterizedby the abilityto increaseexpertiseby learning in the course of solving problems,current expert systems lack many importantcapabilities in this respect: i> They are not capable of analyzing their own solutions, and thus, they cannot determine if a solutioncan be *‘improved” (e.g., by simplifyingit). ii) They don’t try “mental experiments”,that is, imaginaryproblemsin which they could apply new methods or heuristics that might improvetheir problem solvingcapabilities. iii) They are not capableof remembering. If they are given a problem similar,or even identical,to one previouslysolved, they will not recognize this fact and will repeat the solutionprocess. IF problembelongs-toproblem-classj THEN use special-methodj Thus, two things must be learned: a description of a problem class and its correspondingspecialmethod. One way of doing this is by applyinga deductiveapproach. If the system had a theory of the domain it could deduce that for problemshaving certaincharacteristicsa simplifiedsolutioncould be obtained. In this paper, on the other hand, we take an empirical approachin which the system tries to determine descriptions of problem classes by performing experiments. Thus, a theory of the domain is not necessary and this represents an important advantage because the experimentation and generalization methods can be made relatively independentof the domain. The price one pays, -------------------This work was partiallydone at the Departmentsof Computer Science of the Universityof Texas at Austin, and the P.UniversidadCatdlica de Chile. It was supported in part by grant 216/82 of the Direccidnde Investigaci6n,P.UniversidadCatblica de Chile. 11 however, is diminishedcertaintyof the acquired knowledge. Since exhaustive experimentation is impossible, this knowledge represents only plausibleconjectures. Research on learning by practice and discovery has been reported in generalization methods are [41, [61 and [91, a method of presented in and [81, [21,[71 experimentation based on perturbationis proposed and expertise in solving problemsin in [31, physicshas been analyzedin [l] and [5l. 3. the most important and complex and will be analyzed in detail in the next section. Due to space limitationsthe other two stages will not be given furtherconsideration. 4. DETERMININGA DESCRIPTIONOF A PROBLEM CLASS The learning situation under study is characterized by an importantfact: the system has made a single observation that a specific problem can--&-solved in a simplifiedway. This fact is in itself useless,because the likelihood that exactlythe same problemwill be encountered by the system in the future is nil, so that this knowledge will most likely never be used! This impliesthat the systemmust perform some kind of generalizationto determinea class of problemsto which the specializedsolutionapplies. In order for the system to obtain a generalizationfrom only one observation it needs to perform experiments to gather additional information. Thus, the determinationof the descriptionof the problem class is carried out by two highly intertwined processes: experimentation and generalization. To perform these tasks the LA utilizes algorithms, heuristics, and domain knowledge, and for this reason it can be regarded as an expert system whose expertise resides in being able to learn by experimentation and generalization. OVERVIEWOF THE LEARNINGAPPROACH The approachhas been implementedin a system with two main components: a ProblemSolver (PS) and a LearningAgent (LA). To emphasizethe fact that the Learning Agent is responsiblefor the evolutionof the problem solver by developing specializedsolutionmethods to cope with problems in its domain, we refer to it as the DARWIN system. Analyze solutionof problem Determineproblem class description: cycle Hypothesizedescriptions Generateproblem variations Classifyvariations Test descriptionsagainst variations end cycle Build specializedmethod and integrate it in PS The description of the class will be expressed in terms of first order logic and will be based on the problem description and the backgroundknowledgeavailableto the system [12]. The latter kind of informationcan be classified as follows: i) predicatesthat refer to relations of objects (e.g.: positions between "symmetrically located", "at left end")* ii) predicates that refer to relations Aetween attributes of objects (e.g.: "perpendicular", "same size"); and iii) predicatesthat refer to attributes of objects (e.g.: "angle of force equal to x1'). To constrainthe search space we have decomposedthe process so that at each stage differentkinds of predicates are determined in the previous indicated by order the classification.We illustratethe processwith an example: Fig.1: Outline of the Learning Process The PS starts with a general method that allows it to solve problems in its elementary physics domain. The method is based on the principles of equilibriumof forces and moments. The LA acts as a supervisorof the PS and its task can be divided into the followingstages (See Fig.1): 1) Determineif a given problem can be solved in a simplifiedway: using knowledgeabout the domain, the solutionis analyzedto see if it has some specialcharacteristicsthat could lead to simplifications (e.g., that one or more equations produced by the generalmethod are not 2) actually needed to solve the problem). Determine a description of the problem class: when it has been found that the solution of a can be simplified the LA uses problem experimentationand generalization processes to obtain a descriptionof the class, in such a way that all the problems belonging to it can be solved in the same simplifiedway. 3) Derive the specializedmethod and integrateit into the PS: using knowledgeabout the problemdomain and about informationconsumedand producedat each step of the general solutionmethod, the system builds the specializedsolutionmethod and adds it to the PS. The new method can be obtainedby eliminating steps from the general method and by replacing some steps by simplerones. The second stage is "A horizontal lever 15 ft long is supported at the left and right ends by a pivot and rolling pivot, respectively. Two forces are applied to the lever, one which has a magnitudeof 120 lb, an angle of 270 degrees.and is appliedat a point 3 ft from the left end; and anotherwhich has a magnitudeof 120 lb, an angle of 270 degrees,and is applied at a point 12 ft from the left end. Determinethe forces exertedby the pivots so that the lever is in equilibrium."(See Fig.2a). 12 to obtain as general as possiblea descriptionthe system should try to eliminate them. This is accomplished by proposing variations of the original problem and seeing how the predicates behave with respect to them. To determine interesting problem variationsthe system uses a method based on what we call the “mutual support principle** (MSP). Let us assume that the descriptionof the problem class will be expressed as a conjunctionof predicates. (In general, it will consistof a disjunction of conjuncts, but the MSP can be easily restated to cover that case). The MSP simply says that conjuncts l*supportl* each other in the sense that negative variationsnot rejectedby one conjunct must be rejected by others, and positivevariationsmust be acceptedby all predicates(See 4.1.3, below). Fig. 2a: Initial Problem is-45 Fig. 2b: Most General Problem After preprocessingthe initial description the followinginformationis obtained: lever: weight=0 angle=0 length=15 force1: force2: magn=120 magn=120 angle=270 angle=270 pos=3 pas=12 desunk=False desunk=False pivot: pos=o desunk=True rpivot: pos=15 desunk=True (rpivot:rolling pivot; desunk:desiredunknown; pos:position) The PS producesa solution to the problem which is then analyzedby the LA. The following special characteristics are detected: the horizontal component of the force appliedby the pivot is zero, the vertical components of the forces appliedby the pivot and the rollingpivot have the same magnitude,and all the torques due to horizontalcomponentsof the forces are zero. 4.1 DeterminingPositionand AttributeRelations The system starts by determining which relations between positions and attributes of objects are important. Using this principle,problem variations are generated as follows: for every predicatefound true in the initialproblemgenerate,if possible, **true’* and **false** variations(T-varsand F-vars, respectively). A T-var with respect to a predicate is a variationin which the predicate evaluates to true. A false variation is a variation in which the predicate evaluatesto false. T-vars and F-vars are generated using functions in the backgroundknowledge,associated with each predicate. In general there may be severalways of generatingT and F-variationsfrom a predicate. Let us consider the predicate mirrorangles(forcel,force2).F-variationscan be generatedas follows: a) leave the angle of force1 fixed and select a random angle for force2; b) fix angle of force2 and select a random angle for forcel; c) select random angles for both force1 and force2. In all of these variationsthe predicate evaluates to False, as desired. The other predicatesare affectedin different ways. For instance, perpendicular(force2,lever) will evaluateto False in a) and c), but will evaluate to True in b). We can concludefrom this that in order to obtain useful variations, as many differentways of generatingthem as possiblemust be considered. 4.1.3 Classify variations: The variations generated must be classifFedas positive (POS) or negative (NEG) according to * whether their solutions do or do not have the same special characteristics that were detected in the solution of the initialproblem. 4.1.1 HypothesizeDescriptions: The system uses backgroundknowledgeand hypothesizesthat the set of predicatesthat evaluateto True in the initial problem constitutes a descriptionof the class. The followingpredicatesdefined in the background knowledgeare true in the initialproblem: 4.1.4 Test the descriptions: Finally, the predicaKar=ested againstthe sets of POSs and ~GS. In addition,since the system is trying to obtain as general as possiblea description,a “most general** variationmust be picked from all the POSs variations. The criterionused is to select the one that is rejetted by more predicates, because that means that it satisfies fewer constraints. (In general, this criterion may give more than one “most general”variation, meaning that there are alternative most general structures. In the current implementationthe system picks any one of them). Once a most general variationis selected,the predicatesthat reject it are eliminated,as long as all the NEGs are still rejetted. Continuingwith the example, (*c> (I) symloc(pivot,rpivot) atleftend(pivot) (2) atrightendcrpivot) (3) force1,force2) (4) symloc( forcel, force2) (5) sameangles{ perpendicular (force1,lever> (6) perpendicular(force2,lever) i;i; samesize(forcel,force2) (9) mirrorangles(forcel,force2) (*) (symloc:symmetricallylocatedwith respect to the center of the lever) 4.1.2 GenerateProblemVariations: Some of these necessaryand since we want relations may not 13 it turns out that predicates (2),(3),(5),(6) and (7) can be eliminated, which means that the initialproblem satisfied more constraints than needed. Thus, we obtain a new, more **general** problem,in which the forces don’t have to be perpendicular to the lever, the pivots don’t need to be at the ends of the lever, and whose solution has the same special characteristics as the solutionof the initialproblem (See Fig.2b). 4.2 Consideringproblems-with a differentnumber of objects cSo far in our analysisthe number of objects has remained constant. But in the domain we are consideringthere may be several forces appliedto a rigid body, so that it is worth exploringsuch cases. above accepts all POSs and rejects all NEGs generatedat this stage, so that it constitutes a partial descriptionof the class. 4.3 ConsideringValues of Attributesof Objects In the previousstages the system obtained a partial description of the problem class that takes into account relationsbetween positionsand attributes of different objects. In this last stage it is necessaryto take into account the single objects. attributes of of values Additionalbackground knowledge about *lspeciall* values of attributesof objects and “non-special** attribute of is used. For instance,the **weight** a lever has **O** as specialvalue. Any other value is non-special. Using this knowledge new predicatesare hypothesizedand tested. At the end of the whole processthe following predicates were obtained for the problem class under study: 4.2.1 Hypothesize Descriptions: The approach consistsof replacingthe constantsthat appear in variables and then of the predicates by quantifying these variables so that they range over sets of objects. The system uses heuristics to constrain the number of quantifiedpredicates that are generated. For the example above, let (forallfl (thereisonef2 (symloc(f1 ,f2) and samesize(f1 ,f2) and mirrorangles(f1 ,f2)) >>, (forallpivot (forallrpivot symloc(pivot,rpivot) >>, (foralllever (lever.angle= O)), one(pivot),one(rpivot). P = [symloc(forcel,force2) and samesize(forcel,force2) and mirrorangles(forcel,force2)1. That is, P representsthe conjunctionof all the predicates involvingforces that were true in the most general problem. The system generates all predicatesof the form: (quantlfl (quant2f2 P>> in which quantl and quant2 can be the quantifiers “for all”, “there isI1 and **there is one**. (Additionalpredicatesare generatedby adding the clause notequal(fl,f2) to some of those quantified predicates). and 4.2.2 Generate Problem Variations: T from each hypothesis, F-variations are -ted using heuristicsthat depend on the quantifiers and basic predicates that appear in them. For instance,considerthe predicate PI = (forallfl (thereisonef2 (symloc(f1 ,f2) and samesize(f1 ,f2) and mirrorangles(fl,f2)) 1) T-variationsfrom this predicatecan be generated by adding two forces,one of them with arbitrary attributevalues, and the other such that all the basic predicatesare satisfied. F-variationscan be obtainedby adding one or two arbitraryforces. 4.2.3 Classifythe variations: Similar to the processdescribFin Section4.1.3. 4.2.4 Test the Hypotheses: The system tries to determ= aminimal set of predicatesthat accept all POSs and reject all NEGs, This is carriedout by a process which is a modification of one disjunctive proposed in II71 to obtain a description of a concept. After performingthis process for the example, predicate PI defined 14 5. DISCUSSIONAND CONCLUSIONS In a typical inductive situation a set of positive and negative instancesof a concept is given. In the approach described above this informationis lacking,so that the search for the descriptionof the problem class develops in two spaces: the space of descriptionsand the space of variations. The experimentswe have performed show that the process of classifyingthe problem variationsis the most expensive. For the example given above, approximately300 problem variations had to be classified. (The exact number depends on the background knowledge available to the current (interpreted) the system). In implementationof the problem solver it takes an averageof 9 secondsto solve a problem. In order classify the proposed variations of the to originalproblem they must first be solved. Thus, for the system to learn this new class it would need 2700 secondsplus the (substantially smaller) time required to carry out the other processes involved. To lower this cost we have followed a **mixed** approach in which the variations are classifiedby the instructor(who is informed by the system of the specialcharacteristicstheir solutions should satisfy). If, however, the instructor is in doubt about any specific variation,he lets the system to classify it by itself. In the experimentsperformed,the DARWIN system has learned several problem classes that have simplified solutions. It has also learned problem classes in which the unknown(s) take special values which are rememberedby the system, and problem classes in which heuristics that transform a problem into a simplerone, can be validly applied. ACKNOWLEDGMENTS The classesthat can be learnedby the system are essentiallydeterminedby the kinds of special characteristicsthat it can detect in a solution and by the informationavailablein the background knowledge. If the system is not capable of detecting some interesting characteristics of a solutionthen it will not even start a learning episode. On the other hand, once a learning episode is triggered,the correspondingclass will be learnedonly if the system has the appropriate predicatesin the languageto express it. (The lack of a predicatewill be detectedby the system during the testingphase, because there will be negative variations that will not be rejected). Also, the explorationcapabilitiesof the system are determined by the functionsand heuristics that it uses to generate variations. The inability to generatecertain kinds of variations may lead to learning less general descriptions (i.e., subclassesof problems)or, even, incorrect descriptions. A detailed discussion of this point, however,is beyond the scope of this paper. In order to apply the learning method to anotherdomain it will be necessaryto replace the backgroundknowledgethat the system currentlyhas by the background knowledgeappropriatefor the new domain. This can be done without difficulty. There are certain characteristics of the current domain,however,that are more deeply embedded in the system, so that it may be necessaryto make some non-trivialchangesto it. An example of this is the order in which differentaspectsof a problem are examined. More importantly, in some domains it may be difficultor even impossibleto have the system classifythe variationsby itself. In those cases a human instructorwill have to perform that task. Also, the **wellformedness** of the variationsgeneratedby the systemmay become an issue. By the nature of the problems in the physics domain it was very easy to generate **legal** problems,but this may not be the case for other domains so that complex rules of formation may have to be introduced. I would especiallylike to thank Gordon Novak for many discussionsof the ideas presentedhere. I would also like to thank Julian Gevirtz for his comments and his assistance in editing earlier drafts of this paper. REFERENCES 1. Chi,M.T., Feltovich,P.J. and Glaser,R. **Representationof Physics Knowledge by Experts and Novices*'Tech.Rep.2. Learning Researchand DevelopmentCenter,Universityof Pittsburgh,1980. 2. Dietterich,T. and Michalsky,R. **Learning and Generalizationof CharacteristicDescriptions: EvaluationCriteriaand ComparativeReview of Selected Methods*'In Proc. IJCAI-79,Tokyo, Japan, August 1979. 3. Kibler,D. and Porter,B. "Perturbation: A In Proc. Means for Guiding Generalization** IJCAI-83,Karlsruhe,Germany,August 1983. 4. Langley,P., Bradshaw,G.L. and l*RediscoveringChemistry with system**In Machine Learning, Carbonel, Mitm(Eds), Tioga Company, 1983. 5. Larkin,J.L, McDermott,J., Simon,D.P. and Simon,H.A. **Modelsof Competencein Solving Physics Problems**. Tech.Rep. CIP 408, Dept.of Psychology,Carnegie-Mellon University,1979. 6. Heuristics in Lenat,D.B. "The Role of Learningby Discovery: Three Case Studies"In Machine- Learning,- Michalsky, Carbonell, Mitchell (Eds), Tioga Publishing Company, 1983. 7. Michalsky,R.S. **ATheory and Methodology of Inductive Learning**Artificial Intelligence 20:2 When comparingthe method proposedhere with inductive methods in which sets of positiveand negativevariationsare given by an instructor, certain advantages and disadvantages can be discerned. The main advantageis that a system implementing this method is more autonomousthan other systemsbecause insteadof being a passive receptor of instancesit is an active explorerof the domain, and so is less dependent on an instructor. Disadvantages are that, i> as the system assumesmore of the burdensof the learning process its complexityis increased,and iij the method may not be applicableto some domains, as was indicated above. A detailed comparison between the two kinds of approachesconstitutesan important topic for research,because it may very well be that the advantagesof the new method far outweigh its disadvantages,at least for certain domains. 15 (1983) Simon,H.A. the BACON Michalsky, Publishing 111-161. 8. Mitchel1,T.M. **Generalizationas Search** ArtificialIntelligence18:2 (1982) 203-226. 9. and Mitchell,T.M., Utgoff,P.E., Nudel,B. Solving Banerji,R. **Learning Problem Proc. Heuristics through Practice" In IJCAI-81,Vancouver,August 1981. IO. Novak,G.S. "ComputerUnderstandingof Physics Problems Stated in NaturalLanguage"American Journal of Computational Linguistics, %nche 3, 1976. 11. Schank,R.C. **TheCurrentState of AI: One Man's OpinionI*-AI Magazine4:l (1983) 3-8. 12. '*Induction of Relational Vere,S.A. Productions in the Presence of Background Information** In Proc. IJCAI-77, Cambridge,Mass., August 1977.