arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.01711cs.AIcs.LG
收藏

为大型语言模型优化提示:一种因果方法

Optimizing Prompts for Large Language Models: A Causal Approach

School of Business, University of Connecticut(康涅狄格大学商学院);Antai College of Economics and Management, Shanghai Jiao Tong University(上海交通大学安泰经济管理学院)

Wei Chen, Yanbin Fang, Shuran Fu, Fasheng Xu, Xuan Wei

AI总结:

CPO通过因果推断方法优化提示设计,提升企业LLM在复杂查询中的鲁棒性,并降低提示优化的经济成本。

摘要:

大型语言模型(LLMs)正越来越多地嵌入到企业工作流程中,但其性能仍然高度依赖于提示设计。自动提示优化(APO)旨在缓解这种不稳定性,但现有方法面临两个持续存在的挑战。首先,常用的提示策略依赖于静态指令,这些指令在平均表现上表现良好,但无法适应异质查询。其次,更动态的方法依赖于离线奖励模型,这些模型本质上是相关的,将提示效果与查询特征混淆。我们提出因果提示优化(CPO),一种将提示设计重新界定为因果估计问题的框架。CPO分两个阶段进行。首先,它通过将双机器学习(DML)应用于提示和查询的语义嵌入,学习一个离线因果奖励模型,从而隔离提示变化的因果效应与混淆的查询属性。其次,它利用这个无偏的奖励信号来指导一种资源高效的查询特定提示搜索,而无需依赖昂贵的在线评估。我们评估了CPO在数学推理、可视化和数据分析等基准上的表现。CPO在几乎所有基准上都优于人工设计的提示和最先进的自动优化器。这些收益主要由在困难查询上改进的鲁棒性驱动,而现有方法在这些查询上往往会恶化。除了性能之外,CPO还从根本上改变了提示优化的经济模式:通过将评估从实时模型执行转移到离线因果模型,它使高精度、按查询定制成为可能,其成本仅为在线方法所需推理成本的一小部分。这些结果确立了因果推断作为可靠且成本效益高的提示优化在企业LLM部署中的可扩展基础。

英文摘要:

Large Language Models (LLMs) are increasingly embedded in enterprise workflows, yet their performance remains highly sensitive to prompt design. Automatic Prompt Optimization (APO) seeks to mitigate this instability, but existing approaches face two persistent challenges. First, commonly used prompt strategies rely on static instructions that perform well on average but fail to adapt to heterogeneous queries. Second, more dynamic approaches depend on offline reward models that are fundamentally correlational, confounding prompt effectiveness with query characteristics. We propose Causal Prompt Optimization (CPO), a framework that reframes prompt design as a problem of causal estimation. CPO operates in two stages. First, it learns an offline causal reward model by applying Double Machine Learning (DML) to semantic embeddings of prompts and queries, isolating the causal effect of prompt variations from confounding query attributes. Second, it utilizes this unbiased reward signal to guide a resource-efficient search for query-specific prompts without relying on costly online evaluation. We evaluate CPO across benchmarks in mathematical reasoning, visualization, and data analytics. CPO consistently outperforms human-engineered prompts and state-of-the-art automated optimizers. The gains are driven primarily by improved robustness on hard queries, where existing methods tend to deteriorate. Beyond performance, CPO fundamentally reshapes the economics of prompt optimization: by shifting evaluation from real-time model execution to an offline causal model, it enables high-precision, per-query customization at a fraction of the inference cost required by online methods. Together, these results establish causal inference as a scalable foundation for reliable and cost-efficient prompt optimization in enterprise LLM deployments.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑