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: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:All Event Feedback Channels
All Event Feedback Channels
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
- 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)
Surprise-Scaled Parameters
Feedback stimulation parameters scale with surprise magnitude:Exponential Moving Average (EMA)
To stabilize surprise estimates, TD errors are smoothed over time:ema_beta = 0.99: Heavy smoothing, slow adaptationema_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:- Agent takes damage
- Trigger unpredictable stimulation on damage channels
- Low-frequency (5 Hz) irregular pulses for 4 seconds
- Rest for 4 seconds
- 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
Feedback Types
Feedback Command Types
Feedback Command Types
Type 0: InterruptStops ongoing stimulation on specified channels. Used to clear feedback before new events.Type 1: Event FeedbackDelivers event-specific feedback with surprise scaling.Type 2: Reward FeedbackDelivers binary reward/punishment signals based on step rewards.
CL1 Feedback Application
Applying Feedback to Hardware
- Interrupt commands clear ongoing feedback
- Event/reward feedback uses same biphasic pulse design as encoder
- Stimulation designs are cached (LRU, maxsize=2048)
- 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
Design Rationale
Why Separate Feedback Channels?
- Avoid Confounding: Encoder-decoder loop learns from spike responses without reward information leaking in
- Clear Attribution: Feedback channels explicitly signal reward, not game state
- Biological Plausibility: Mimics reward pathways (dopamine, etc.) separate from sensory processing
- Debugging: Can disable feedback without affecting encoder-decoder functionality
Why Surprise Scaling?
- Learning Efficiency: Focus neural resources on unexpected events
- Curriculum Learning: Automatic adjustment as value function improves
- Biological Relevance: Mimics prediction error signals in animal brains
- Sample Efficiency: Strong feedback when it matters most
Why Unpredictable Stimulation?
- Aversion Learning: Irregular patterns harder to adapt to, maintaining discomfort
- Safety Incentive: Encourages damage avoidance behaviors
- Biological Realism: Pain responses in animals are persistent and irregular
Monitoring Feedback
The CL1 interface logs feedback commands:- Events: Episode metadata logged
- Feedback: Total feedback commands processed
- Avg spikes: Overall neural activity level
Future Directions
Potential Enhancements
Potential Enhancements
Adaptive Feedback Scaling
- Automatically tune
base_amplitudeandbase_frequencybased on neural response - Detect and compensate for neural adaptation over time
- Combine frequency/amplitude/pulse count scaling
- Explore temporal patterns (bursts, ramps)
- Learn which channels are most effective for reward signaling
- Adaptively allocate feedback across channel subsets
- Adjust feedback based on decoder confidence
- Reduce feedback when decoder is certain, increase when uncertain