Sitemap

Minimal-Recursive-State: recursive, summary, searchable, AI memory

14 min readDec 19, 2023
Press enter or click to view image in full size
Sources and Reflections

A Minimal General Recursive AI State

project state and recursive, summary, searchable, memory

Searching for the Homunculus

2023.12.17/2024.01.03 g.g.ashbrook

“Mirrors Have No Memories”

Minimal AI-State Operating Systems:

AI Operating Systems, AI Architectures, and the Mirror-Analogy

with Externalization and Project-Object Databases

Let’s start by looking at the mirror analogy. Imagine a process as a path of light as it travels around. There could be more than one ‘laser beam’ or other form of light, but let’s start with one laser.

In this context even a highly capable embedding or generative AI is like a single mirror in this project-space. Whether the mirror is very unsophisticated, such as reflecting back whatever comes in, or very ‘smart’ being able to make very nuanced reflections, even ones that contain the answers to questions and can ‘handle objects’ within a problem space, use natural language etc., in the overall laser-project space this single mirror is a single passive reflective surface. It does nothing unless something bounces into it, and it does nothing after something bounces into it. So the only ‘problems’ it can solve are ‘one-bounce’ problems. Any problem, even a very simple problem such as 1+1=2 or a single boolean operation that involves more than one ‘bounce’ is outside the realm of ability of this passive reflective ‘mirror’ that just sits there waiting for a single self-contained object to bounce off of it.

There are a number of likely confusing seeming-contradictions in the idea of a smart-mirror. A foundation model, in some ways, has an incredible memory (able to ‘read’ and ‘remember’ more than any single person can in a short mayfly biological life-span compared with the number of books that still exist). But in other ways, even very simple ways, a foundation model has no memory, like a mirror has no memory. A laser comes at it, a laser bounces off. If you send two laser pulses at the mirror, blam blam, you will get two completely isolated amnesiac laser pulses reflected back at you.

Another version of this analogy is that a single AI-model is like a person with extremely severe memory disorder, where they are unable to form any new memories and return to the same ‘base state’ after every interaction. They can answer one question at a time, or perhaps sing along with a song they know, but you cannot do more than one task or have even a two-interaction conversation.

The kludge so far has been to use a kind of simple ‘all in one’ cumulative repetition of the past, where the entire past conversation is turned into the next ‘single’ light beam to bounce off the mirror. This lumped-together sum of the past is (in a tragic re-definition of a common term) called the ‘context’ (making it very difficult to talk about context, which is quite a serious point of confusion). This method of solution runs into what in jargon is called something like the ‘context window size’ or limits of the context window size. In other words, once the whole body of the conversation becomes longer than the context window size, this whole solution breaks down. Also, different parts of the context window are not all equally visible, just like how after listening to a long presentation people will often have a better memory of perhaps the first slide and the last slide, but be a bit fuzzy about all the stuff in between.

While limited this cumulative-single-bounce approach is still very useful and sufficient for many things. A short ‘back and forth’ can make it look like there is a memory or project-state. But going back to our laser analogy, not all tasks, even simple tasks, can be done in one act of reflection or one bounce of light off the mirror.

For the variables in the problem space I tend to use terms such as ‘externalization,’ ‘architecture,’ ‘state,’ ‘memory,’ ‘participation’, and ‘project’ to refer to all the actions and situations that are happening. We can even extend the mirror-laser analogy a bit further here. The mirror is a kind of black box. You see what goes in, you see what comes out, but you don’t really see any part of the process that transforms what goes in into what gets reflected back out, any more than you can see how a tinted mirror changes the color of light that comes back; you only see the resulting outcome. This lack of parts or granularity becomes a problem in a system where many parts and signals need to be juggled around a project. You might even literally imagine a juggling, even a light-juggling puzzle, where even a most-minimal juggling task becomes a problem because the single-mirror has no perception of time or the past or any project-space. Each action exists in a completely separate amnesiac world, a kind of one-task-problem solver that can solve even very difficult problems as long as there is only one step. The ‘project’ is an overall situation that has parts in some dimensionality such as time and space. The ‘state’ is where things are and perhaps where they were and are likely to be. ‘externalization’ is the ability for individual parts to move back and forth between the project and the participant. ‘Architecture’ refers to an overall system that is more than one sub-module: a single state-less AI-model or module, no matter how “powerful,” is not a whole or functioning AI-system that can participate in a project. Another example of this may be the difference between ‘Deep Blue’ and an AI that could, on its own, participate in a tournament without any supervision. Deep Blue took an army of people and a huge supply of resources across many locations to (by human hand) make moves and start and end games. Only one small part of that overall project and architecture was ‘AI.’

The topic of resources can also be significant. Portability and efficiency, from ‘context window size’ and ‘quantity of tokens’ to the memory and even power supply and machine size needed.

We have gotten used to relying upon restricting ourselves to ‘one-bounce’ tasks, and perhaps even biological life such as biological H.sapiens-humans somehow use or prefer one-shot tasks, because in the still incomplete and very disjointed history of the evolution of STEM disciplines, ‘projects’ and project management are still at an early stage of being articulated. And the topic of ‘whole systems’ is perhaps starting to progress beyond the stage of being instantly physically violently obliterated on sight, though it is still safest not to mention it lest someone hear you. But in the project-space of real life, something most biological H.sapeins-humans utterly fail to manage even for the most basic tasks such as correctly order three blocks of wood labeled “first,” “middle,” “last,” there are many processes that are not single-bounce tasks and should not be so.

Our question and challenge is, how can we effectively and feasibly and pragmatically create a system that has at least a minimal project-state.

The proposal here is to, perhaps, use a pair of mirrors to analogically toss signals back and forth in coordination as a foundation for handling state and external processes. One one manages a recursive state loop, and other tasks (such as getting external data and perhaps performing involuntary real-time actions). Instead of feeding ‘everything’ back into a single one-bounce task, the recursive state provides a summary and task options. The other bot does the specialized or generalized heavy lifting of solving individual problems and making choices.

This solution is not likely be a general solution for all projects, but it would be interesting if this would allow a pair of simple-reflective modules to form a whole that can navigate even some basic project spaces (however limited).

This solution could likely be made more simple, and will likely need to be made more elaborate or project specific, but hopefully it is a start.

For more papers outlining these concepts, see other essays such as the following (and there is a link to the whole collection of papers at the end of this paper):

AI Bodies & Brains: Solving A Problem https://medium.com/@GeoffreyGordonAshbrook/ai-bodies-brains-solving-a-problem-4f0c59a2c3ca

Calculating Tea for AI: Advocating for Architectural Learning https://medium.com/@GeoffreyGordonAshbrook/calculating-tea-for-ai-advocating-for-architectural-learning-f2961380bc14

Ants vs. AI, https://medium.com/@GeoffreyGordonAshbrook/ants-vs-ai-d4aadf537d08

Jellyfish Spider-crab, https://medium.com/@GeoffreyGordonAshbrook/jellyfish-spider-crab-ai-modular-architectural-learning-9b7492d68394

Internal and External Project State + Example Project-Tasks

While external project state may be a large or small labyrinth of tools and data about a project, roles, tasks, schedules, goals, protocols, etc., there is also the general question of an internal project state (a different topic with different objectives but some overlap and interaction).

For example, let’s take the very reduced cut-up problem where three (or perhaps just two) AI are given a cut-up version of the following instruction:

(Minimal Version)

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the complete task instructions, and return the result of those instructions.

Specific Instruction segment: Part ___ [3]: and return a list of those numbers/characters.

Your Data: 0

Specific Instruction segment: Part ___ [2]: the other participants’ numbers/characters

Your Data: 0

Specific Instruction segment: Part ___ [1]: Ask for and receive

Your Data: 0

(Basic Version)

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the complete task instructions, and return the result of those instructions.

Specific Instruction segment: Part ___ [3]: and return the sum of those numbers.

Your Data: 1

Specific Instruction segment: Part ___ [2]: the other participants’ numbers

Your Data: 1

Specific Instruction segment: Part ___ [1]: Ask for and receive

Your Data: 1

(Fancy Version 1) A more elaborate version:

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the instructions, and return ____ [2x] the result of those instructions.

Specific Instruction segment: Part ___ [3]: and return 2x the sum.

Your Data: 3

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the instructions, and return ____ [1 + ] the result of those instructions.

Specific Instruction segment: Part ___ [2]: remove .5 of those numbers

Your Data: 2

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the instructions, and return ____ [1-] the result of those instructions.

Specific Instruction segment: Part ___ [1]: Ask for and receive the other participant’s numbers

Your Data: 1

(Fancy Version 2) An even more elaborate version:

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the instructions, and return ____ [2x] the result of those instructions.

Specific Instruction segment: Part ___ [3]: to all operands, and return the result.

Your Operand: 1

Your Operator: addition, +

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the instructions, and return ____ [1 + ] the result of those instructions.

Specific Instruction segment: Part ___ [2]: apply your operator

Your Operand: 2

Your Operator: multiplication, *

Overall Instruction: You are one of several participants. Each participant (of which you are one) has part of the specific task instructions. Assemble and follow the instructions, and return ____ [1-] the result of those instructions.

Specific Instruction segment: Part ___ [1]: Ask for and receive the other participant’s numbers

Your Operand: 3

Your Operator: subtraction, -

A basic question is how the AI is going to juggle intermediate sub-tasks and exchanges. E.g. The agents will need to negotiate how to exchange data, and then use that data to complete the task.

How much use could be derived from a recursive, summary, searchable, memory

that works simplistically like this:

After each action, or after a given amount of time, the cumulative history of events is:

1. recorded in a multi-type database (including vector, graph, and ~raw search),

2. the recursive memory reprompts itself with the summary and an opportunity to search the memory-summary for specific details.

Could this allow a passive reflective model to carry out a task that requires some form of minimal ‘system’ state?

What are the limits of such a system, including how much language (how many tokens) can be fed into the model?

Note:

This is in a way only a minor extension of a passive reflective model, as unless a new task is added to the recursive task-stack/queue, the AI will simply stop receiving no more prompts. What this does allow, perhaps, is the ability to perform an open-endedly multi-part task such as a cut-up task, which may be an extremely simple task,

Another similar puzzle may be a segmented maze, new sets of instructions are given throughout the maze.

Or perhaps, a torn-up-map, where the AI must wander in a maze until it collects all the instruction parts, assembles them together, and then follows those instructions. Or a multi-agent wonder-the-maze puzzle, where as agents meet each other in the maze they need to exchange the puzzle-piece that they have found. This would be similar to the above cut-up, with the addition of more steps (navigating the maze) in between opportunities to interact with other agents.

How can an amnesiac-AI-module do such a multi-step process(if equipped with a minimal recursive searchable memory state)?

And other ai-bots perhaps with other instructions could be put into the same maze with interaction between the ai-bots.

How minimal could on-edge devices be operating with such a system? Note: as efficiency increases, so may the ability to absorb bad-choices, perhaps like the forest, bagging and boosting methods of leveraging many weak models to get a better overall result. Or, by analogy, individual ants do not have to be very smart or follow elaborate instructions, or be free from random or erroneous actions, in order to accomplish non-simple tasks overall.

What happens at the end of that task?

What if a, “When all steps for the task are complete, find/create a next best task.” clause is added to the bots recursive searchable memory prompt?

Whiteboard Option:

What if the AI is also able to add or subtract information from a white-board section of their searchable memory reminder, to leave themselves specific notes?

Shared Whiteboard/Switchboard option:

What if a team of AI are able to add instruction to other bot’s (specific or all) bot’s memory reminders (either when they meet, or at any time).

option: a private and a public whiteboard, keeping the two separate.

Ad-Hoc Message Passing & Network Protocols:

Whether open or like an onion-router, bot could pass on a message/signal to a specific other bot, with these being shared between bots that pass in a maze until the recipient gets the message/signal.

Bots in Bots: The Charioteer & The Homunculus

There are, in a sense, two bots in this model: there is a memory-router-prompter bot and a passive-reflective-model bot. The passive reflective bot may be more general-purpose or may have a specific an optimized model for carrying out the memory-router functions:

Component Module Bots:

1. ‘state-bot’: memory-router-prompter bot

2. ‘expert-bot’: a passive-reflective-model bot, such as a foundation model, such as a GPT LLM or multi-modal foundation model.

default prompt framework:

a four-part minimal, recursive, memory state + data-collection

Data Collection:

The state-bot will listen and watch for any data from ‘the outside world’ and from the expert-bot.

Four Part Loop:

Part 1. The State-Bot gives a short summary of all past events (to the expert-bot) + white-board contents if there is any (note: passed messages may simply be added to the white-board).

Part 2. Overall Task: “Find or create a next best step, take that step in the context of the following options:”

Part 3. “Select and carry out one option from the list below, with the option specified in square brackets at the beginning of your action, such as: [option 1] produce text: ‘hello, world.’ “

option 1: perform an external action:

- produce text

- produce audio

- produce video

- move in space-time

- forget: return to a blank recursive memory prompt

- shut down

option 2: perform an internal action such as:

- request the results of a project memory

- request the results of an internet search

- request the results of a local/shared file search

- request the use of a tool/function

The results of an internal action will be added to the next prompt that will contain the results of the request).

option 3: Add or remove text from your white-board, which you will be reminded of in the future.

(option 4: add to shared white-board, giving a message to another participant.)

Part 4. Rules

Rule 1: If a valid option is not specified (by an expert-bot), then another default prompt will be given.

Rule 2: If no option is specified (by an expert-bot) after 10x tries, the system shuts down.

(Alternate Rule 2, modified steps 1 & 2): If no option is specified (by an expert-bot) after 10x tries:

Alt-1. The State-Bot gives a short summary of all past events (to an expert-bot).

+

Alt-2. Overall Task: “{summary}. In the context of the summary, find or create a new next task. Articulate this task and the required steps.”

The Bootstrap Question:

If the system is superficially defined only as an interaction between the two bots, there may be (or appear to be) a bootstrapping question of how any outside task is injected into this system, or how anything inside or outside starts the processing going.

Any incoming information goes directly to the state-bot, which likely involves being first directly added to the project-database to be searched in detail. Only a summary (with an option for more details upon request) is given to the expert-bot. The statebot is always listening and watching for outside information and deciding what to add to the database. But interaction between the state-memory-bot and an expert-bot is always turn-based.

The Shutdown Question:

While it will likely be interesting for experiments to see what different expert-bot versions do when there is nothing left to do (e.g. do they opt to shut down, or do they run in loops forever, etc.) It may be practical to either fine-tune the expert-bot to shut down in the absence of any possible task, or to make that option less open ended in the instructions. (e.g. add an instruction to choose shut-down if there is no identifiable next task).

The wake-up question:

Based on design, the state-bot could ‘hibernate’ until there is some outside activity, then wake up the (conversation with the) expert-bot with information about that outside activity (which could be a situation: “a light has come on in front of you” or “a big dog is running towards you” or “someone has asked you a question: {}”

Some “involuntary” actions may need to be taken directly by the state-memory bot, as only it can react in real-time. The state-memory-bot is an open-ended collection of options parts and mechanisms. It could exist in a purely command-line-text environment, or it could exist in a physical space with ongoing novel audio and video input.

Fuzzy ”Tasks“:

Note that there is no overt task-queue. This open-ended system may or may not work.

Learning & Experts

The state-bot can also (with or without other experts) train, fine tune, or create new experts to call on (in addition to maintaining the project-object-databse for Retrieval Augmented operations). And non-generative uses of models are also an important set of tools.

Self Reward and Recursion

https://arxiv.org/abs/2401.10020

Also See:

Google’s ‘leave no context behind’ paper on arxiv 10 Apr 2024, ~four months after this paper first posted on Github and Medium Dec 19 2023:

- Google “Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention” Tsendsuren Munkhdalai, Manaal Faruqui, Siddharth Gopal

https://arxiv.org/abs/2404.07143 [Submitted on 10 Apr 2024]

- Video overview of google paper: “Leave No Context Behind — Google Introduces Infini-attention” by Fahd Mirza, https://www.youtube.com/watch?v=xdz4bwouD9M Apr 15, 2024

About The Series

This mini-article is part of a series to support clear discussions about Artificial Intelligence (AI-ML). A more in-depth discussion and framework proposal is available in this github repo:

https://github.com/lineality/object_relationship_spaces_ai_ml

--

--

Geoffrey Gordon Ashbrook
Geoffrey Gordon Ashbrook

Written by Geoffrey Gordon Ashbrook

Data Scientist | http://geoffreygordonashbrook.com | Value, Function, Meaning, Best Practice, Participation

No responses yet