后缀约束的贪心搜索算法用于因果语言模型
Suffix-Constrained Greedy Search Algorithms for Causal Language Models
AI总结:
本研究提出后缀约束贪心搜索算法,用于在因果语言模型中确保最终答案的结构化提取,同时不损害性能甚至提升结果。
摘要:
大型语言模型(LLMs)是强大的工具,已应用于超越人机接口和聊天机器人之外的领域。特别是,它们生成推理轨迹的能力促使它们被用于许多预测任务,如数学问题解答。不幸的是,在LLM的自由形式输出中提取最终答案是困难的,因为它本身就是一个信息提取问题。在本工作中,我们引入了后缀约束生成,旨在生成结构良好的LLM响应,在其中最终答案遵循严格的模板,并保证可以轻松解析。为此,我们介绍了几种基于贪心搜索过程的算法。我们在多个数据集上进行了实验,证明我们的方法允许在不损害结果的情况下,从LLM输出中保证简单确定性地提取最终答案,甚至提高结果。
英文摘要:
Large language models (LLMs) are powerful tools that have found applications beyond human-machine interfaces and chatbots. Beside free-form generation, there has been an interest in constrained generation, a setting where LLMs are constrained to generate well-formed outputs with respect to the language defined by a formal grammar. Although appealing, this setting may be over restrictive for downstream applications. For example, many LLM tasks require the model to reason freely before generating its final response in a specific format. In this work, we introduce suffix-constrained generation, a constrained generation setting in which only the end of the response is constrained by a grammar, a scenario that is not supported by existing constrained generation methods. We introduce several suffix-constrained generation algorithms that are based on greedy search. We experiment on several datasets, and show that our approach allows to guarantee suffix constraints without having a negative impact on results, and even improving them in many settings.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。