Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

M1 — ReAct substrate loop

Paper: Yao, Zhao, Yu, Du, Shafran, Narasimhan, Cao — ReAct: Synergizing Reasoning and Acting in Language Models (ICLR 2023)

Linear: AGE-6 · Crates: chatty-core (loop), chatty-trace (attribution) · Promotion: loop = default; variants pending

Mechanism (what the paper actually claims)

Augment action space to  = A ∪ L — language thoughts condition the next action without changing environment state. Trajectory = (thought, action, observation) triples from a frozen LLM with few-shot exemplars.

Two regimes:

  • Knowledge-intensive (HotpotQA, FEVER): dense thoughts; search / lookup / finish
  • Decision-making (ALFWorld, WebShop): sparse thoughts; model decides when to think

Important: ReAct alone does not beat CoT-SC on HotpotQA in the paper — it wins on FEVER and interaction tasks. Reproducing “ReAct beats CoT on HotpotQA” would be wrong.

Chatty mapping

Paper conceptChatty locationStatus
ReAct loopchatty-core llm_service.rs + agent_factory/Ships today
~60 toolschatty-core/src/tools/Ships
Wikipedia envAdapter over search_tool / fetch_toolStage A
Strategy variants (Act, CoT, CoT-SC, hybrids)chatty-optimize::StrategyReserved backoff rule
Per-step traceM0 TraceWIP
Few-shot exemplar prefixModelConfig.preambleShips (user-editable)

Do not rebuild the loop. Extend fidelity and capture only.

Eval protocol

Stage A:

  • Real HotpotQA run → Trajectory round-trips with per-step ModuleId
  • Four prompt regimes: dense/sparse × QA/interaction
  • Wikipedia lookup returns k-th matching sentence (paper semantics)
  • Reproduce ordering of methods, not absolute PaLM-540B numbers

Stage B: Harbor coding/env tasks using the same tool registry.

Production landing

MechanismLikely promotion
ReAct loop with toolsDefault (already)
CoT / CoT-SC / Act / hybrid strategiesSetting or eval-only
WikiEnv adapterEval harness only

Reserved symbols

Strategy backoff rule and loop termination semantics — see RESERVED.md.

Depends on

Downstream

Everything. M2–M4 all reflect on traces from this loop.