← Back to AI Engineering Mind Map
🤖 AI EngineeringID: reflexion-self-correction

Reflexion Self-Correction

Reflexion 自我反思与反思记忆
🎯Core Definition
Reflexion is an advanced agentic architecture that reinforces task performance through verbal self-reflection rather than traditional reinforcement learning weight updates; upon task execution failure evaluated by an objective judge (e.g., failed unit tests), the Self-Reflection module analyzes the entire trajectory, authoring a natural language critique detailing the failure root cause and strategic corrections; this reflection memory is appended to working memory, guiding the agent in subsequent trials to actively avoid past mistakes.
💡Use Cases
Autonomous code generation and test-driven self-repair (HumanEval, SWE-bench), multi-step scientific deduction, and strategic decision simulations.
⚡Key Problems Solved
Standard ReAct agents trapped in a bad state loop repeatedly repeat identical missteps across retries; Reflexion externalizes past mistakes into explicit textual memory buffers, enabling trial-over-trial error recovery and behavioral self-correction.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Reflexion Self-Correction.
Use Cases
In production engineering, what are the primary use cases for Reflexion Self-Correction and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Detail the tripartite architecture of Reflexion: Actor, Evaluator, and Self-Reflection modules and their execution flow?
2
Explain the FIFO sliding window eviction and vector-based semantic retrieval across Reflexion memory buffers?
3
Why does unit-test grounded Reflexion boost HumanEval/LeetCode pass@1 from ~60% to over 90% across 3 trials?
4
Design prompt constraints to prevent models from authoring vague, ungrounded reflections that fail to guide self-correction?
5
Compare Reflexion vs traditional Reinforcement Learning (PPO/DPO) in sample efficiency, inference cost, and cold-start feasibility?
📖 In-depth Guide:📄 agent-design-patterns →
Updated 2026-08-14
🎯
Verify Mastery: Practice Exam Questions for "Reflexion Self-Correction"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardReAct Thought-Action-ObservationNext Card →Plan-and-Execute Pattern

🔗 More AI Engineering Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/AI_Engineering/card/reflexion-self-correction
中文速览与面试要点

Reflexion 自我反思与反思记忆 (Reflexion Self-Correction)

定义: Reflexion(自我反思与强化自愈 Agent 架构)是一种通过“口头自省反思反馈 (Verbal Self-Reflection)”而非传统强化学习权重更新来迭代提升任务成功率的先进 Agent 设计范式;当 Agent 执行完一轮完整轨迹并在评估器 (Evaluator) 中被判定为失败(如测试用例未通过、目标未达成)时,自我反思模块 (Self-Reflection Model) 介入分析完整历史轨迹,自主撰写一份包含“为什么失败、哪一步出现误判、下次尝试应如何修正”的自然语言反思日志 (Reflection Memory);该反思日志被永久追加到 Agent 的工作记忆缓冲区中,在开启下一轮试验 (Next Trial) 时作为显式提示词指引 Agent 避开前序陷阱。 使用场景: 复杂代码生成与单元测试自动修复 (HumanEval/SWE-bench)、多步科学推理推导以及决策博弈模拟。 解决的问题: 传统 ReAct Agent 在某步走入死胡同后,容易在同一错误逻辑内打转、即使重试也会反复犯相同的错误;Reflexion 通过将过往失败教训外化为显式反思记忆,使模型具备跨轮次自我纠偏与持续进化能力。

核心要点

  • 详细梳理 Reflexion 系统的三大核心模块(Actor 动作执行者、Evaluator 奖励评估器、Self-Reflection 反思生成器)的协作流?
  • Reflexion 反思记忆缓冲池 (Memory Buffer) 的 FIFO 滑动窗口淘汰与向量检索检索机制?
  • 为什么在代码生成基准 (HumanEval / LeetCode) 上,结合单元测试反馈的 Reflexion 能够将 pass@1 从 60% 提升至 90%+?
  • 防止模型生成“空洞敷衍的无效反思 (Vague / Hallucinated Reflections)”的 Prompt 架构设计与强制证据引用约束?
  • Reflexion 与传统强化学习 (RL / PPO / DPO) 在样本效率、推理成本与冷启动难度上的综合对比?