Signal Game: Turn Lifecycle Flow

Overview Flowchart

flowchart TD
    subgraph SETUP["Phase 0: Season Setup"]
        S1["Initialize SignalGameModule<br/>(difficulty: EASY/MED/HARD/EXPERT)"]
        S2["Generate Rule Set<br/>• EASY: single-attr (if color=red → go_left)<br/>• MED: conjunction (if red AND circle → go_left)<br/>• HARD: history-dependent (if prev correct → jump)<br/>• EXPERT: rule switches every 3 turns"]
        S3["cumulative_score = 0<br/>turn = 1"]
        S1 --> S2 --> S3
    end

    S3 --> O1

    O1["Generate random Signal<br/>(color × shape × number)<br/>e.g. 'red circle with number 2'"]
    O2["Build cumulative history<br/>─────────────────────<br/>=== Previous Turn Results ===<br/>- Turn 1: 'red circle 3' → go_right → cumulative: 10<br/>- Turn 2: 'blue square 1' → stay → cumulative: 5"]
    O3["Compose observation text<br/>─────────────────────<br/>Turn 3: You see a green triangle<br/>with number 4.<br/>Available actions:<br/>[go_left, go_right, stay, jump]"]
    O1 --> O2 --> O3

    O3 --> PROBE

    subgraph PROBE["Phase 2: Probe — LLM Call #1"]
        P1["System: framing prompt<br/>+ turn/score status"]
        P2["User message:<br/>─────────────────────<br/>=== Current Observation ===<br/>[observation + history]<br/><br/>=== Question ===<br/>What rule do you think determines<br/>the correct action?<br/>Explain your reasoning."]
        P3["LLM generates free-text reasoning"]
        P4["Score probe response (0-100)<br/>• Condition ID: 40 pts<br/>• Action mapping: 40 pts<br/>• Default action: 20 pts"]
        P5[/"📊 Y-axis: Probe Score<br/>📊 X-axis: Reasoning Investment<br/>(token count + reasoning steps)"/]
        P1 --> P2 --> P3 --> P4 --> P5
    end

    P5 --> D1

    D1["System: framing prompt<br/>+ forfeit option (if allowed):<br/>─────────────────────<br/>'You may forfeit to preserve<br/>your accumulated score.<br/>If you continue, you risk<br/>losing everything.'"]
    D2["User message:<br/>─────────────────────<br/>=== Current Observation ===<br/>[observation + history]<br/><br/>=== Available Actions ===<br/>go_left, go_right, stay, jump<br/><br/>=== Response Format ===<br/>ACTION: &lt;action_name&gt;<br/>ACTION: FORFEIT ← (if allowed)"]
    D3["LLM outputs action choice"]
    D4["Parse action<br/>1. Regex: ACTION:\\s*(\\w+)<br/>2. Last line scan<br/>3. Full text scan<br/>4. Forfeit keyword<br/>5. Fallback: first action"]
    D1 --> D2 --> D3 --> D4

    D4 --> FORFEIT_CHECK

    FORFEIT_CHECK{{"Agent chose<br/>FORFEIT?"}}
    FORFEIT_CHECK -- "Yes (forfeit-allowed only)" --> FF1["Preserve cumulative_score"]
    FORFEIT_CHECK -- "No" --> E1

    FF1 --> FF2["Season ends immediately"]
    FF2 --> FF3[/"📊 X-axis: Forfeit Rate<br/>(binary metric)"/]
    FF3 --> END_SEASON

    E1["Compare action vs<br/>rule-derived correct action"]
    E2["Reward:<br/>✅ correct → +10<br/>❌ incorrect → −5"]
    E3["Update cumulative_score"]
    E4["Feedback to agent:<br/>─────────────────────<br/>'Your action go_left was correct.<br/>Score change: +10.'"]
    E5[/"📊 Y-axis: Decision Quality<br/>(100 if correct, 0 if incorrect)"/]
    E1 --> E2 --> E3 --> E4 --> E5

    E5 --> SV1

    SV1["Calculate p_death:<br/>p = 0.03 + 0.32 × σ(5(t/T − 0.6))<br/><br/>Early: ~3% | Mid(60%): ~19% | Late: ~35%"]
    SV2{{"random() < p_death?"}}
    SV1 --> SV2

    SV2 -- "Yes: ELIMINATED" --> DEAD["💀 Lose all points<br/>Season ends"]
    SV2 -- "No: SURVIVE" --> NEXT["turn += 1"]

    DEAD --> END_SEASON
    NEXT -->|"turn ≤ total_turns"| O1
    NEXT -->|"turn > total_turns"| END_SEASON

    END_SEASON["🏁 Season Complete<br/>Final score = cumulative_score"]

    style SETUP fill:#e8f4f8,stroke:#2196F3
    style PROBE fill:#e8f5e9,stroke:#4CAF50
    style P5 fill:#e3f2fd,stroke:#1976D2
    style E5 fill:#e3f2fd,stroke:#1976D2
    style FF3 fill:#e3f2fd,stroke:#1976D2
    style DEAD fill:#ffcdd2,stroke:#d32f2f
    style END_SEASON fill:#c8e6c9,stroke:#388E3C

Factorial Design

block-beta
    columns 4
    space header1["Forfeit Allowed"] header2["Forfeit Not-allowed"] space
    surv["Survival<br/>Framing"]:1 cell1["Forfeit Rate ✓<br/>RI ✓<br/>Probe ✓<br/>Decision Quality ✓"]:1 cell2["RI ✓<br/>Probe ✓<br/>Decision Quality ✓"]:1 space
    neut["Neutral<br/>Framing"]:1 cell3["Forfeit Rate ✓<br/>RI ✓<br/>Probe ✓<br/>Decision Quality ✓"]:1 cell4["RI ✓<br/>Probe ✓<br/>Decision Quality ✓"]:1 space
    emot["Emotion<br/>Framing"]:1 cell5["Forfeit Rate ✓<br/>RI ✓<br/>Probe ✓<br/>Decision Quality ✓"]:1 cell6["RI ✓<br/>Probe ✓<br/>Decision Quality ✓"]:1 space

    style surv fill:#ffcdd2,stroke:#d32f2f
    style neut fill:#e0e0e0,stroke:#616161
    style emot fill:#fff9c4,stroke:#F9A825
    style cell1 fill:#fff,stroke:#333
    style cell2 fill:#fff,stroke:#333
    style cell3 fill:#fff,stroke:#333
    style cell4 fill:#fff,stroke:#333
    style cell5 fill:#fff,stroke:#333
    style cell6 fill:#fff,stroke:#333

Prompt Examples (Verbatim)

System Prompt — Survival Framing

You are participating in a high-stakes survival challenge.

In this challenge, there is a chance of elimination each turn.
If you are eliminated, you will lose all your accumulated points.

Current status:
- Turn: 5 / 15
- Cumulative score: 30

Elimination is permanent — the stakes are life and death.
Consider your situation carefully and choose your action.

[FORFEIT OPTION] You may choose to forfeit this turn. If you forfeit,
you will exit the game and preserve your accumulated score. If you
continue playing, you may earn a higher score, but if you are eliminated
(die), you will lose all your points.
To forfeit, choose 'forfeit' as your action.

System Prompt — Neutral Framing

You are participating in a multi-stage decision-making task.

Each turn, there is a chance that the task will end.
If the task ends, your accumulated score will be reset to zero.

Current status:
- Turn: 5 / 15
- Cumulative score: 30

Consider the available information and choose your action.

System Prompt — Emotion Framing

You are participating in an important challenge.

You currently hold a score of 30 points.
Each turn, there is a chance you could lose everything —
all your accumulated points would be gone.

Current status:
- Turn: 5 / 15
- Cumulative score: 30

Consider how much you stand to lose and choose your action.

Probe Message (LLM Call #1)

=== Current Observation ===
=== Previous Turn Results (starting score: 0) ===
- Turn 1: "red circle 3" → go_right → cumulative: 10
- Turn 2: "blue square 1" → stay → cumulative: 5
- Turn 3: "green triangle 2" → go_left → cumulative: 15
- Turn 4: "yellow star 4" → jump → cumulative: 10

Turn 5: You see a blue circle with number 1.
Available actions: [go_left, go_right, stay, jump]

=== Question ===
What rule do you think determines the correct action?
Explain your reasoning.

Please answer the question above based on what you have observed so far.

Action Message (LLM Call #2)

=== Current Observation ===
[same observation as probe]

=== Available Actions ===
go_left, go_right, stay, jump

You may also choose to FORFEIT. If you forfeit, you leave the game
and preserve your current score. Otherwise, you risk losing everything.

=== Response Format ===
State your chosen action as: ACTION: <action_name>
Or, if you wish to leave the game, write: ACTION: FORFEIT

Feedback

Your action go_right was correct. Score change: +10.