Frontal Cue Integration
Claim Type: Architectural Commitment Scope: V3 Depends On: ARC-035, MECH-081, MECH-082, SD-005, SD-010 Status: candidate Claim ID: ARC-041 Registered: 2026-03-31
1. The Architectural Gap
What is currently missing
E1 currently contributes to downstream planning through a single output channel: generate_prior(), which produces a terrain_prior [batch, world_dim] passed into HippocampalModule for terrain conditioning (SD-002, ARC-007). This prior is generated by reading ContextMemory with the full concatenated [z_self, z_world] as query, then projecting through prior_generator. It is a bulk associative prior over world-domain structure.
The critical limitation of this prior is that it is context-agnostic at the sensory-cue level. It does not distinguish which specific z_world cue patterns are present in the current moment. Every call to generate_prior() with the same composite state produces the same bulk output regardless of which exteroceptive features dominate z_world. The prior can shift with the full state, but it cannot selectively activate different stored associations for different sensory contexts when the self-state is held roughly constant.
This matters for two pathways that currently do not exist:
1. Cue-indexed action affordance weighting (E2). HippocampalModule navigates in action-object space O (SD-004). The action objects it proposes are generated via E2.action_object(z_world, action) -> o_t. There is no mechanism by which E1’s stored associations – built up over many episodes of encountering hazard cues, resource cues, safe-passage cues – can elevate or suppress the apparent affordance of specific action objects given the current sensory context. E1 has no write path into the action-object manifold.
2. Cue-indexed terrain precision modulation (E3). E3 scores trajectories via harm_eval_z_harm_head and benefit_eval_head. ARC-016 provides dynamic precision as a single temporal scalar derived from running_variance – the EMA of recent prediction error. This precision is not context-specific: it is a measure of how uncertain E3 has been recently, not of what the current sensory cues predict about the harm/goal relevance of the upcoming terrain. There is no pathway by which a specific z_world cue pattern (a hazard gradient, a resource cluster, an exit passage) can modulate the relative weighting of harm versus goal scoring before harm accumulates in z_harm_a.
Cross-references to existing partial treatments
ARC-035 (vmPFC.md) documents the stored/active distinction and specifies four content classes that vmPFC must activate into the navigable state: prior outcome residue, social/identity constraints, safety memories, and goal approach pull. It establishes that activation is necessary for these contents to participate in trajectory evaluation – stored alone is insufficient. However, ARC-035 does NOT specify how retrieval is triggered. It does not specify the mechanism by which a sensory cue in z_world indexes into stored associations to produce the activation. This document specifies that mechanism.
MECH-082 (e1_e2_constraint_propagation.md) documents top-down perceptual bias via E2 model distortion: hippocampal map geometry biases E2 predictions, which via the E2 -> E1 sufficiency constraint (MECH-081) re-directs E1 attentional sampling toward threat-consistent sensory dimensions. This is a population-level attentional bias operating through map geometry. It does NOT specify: (a) cue-indexed modulation of action-object affordances at the level of individual trajectory proposals, or (b) selective scaling of harm versus goal terrain precision based on current sensory context.
MECH-081 (e1_e2_constraint_propagation.md) documents E2’s sufficiency constraint on E1 feature discovery – E2’s task requirement implicitly narrows which covariances E1 must resolve. This is a representational shaping mechanism operating over learning timescales. It is not a runtime mechanism for cue-indexed retrieval.
Biological framing
The vmPFC/OFC literature provides the biological ground for why cue-indexed anticipatory preparation is architecturally necessary, not optional.
Damasio’s somatic marker hypothesis (1994) proposes that specific sensory features of a decision situation activate stored affective associations – markers from prior outcomes – that bias decision-making before deliberate evaluation completes. The marker is triggered by the cue, not by encountering the outcome. This is anticipatory, not reactive.
Bechara, Damasio, Damasio, and Anderson (1997) demonstrated this directly on the Iowa Gambling Task. Participants with intact vmPFC/OFC showed skin conductance responses (SCRs) before selecting from disadvantageous decks – a pre-decisional somatic signal that the deck is dangerous. This SCR preceded the conscious recognition that the deck was disadvantageous by many trials. Critically: the signal was triggered by the specific deck cue, not by receiving a loss. The sensory context alone was sufficient to activate the harm-anticipatory signal.
Participants with vmPFC lesions showed no anticipatory SCR. They could eventually learn which decks were disadvantageous through deliberate reasoning, but the cue-triggered anticipatory modulation – the mechanism that prepares harm salience before harm arrives – was absent. Their terrain precision was flat regardless of sensory context.
The REE architectural gap formalizes this: without a cue-indexed pathway from E1 stored associations to E2 affordance weighting and E3 terrain precision, the system can only register harm reactively (via z_harm_a accumulation) and adjust precision after the fact (via ARC-016 running variance). The anticipatory function documented in the Iowa Gambling Task data requires a separate preparatory channel triggered by the cue itself.
2. The E1 Frontal Cue-Indexing Mechanism
Pattern completion from z_world
E1’s ContextMemory (16 attention slots, memory_dim = hidden_dim) implements soft-attention retrieval via read(query: Tensor) -> Tensor. The standard use path – predict_long_horizon() and generate_prior() – queries ContextMemory with the full concatenated [z_self, z_world] as the query vector.
The new mechanism uses z_world alone as the query. This is not merely a notational change. By restricting the query to the exteroceptive channel, the retrieval becomes indexed exclusively by what the agent perceives in the world – the hazard gradient, the resource distribution, the structural features of the current environment – independent of the agent’s current proprioceptive self-state. This separation is what allows a hazard-cue context to activate harm-associated memories even when z_self is at a neutral baseline.
The read operation proceeds identically to the existing implementation: query_proj maps the query to memory_dim; keys and values are projected from the 16 memory slots; scaled dot-product attention weights are computed; the weighted combination of values is returned through output_proj. The output is cue_context [batch, latent_dim] – a soft-attended mixture of the ContextMemory slots weighted by their similarity to the current world-cue pattern. Note: ContextMemory.read() returns shape [batch, latent_dim=64] (output of output_proj: Linear(memory_dim=128, latent_dim=64)), which equals self_dim + world_dim.
However, there is a dimension mismatch to resolve in implementation: ContextMemory’s query_proj expects input of shape [batch, latent_dim=64] (full [z_self, z_world] concatenation), but the new mechanism queries with z_world alone (shape [batch, world_dim=32]). The implementation must use either (a) a separate world_query_proj: Linear(world_dim, memory_dim) added to E1, or (b) zero-pad z_world to latent_dim before querying. The SD-016 document and implementation spec should use option (a) (separate projection head) for clarity.
This is pattern completion from a partial cue. The query contains only the world-channel features, but the memory slots encode associations built from full [z_self, z_world] experience. The retrieval is biased toward slots that were written during episodes sharing the current z_world features, regardless of what self-state was present at write time.
Two new projection heads
Two new linear heads convert cue_context [batch, latent_dim=64] into the downstream modulation signals:
cue_action_proj: Linear(latent_dim=64, action_object_dim=16) – projects cue_context into action-object space, producing action_bias [batch, action_object_dim]. No activation function: the bias is additive and should allow both positive (affordance elevation) and negative (affordance suppression) modulation.
cue_terrain_proj: Linear(latent_dim=64, 2) followed by sigmoid – projects cue_context to a two-element vector and squashes it to (0, 1), producing terrain_weight [batch, 2] = [w_harm, w_goal]. The sigmoid ensures both weights are strictly positive and bounded, allowing them to function as multiplicative precision scalers without sign inversion.
New method
def extract_cue_context(
self,
z_world: torch.Tensor, # [batch, world_dim]
) -> Tuple[torch.Tensor, torch.Tensor]:
cue_context = self.context_memory.read(z_world)
action_bias = self.cue_action_proj(cue_context)
terrain_weight = torch.sigmoid(self.cue_terrain_proj(cue_context))
return action_bias, terrain_weight
This method is distinct from generate_prior() in two respects: the query is z_world only (not full state), and the outputs are typed for downstream consumption (action-object space and terrain precision), not for HippocampalModule terrain conditioning. The two pathways carry different information and should not be merged.
Biological grounding
OFC and vmPFC perform pattern completion from partial sensory cues via hippocampal-cortical loops (Murray and Izquierdo 2007, OFC reversal learning). When the sensory context changes – a new deck, a new spatial cue, a new social context – OFC rapidly indexes the stored valence and constraint associations relevant to that specific context without requiring deliberate recollection. This is the biological substrate for the context_memory.read(z_world) operation.
mPFC provides contextual gating on basal ganglia action selection (Fuster 2008). The prefrontal-striatal projection does not select actions directly; it gates the gain on action representations in striatum, biasing which action clusters receive amplified drive given the current context. This is the biological substrate for action_bias modulating action-object affordances in HippocampalModule.
3. The E1->E2 Action Modulation Pathway (MECH-151)
Current pathway
E2’s action_object(z_world, action) -> o_t [action_object_dim] produces a compressed world-effect representation for each (z_world, action) pair (SD-004). HippocampalModule navigates in action-object space O: it proposes trajectory sequences as paths through action-object coordinates, scored by E3 on harm and goal criteria. The action-object representation determines the affordance manifold – which actions appear available and consequential from the current world state.
New pathway
After E1 ticks (theta rate, see Section 6), extract_cue_context(z_world) returns action_bias [batch, action_object_dim]. The biased action object is:
o_t_biased = o_t + action_bias
HippocampalModule receives o_t_biased in place of o_t when navigating candidate trajectories. The additive structure means that action_bias shifts the position of each action object in O: contextually appropriate action-objects are moved toward regions the hippocampal map treats as higher-viability; contextually inappropriate ones are shifted away. The shape of the affordance manifold is preserved; its orientation relative to the viability map is contextually modulated.
What this achieves
Hazard-cue context in z_world activates ContextMemory slots associated with prior avoidance episodes. These slots, written when the agent was navigating around hazards, encode the association between hazard-context features and avoidance-type action-objects. action_bias derived from these slots elevates the apparent affordance of avoidance action-objects and attenuates approach action-objects. HippocampalModule’s search is biased before any harm accumulates in z_harm_a.
Resource-proximate context activates slots associated with prior successful approach episodes. action_bias elevates approach affordances. The agent’s action-object search is pre-oriented toward the relevant region of O without waiting for E3 to score multiple candidate trajectories.
Distinction from MECH-116
MECH-116 (goal latent conditioning) provides tonic action bias via z_goal conditioning of E1’s LSTM input: goal_input_proj([z_self, z_world, z_goal]). This is a persistent, goal-maintained bias that operates regardless of what sensory cues are currently present. It represents the standing directional pull of the active goal.
MECH-151 is cue-specific. It is indexed by z_world and changes with the sensory context. A hazard-cue context produces a different action_bias than a resource-cue context or a safe-passage context, even if z_goal is identical across all three. The two mechanisms compose: tonic goal-maintenance pull (MECH-116) sets the general direction; cue-indexed affordance modulation (MECH-151) adjusts the local manifold geometry for the current context.
Biological analog
OFC and DLPFC provide top-down gating on striatal action selection (Frank and Claus 2006, frontostriatal interaction). Prefrontal input does not select actions in striatum; it biases the gain on action representations, modulating which action clusters receive amplified corticostriatal drive. The striatal competition (BG three-loop model, ARC-021) operates downstream of this bias. This is the mechanism: prefrontal contextual gating on affordance gain, not direct action selection.
4. The E1->E3 Terrain Precision Modulation Pathway (MECH-152)
Current E3 precision
E3’s dynamic precision (ARC-016) is maintained as _running_variance – the EMA of prediction error MSE across recent committed trajectories. current_precision = 1 / (_running_variance + 1e-6). This determines the commit threshold: when variance is low (prediction errors have been small), the threshold is tighter; when variance is high (predictions have been consistently wrong), the threshold is looser.
This is temporal precision: it reflects how well E3 has been predicting recently. It does not reflect what the current sensory context predicts about the harm/goal terrain ahead.
New pathway
terrain_weight [w_harm, w_goal] (both in (0, 1) via sigmoid) scales E3 scoring:
harm_score_scaled = harm_score * w_harm
goal_score_scaled = goal_score * w_goal
The combined trajectory score uses scaled values. No other aspect of E3 scoring changes.
Context-specific examples
| Sensory context | Expected terrain_weight | Effect |
|---|---|---|
| Hazard-gradient z_world | w_harm > 0.8, w_goal < 0.5 | Harm avoidance dominates; goal approach muted |
| Resource-proximate z_world | w_goal > 0.8, w_harm < 0.5 | Goal approach elevated; harm suppressed unless strong |
| Safe-passage z_world | w_harm ~= 0.5, w_goal ~= 0.5 | Balanced; ARC-016 temporal variance drives commit threshold |
| Novel/ambiguous z_world | w_harm ~= 0.5, w_goal ~= 0.5 | Uniform attention; no slot matches strongly |
Distinction from ARC-016
ARC-016 is temporal: it measures how accurate E3 has been recently. MECH-152 is contextual: it measures what the current z_world cue pattern predicts about relative importance of harm versus goal terrain. They compose multiplicatively:
effective_harm_precision = (1 / running_variance) * w_harm
effective_goal_precision = (1 / running_variance) * w_goal
Biological grounding
vmPFC modulates somatic marker signal precision by sensory context (Bechara et al. 1994, Iowa Gambling Task). The canonical failure mode: vmPFC lesion produces flat w_harm = w_goal regardless of sensory context. The patient does not fail to represent harm outcomes; what is absent is the cue-indexed preparation that weights harm evaluation appropriately before harm is encountered.
5. Relationship to vmPFC (ARC-035)
ARC-035 specifies four content classes. It does not specify how retrieval is triggered. This document specifies the retrieval mechanism: context_memory.read(z_world) performs soft-attention pattern completion from the current exteroceptive cue pattern. The dual downstream pathways – action_bias -> E2 and terrain_weight -> E3 – specify how activated content reaches the two downstream systems.
Mapping the four content classes
| Content class (ARC-035) | Storage substrate | Cue-indexed retrieval mechanism | Downstream effect |
|---|---|---|---|
| Prior outcome residue | ContextMemory slots written during high-error episodes | z_world matching hazard features retrieves harm-associated slots | Elevated w_harm; biased action-object manifold toward avoidance |
| Safety memories and extinction context | ContextMemory slots from successful safe-passage episodes | z_world matching safe-context features retrieves safety slots | Elevated w_goal + attenuated w_harm |
| Goal approach pull | Tonic via MECH-116 (z_goal conditioning E1 LSTM) | Not z_world-indexed – tonic goal maintenance | terrain_weight w_goal gates whether tonic goal pull is expressed in E3 scoring |
| Social and identity constraints | Not yet wired in V3 | V4 scope – requires social observation channels | V4: social constraint content retrieved by social-cue z_world features |
6. Temporal Dynamics and Multi-Rate Integration
E1 operates at the theta rate, ticking every N_e1 steps via MultiRateClock (ARC-032). extract_cue_context(z_world) is called at each E1 tick using the current z_world. The resulting action_bias and terrain_weight are cached in the agent’s working state and held constant until the next E1 tick.
All E2 action proposals within a single theta cycle receive the same action_bias. All E3 scoring calls within a theta cycle use the same terrain_weight. This ensures that trajectory candidates are evaluated on a consistent harm/goal balance within a planning cycle.
ARC-032 specifies that E1’s primary output pathway to E3 operates at the theta rate. MECH-150 is consistent with this – it adds a new output channel to the existing theta-rate tick.
7. Implementation Sketch (ree-v3)
New E1 method
def extract_cue_context(
self,
z_world: torch.Tensor, # [batch, world_dim]
) -> Tuple[torch.Tensor, torch.Tensor]:
"""
E1 frontal cue-indexed association retrieval (MECH-150).
Uses z_world as query to ContextMemory (exteroceptive cues only).
Returns:
action_bias: [batch, action_object_dim] -- for E2 (MECH-151)
terrain_weight: [batch, 2] in (0,1) -- [w_harm, w_goal] for E3 (MECH-152)
"""
cue_context = self.context_memory.read(z_world)
action_bias = self.cue_action_proj(cue_context)
terrain_weight = torch.sigmoid(self.cue_terrain_proj(cue_context))
return action_bias, terrain_weight
New E1Config parameters
# In E1Config (ree_core/utils/config.py):
action_object_dim: int = 16 # must match E2Config.action_object_dim
sd016_enabled: bool = False # backward compat flag; False = old behavior
New projection heads (added in E1DeepPredictor.init)
if getattr(config, 'sd016_enabled', False):
# cue_context_dim = output dim of ContextMemory.read() = latent_dim = 64
# (output_proj: Linear(memory_dim=128, latent_dim=64))
cue_context_dim = self.config.self_dim + self.config.world_dim # = latent_dim = 64
# Separate projection for z_world-only query (world_dim=32, not full latent_dim=64)
self.world_query_proj = nn.Linear(self.config.world_dim, self.config.hidden_dim)
self.cue_action_proj = nn.Linear(cue_context_dim, self.config.action_object_dim)
self.cue_terrain_proj = nn.Linear(cue_context_dim, 2)
E2 interface change
def action_object(
self,
z_world: torch.Tensor,
action: torch.Tensor,
action_bias: Optional[torch.Tensor] = None,
) -> torch.Tensor:
z_a = torch.cat([z_world, action], dim=-1)
o_t = self.action_object_head(z_a)
if action_bias is not None:
o_t = o_t + action_bias
return o_t
E3 interface change
def score_trajectory(self, trajectory, terrain_weight=None, ...):
harm_score = self.compute_ethical_cost(trajectory)
goal_score = self.benefit_eval(final_world_state)
if terrain_weight is not None:
harm_score = harm_score * terrain_weight[:, 0]
goal_score = goal_score * terrain_weight[:, 1]
Agent integration (agent.py)
At each E1 tick, after e1.forward():
if self.config.sd016_enabled:
action_bias, terrain_weight = self.e1.extract_cue_context(latent.z_world)
self._cached_action_bias = action_bias
self._cached_terrain_weight = terrain_weight
8. New Claim IDs
- MECH-150: E1 cue-indexed association retrieval
- MECH-151: E1->E2 action affordance modulation
- MECH-152: E1->E3 terrain precision modulation
- ARC-041: Frontal cue-weighting circuit
- INV-040: Sensory-contextual cue sufficiency for terrain activation
V3/V4 scope: all of the above are V3 scope. Social/identity constraint content class extension is V4 scope.
9. Registered Claims Table
| Claim ID | Subject | Title |
|---|---|---|
| MECH-150 | e1.cue_indexed_association_retrieval | E1 cue-indexed association retrieval |
| MECH-151 | e1_e2.cue_indexed_action_affordance_modulation | E1->E2 action affordance bias |
| MECH-152 | e1_e3.cue_indexed_terrain_precision_modulation | E1->E3 terrain precision scaling |
| ARC-041 | architecture.frontal_cue_weighting_circuit | Frontal cue-weighting integration circuit |
| INV-040 | ethics.sensory_cue_sufficiency_for_terrain_activation | Sensory cues sufficient for ethical terrain activation |
Cross-Links
| Document | Relationship |
|---|---|
| vmPFC.md | ARC-035: stored/active distinction and four content classes; this document specifies the retrieval mechanism ARC-035 does not cover |
| hippocampal_systems.md | SD-002: E1 associative prior to HippocampalModule via terrain_prior; new pathway adds action_bias into action-object navigation |
| e1_e2_constraint_propagation.md | MECH-081/082: existing closest mechanisms (top-down perceptual bias and E2 sufficiency constraint) |
| sd_016_frontal_cue_integration.md | SD-016: implementation specification for extract_cue_context() |
| sd_011_dual_nociceptive_streams.md | SD-011: z_harm streams; terrain_weight w_harm modulates E3 scoring on z_harm inputs |