如何将大型语言模型(LLMs)应用于需要复杂数据分析的决策制定问题? 定义了一种新的任务类型,称为决策问答(Decision QA),它要求模型回答给定的决策问题、业务规则和数据库的最佳决策。决策QA示例。一个红点代表一个交易节点。在Deccan框中的盈利表示每个决策可能带来的盈利变化。请注意,潜在的盈利变化不在数据库中,应该从数据库中计算得出。每个国家只有一个主要的(家庭)交易节点。在表格中,下划线列名表示表格的键。 为了有效解决决策问答任务,提出了一种新的基于迭代计划然后检索增强生成(PlanRAG)的技术: ingFang SC", miui, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size: 14px;letter-spacing: 0.5px;text-align: start;text-wrap: wrap;background-color: rgb(49, 49, 58);" class="list-paddingleft-1">PlanRAG技术:它通过两个主要的推理类型来回答问题:首先是制定计划,其次是基于检索结果的推理。PlanRAG技术的核心在于,它使用单个语言模型来执行这两种类型的推理,以减少使用不同语言模型可能带来的副作用。 PlanRAG的推理过程:PlanRAG的推理过程包括三个主要步骤: 规划(Planning):语言模型接收决策问题、数据库架构和业务规则作为输入,生成一个初始的数据分析计划。 检索与回答(Retrieving & Answering):与之前的RAG技术不同,PlanRAG在这一步骤中不仅考虑问题和规则,还包括初始计划,以更有效地生成数据分析查询。 重新规划(Re-planning):如果初始计划不足以解决问题,PlanRAG会根据每次检索的结果评估当前计划,并生成新的计划或纠正先前分析的方向。 先前RAG技术与PlanRAG 技术推理过程的比较在定位场景中,先前的迭代RAG与PlanRAG 推理过程的示例 对不同类型的问题(单次检索和多次检索问题)进行了分析,定位场景中比最先进的迭代RAG方法提高了15.8%,在构建场景中提高了7.4%。DQA 技术准确率(%)(每个准确率是 RDB 和 GDB 中准确率的平均值)
IterRAG-LM和PlanRAGLM 在简单回答(SR)和多步回答(MR)问题上的准确率(%) 定位场景中,针对 GDB 案例的单轮 RAG 技术检索Prompt模版:#PrefixYouareadecision-makingagentansweringagivenquestion.Youshouldcollectthedatatoanswerthequestion:#TooldescriptionsGraphDB:Usefulforwhenyouneedtocollectthedatathatfollowsthefollowingschema(YouMUSTgenerateaCypherquerystatementtointeractwiththistool) n:Trade_node{{name,local_value,is_inland,total_power,outgoing,ingoing}});(m:Country{{name,home_node,development}});(Trade_node)-[r:source{{flow}}]->[Trade_node](Country)-[NodeCountry{{is_home,has_merchant,base_trading_power,calculated_trading_power}}]->(Trade_node),args:{{{{'tool_input':{{{{'type':'string'}}}}}}}}Selfthinking:Usefulforwhenthereisnoavailabletool.,args:{{{{'tool_input':{{{{'type':'string'}}}}}}}}#FormatinstructionsUsethefollowingStrictformat uestion:theinputquestionyoumustanswer.Thought:youshouldalwaysthinkaboutwhattodo.Action:asuitabledatabasename,MUSTbeoneof[‘GraphDB’,‘Self-thinking’].Actioninput:asyntacticallycorrectquerystatementonly,MUSTbewrittenbyCypherquerylanguage.Observation:theresultoftheaction.Thought:Inowknowtheanswer.Finalanswer:thefinalanswertothequestionbasedontheobserveddata.#SuffixBegin!KeepinmindthatYourresponseMUSTfollowthevalidformatabove. 在定位场景中,针对 GDB 案例的单轮 RAG 技术答案生成Prompt模版:#PrefixYouareadecision-makingagentansweringagivenquestion.Youhavealreadycollectedthedatatoanswerthequestion.Indeed,youshouldmakeyourFinalanswerimmediately.:#TooldescriptionsGraphDB:Usefulforwhenyouneedtocollectthedatathatfollowsthefollowingschema(YouMUSTgenerateaCypherquerystatementtointeractwiththistool) n:Trade_node{{name,local_value,is_inland,total_power,outgoing,ingoing}});(m:Country{{name,home_node,development}});(Trade_node)-[r:source{{flow}}]->[Trade_node](Country)-[NodeCountry{{is_home,has_merchant,base_trading_power,calculated_trading_power}}]->(Trade_node),args:{{{{'tool_input':{{{{'type':'string'}}}}}}}}Selfthinking:Usefulforwhenthereisnoavailabletool.,args:{{{{'tool_input':{{{{'type':'string'}}}}}}}}#FormatinstructionsUsethefollowingStrictformat:Finalanswer:thefinalanswertothequestionbasedontheobserveddata.#SuffixBegin! https://arxiv.org/pdf/2406.12430PlanRAG:APlan-then-RetrievalAugmentedGenerationforGenerativeLargeLanguageModelsasDecisionMakershttps://github.com/myeon9h/PlanRAG.
|