Skip to main content

Overview

Beyond the encoder-decoder loop, the DOOM Neuron system provides event-based feedback stimulation to biological neurons. This feedback acts as an auxiliary teaching signal, delivering reward/punishment information through dedicated neural channels based on game events and temporal-difference (TD) prediction errors.

Feedback Architecture

The feedback system operates in parallel to the main encoder-decoder loop:

Feedback Channel Types

Reward Feedback Channels

Dedicated channels for general positive/negative reward signals:
Purpose: Provide binary reward/punishment feedback based on step-level rewards:
Reward feedback channels are separate from encoding/action channels to avoid confounding the encoder-decoder learning. The decoder doesn’t read from these channels.

Event Feedback Channels

Dedicated channels for specific game events with surprise-based scaling:
Event Types:
Positive Events (Rewards):
  • enemy_kill [35, 36, 38]: Agent eliminates an enemy
  • armor_pickup [39, 40, 43]: Agent collects armor item
  • approach_target [5, 6, 11]: Agent moves closer to enemy
Negative Events (Punishments):
  • took_damage [44, 47, 48]: Agent receives damage
  • ammo_waste [52, 54, 55]: Agent shoots without hitting
  • retreat_target [12, 15, 16]: Agent moves away from enemy

Surprise Scaling

Temporal-Difference (TD) Error

Feedback intensity is modulated by surprise - how unexpected the event was:
TD error measures prediction error:
  • Positive TD: Event better than expected (surprising reward)
  • Negative TD: Event worse than expected (surprising punishment)
  • Zero TD: Event perfectly predicted (no surprise)
By scaling feedback with TD error, the system emphasizes unexpected outcomes that provide the most learning value.

Surprise-Scaled Parameters

Feedback stimulation parameters scale with surprise magnitude:
Example: Enemy kill with high surprise
Surprise scaling acts as a natural curriculum: Early in training, most events are surprising (high TD errors), producing strong feedback. As the value function improves, only genuinely unexpected events trigger strong feedback.

Exponential Moving Average (EMA)

To stabilize surprise estimates, TD errors are smoothed over time:
EMA prevents single outlier TD errors from dominating feedback:
  • ema_beta = 0.99: Heavy smoothing, slow adaptation
  • ema_beta = 0.90: Faster adaptation to changing predictions

Unpredictable Stimulation

Damage Aversion Learning

Certain negative events (like taking damage) use unpredictable stimulation to create aversion:
Purpose: Create persistent, uncomfortable stimulation that the agent learns to avoid. Mechanism:
  1. Agent takes damage
  2. Trigger unpredictable stimulation on damage channels
  3. Low-frequency (5 Hz) irregular pulses for 4 seconds
  4. Rest for 4 seconds
  5. Repeat pattern if damage continues
Unpredictable stimulation differs from regular feedback:
  • Duration: Lasts seconds, not milliseconds
  • Pattern: Irregular, low-frequency (harder for neurons to adapt)
  • Channels: Same as event feedback but with different parameters
  • Goal: Aversion learning, not just event signaling

Feedback Command Protocol

UDP Packet Format

Packet Structure (120 bytes total):

Feedback Types

Type 0: Interrupt
Stops ongoing stimulation on specified channels. Used to clear feedback before new events.Type 1: Event Feedback
Delivers event-specific feedback with surprise scaling.Type 2: Reward Feedback
Delivers binary reward/punishment signals based on step rewards.

CL1 Feedback Application

Applying Feedback to Hardware

Key Points:
  1. Interrupt commands clear ongoing feedback
  2. Event/reward feedback uses same biphasic pulse design as encoder
  3. Stimulation designs are cached (LRU, maxsize=2048)
  4. Non-blocking socket prevents loop stalls

Feedback Timing

Step-Level Feedback

Reward feedback is sent after each environment step:

Event-Level Feedback

Event feedback is sent when specific events occur:

Episode-Level Feedback

Optional feedback at episode end based on total episode performance:

Configuration

Feedback Parameters

Start with conservative feedback parameters (low amplitude, low pulse counts) and gradually increase if neurons don’t respond. Excessive feedback can cause adaptation or desensitization.

Design Rationale

Why Separate Feedback Channels?

  1. Avoid Confounding: Encoder-decoder loop learns from spike responses without reward information leaking in
  2. Clear Attribution: Feedback channels explicitly signal reward, not game state
  3. Biological Plausibility: Mimics reward pathways (dopamine, etc.) separate from sensory processing
  4. Debugging: Can disable feedback without affecting encoder-decoder functionality

Why Surprise Scaling?

  1. Learning Efficiency: Focus neural resources on unexpected events
  2. Curriculum Learning: Automatic adjustment as value function improves
  3. Biological Relevance: Mimics prediction error signals in animal brains
  4. Sample Efficiency: Strong feedback when it matters most

Why Unpredictable Stimulation?

  1. Aversion Learning: Irregular patterns harder to adapt to, maintaining discomfort
  2. Safety Incentive: Encourages damage avoidance behaviors
  3. Biological Realism: Pain responses in animals are persistent and irregular

Monitoring Feedback

The CL1 interface logs feedback commands:
Statistics:
  • Events: Episode metadata logged
  • Feedback: Total feedback commands processed
  • Avg spikes: Overall neural activity level

Future Directions

Adaptive Feedback Scaling
  • Automatically tune base_amplitude and base_frequency based on neural response
  • Detect and compensate for neural adaptation over time
Multi-Modal Feedback
  • Combine frequency/amplitude/pulse count scaling
  • Explore temporal patterns (bursts, ramps)
Channel-Specific Learning
  • Learn which channels are most effective for reward signaling
  • Adaptively allocate feedback across channel subsets
Closed-Loop Feedback
  • Adjust feedback based on decoder confidence
  • Reduce feedback when decoder is certain, increase when uncertain