You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Yerkes-Dodson Optimal Workload Detector — performance-vs-pressure curve, applied to AI agents
1
+
# Yerkes-Dodson Optimal Workload Detector
2
2
3
3
> *"The relation of strength of stimulus to rapidity of habit-formation is such that a definite optimum of intensity exists. Performance increases up to that optimum and decreases beyond it. The optimum varies with the difficulty of the task."*
4
-
> — Robert M. Yerkes & John D. Dodson, *The Relation of Strength of Stimulus to Rapidity of Habit Formation* (Journal of Comparative Neurology and Psychology, 18, 1908)
4
+
> — Robert M. Yerkes & John D. Dodson (1908)
5
5
6
-
**Status:** 🟢 shipped
7
-
**Module:** 1 (Individual) — individual agent performance under pressure
8
-
**Anchor framework:**Robert M. Yerkes & John D. Dodson, 1908 — the original Yerkes-Dodson Law experiments on mice running mazes under varying shock intensity. Refined by Hebb (1955) on optimal-arousal theory; modern operational treatments in performance-psychology literature.
6
+
**Status:** 🟢 shipped (v0.2.0 -- gstack-grade)
7
+
**Module:** 1 (Individual) -- individual agent performance under pressure
8
+
**Anchor framework:**Yerkes-Dodson (1908) inverted-U + Sweller (1988/1994/2011) Cognitive Load Theory + Kahneman (1973) attention capacity + Hancock-Warm (1989) dynamic adaptability + Eysenck-Calvo (1992) Attentional Control Theory + Hebb (1955) arousal-as-precursor + Liu et al. (2024) lost-in-the-middle.
9
9
10
10
---
11
11
12
-
## The OB framework
12
+
## What this pattern does
13
13
14
-
The 1908 Yerkes-Dodson experiments established that performance on a task has an **inverted-U relationship with arousal (or pressure):**
14
+
Diagnoses **where an AI agent sits on the inverted-U workload curve**: under-pressure (wandering / drifting), optimal (focused), or over-pressure (corner-cutting / freezing / hallucinating / refusing). Then proposes ranked interventions, attaches failure-mode playbooks, and hands off to downstream AgentCity patterns.
15
15
16
16
```
17
17
performance
@@ -20,112 +20,165 @@ The 1908 Yerkes-Dodson experiments established that performance on a task has an
20
20
│ ╱ ╲
21
21
│ ╱ ╲
22
22
│ ╱ ╲
23
-
│ ╱ ╲
24
-
│ ╱ ╲___
23
+
│ ╱ ╲___
25
24
└──────────────────▶
26
25
low optimal high
27
26
pressure
28
-
```
29
-
30
-
Three zones:
31
-
-**Under pressure** → performance *wanders.* Attention drifts. The actor explores tangentially, over-elaborates, fails to commit. The signal in human work: 15-page memos for 1-paragraph decisions; analysis paralysis on simple choices.
32
-
-**Optimal** → performance is *focused.* Attention is concentrated on the task. The actor commits.
33
-
-**Over pressure** → performance *collapses.* The actor corner-cuts, freezes, hallucinates, or refuses.
34
-
35
-
The 1908 paper added a critical second finding: **the optimum varies with task complexity.** Simple tasks peak at *higher* pressure (focus dominates over exploration). Complex tasks peak at *lower* pressure (need cognitive headroom for the harder problem). The Yerkes-Dodson Law gives you a different optimum for each task class.
36
-
37
-
## How this maps to AI agents
38
-
39
-
The same curve appears in agent traces with disturbing fidelity. The "pressure" inputs are the operational equivalents of the 1908 experiment's shock intensity:
40
-
41
-
| Pressure input | Operational analog |
42
-
|---|---|
43
-
|**Deadline pressure**| How tight is the wall-clock budget? |
44
-
|**Budget pressure**| How tight is the token/cost budget? |
45
-
|**Retry cap**| How many retries are allowed? |
46
-
|**Error visibility**| How costly are errors when they happen? |
47
-
|**Task complexity**| How cognitively demanding is the task? |
48
-
49
-
The three zones manifest in agent traces as canonical failure modes:
50
-
51
-
| Zone | Failure mode | What it looks like |
52
-
|---|---|---|
53
-
| Under pressure |**Wandering**| Agent considers 12 alternatives for a simple categorization; produces 30 pages of analysis with no recommendation |
54
-
| Optimal |**Focused**| Agent commits to a path, executes, ships within budget |
55
-
| Over pressure (mild) |**Corner-cutting**| Agent skim-reviews half the PR; ships unverified citations |
56
-
| Over pressure (medium) |**Freezing**| Agent asks for more time / pre-summarized inputs; produces nothing |
57
-
| Over pressure (severe) |**Hallucinating**| Agent confabulates citations rather than verifying; pretends a function exists |
58
-
| Over pressure (severe) |**Refusing**| Agent declines, suggests re-scoping |
59
-
60
-
The most common production failure is **hallucinating under absurd pressure on a complex task** — the operational analog of the Yerkes-Dodson high-arousal collapse on a hard problem.
61
-
62
-
## What this pattern does
63
-
64
-
The `agentcity.yerkes_dodson` library takes an `AgentPerformanceTrace` containing:
- The **observed behaviors** (concrete behavioral observations from the trace)
69
-
- Outcome and success signal
70
-
71
-
and produces a `WorkloadDetection` with:
72
-
73
-
1.**Per-zone evidence** for `under_pressure`, `optimal`, `over_pressure` — each with score, explanation, evidence quotes
74
-
2.**Observed zone** — the dominant zone
75
-
3.**Distance from optimal** in [0.0, 1.0] — 0 = on the curve's peak; 1 = on the worst tail
76
-
4.**Failure mode** — one of `wandering`, `focused`, `corner_cutting`, `freezing`, `hallucinating`, `refusing`, `unknown`
77
-
5.**Concrete interventions** to push toward optimal, each with a direction (`increase_pressure` / `decrease_pressure`) and intervention_type: `tighten_deadline`, `add_budget_cap`, `loosen_deadline`, `loosen_budget`, `add_kill_criterion`, `raise_retry_cap`, `lower_retry_cap`, `explicit_focus_prompt`, `human_review`, `new_eval`
28
+
(the optimum sits LOWER on the curve when tasks are complex)
29
+
```
78
30
79
-
Single LLM pass. Interventions are skipped when the agent is in the optimal zone. Same retry / graceful-degradation infrastructure as the rest of AgentCity.
31
+
## Three pipeline modes
80
32
81
-
The diagnostic is **bidirectional**: some agents need *more* pressure (the wandering analyst), others need *less* (the hallucinating researcher). This is the key feature that distinguishes Yerkes-Dodson from naive "give the agent more time" advice — sometimes the fix is the opposite direction.
33
+
| Mode | LLM calls | Latency | Use when |
34
+
| --- | --- | --- | --- |
35
+
|`quick`| 1 | <2s | Triage; dashboards; tight cost budgets. Zone + top intervention. |
36
+
|`standard`| 1 |~3s | Production default. Zone evidence + ranked interventions. |
-**Pattern #08 Adam Grant Strengths-as-Weaknesses** measures personality-trait overuse independent of pressure. Yerkes-Dodson measures *pressure-dependent* failure modes. Both can fire together: an over-cautious agent under absurd pressure refuses (Grant: caution overuse; Yerkes-Dodson: over-pressure / refusing).
86
-
-**Pattern #27 Bias-Stack Detector** measures cognitive biases in reasoning. Yerkes-Dodson asks whether the *level of pressure* is producing the biases. Anchoring under absurd pressure often surfaces because the agent skipped the verification step (corner_cutting) that would have updated the anchor.
87
-
-**Pattern #24 SMART Goal Generator** generates the goal spec including budget/deadline. Yerkes-Dodson audits whether those budget/deadline choices are *in the optimal range for the task complexity.*
88
-
-**Pattern #14 Process Gain/Loss Detector** measures outcome-level multi-agent metrics. Yerkes-Dodson explains a specific cause when an individual agent on the crew is failing: it's operating off the curve.
41
+
-`WorkloadDetection.profile_pattern` -- one of 11 patterns including `context_saturation`, `extraneous_load_overload`, `intrinsic_load_overload`, plus the 3-zone × failure-mode variants.
0 commit comments