From OpenCog

Attention Allocation via Data Mining on the System Activity Table

In this section we'll discuss an object called the System Activity Table, which contains a number of subtables recording various activities carried out by the various objects in the OCP system. These tables may be used for sophisticated attention allocation processes, according to an approach in which importance values are calculated via direct data mining of a centralized knowledge store (the System Activity Table). This approach provides highly accurate attention allocation but at the cost of significant computational effort. In the following section we will discuss the logic and mechanics of its integration with less computationally expensive, less accurate techniques.

The System Activity Table

The System Activity Table is actually a set of tables, with multiple components.

First, there is a MindAgent Activity Table, which includes, for each MindAgent in the system, a table of the following form:

System Cycle Effort Spent Memory Used Atom Combo 1 Utilized Atom Combo 2 Utilized
Now 3.3 4000 Atom21, Atom44 Atom 44, Atom 47, Atom 345
Now -1 0.4 6079 Atom123, Atom33 Atom 345
... ... ... ... ...

The time-points recorded are the last T system cycles; the Atom-lists recorded are lists of Handles for Atoms.

The MindAgent's activity table records, for that MindAgent and for each system cycle, which Atom-sets were acted on by that MindAgent at that point in time.

Similarly, a table of this nature must be maintained for each Task-type, e.g. InferenceTask, MOSESCategorizationTask, etc. The Task tables are used to estimate Effort values for various Tasks, which are used in the procedure execution process. If it can be estimated how much spatial and temporal resources a Task is likely to use, via comparison to a record of previous similar tasks (in the Task table), then a MindAgent can decide whether it is appropriate to carry out this Task (versus some other one, or versus some simpler process not requiring a Task) at a given point in time, a process to be discussed in a later chapter.

In addition to the MindAgent and Task-type tables, we require that a table be maintained for each goal in the system, including simple goals like create new truth value as well as more complex and system-specific ones:

System Cycle Total Achievement Achievement for Atom Achievement for set {Atom44, Atom 233}
Now — T .4 .5 .4
Now —1 .5 .55 .4
... ... ... ...

For each goal, at minimum, the degree of achievement of the goal at a given time must be recorded. Optionally, at each point in time, the degree of achievement of a goal relative to some particular Atoms may be recorded. Typically the list of Atom-specific goal-achievements will be short and will be different for different goals and different time points. Some goals may be applied to specific Atoms or Atom sets, others may only be applied more generally.

Of course, if one has a large OCP configuration in which there are many functionally separate lobes, then separate tables must be used for each lobe.

The basic idea presented here is that attention allocation and credit assignment may be effectively carried out via datamining on these tables.

Semantics of Importance Levels Based on System Activity Tables

Now we return to our prior discussion of the semantics of STI and LTI, in the context of the specific data gathered in the SystemActivityTables.

Assume that the goals in the system are weighted, so that one can define a composite ubergoal, whose satisfaction is the weighted sum of the satisfactions of the goals in the system. (The proper definition of the ubergoal may also involve subtracting off for dependencies among the various goals.)

Let A denote an Atom, or else a set of more than one Atom. Where E denotes the expected value, we may define the generic STI of A as

I(A,T) = E(amount by which acting on A at time T will increase the satisfaction of the ubergoal in the near future)

and the generic LTI of A as

LTI(A,T) = E(amount by which acting on A at time T will increase the satisfaction of the ubergoal in the foreseeable future)

These may be estimated from the Activity Tables described above, using approximative approaches. The Activity Tables contain information on how much effort was applied to processing each Atom at each point in time, and how much utility was obtained from such application.

We may also define several more specific importance numbers, such as

I(A, M, G, R,T) = E

(amount by which MindAgent M acting on A at time T will increase the satisfaction of goal G by time T+R)

Generic importance may be defined in terms of specific importance by averaging specific importance over many argument values. It seems that a very useful kind of specific importance is

I(A, M,T) = E

(amount by which MindAgent M acting on A at time T will increase the satisfaction of the supergoal in the foreseeable future)

i.e., Mind-Agent-specific importance. This kind of importance can help MindAgents decide which Atoms to choose at a given time. Of course, if a given MindAgent lacks experience with a given Atom A, then I(A, M) may be estimated in terms of I(A), or in terms of I(B ,M) for other B that are related to A.


Next, special links called HebbianLinks may be created based on these importance values, recording probabilities such as

(HebbianLink A B).tv.s = E ( (A is important at time T).tv.s || (B is important at time T).tv.s )

which should ideally be computed assuming the component truth values are distributional truth values, but can also be approximatively computed using simple truth values.

PLN inference may be carried out on HebbianLinks by treating (HebbianLink A B) as a virtual predicate evaluation relationship , i.e. as

EvaluationLink Hebbian_predicate (A, B)

PLN inference on HebbianLinks may then be used to update node importance values, because node importance values are essentially node probabilities corresponding to HebbianLinks. And similarly, MindAgent-relative node importance values are node probabilities corresponding to MindAgent-relative HebbianLinks.

Finally, inference on HebbianLinks leads to the emergence of maps, via the recognition of clusters in the graph of HebbianLinks.

Schema Credit Assignment

And, how do we apply a similar approach to clarifying the semantics of schema credit assignment?

From the above-described System Activity Tables, one can derive information of the form

Achieve(G,E,T) = "Goal G was achieved to extent E at time T"

which may be grounded as.

                HypLink G

and more refined versions such as

Achieve(G,E,T,A,P) = "Goal G was achieved to extent E using Atoms A (with parameters P) at time T"
Enact(S,I,T1,O,T2) = "Schema S was enacted on inputs I at time T1, producing outputs O at time T2"

The problem of schema credit assignment is then, in essence: Given a goal G and a distribution of times DT, figure out what schema to enact in order to cause G's achievement at some time in the future, where the desirability of times is weighted by DT.

The basic method used is the learning of predicates of the form



  • the Pi are Enact() statements in which the T1 and T2 are variable, and the S, I and O may be concrete or variable
  • C is a predicate representing a context
  • GS is an Achieve() statement, whose arguments may be concrete or abstract
  • F is a Boolean function

Typically, the variable expressions in the T1 and T2 positions will be of the form T+offset, where offset is a constant value and T is a time value representing the time of inception of the whole compound schema. T may then be defined as TG - offset1, where offset1 is a constant value and TG is a variable denoting the time of achievement of the goal.

For the purpose of the present discussion, these predicates may be learned by any method; in practice, we assume they will be learned by a combination of greedy statistical pattern mining, PLN inference and PEL optimization.

The choice of what action to take at a given point in time is then a probabilistic decision. Based on the time-distribution DT given, the system will know a certain number of expressions CS = F(C,P1,...,Pn) of the type described above. Each of these will be involved in an ImplicationLink with a certain estimated strength. It may select the "compound schema" CS with the highest strength.

One might think to introduce other criteria here, e.g. to choose the schema with the highest strength but the lowest cost of execution. However, it seems better to include all pertinent criteria in the goal, so that if one wants to consider cost of execution, one assumes the existence of a goal that incorporates cost of execution (which may be measured in multiple ways, of course) as part of its internal evaluation function.

Another issue that arises is whether to execute multiple CS simultaneously. In many cases this won't be possible because two different CS's will contradict each other. It seems simplest to assume that CS's that can be fused together into a single plan of action, are presented to the schema execution process as a single fused CS. In other words, the fusion is done during the schema learning process rather than the execution process.

A question emerges regarding how this process deals with false causality, e.g. with a schema that, due to the existence of a common cause, often happens to occur immediately prior to the occurrence of a given goal. For instance, roosters crowing often occurs prior to the sun rising. The answer is: In the current approach, if roosters crowing often causes the sun to rise, then if the system wants to cause the sun to rise, it may well cause a rooster to crow. Once this fails, then the system will no longer hold the false believe, and afterwards will choose a different course of action. Furthermore, if it holds background knowledge indicating that roosters crowing is not likely to cause the sun to rise, then this background knowledge will be invoked by inference to discount the strength of the ImplicationLink pointing from rooster-crowing to sun-rising, so that the link will never be strong enough to guide schema execution in the first place.

The problem of credit assignment thus becomes a problem of creating appropriate heuristics to guide inference of ImplicationLinks of the form described above. Assignment of credit is then implicit in the calculation of truth values for these links. The difficulty is that the predicates F involved may be large and complex.

The Pragmatics of the Data Mining Approach to Attention Allocation

In the preceding sections we have discussed the probabilistic definition of STI, LTI and related quantities in terms of the SystemActivityTable. This is an elegant, conceptually and pragmatically correct approach to attention allocation; however, its Achilles Heel is computational efficiency. Data mining the SystemActivityTable is not necessarily as slow as doing sophisticated inference using PLN or learning complex new procedures or patterns using evolutionary learning — but even greedy stochastic pattern mining algorithms are not necessarily so cheap. Inference based on the SystemActivityTable can't be carried out regarding every Atom and MindAgent every second that a OCP system is operating.

What is needed is an attention allocation mechanism that incorporates these sophisticated methods together with cheaper and less intelligent methods, in a way that allows their seamless combination. This is achieved by the OpenCogPrime:EconomicAttentionAllocation methods described in the following section.