From OpenCog
Jump to: navigation, search

Freezing and Defrosting

In the OCP design, attention is given to Atoms only by specific dynamics embodied in MindAgents or Tasks, which then allow Atoms to carry out particular operations. However, as we've hinted in the introduction, the number of Atoms in the system is very large, and not all Atoms can be realistically kept in memory all the time. This is the reason for the creation of the cache-enabled AtomSpaces.

When one enables caching, only a subset of Atoms is kept in RAM (usually a reasonably small subset), and the other Atoms are cached out to disk — we say they're frozen, because they can't be the subjects of any transformations made by the CIM-Dynamics.

Atoms are frozen (cached to disk) and defrosted (loaded back into RAM) based on a component of their AttentionValue called the Long-Term Importance (LTI). When an Atom's LTI drops below a certain threshold i1, it is removed from RAM, and a proxy is kept in its place. The proxy uses much less space than the original Atom, and it remains involved in the relationships that included the cached Atom.

Maintaining the proxy allows the system to keep the Atom's LTI value current, through the process of Importance Updating, which is described in the page on AttentionAllocation. When the proxy's LTI increases above a second threshold i2, the system understands that the Atom has become relevant again, and loads it from the Cache.

Eventually, it may happen that the proxy doesn't become important enough over a very long period of time. In this case, the system should remove even the proxy, if its Long Term Importance (LTI) is below a third threshold i3. Other actions, usually taken by the system administrator, can cause the removal of Atoms and their proxies from RAM. For instance, in an OCP system managing information about a number of users of some information system, the deletion of a user from the system would cause all that user's specific Atoms to be removed.

When Atoms are saved to disk and have no proxies in RAM, they're considered totally frozen, and can only be reloaded by the system administrator. When reloaded, they will be disconnected from the rest of the AtomSpace, and should be given special attention in order to pursue the creation of new Links with the other Atoms in the system.

It's important that the values of i1, i2, and i3 be set correctly. Otherwise, one or more of the following problems may arise:

  • If i1 and i2 are too close, the system may spend a lot of resources with freezing and defrosting.
  • If i1 is set too high, important Atoms will be excluded from the system's dynamics, decreasing its intelligence.
  • If i3 is set too high, the system will forget very quickly and will have to sped resources re-creating necessary but no longer available evidence.

Generally, we want to enforce a degree of hysteresis for the freezing and defrosting process. What we mean is that:

i2 - i1 > c1, c1 > 0
i1 - i3 > c2, c2 > 0

This ensures that when Atoms are defrosted, their importance is still above the threshold for freezing, so they will have a chance to build new Links and become more important, and won't be frozen again very quickly. It also ensures that frozen Atoms stay in the system for a period of time before their proxies are removed and they're definitely forgotten.