Skip to content

09 - Embodiment

TextWorld Environment, Embodied Agent, and Object Permanence Testing


SCIENTIFIC BOUNDARY: This framework measures theory-derived consciousness indicators. It does NOT prove, establish, or demonstrate subjective experience, phenomenal consciousness, sentience, or any form of inner life. Text-world simulations test prediction and attention indicators in a controlled setting. They do NOT prove real-world understanding, embodied cognition, spatial reasoning, or subjective experience of an environment.


1. Overview

Embodiment — the coupling of a cognitive system to an environment through sensors and effectors — is increasingly recognized as relevant to consciousness evaluation. Butlin et al. (2023) note that embodied agents face challenges (object permanence, prediction violation in a physical context, self/world distinction) that are difficult to fake through purely linguistic processing. The CIA framework provides a text-based simulation environment and an embodied agent wrapper to test these indicators in a controlled, reproducible setting.

The embodiment subsystem consists of three components:

  1. BaseEnvironment — Abstract interface for simulation environments
  2. TextWorldEnvironment — Deterministic text-based world with objects, screens, and prediction violations
  3. EmbodiedAgent — Wrapper connecting the CIA system to an environment in an observe-think-act loop

Important caveat: CIA's text-world is a purely computational simulation. It has no physical sensors, no spatial reality, and no genuine embodiment. The "environment" is a text generator, and the "agent" is a text-processing pipeline. This setup tests whether the CIA cognitive architecture can maintain coherent state when interacting with a simulated world — it does not demonstrate that the system is embodied in any meaningful physical sense.


2. BaseEnvironment Interface

Location: src/cia/environment/base_env.py

All simulation environments in CIA must implement the BaseEnvironment abstract class, which defines five methods:

from abc import ABC, abstractmethod

class BaseEnvironment(ABC):
    @abstractmethod
    def reset(self) -> dict[str, Any]:
        """Reset environment to initial state."""
        ...

    @abstractmethod
    def observe(self) -> str:
        """Return current observation as text."""
        ...

    @abstractmethod
    def step(self, action: str) -> dict[str, Any]:
        """Execute action, return {reward, done, info}."""
        ...

    @abstractmethod
    def available_actions(self) -> list[str]:
        """Return currently available actions."""
        ...

    @abstractmethod
    def state_summary(self) -> dict[str, Any]:
        """Return environment state summary."""
        ...

This interface follows the standard reinforcement learning environment pattern (similar to OpenAI Gym), allowing CIA to integrate with existing environment frameworks by writing thin adapter classes.


3. TextWorldEnvironment

Location: src/cia/environment/text_world.py

The TextWorldEnvironment implements a deterministic text-based world with objects, a screen (occluder), and prediction violation events. It is designed to test object permanence, prediction tracking, and attention responses to unexpected events.

3.1 Initial State

The environment starts with a configurable set of objects (default: "red ball", "blue cup", "green book") placed on a table. A screen/occluder is available in the room. All objects are initially visible.

from cia.environment.text_world import TextWorldEnvironment

env = TextWorldEnvironment(
    seed=42,
    room_objects=["red ball", "blue cup", "green book"],
    has_screen=True,
)
env.reset()
observation = env.observe()
# "You see: red ball, blue cup, green book. A screen is in the room, nothing behind it."

3.2 Available Actions

The environment supports a set of text-based actions:

Action Format Effect
Look "look" Returns current observation text
Hide "hide <object>" Moves a visible object behind the screen
Reveal "reveal" Removes the screen, making all hidden objects visible
Move "move <object> <location>" Changes an object's location (e.g., "move red ball shelf")
Wait "wait" Passes one time step; random chance (30%) of prediction violation event
actions = env.available_actions()
# ["look", "wait", "hide red ball", "hide blue cup", "hide green book",
#  "move red ball shelf", "move red ball floor", ...]

3.3 Object Permanence

Object permanence is a foundational cognitive capacity — the understanding that objects continue to exist even when unobserved. The text-world tests this through hide/reveal sequences:

# Hide an object behind the screen
result = env.step("hide red ball")
# {"reward": 0.1, "done": False, "info": {"observation": "red ball moved behind the screen."}}

# The object is no longer visible but still exists
observation = env.observe()
# "You see: blue cup, green book. A screen is in the room. 1 object(s) may be behind it."

# Reveal hidden objects
result = env.step("reveal")
# {"reward": 0.2, "done": False, "info": {"observation": "The screen is removed. All objects are visible."}}

When the CIA system processes these observations through its cognitive pipeline, the predictive world model tracks the expected state of objects. If the system maintains predictions about hidden objects that are confirmed upon reveal, this indicates successful object permanence tracking — a relevant indicator for theories that connect consciousness to coherent world modeling (Butlin et al. 2023, 2025).

3.4 Prediction Violation Events

The "wait" action introduces stochastic prediction violation events with 30% probability per step. These violations test the system's response to unexpected changes:

  • Object disappearance: A visible object unexpectedly vanishes and moves behind the screen.
  • Object reappearance: A hidden object unexpectedly reappears.
result = env.step("wait")
# Possible outcomes:
# 1. "Nothing happened." (70% chance)
# 2. "red ball vanished unexpectedly!" (prediction_violation=True)
# 3. "green book reappeared unexpectedly!" (prediction_violation=True)

When a prediction violation occurs, the info dictionary includes {"prediction_violation": True}, allowing the embodied agent to detect and respond to these events. The CIA system's predictive world model should register increased prediction error on violation inputs, which is measurable through the PredictionState.prediction_error field.

The prediction violation mechanism draws on the predictive processing framework implicit in Butlin et al. (2023), which emphasizes that consciousness-relevant systems should not merely process inputs but should maintain generative models that predict expected inputs and flag violations. The degree to which a system detects and responds to prediction violations is therefore a relevant — though not sufficient — indicator.

3.5 Determinism and Reproducibility

The environment uses a seeded pseudorandom number generator (random.Random(seed)) for all stochastic events. With the same seed, the same sequence of "wait" actions will produce identical prediction violation patterns, ensuring experiment reproducibility.

env_deterministic = TextWorldEnvironment(seed=42)
env_deterministic.reset()
# Repeating the same actions will always produce the same outcomes

4. EmbodiedAgent Wrapper

Location: src/cia/environment/embodied_agent.py

The EmbodiedAgent connects a CIA system to a simulation environment, implementing the observe-think-act loop:

4.1 Architecture

Environment ←observe→ EmbodiedAgent ←think→ CIA System
     ↑                                                |
     └──────── action (selected from attention focus) ─┘
from cia.simulation import CombinedConsciousnessIndicatorSystem
from cia.environment.text_world import TextWorldEnvironment
from cia.environment.embodied_agent import EmbodiedAgent

system = CombinedConsciousnessIndicatorSystem()
env = TextWorldEnvironment(seed=42)
agent = EmbodiedAgent(system, env)

agent.reset()
result = agent.step()
# {"step": 1, "observation": "You see: ...", "action": "look", 
#  "report": SimulationReport(...), "reward": 0.0, "done": False}

4.2 Action Selection

The agent selects actions based on the CIA system's attention focus from the most recent cognitive cycle:

  1. The observation text is processed through the full CIA pipeline.
  2. The attention controller selects a focus from competing content items.
  3. The agent tries to find an available action that matches the attention focus.
  4. If no match is found, the agent defaults to "look".

This mechanism connects the CIA's attention system to environmental interaction, allowing researchers to evaluate whether attention-driven action selection produces coherent behavior in the text-world.

4.3 Multi-Step Execution

results = agent.run_n_steps(10)
for r in results:
    print(f"Step {r['step']}: action={r['action']}, reward={r['reward']:.2f}")

5. Self/World Distinction Tracking

The EmbodiedAgent maintains a self/world distinction log that separates world observations from self-model states:

agent.reset()
agent.run_n_steps(5)

log = agent.self_world_log
for entry in log:
    if entry["type"] == "world_observation":
        print(f"[WORLD] {entry['content']}")
    elif entry["type"] == "self_model_state":
        print(f"[SELF]  {entry['content']} (confidence: {entry['confidence']:.2f})")

Each step produces two log entries: 1. World observation: The raw text from the environment (source: "environment") 2. Self-model state: The system's current belief after processing (source: "self_model")

This tracking allows researchers to evaluate whether the system maintains a distinction between external world states and its own internal representations — a capacity relevant to self-awareness indicators described by Butlin et al. (2023, 2025) and the higher-order thought framework underlying the CIA self-model module.


6. Why Embodiment Testing Matters for Indicators

Embodiment testing matters for consciousness indicator evaluation for several reasons:

  1. Object permanence: A system that maintains coherent predictions about hidden objects demonstrates a form of world modeling that goes beyond purely linguistic processing. Butlin et al. (2023) identify this as a relevant indicator.

  2. Prediction violation responses: The text-world's stochastic violation events test whether the system detects unexpected state changes, updates its models accordingly, and potentially shifts attention — all of which are relevant to predictive processing indicators.

  3. Self/world distinction: Maintaining separate representations for "what the world is like" and "what I believe about the world" is a prerequisite for the self-model indicator and the attention schema consistency indicator.

  4. Attention-driven action: When the agent's attention focus determines its actions in the environment, the global broadcast and attention indicators have observable behavioral consequences, making them easier to evaluate.

  5. Temporal coherence: Multi-step interaction requires the system to maintain coherent state across time, testing memory continuity and self-model stability.

However, it is critical to note that text-world embodiment is a severe limitation compared to physical embodiment. The environment is purely textual, the objects have no spatial reality, and the agent's "actions" are string operations. These tests evaluate architectural properties in a simplified setting — they do not demonstrate that the system understands physical space, has genuine sensorimotor experience, or possesses embodied cognition in any meaningful sense.


7. Research Anchors

Reference Relevance to Embodiment Testing
Butlin et al. (2023) "Consciousness in Artificial Intelligence" Identifies embodiment-relevant indicators including object permanence and prediction violation
Butlin et al. (2025) "Identifying indicators of consciousness in AI systems" Emphasizes the importance of evaluating indicators in interactive, environmentally coupled contexts
Baars (2005) Global Workspace Theory The workspace broadcast mechanism gains additional relevance when connected to environmental action
Shanahan & Baars (2005) Applying GWT to frame problem Addresses how globally broadcast information resolves ambiguity in environmental interaction
Graziano & Webb (2015) Attention Schema Theory Self-modeling of attention gains behavioral relevance when attention drives environmental action
Albantakis et al. (2023) IIT 4.0 Causal integration metrics can be evaluated in the context of environmental coupling

8. Summary

The embodiment subsystem provides a text-based simulation environment, an embodied agent wrapper, and self/world distinction tracking to test consciousness-relevant indicators in an interactive context. The text-world supports object permanence scenarios, prediction violation events, and attention-driven action selection. These tests evaluate whether the CIA cognitive architecture maintains coherent state when coupled to a simulated environment — a prerequisite for many consciousness indicators. However, text-world embodiment is a dramatic simplification of physical embodiment. No result from these tests proves that the system has genuine spatial understanding, sensorimotor experience, or subjective experience of an environment.