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

EmbedGrad:面向大语言模型的嵌入空间梯度提示优化

EmbedGrad: Gradient-Based Prompt Optimization in Embedding Space for Large Language Models

Xiaoming Hou, Jiquan Zhang, Zibin Lin, DaCheng Tao, Shengli Zhang

AI总结:

EmbedGrad通过梯度优化提示嵌入,实现无需架构改变的精细校准,在数学推理等任务上显著提升小模型性能,开辟任务适配新范式。

摘要:

有效适配强大的预训练基础模型到多样任务仍是AI部署中的关键挑战。当前方法主要遵循两种范式:通过提示工程对文本提示进行离散优化,或通过额外可训练参数进行连续适配。两者均存在局限性——离散方法缺乏精细调整精度,而基于参数的技术增加了复杂性并降低了可解释性。为解决这些约束,我们提出EmbedGrad,一种通过基于梯度的精炼来优化文本提示嵌入的新框架。我们的方法独特地将训练与部署解耦:在优化期间,带标签的示例引导精确的嵌入调整,同时保持语义;在推理期间,仅优化的嵌入与用户查询集成。这实现了文本空间中不可能的细粒度校准,例如增强如“请逐步推理”等提示的推理能力。跨数学推理、情感分析和因果判断任务的全面评估证明了EmbedGrad的有效性:针对Qwen2.5-Math-1.5B优化此推理提示,在数学问题上将准确率从14.74%提升至58.96%。在模型规模(0.5B-14B)和所有任务中均观察到一致的改进,尤其在复杂问题(如因果判断)上,较小模型的提升尤为显著。通过在不改变架构的情况下桥接提示工程和参数效率,我们的工作确立了嵌入精炼作为任务适配的强大新范式。

英文摘要:

Effectively adapting powerful pretrained foundation models to diverse tasks remains a key challenge in AI deployment. Current approaches primarily follow two paradigms:discrete optimization of text prompts through prompt engineering, or continuous adaptation via additional trainable parameters. Both exhibit limitations-discrete methods lack refinement precision while parameter-based techniques increase complexity and reduce interpretability. To address these constraints, we propose EmbedGrad, a novel framework that optimizes text prompt embeddings through gradient-based refinement. Our approach uniquely decouples training from deployment:during optimization,labeled examples guide precise embedding adjustments while preserving semantic meaning; during inference, only optimized embeddings integrate with user queries. This enables fine-grained calibration impossible in text space, such as enhancing the reasoning capability of prompts like please reason step by step. Comprehensive evaluations across mathematical reasoning, sentiment analysis, and causal judgment tasks demonstrate EmbedGrad's effectiveness:optimizing this reasoning prompt for Qwen2.5-Math-1.5B increased accuracy from 14.74\% to 58.96\% on mathematical problems. Consistent improvements were observed across model scales (0.5B-14B) and all tasks, with particularly significant gains for smaller models on complex problems like causal judgment. By bridging prompt engineering and parameter efficiency without architectural changes, our work establishes embedding refinement as a powerful new paradigm for task adaptation.

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

↑