Self-model and reflection based on memory
This chapter contains several different studies. Go through them sequentially: first the source history, then the internal access, then the change in strategy, and only after that the composite agent. The failure of one comparison does not invalidate the results of another; the success of a single module does not automatically transfer to the entire system. For each step we will save the device, intervention, result and the exact limits of inference.
From own action to source history
When an agent learns to associate a command with an effect, it has a useful model of its effect on the environment. However, the experienced authorship of an action, bodily belonging, and explicit reasoning about oneself remain distinct objects of explanation. In this chapter we will build several small mechanisms and find out what allows each result to be asserted. All experiments are performed in code; the transition to the experience hypothesis is discussed based on the requirements of chapter 26.
The first mechanism continues the example from chapter 25. Let's imagine two observable sources A and B. For each event it is known whether the current sign supports the hypothesis of a common cause of signals. In the training example, source labels are available to the model and are recognized accurately. They are not hidden marks of the body's true identity. This idealization allows us to first test the mathematics and then separately examine source recognition errors.
The M0 model has no belief transfer: each event begins with a probability 0.5. M1 stores one belief for the entire thread. M2 stores a separate belief for each observed source. The general identification tracker M1I does the same for external objects. In the minimal implementation, M2 and M1I are intentionally mathematically the same. This is a strong control: the memory name should not artificially create an advantage.
Executable example of shared and separate memory
A positive sign has a probability of 0.75 for a common cause and 0.25 for separate causes. Before the update, the previous belief is one-fifth closer to 0.5. For M2, this happens the next time a given source is accessed, and not at each world step. A different model of forgetting would yield different meanings, so the rule must be written explicitly.
python3 mechanisms_lab.py --lab 5 --json source.json
In the source_history_example section of the result file there is a sequence A is positive, B is negative, A is positive, B is positive. The program reproduces values that can be checked manually. The table shows the updated estimate of the active source; the inactive entry M2 is stored separately.
Event | M0 | M1 | M2 | M1I |
A positive | 0.7500 | 0.7500 | 0.7500 | 0.7500 |
B negative | 0.2500 | 0.4375 | 0.2500 | 0.2500 |
A positive | 0.7500 | 0.7105 | 0.8750 | 0.8750 |
B is positive | 0.7500 | 0.8581 | 0.5625 | 0.5625 |
At the third event, M2 returns to the positive history A, while M1 also suffers the negative experience B. At the fourth event, the opposite side appears: M2 returns to its own negative history B. Separate memory does not always have to give a higher probability. Its distinctive property is the dependence of the update on the history of the corresponding source.
These values are consequences of a given algorithm. They do not yet show how a person’s experienced belonging changes. To relate models to such data, one must select a measurement, estimate parameters on one set of observations, and test predictions on another. If M1I continues to give the same answers, it is the special mechanism of self-reference that has not been identified. It is necessary to find an additional theoretical difference or to recognize the general nature of the explanation.
Figure 70. Whose history is used when updating. Results of the fifth work. The dots show the assessment of the active source after the event; the lines connect sequential events and do not represent a continuous change in the record of one source. M2 and the general tracker M1 are computationally the same. Marks A and B are observable and unmistakable here. Data: mechanisms_results.json, source_history_example.
How to find the source of your own influence
The second part of the fifth work solves another problem. The agent sends binary commands and sees two streams of consequences. One is related to commands, the other is random. The associated thread can be two steps late. The model must determine the channel from the observed history, without access to the hidden index of the managed source.
One version compares only simultaneous values. The other considers delays from zero to three and selects the best match. The general tracker receives the same information and uses the same calculation. Additional control randomly shuffles command history. First, a channel and delay are selected based on one hundred events, then the match is checked using sixty new events. In this way we separate the choice of explanation from subsequent testing.
With zero latency in the basic three hundred repetitions, both basic methods correctly determine the channel. With a delay of two, simultaneous comparison gives 49.67 percent of correct choices, history and the general tracker - one hundred percent each. On new events, the connection chosen by the historical model is reproduced in approximately 87.7 percent of cases, which is consistent with the inherent noise. The shuffled history produces results around the random level.
Many observations are combined to select a channel. Therefore, an error-free channel determination is compatible with prediction errors of individual future effects.
Figure 71. History helps to recognize a delayed source. Results of the fifth work: for 300 repetitions at delays 0 and 2 step. The bars show the correctness of channel selection across many events, rather than the proportion of correct predictions of individual effects. The history and general tracker use the same algorithm. Channel and delay are selected at 100 events; compliance is additionally checked for 60 new events. Data: mechanisms_results.json, conditions_by_delay.
Internal access with causal verification
The sixth work creates a minimum standard for internal monitoring. There is a hidden binary feature in the system. Public action does not depend on it. The internal sensor receives the sign directly and reports the value; the outside observer only sees the public side and uses the basic response. Another version has a disabled internal channel.
Nothing changes in the control condition. During sham intervention, an extraneous bit is changed. With targeted intervention, it is the internal state that is being assessed that is reversed. The report is checked against the condition after the intervention. All conditions receive comparable initial events, so one can ask whether the message follows the desired cause.
python3 mechanisms_lab.py --lab 6 --json internal_access.json
The internal sensor responded correctly in all two thousand trials of each condition, while the external observer and the disabled version responded correctly in about half. The result is as expected: privileged access has been explicitly designed. We have obtained a proof-of-concept with which more complex systems can be compared. When studying a language model or a self-trained agent, the presence of such a channel will still need to be established.
The structure of the test remains the same as the complexity of the problem increases: what variable is available, when is it available, and what alternative information could trigger the response? The coincidence of the report with the experimenter's expectation allows for different explanations.
Figure 72. Internal access is verified by intervention. Training scheme and results of the sixth work: according to 2000 tests in the initial condition, with a fictitious impact and when flipping the target bit. In all three conditions, the direct sensor gives 100 percent; two controls - about 50 percent. The assessment refers to the post-intervention status. The access channel is specified by the designer; the diagram does not depict the detected introspection of complex AI. Data: mechanisms_results.json, work 6.
Revision as a reason for new action
In the seventh job, the agent chooses between two predefined classification strategies. Each compares the observed number with its own threshold. The first is true before the environment changes, the second - after. The agent does not receive a rule change flag. The correct answer is revealed only after recording the current prediction and can be used in the next steps.
The adaptive version stores the thirty most recently marked examples. Before each new answer, it compares the errors of both strategies on past data and chooses the best one. The fixed version retains the first strategy. The narrative_only version could talk about revision, but its actions remain fixed. In the code, the language story is not generated: the name denotes control of the causal influence of the intended explanation.
Figure 73. Causal order of functional revision. The order of operations follows revision_lab(): the current correct answer is only available after the prediction. No more than thirty past examples come into memory; adaptation chooses between two predetermined rules and can only influence subsequent decisions.
python3 mechanisms_lab.py --lab 7 --json revision.json
In the baseline experiment of 1200 steps, the adaptive version changes the strategy once. Before the change, all modes respond correctly; after it, adaptive gives 99 percent of success, fixed and control without changing actions - 69.67 percent. The JSON stores a section of log around the switch, which shows which strategy was chosen before the current response was received.
This is a small model of functional revision. We have specified the candidate rules and the method for comparing them. More developed reflection will require the formation of alternatives, evaluation of initial assumptions, transfer of conclusions and control of one’s own errors at different levels. But already the initial model allows us to test the key causal relationship: the revision should change subsequent decisions.
Figure 74. The revision becomes the reason for a new decision. Results of the seventh work, 1200 steps, seed 1729. The saved section of the log is shown: the strategy changes at step 620 after errors in past responses. The correct label for the current case is revealed only after the prediction. Below - success at steps 600 after changing the environment. The narrative_only control saves actions; The program does not generate a text story. Data: mechanisms_results.json, work 7.
Composite Candidate Assembly
The eighth work combines several mechanisms in one prototype. It uses a probabilistic world memory, a self-influence model, a shared two-belief representation, a choice module, a predictive success monitor, and a learning rate change rule. The medium is taken from the first work. So we have a functioning system with several interacting parts.
The overall view publishes the probability of the target on the right and the probability of direct control. The action module and monitor read the same version of this information. A history of unexpected effects may enable more rapid revision of the management model. The candidate is not given the correct goal or schedule for changing the environment. The researcher saves the log and calculates the metrics separately.
python3 mechanisms_lab.py --lab 8 --json candidate.json
Figure 75. Assembling several mechanisms into one system. Study diagram for the eighth work. Two beliefs are published for action selection and success prediction. The average surprise of the latest 20 effects may switch the control model revision parameter from 0.02 to 0.12 when the threshold 0.35 is exceeded. This conditional rule is designed explicitly. Arrows indicate information transfer and parameter changes; they do not establish experience.
In a thousand-step scenario, the full version gives 83.80 success percentage and 0.81808 utility per step. Direct reading of beliefs gives the same result. The no_broadcast mode simultaneously disables the transmission of content and additional observations; its success rate is 51.90 percent. Therefore, the comparison does not highlight the contribution of one channel. This is a separate scenario, not the average of thirty runs of chapter 28.
The fourth mode is especially useful, where the rate of revision is fixed. In this launch it coincides with the full mode. The log shows the reason: the threshold for enabling accelerated learning was never reached. The module is present in the program, but its contribution was not evident in this experiment. The parameters were not changed after viewing the result to gain an advantage.
This gives rise to the following project: select in advance the conditions where the mechanism should turn on, and test them on new scenarios. The frequency of control changes or the rule for assessing surprise can be examined. If parameters are selected based on data already seen, this stage should be called search. For the verification phase, the conditions are fixed until a new launch.
How does the presence of a module differ from its contribution?
In a composite candidate, the expedited review rule is enabled only if the surprise reaches the threshold. In the base scenario this never happened. Therefore, matching the full version and the fixed tempo version does not compare the effect of the two tempos at the moment of the actual switch. First you need to check the inclusion log. Then, under new pre-selected conditions, situations where the rule should work can be explored. Selecting a successful threshold based on the initial result will be a search step and will require a separate check.
What has now been established
Now each function has its own question: is the history used, is the internal state available, is the revision changing the new action, and is the component required in the composite agent.
Figure 76. The presence of a module does not yet indicate its contribution. Results of the eighth work: one scenario from 1000 steps, seed 1729. The three regimes coincided on all saved indicators: the accelerated review condition never worked. No-transfer mode also disables additional requests, so this is a compound intervention. To verify an individual contribution, a new predefined experience is needed. Data: mechanisms_results.json, work 8.
Practice 30 Protect the conclusion about your own system
Why do it: Prepare a causal argument for one selected work instead of summing up all successful demonstrations.
What you will need: Separate memory from chapter 25; causal access check; preliminary forecast and feedback. Works 5–8 can be performed on different days.
Time guide: 35–50 minutes for one job. Can be done intermittently; This is not a speed standard.
1. Select job 5, 6, 7 or 8 and execute it separately by running mechanisms_lab.py with the appropriate --lab.
2. Before examining the result, indicate the available inputs, the function being changed, and the main indicator.
3. For operation of 5 compare the general tracker; for 6, check target and dummy intervention; for 7, save the forecast until feedback; for 8, check the number of revision inclusions.
4. Write four sentences: what is realized, what is causally verified, what remains undifferentiated, and what next experiment is needed.
What to keep: One testable report with a log, a control case, and a separate conclusion about the phenomenal hypothesis.
Hint: A comparison that simultaneously disables transmission and additional requests does not highlight the net contribution of a single transmission.
Research continuation: Formulate new conditions for activating the selected component before launch. Keep the previous non-discriminating result and compare the strong competitor in new scenarios.
Analysis and answers - Appendix F, chapter 30, p. 294
Self-test
1. Why does the equality M2 and M1I represent a meaningful result?
2. What determines one hundred percent correct responses of a designed internal sensor?
3. Can we consider the benefits of accelerated revision as shown in the eighth paper?
The digital model makes all states available to the developer. When moving to living tissue, some of these possibilities disappear, and the role of external equipment increases. Therefore, the next chapter will separately prepare work with real data.
Chapter 31






