We automate deep step-by step reasoning in an LLM dialog thread by recursively exploring alternatives (OR-nodes) and expanding details (AND-nodes) up to a given depth. Starting from a single succinct task-specific initiator we steer the automated dialog thread to stay focussed on the task by synthesizing a prompt that summarizes the depth-first steps taken so far. Our algorithm is derived from a simple recursive descent implementation of a Horn Clause interpreter, except that we accommodate our logic engine to fit the natural language reasoning patterns LLMs have been trained on. Semantic similarity to ground-truth facts or oracle advice from another LLM instance is used to restrict the search space and validate the traces of justification steps returned as answers. At the end, the unique minimal model of a generated Horn Clause program collects the results of the reasoning process. As applications, we sketch implementations of consequence predictions, causal explanations, recommendation systems and topic-focussed exploration of scientific literature.
翻译:我们通过递归探索替代分支(OR节点)并展开细节(AND节点)直至指定深度,实现了大语言模型对话线程中深度逐步推理的自动化。从简洁的任务特定初始化提示出发,通过综合已执行的深度优先步骤摘要提示,引导自动化对话线程始终聚焦于目标任务。本算法源自Horn子句解释器的简单递归下降实现,但我们将逻辑引擎适配至大语言模型所训练的自然语言推理模式。通过利用与事实基准的语义相似度或其他大语言模型实例的预言建议,可有效约束搜索空间并验证返回的论证步骤追踪。最终,生成的Horn子句程序中的唯一最小模型汇聚了推理过程的全部结果。作为应用示例,我们概述了该框架在后果预测、因果解释、推荐系统及科学文献主题聚焦探索中的实现方案。