arXiv:2412.05967cs.CLcs.AI2024-12被引 3

让大模型用工具更灵活,不绑模型也不绑提示。

Language hooks: a modular framework for augmenting LLM reasoning that decouples tool usage from the model and its prompt

  • 用模块化程序在生成文本时动态触发工具调用
  • 在多个任务上表现优于依赖提示的基线方法
  • 适合需要跨任务复用工具能力的研究与应用

提示和微调是增强语言模型新能力(如使用工具)的两种主流方法。提示方法部署快,但需在提示中显式演示每种工具的用法,导致工具使用与任务耦合,限制泛化能力;微调可避免运行时的任务特异性演示,但将新能力绑定到单一模型,使高成本成为重复开销。本文提出语言钩子(language hooks),一种解耦模型任务提示与模型本身的增强框架。该算法在基础模型生成文本的同时,通过条件触发模块化程序执行,这些程序可调用外部工具、辅助语言模型(如使用特定提示)或修改上下文。我们在多个基准上评估该方法,结果表明其优于依赖任务感知的基线,并展现出对新任务的泛化能力。

原文摘要 · Abstract (English)

Prompting and fine-tuning have emerged as two competing paradigms for augmenting language models with new capabilities, such as the use of tools. Prompting approaches are quick to set up but rely on providing explicit demonstrations of each tool's usage in the model's prompt, thus coupling tool use to the task at hand and limiting generalisation. Fine-tuning removes the need for task-specific demonstrations of tool usage at runtime; however, this ties new capabilities to a single model, thus making already-heavier setup costs a recurring expense. In this paper, we introduce language hooks, a novel framework for augmenting language models with new capabilities that is decoupled both from the model's task-specific prompt and from the model itself. The language hook algorithm interleaves text generation by the base model with the execution of modular programs that trigger conditionally based on the existing text and the available capabilities. Upon triggering, programs may call external tools, auxiliary language models (e.g. using tool specific prompts), and modify the existing context. We benchmark our method against state-of-the-art baselines, find that it outperforms task-aware approaches, and demonstrate its ability to generalise to novel tasks.

大模型工具调用模块化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。