# OpenCogPrime:ProcedureEvolution

## Evolution of Pattern-Embodying Predicates

Now we turn to predicate learning — the learning of compound PredicateNodes, in particular.

Aside from logical inference and learning predicates to match existing concepts, how does the system create new predicates? Goal-driven schema learning (via evolution or reinforcement learning) provides an alternate approach: create predicates in the context of creating useful schema. Here we will describe (yet) another complementary dynamic for predicate creation: pattern-oriented PredicateNode evolution.

In most general terms, our approach is to form predicates that embody patterns in itself and in the world. This brings us straight back to the foundations of the patternist philosophy of mind, in which mind is viewed as a system for recognizing patterns in itself and in the world, and then embodying these patterns in itself. This general concept is manifested in many ways in the OCP design, and in this section we will discuss two of them:

- Reward of surprisingly probable Predicates
- Evolutionary learning of pattern-embodying Predicates

These are emphatically not the only way pattern-embodying PredicateNodes get into the system. Inference and concept-based predicate learning also create PredicateNodes embodying patterns. But these two mechanisms complete the picture.

### Rewarding Surprising Predicates

The TruthValue of a PredicateNode represents the expected TruthValue obtained by averaging its TruthValue over all its possible legal argument-values. Some Predicates, however, may have high TruthValue without really being *worthwhile.* They may not add any information to their components. We want to identify and reward those Predicates whose TruthValues actually add information beyond what is implicit in the simple fact of combining their components.

For instance, consider the PredicateNode

AND InheritanceLink X man InheritanceLink X ugly

If we assume the man and ugly concepts are independent, then this PredicateNode will have the TruthValue

man.tv.s * ugly.tv.s

What makes the PredicateNode interesting is if:

- Links it is involved in are important
- Its TruthValue differs significantly from what would be expected based on independence assumptions about its components

It is of value to have interesting Predicates allocated more attention than uninteresting ones. Factor 1 is already taken into account, in a sense: if the PredicateNode is involved in many Links this will boost its activation which will boost its importance. On the other hand, Factor 2 is not taken into account by any previously discussed mechanisms.

It seems to make sense to reward a PredicateNode if it has a surprisingly large or small strength value.

One way to do this is to calculate:

sdiff = ||actual strength — strength predicted via independence assumptions|| * weight_of_evidence

and then increment the value:

K*sdiff

onto the PredicateNode's LongTermImportance value, and similarly increment STI using a different constant.

Another factor that might usefully be caused to increment LTI is the simplicity of a PredicateNode. Given two Predicates with equal strength, we want the system to prefer the simpler one over the more complex one. However, the OckhamsRazor CIM-Dynamic, to be presented above, rewards simpler Predicates directly in their strength values. Hence if the latter is in use, it seems unnecessary to reward them for their simplicity in their LTI values as well. This is an issue that may require some experimentation as the system develops.

Returning to the surprisingness factor, consider the PredicateNode representing

AND InheritanceLink X cat EvaluationLink (eats X) fish

If this has a surprisingly high truth value, this means that there are more X known to (or inferred by) the system, that both inherit from *cat* and eat fish, than one would expect given the probabilities of a random X both inheriting from cat and eating fish. Thus, roughly speaking, the conjunction of inheriting from cat and eating fish may be a pattern in the world.

We now see one very clear sense in which OCP dynamics implicitly leads to predicates representing patterns. Small predicates that have surprising truth values get extra activation, hence are more likely to stick around in the system. Thus the mind fills up with patterns.

### A More Formal Treatment

It is worth taking a little time to clarify the sense in which we have a *pattern* in the above example, using the mathematical notion of pattern introduced in (Goertzel, 1997) and revised slightly in the Appendix to The Hidden Pattern.

Consider the predicate:

pred1(T).tv equals > GetStrength AND Inheritance $X cat Evaluation eats ($X, fish) T

where T is some threshold value (e.g. .8). Let B = SatisfyingSet(pred1(T)). B is the set of everything that inherits from cat and eats fish.

Now we will make use of the notion of *basic complexity.* If one assumes the entire AtomSpace A constituting a given OCP system as given background information, then the basic complexity:

c(B||A)

may be considered as the number of bits required to list the handles of the elements of B, for lookup in A; whereas:

c(B)

is the number of bits required to actually list the elements of B. Now, the formula given above, defining the set B, may be considered as a process P whose output is the set B. The simplicity:

c(P||A)

is the number of bits needed to describe this process, which is a fairly small number. We assume A is given as background information, accessible to the process.

Then the degree to which P is a pattern in B is given by

1 - c(P||A)/c(B||A)

which, if B is a sizable category, is going to be pretty close to 1.

The key to there being a pattern here is that the relation:

(Inheritance X cat) AND (eats X fish)

has a high strength and also a high count. The high count means that B is a large set, either by direct observation or by hypothesis (inference). In the case where the count represents actual pieces of evidence observed by the system and retained in memory, then quite literally and directly, the PredicateNode represents a pattern in a subset of the system (relative to the background knowledge consisting of the system as a whole). On the other hand, if the count value has been obtained indirectly by inference, then it is possible that the system does not actually know any examples of the relation. In this case, the PredicateNode is not a pattern in the actual memory store of the system, but it is being hypothesized to be a pattern in the world in which the system is embedded.