Reflexion: Language Agents with Verbal Reinforcement Learning


發表時間:2023(NeurIPS 2023)
文章要點:文章提出Reflexion框架,通過交互的方式獲得反饋,並變成細緻的語言feedback的形式作爲下一輪的prompt,以此強化language agents的能力,同時避免了更新大模型的參數。這樣的好處有1)輕量,不需要finetune LLM,2)feedback相比一個reward信號更加細緻,3)充分利用過去的經驗對未來的動作給予指導。缺點在於,很依賴大模型自我評估的能力(have the disadvantages of relying on the power of the LLM’s self-evaluation capabilities (or heuristics) and not having a formal guarantee for success)。
具體的,框架包括三個模型:Actor, Evaluator model, Self-Reflection model。
Actor是一個LLM,用來生成動作。Actor具體可以採用Chain of Thought和ReAct等方式實現。此外,還維護了一個memory用來存儲過去的經驗作爲Actor的prompt。這個memory被稱爲short-term memory。
Evaluator分析Actor的輸出並給軌跡打分(It takes as input a generated trajectory and computes a reward score that reflects its performance within the given task context.)。Evaluator可以是環境準確的反饋(reward functions based on exact match (EM) grading),可以是定義好的函數(pre-defined heuristic functions),也可以是LLM。
Self-reflection是一個LLM,主要作用是將Evaluator的打分轉換成更細緻的語言反饋(by generating verbal self-reflections to provide valuable feedback for future trials)。同時這個反饋也存到memory中,這個被稱爲long-term memory.
整個reflexion的過程是一個迭代優化的過程。Actor和環境交互得到軌跡,Evaluator給軌跡打分,Self-reflection分析軌跡和得分並生成語言形式的反饋存到memory裏作爲下一次迭代的prompt。如此循環下去直到回答正確或者達到最大嘗試次數。
下圖給了一個具體的例子

總結:文章寫的很清楚了,優點是輕量而且有效,缺點就是比較依賴LLM的能力。感覺這個點是不是可以通過增加一個真正的RL的過程來彌補,可以考慮考慮。
疑問:無。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章