arXiv:2410.06154cs.CV2024-10被引 6

让大模型当隐式优化器,自动调优视觉语言模型提示词

GLOV: Guided Large Language Models as Implicit Optimizers for Vision Language Models

  • 用大模型生成并排序适合下游任务的提示词
  • 通过嵌入差值偏置,引导生成更匹配的提示词,提升准确率15%以上
  • 特别适合提升视觉模型安全性和零样本分类性能

本文提出GLOV,使大语言模型(LLM)作为隐式优化器,提升视觉语言模型(VLM)在下游视觉任务中的表现。GLOV通过任务描述提示LLM生成候选提示词(如CLIP的零样本分类),并根据其在下游任务中的表现进行排序。每轮优化中,将已知表现良好的提示词及其准确率作为上下文示例输入LLM,赋予其对理想提示形式的认知。同时,在每轮生成中引入偏置向量——由前一轮正负样本嵌入差异计算得出——作用于网络中间层,引导生成更符合目标VLM偏好的语言表达。实验涵盖物体识别与模型安全性增强两个任务:在双编码器(如CLIP)和编码器-解码器(如LlaVA)模型上,物体识别准确率最高提升15.0%;在对抗攻击场景下,状态最优的VLM攻击成功率(ASR)降低最高达60.7%。

原文摘要 · Abstract (English)

In this work, we propose GLOV, which enables Large Language Models (LLMs) to act as implicit optimizers for Vision-Language Models (VLMs) to enhance downstream vision tasks. GLOV prompts an LLM with the downstream task description, querying it for suitable VLM prompts (e.g., for zero-shot classification with CLIP). These prompts are ranked according to their fitness for the downstream vision task. In each respective optimization step, the ranked prompts are fed as in-context examples (with their accuracies) to equip the LLM with the knowledge of the type of prompts preferred by the downstream VLM. Furthermore, we explicitly guide the LLM's generation at each optimization step by adding an offset vector -- calculated from the embedding differences between previous positive and negative solutions -- to the intermediate layer of the network for the next generation. This offset vector biases the LLM generation toward the type of language the downstream VLM prefers, resulting in enhanced performance on the downstream vision tasks. We comprehensively evaluate our GLOV on two tasks: object recognition and the critical task of enhancing VLM safety. Our GLOV shows performance improvement by up to 15.0% and 57.5% for dual-encoder (e.g., CLIP) and encoder-decoder (e.g., LlaVA) models for object recognition and reduces the attack success rate (ASR) on state-of-the-art VLMs by up to $60.7\%$.

视觉语言模型提示优化大模型应用模型安全

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