jump to navigation

https://amahabal.medium.com/ August 30, 2021

Posted by amahabal in Uncategorized.
add a comment

Now I write at https://amahabal.medium.com/

Squinting December 15, 2006

Posted by amahabal in Uncategorized.

Here and I explain what I mean by squinting, and put forth a case for why this is a fruitful exploration. Sequences can often be seen in distinct and valid ways. For example the sequence “1 2 3 2 1 2 3” can be seen as an oscillating between 1 and 3, but it can also be seen as the four terms [1 2 3 2] repeating endlessly. Though both ways of understanding agree on every single term, they are psychologically nothing like each other. They have a different feel and the set of “other similar sequences” is quite dissimilar in the two cases. In the first case, a sequence that lies nearby in idea space is “1 2 3 4 3 2 1 2 3 4 3 2 1”, while in the second case, a nearby sequence is “3 4 7 5 3 4 7 5 3 4 7 5” (which is just the four terms [3 4 7 5] repeating endlessly).


Richard Feynman argued in “the character of physical law” that two theories that fit the data equally well can nonetheless be of unequal utility according to what other theories they evoke. The two different theories of what the sequence above consists of fit the data equally well. The second theory, however, misses important bits of relationships between the pieces. It ignores, for instance, that the second repeating bit (2) is one more than the first repeating bit (1). In the examples that I shall present, ignoring squinting leads to theories that ignore important aspects of the situation.


Consider the sequence “1 2 0 4 5 1 2 3 0 5 6 1 2 3 4 0 6 7”. One way of understanding the sequence is to consider each block (for example, 1 2 0 4 5) as consisting of three pieces: a pre-zero piece, a zero and a post-zero piece. In this way, the sequence can be looked at as three interlaced sequences. The first of the three interlaced is “[1 2] [1 2 3] [1 2 3 4]”, the second “0 0 0 0”, and the third “[4 5] [5 6] [6 7]”. Each of these three is a very simple sequence to understand. The only way that this theory is wanting is in that it treats its three constituents as independent of each other.


The other way of looking at this sequence is to say that it is just “1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7” except that some terms are hidden behind a zero. Or, put differently, the zeros stand for a 3, a 4 and a 5 respectively.


Which of these is the right way? That should be rephrased as which of the two people prefer once they see both. That is an empirical question, but I put my money on the solution of the zeros standing for something else. Being able to see something as something else is a rampant cognitive phenomenon. The remainder of this post has example after example of scholarly writing pointing in that direction.


Let me point out a continuum of “seeing as.” At the one end is seeing something as an instance of a category. Seeing a creature and recognizing it as a dog is of this type. At the other end is seeing something as one particular object (instead of a category). Examples at this end include seeing somebody as being Einstein: all the following people have been so seen: Charles Hartshorne (Einstein of religious thought), Dr. Magnus Hirschfeld (Einstein of sex), and Eric Drexler (Einstein of Nanotechnology). These two ends, while not the same, clearly form a spectrum if we consider Einstein to be a category, albeit small. From here on, I do not consider this distinction.

  • Language is permeated with metonyms and metaphors. Authors like George Lakoff (metaphors we live by; women, fire and dangerous things; where mathematics comes from) believe that much of cognition is metaphorical. A simple Internet search on Google with the query “can be seen as” returns several matches where people are seeing things and situations as problems, as opportunities and as insults.



  • Science and mathematics have big formidable edifices built out of repeated seeing as. All of modeling is of course seeing something as something else. It is also easy to come up with very specific examples. Integration can be seen as summation. Though the official definition involves limits, numerical computation is in practice done via summation.


Many combinatorial identities can be reasoned about by seeing both sides of the identity as ways of choosing team members from a pool of candidates. Such solutions are usually orders of magnitude higher in elegance. You can find some pretty examples in this Wikipedia entry.


Proofs of Wilson’s theorem involve seeing the number 2 through p-2 as a group, thereby allowing the use of results from group theory. Entire branches of mathematics are based on seeing a certain type of objects as something else: Algebraic Topology (which sees sets of topologies as groups) being an example.


  • Ervin Goffman gives several acts of pretending, game playing, conning (causing somebody else to see things different from reality) and so forth in his classic Frame Analysis.



Convinced that perception is the key to intelligence, Ulam was trying to explain the subtlety of human perception by showing how subjective it is, how influenced by context. He said to Rota, “When you perceive intelligently, you always perceive a function, never an object in the physical sense. Cameras always register objects, but human perception is always the perception of functional roles. The two processes could not be more different…. your friends in AI are now beginning to trumpet the role of contexts, but they are not practicing their lesson. They still want to build machines that see by imitating cameras, perhaps with some feedback thrown in. Such an approach is bound to fail…”

Rota, clearly much more sympathetic than Ulam to the old-fashioned view of AI, interjected, “but if what you say is right, what becomes of objectivity, and idea formalized by mathematical logic and the theory of sets?”

Ulam parried, “what makes you so sure that mathematical logic corresponds to the way we think? Logic formalizes only a very few of the processes by which we actually think. The time has come to enrich formal logic by adding to it some other fundamental notions. What is it that you see when you see? You see an object as a key, a man in a car as a passenger, some sheets of paper as a book. It is the word as that must be mathematically formalized…. until you do that, you will not get very far with your AI problem.”

To Rota’s expression of fear that the challenge of formalizing the process of seeing a given thing as another thing was impossibly difficult, Ulam said, “do not lose your faith— a mighty Fortress is our mathematics,” a droll but ingenious reply in which Ulam practices what he is preaching by seeing mathematics itself as a fortress.



Fixing AttemptExtension December 12, 2006

Posted by amahabal in Uncategorized.

One of the actions suggested by a group— when it is the current thought— is to schedule an AttemptExtension codelet. I will describe how this works, and then argue that it needs fixing.

 Here is how the thing currently works. Let the sequence under consideration be “1 7 8 2 8 9 10 3 9 10 11 12…”, and let us assume that the group ‘8 9’ has been seen, and that this is the group on which the codelet has been let loose. The codelet needs an extra argument telling it which direction to extend in: left or right. We will try to expand right.

 The codelet first figures out what the next object in that direction should be. In this case, the next object would be a 10. In step two, it checks whether this is the object present in the workspace at that location. In this case, it is. In step three, it handles the logistics like actually adding the object to the group, updating relations and so forth.

 All these steps look fine and behave well in the sequence we were considering. Can you guess where we are going to run into trouble? As a hint, a troublesome sequence is ‘1 2 2 3 1 2 3 3 4 1 2 3 4 4 5…’

 Yes, step two is the culprit. In the sequence ‘1 2 2 3 1 2 3 3 4 1 2 3 4 4 5…’, Let us try to extend the marked group right. Step one tells us to look for a ‘3’. Step two does the looking, and finds the 3. Except, for this sequence, that is the wrong 3. The program needs to see the [3 3] as a 3 in order to see the sequence as “really just 1 2 3 1 2 3 4 1 2 3 4 5…”. Since step 2 is so literal about what it seeks it cannot find the right answer. (And this is a vindication of my use of fringes. The program does solve this problem via a different route involving fringes. But that is a story for another day).

 The literalness of the second step currently makes it impossible for the program to see the sequence “1 2 0 4 5 1 2 3 0 5 6…”. Here, even the fringes cannot help: the fringe of 0 certainly does not contain ‘4’.

 What we need from step two is a check that an object of the sort we seek is present in the workspace at the particular location. In our troublesome example, we need an object that can be seen as a 3. Both ‘3’ and ‘3 3’ fit the bill. However, this raises a timing issue: what if the ‘3 3’ had not yet been seen as a group? Or if it had not been seen as possibly standing for a 3? There is an additional complication involving time. In the sequence “1 2 0 4 5 1 2 3 0 5 6…” there is understandable resistance to seeing the 0 as a 4. This resistance is overcome as more examples of similar squinting are noticed in other parts of the sequence. Similarity space, thus, changes its shape over time. What was dissimilar can become similar, and vice versa.


The new approach— yet to be implemented— replaces the second step with something more elaborate:

  • Get all adjacent objects in the redirection of the extension. In the troublesome example, that includes the 3 and (if it has been seen as a group,) ‘3 3’.
  • For each such object, the question “can this object be seen as a 3” can have three possible answers:
    • “yes”
    • “Hmm, never thought about this. I need to think”
    • “no, I tried it, does not work”


  • If we get (c) as an answer for all objects, the extension cannot be done, at least for now.
  • If we get (a) as the answer for more than one, we can pick one.
  • For any (b)s, we should launch codelets exploring the likelihood of that squinting. Subsequent attempts can use what the codeless discover.


Finally, we must add another codelet that shakes boundaries. What it should do, for a given group, is to shorten and then elongate the group at one end. This is like treating the boundaries as somewhat tentative and fluid. Pragmatically, this is our insurance against choosing wrongly if several possible answers look valid while extending. No choice is binding. Moreover, this also makes groups a more fluid data structure. I will end with a short quote from page 119 of FCCA:


Thought’s fluidity emanates from the non-rigidity— the fluidity— of representational structures. They have an ability to adjust, to alter themselves effortlessly, to assume many conformations. For fluidity to emerge at a high level in a computer model of thought, the underlying data structures must be permeated by an ability to flip back and forth at the drop of a hat […]





A change of terminology: no more relations December 12, 2006

Posted by amahabal in Uncategorized.
add a comment

In the post “relations” I described how the relations Seqsee notices have both related objects sharing a category, and also mentioned exceptions in the world around us: George W. Bush and the United States do not share obvious categories, and yet, the question “how is Bush related to the United States?” is not inane and has an answer.

 I want to step back and point out that the relations Seqsee needs most are really descriptions of change—“how can I change a ‘1 2 3’ to a ‘2 3 4’?”—and being able to apply the same change to other objects. Applying the same change to ‘5 6 7’ yields ‘6 7 8’. I want to suggest changing relations to change descriptions.

 Unfortunately, this term sounds mechanical and lifeless. Relations is a warm word, deriving part of its warmth from human relations. Lifeless or not, I think change descriptions is more accurate. Seqsee gets its traction from descriptions, and this is true at several levels. Descriptions drive similarity discovery, for example.

 Am I, with this shift in nomenclature, outlawing relations not based on shared categories? Are there not aspects of the domain that are genuinely such relations? The relation between a ‘1 2 3’ group and the category ascending, for example?

 No, these live on, as they always have, in long-term memory. Long-term memory is a graph (of the nodes and edges variety), and can be a home for arbitrary associations between ideas. All I am suggesting here is renaming a concept to be more accurate.

A wiki for Seqsee December 11, 2006

Posted by amahabal in Uncategorized.
add a comment

This is a short entry just to publicize the existence of a Wiki for Seqsee. It is world readable but not world editable. I am also working on a web site where I would put longer articles that would not easily fit into a wiki format or a blog format, and on which I can spend more time polishing.

Relations December 11, 2006

Posted by amahabal in Uncategorized.

Relations in Seqsee play a role similar to that played by bonds and bridges in Copycat and Metacat. As mentioned in the previous entry relations in Seqsee need to be generalized to take care of what I called weak relations. Because of this transition, this entry is tentative but not very much so.


Let us stay concrete with an example. Let group A be [2 3 4] and group B be [3 4 5], with neither having yet been seen as ascending groups. Then the function “find relation” returns empty-handed: in Seqsee, all relations are based on categories shared by the two ends. Without a common category, no relation is discovered.


Let us proceed to a subsequent time when both groups have been seen as ascending. Now the function “find relation” does succeed and discovers the relation based on this shared category: in going from group A to group B both the start and the end have gone up by one. ‘Start‘ and ‘end‘ are words that are applicable to things that are ascending groups. For mountains ([3 4 5 6 5 4 3], for example), applicable words include ‘peak‘, a word that would scant make sense for ascending groups.


This restriction of sharing a category in order to be related might seem restrictive. However, several relations are of this type. Those that are not include the relation between George W. Bush and the United States. One is a country and the other is not. At least in the domain of sequences, though, this restriction does not seem crushing. There are also good reasons why similarity must play a role in describing differences. A quote from Michael Agar’s “language shock” has vividly stuck in my mind. He was describing the classic experiment of Berlin and Kay where they tried to make sense of differences in color terms in different languages. Using the spectrum, they asked natives to pinpoint what the central example of the color red was. I quote from page 75:


Berlin and Kay made sense of differences between languages in terms of similarities that humans share. Before their work, linguists used the spectrum to highlight the differences. What Berlin and Kay did was to show how the differences showed up against the background of human universals of color perception, abilities wired into the eye and brain.


Categories in Seqsee provide just such a backdrop of similarity with which to compare. To drive the point home—at the risk of repeating myself or of stating something obvious—let me point out that a question like “how does evolution differ from gravity?” is silly, unless you make both the things being compared belong to the same category, say, the category “scientific theory”. Now the two can be compared in terms of how much people believe them, how mathematically quantifiable they are and so forth.


So far so good. Let us go into deeper waters. Consider the groups [ [2 2] 3 4] and [3 [4 4] 5] where the ‘2 2’ has been seen to be just a funny 2, and the two groups have been seen as blemished versions of [2 3 4] and [3 4 5] respectively. How do we now describe what changed? Another quote from Michael Agar from the same chapter is relevant (page 82):


[…] similarities are always too simple and differences are always too complicated. The academic tendency is to put together a framework of similarities and then go forth and understand the world in terms of it. With a good framework, you can understand something of each piece of the world, no doubt about it. But each piece of the world will not just consist of that similarity; it will consist of that similarity plus plenty of other things working within the system where the similarity is found.


The author was not talking about a program understanding sequences, to be sure, but rather about people trying to understand other cultures. That does not make the quote any less true here.


Relations in Seqsee are programmed to note several other characteristics like the blemishes present and their positions. This does give it some framework in which to describe differences. This framework needs to be at the same time stronger and more flexible. Relations like that between [3 4 5] and [8 9 10] are not supported yet. I did not reach the stage of talking about weak relations as I had expected to, but I will get there in the near future.

The state of Seqsee December 11, 2006

Posted by amahabal in Uncategorized.
add a comment

This entry will try to pinpoint what is still not done in Seqsee. Here is the programme: I will trot out a sequence at a time and point out whether Seqsee would get that, and if the answer is no talk about what the missing pieces are. Often, it is not so much that pieces are missing as that they have not been fit into the puzzle.


1 2 3 4 5…


Yes, Seqsee gets this. I wanted to put in at least one thing that works.




Nope, not just yet! This requires a piece that sits half-built in my workshop: long-term memory. By long-term I mean a memory capable of remembering things between runs. One of the next few entries will spell out what I am thinking.


1 1 2 3 1 2 2 3 4 1…


Yes, kind of. Seqsee sometimes gets this, but has a way of unseeingly staring at the solution. Rules will help it see this sort of thing much faster, and rules shall be the topic of an entry in the next couple of days.


2 15 16 1 2 3 8 9 10 11 5 6 7 8 9 11 12 13 14 15 16…


No. For most sequences that Seqsee shall deal with, the next term after seeing several terms is more or less well determined. Not in this case, though. The next seven terms will form an ascending group but it could be any such group. What is missing from Seqsee that prevents it from seeing such sequences is the notion of a weak relation. A weak relation is exactly of the sort present in the sequence: it under-determines the right hand side given the left-hand side. In this particular sequence, the relation is that the right hand side is also an ascending group but longer by one.


What is also missing is the ability to create random groups meeting a specification. In this particular case, the subsequent group has the specification “ascending group of length seven”. There are other less spelled out constraints like “the group shall start with a smaller number (and not 1 million)”.


A third bit that is missing is that I do not have a mechanism yet to look for a group meeting a specification already present in the workspace. Currently, since sequences that Seqsee deals with are deterministic, it is enough to check whether a particular thing is in the workspace at a particular point. I would need to extend that to be able to check whether that particular type of thing is in the workspace at a particular point.


1 1 2 3 1 2 2 3 1 2 3 3 1 1 2 3…


No! After the 12th term, Seqsee hits the big snag, and it has not yet learned to recover. Rules, again, are implicated in this.


All the foregoing might suggest that there is much that Seqsee cannot do. This is true: even when Seqsee solves all the sequences on this page it will be no less true (just as it is not true that people living in high-rise buildings are somehow closer to God). I do hope that by the time I am done with my Ph.D. Seqsee would at least get all these sequences.

Self-watching II: Could the trace and the stream be merged? December 11, 2006

Posted by amahabal in Uncategorized.
add a comment

In my last post I mentioned how I think Metacat’s temporal trace did not get it exactly right when it allowed important but ancient events to be accessible without also allowing recent events just below the importance threshold to be accessible. I just realized that the stream of thought in Seqsee makes the exact opposite error: it remembers the most recent thoughts but not important thoughts that are somewhat old.


Let me review briefly how the stream of thought currently works. After that I will be able to explain what I am thinking would be required to merge both views.


Seqsee contains “thoughts”, which could be looked at as codelets that are handled in a special way. When a thought is “the current thought”, its fringe is calculated. The fringe contains things related to the current thought. More on this later at some point but suffice it to say for now that if the fringes of two thoughts overlap then they might be similar in some way. A concrete example would help: the groups [2 3 4] and [7 8 9 10] may both have “ascending” in their fringe. Overlapping fringes is the primary method by which similarity discovery happens in Seqsee.


Another thing that the “current thought” does is to suggest potential actions to be taken. For instance, if the current thought is about a group [2 3 4] then a possible suggested action could be “try to make the group longer”.


The stream remembers the last few thoughts and their fringes. The most recent thought’s fringe is present to the greatest extent. Currently, the stream only remembers the last 10 thoughts. The stream then checks the fringe of the current thought for overlap with the stored fringes. If a significant overlap is discovered with a prior thought then a codelet is launched to explore whether the two are related (thus possibly precipitating a bond formation).


In Seqsee, this overlap was looked at A Good Thing. After all, uniformity is a good thing. Finally, we want to discover a rule that explains the sequence harmoniously and is itself simple. Therefore, Seqsee currently tries to make the most of the good news that overlap happened by responding with attempted bond formation. However, fringe overlap can also signals problems. If you are having the same thought over and over and over again, the fringes will, of course, overlap.


The temporal trace is sensitive to the repetition of certain types of events. There are codelets that try to find patterns amongst snags that the program hit. If snags were one type of thought in Seqsee then a new snag— if it was similar to another recent snag— would awaken Seqsee to this snag repetition. Unlike groups with overlapping fringes, snags with overlapping fringes are bad news and Seqsee can take corrective action.


This does not yet I mean that the stream of thought can take over all the work that the temporal trace did. The trace also remembered the order of events and that has not yet been integrated into the stream. However, whether (and how much) we remember the order of events is not clear to me. I remember several conversations with two friends at different times. While I have some sense of the ordering of conversations with the first friend (i.e., I have some sense of which conversation which conversation happened before which), and also some sense of ordering of the conversations with the second friend, I cannot at all re-create temporally the set containing both sets of conversations: I cannot say if this conversation with the first friend happened before or after that conversation with the second friend. I suspect that the ordering I could remember within each individual set was something that I calculated (figured out) instead of really remembering. I remember Roger Schank talking of something similar in his book “dynamic memory”.


The previous paragraph notwithstanding, we do remember some amount of ordering information, I think, and the stream needs to be able to do that at least a little bit. I also need a way to remember important but old thoughts.


I think I am happy with the way things are going with this “integration”. I am curious to see how the story unfolds!

Self-Watching in Seqsee December 11, 2006

Posted by amahabal in Uncategorized.
add a comment

I have finally come to a stage where I can realistically think about how I will implement self-watching in Seqsee. The most prominent FARG program that watches itself is Metacat: after all, it is subtitled “a self watching cognitive architecture for analogy making and high level perception”. As I was reading Jim Marshall’s dissertation I could not help but feel that something very similar would do the trick for Seqsee.


Here is a brief description of Metacat’s self-perception. The crucial components include the temporal trace and two new codelets, the progress watcher and the jootser. The temporal trace can be, in Jim’s words, “thought of as a short term memory for storing the recent past events during a single run”. Codelets can examine these structures, and Jim Marshall goes on to say on page 163 of his dissertation:


From a theoretical standpoint … the structures stored in the trace are no different from other types of perceptual structures stored in the workspace, since they are all subject to processing by codelets, so in an important sense, the temporal trace and the workspace can be identified with each other— implying a kind of “level collapse” between Metacat’s cognitive and sub cognitive levels (see [GEB, chapter 20] …). Thus, conceptually, the same set of general processing mechanisms is responsible for perception, for self-perception, and for self-control in Metacat.


I agree absolutely with the sentiments mentioned in the quote above. I feel that this is how things should be. What I am not sure about— given my possibly incorrect understanding of Metacat— is how much of a level collapse actually happens in Metacat, as it currently exists. Please allow me to elaborate.


The way both Copycat and Metacat perceive letter-strings involves adding descriptions of various objects, noticing relations and creating groups. All this activity is crucial. Almost nothing like this happens at the level of the temporal trace: there are no bonds formed between the events stored, nor are descriptions added to events to allow similarity discovery (though some description is added, namely the important themes present when the event occurred). There are certain types of events whose repetition Metacat spots: repeated snags and repeated clamping, and is able to take evasive action. Other repetitions—like attempting to create the same relation between the same two objects and repeatedly destroying it—goes unnoticed (I think). Thus, while the trace does go somewhat towards doing “the same sort of processing” for the strings and the trace, it could go further still.


I must hurry and point out that the two types of processing cannot be identical: the strings are “permanently” present, while the things in the trace are ephemeral in the sense that very old parts of the trace (things that happened 50000 codelets ago, say) should be pretty nigh inaccessible. Mike Gasser would say that the strings are being read (and we can dart our eyes back and forth over them), where as the trace is being “listened to”, sort of.


Another slightly problematic thing with Metacat’s trace, I felt, was that important old events are remembered, where as relatively unimportant stuff that just happened is not.


My next entry would probably be about some half-baked ideas about how I could use the stream in Seqsee to also act as the trace, sort of, and get more of the “same processes” to bear on the event history.

Skins for Seqsee December 11, 2006

Posted by amahabal in Uncategorized.
1 comment so far

This post would never end in my dissertation; but it is a recent day of hacking I enjoyed, and a lot of good can come out of it.

What I did was simple: until now, I had coded the UI imperatively, and I merely shifted to a declarative style. Thus, I went from something like


$button_frame = $MW->Frame()->pack(-side => ‘top’);

$button_frame->Button(-text => ‘quit’, -command => sub { exit })

->pack(-side => ‘left’);


to something like:



button_frame MW Frame top



quit: exit


The main reason to do this was to make the UI more configurable and to get rid of lots of duplicate code inherent in an imperatively coded UI. However, a far nicer side effect has emerged. In the process of going to declarative style, I had to handle the special code I had cut to handle widgets I had specifically crafted for Seqsee. This made me start thinking about what these widgets were, and I realized that these are just views into the innards of Seqsee, and I could have arbitrarily many of them, even with overlapping functionality. Until now, I just had viewers for individual components of the program. I used one to visualize the stream, for instance. In this mindset, it did not make sense to have multiple viewers for the same component. Now under the new mindset “it’s just a view” that restriction is lifted. I am free to have as many different widgets as I fancy.

Here are just some potential widgets that would help me understand what the program is doing much much better.

  • A strength visualizer that would let me compare how strong various components are. This would be crucial as the relative probability of choosing a particular object is strongly modulated by its strength. So having a good way to calculate strength is crucial, and checking if I indeed have a decent way to calculate requires a visualizer.
  • A workspace activity visualizer, something that tells me whether the program is thinking that things are going well. Think of it as a temperature visualizer: it shall show me how the temperature has been changing over time. Several activities like destroying objects depend on this number.
  • Any other as required when I get stuck and need to see what Seqsee is thinking.

There is also code duplication amongst the various widgets and I should eliminate these if I begin producing several widgets.

All I have been saying, briefly, is that the MVC pattern is often a very good idea, and it allows you the freedom to dream up strange V’s.

Being able to look at what is going on from different perspectives is crucial. Hey, for all I know, I might be able to work this into my dissertation!