arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.12246cs.AI
收藏

PromptFlow:像训练神经网络一样训练提示词

PromptFlow: Training Prompts Like Neural Networks

Jingyi Wang, Hongyuan Zhu, Ye Niu, Yunhui Deng

AI总结:

针对提示工程中静态更新、缺乏细粒度编辑和经验回收不足的问题,提出受TensorFlow启发的模块化框架PromptFlow,集成元提示、算子、优化器和评估器,利用梯度元学习与强化学习经验回收,在多种数据集上验证了有效性。

摘要:

大型语言模型(LLM)在自然语言处理(NLP)任务中展现出了深远的影响。然而,它们在不同领域的有效部署通常需要针对特定领域的适应策略,因为通用模型在面对专门的数据分布时可能表现不佳。提示工程(PE)方面的最新进展提供了一种有前景的替代方案,通过优化输入指令来使LLM输出与任务目标对齐,从而避免大量的重新训练。这种范式已成为一种快速且多功能的模型微调方法。尽管具有潜力,手动提示设计仍然劳动密集且高度依赖专业知识,通常需要迭代的人工努力才能达到最佳表述。为解决这一局限,已开发出自动化提示工程方法,以系统地生成针对特定任务的提示。然而,当前的实现主要采用静态更新规则,缺乏动态策略选择机制,导致对多样化NLP任务要求的适应欠佳。此外,大多数方法在每一步都整体地处理和更新提示,而未考虑以更细粒度编辑提示部分。最后,特别是LLM中经验回收的问题仍未得到充分探索。为此,我们提出了PromptFlow,一个受TensorFlow启发的模块化训练框架,它集成了元提示、算子、优化器和评估器。我们的框架可配备最新的优化方法,并通过基于梯度的元学习自主探索最优提示优化轨迹,仅需极少的任务特定训练数据。具体而言,我们设计了一种强化学习方法,在PE过程中为LLM回收经验。最后,我们在各种数据集上进行了广泛实验,并证明了PromptFlow的有效性。

英文摘要:

Large Language Models (LLMs) have demonstrated profound impact on Natural Language Processing (NLP) tasks. However, their effective deployment across diverse domains often require domain-specific adaptation strategies, as generic models may underperform when faced with specialized data distributions. Recent advances in prompt engineering (PE) offer a promising alternative to extensive retraining by refining input instructions to align LLM outputs with task objectives. This paradigm has emerged as a rapid and versatile approach for model fine-tuning. Despite its potential, manual prompt design remains labor-intensive and heavily depends on specialized expertise, often requiring iterative human effort to achieve optimal formulations. To address this limitation, automated prompt engineering methodologies have been developed to systematically generate task-specific prompts. However, current implementations predominantly employ static update rules and lack mechanisms for dynamic strategy selection, resulting in suboptimal adaptation to varying NLP task requirements. Furthermore, most methods treat and update the whole prompts at each step, without considering editing prompt sections at a finer granularity. At last, in particular, the problem of how to recycle experience in LLM is still underexplored. To this end, we propose the PromptFlow, a modular training framework inspired by TensorFlow, which integrates meta-prompts, operators, optimization, and evaluator. Our framework can be equipped with the latest optimization methods and autonomously explores optimal prompt refinement trajectories through gradient-based meta-learning, requiring minimal task-specific training data. Specifically, we devise a reinforcement learning method to recycle experience for LLM in the PE process. Finally, we conduct extensive experiments on various datasets, and demonstrate the effectiveness of PromptFlow.

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

↑