Q&A: Phase 21.3 — EmpathyEngine Bayesian profiles, mirror strength & compassion thresholds #505
Unanswered
web3guru888
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
EmpathyEngine — Frequently Asked Questions
Q1: What's the difference between COGNITIVE and AFFECTIVE empathy in this system?
COGNITIVE empathy is pure inference — the engine predicts what another agent is feeling based on accumulated observations, without modifying its own emotional state. Think of it as "cold" understanding: "Based on 2 interactions, agent-X is likely frustrated (low confidence)."
AFFECTIVE empathy involves the
mirror()mechanism — the engine actually blends the target's PAD state into its own, producing a partial emotional resonance. Withmirror_strength = 0.3, the engine absorbs 30% of the target's emotional state. This allows downstream components (ResponseGenerator, DialogueManager) to produce more emotionally congruent responses.The key architectural difference: COGNITIVE only reads from profiles; AFFECTIVE reads AND writes to the engine's own emotional state via mirroring.
Q2: How does the Bayesian update actually work? Is it a full Bayesian posterior?
It's a simplified exponential moving average that approximates Bayesian updating:
With default
perspective_decay = 0.1:α = 1.0→ pure prior (no data yet)α = 0.1→ 90% observationα = 0.001→ 99.9% observationα = 0.00001→ effectively pure observationThis is not a full conjugate prior/likelihood Bayesian update (which would require modeling the observation noise distribution). Instead, it captures the key property: more observations → prior matters less. The exponential decay makes convergence very fast, which is appropriate for social contexts where recent behavior is most informative.
Q3: How should I tune
mirror_strength?mirror_strengthcontrols the blending weight for affective mirroring:0.00.1–0.20.3(default)0.5–0.71.0Values above 0.5 risk emotional feedback loops — if two agents mirror each other with high strength, negative emotions can amplify. The MoodRegulator (Phase 21.2) provides damping to prevent this, but keep
mirror_strength < 0.5in production.Q4: What happens when
max_profilesis exceeded?The engine uses LRU (Least Recently Updated) eviction:
update_profile(), the target profile'slast_updatedtimestamp is refreshedlen(_profiles) > max_profiles, the profile with the oldestlast_updatedis evictedWith the default
max_profiles = 500, this supports environments with hundreds of interacting agents. For large multi-agent systems, increase this value but monitoractive_profiles_gauge— each profile consumes ~200 bytes.Important: Eviction resets the relationship. If an evicted agent reappears, the engine starts from the prior again, effectively "forgetting" that agent. This is intentional — if we haven't interacted with an agent in a long time, our model of them is likely stale anyway.
Q5: How is empathic accuracy measured? Can it degrade over time?
Accuracy is measured on each
update_profile()call:predicted = current estimated_padobserved_pad, compute Euclidean distance in PAD spaceaccuracy = 1.0 - distance / sqrt(12)accuracy_history(rolling window ofaccuracy_windowentries)Accuracy can degrade if an agent's emotional patterns change — for example, if agent-X was consistently calm but suddenly becomes volatile. The fast convergence of the Bayesian update means the engine adapts within 3–5 observations, but during that transition period, accuracy will dip.
The
empathic_accuracy_gaugePrometheus metric exposes this per-agent, allowing monitoring dashboards to detect "empathy failures" — sustained low accuracy for important agents.Q6: Can agents manipulate the EmpathyEngine by faking emotions?
Yes, this is a real concern. The current design trusts observed PAD states at face value. Potential mitigations (implementation notes, not yet in spec):
The
confidencefield inEmpathyResultnaturally provides some protection — low-interaction agents can't trigger COMPASSIONATE mode regardless of their reported state.Q7: How would I set up a Grafana dashboard for EmpathyEngine?
Alerts:
empathic_accuracy < 0.3 for 10m→ empathy model degraded, retrain or increasemin_interactionsactive_profiles_gauge > max_profiles * 0.9→ approaching eviction thresholdrate(compassion_triggers_total[5m]) > 20→ unusually high distress detection, investigateBeta Was this translation helpful? Give feedback.
All reactions