InstructZero:針對黑盒大型語言模型的有效指令優化
InstructZero: Efficient Instruction Optimization for Black-Box Large Language Models
June 5, 2023
作者: Lichang Chen, Jiuhai Chen, Tom Goldstein, Heng Huang, Tianyi Zhou
cs.AI
摘要
大型語言模型(LLMs)是指令跟隨者,但對於不同情況找到最佳指令可能會有挑戰,尤其是對於禁止反向傳播的黑盒LLMs。我們不直接優化離散指令,而是優化一個低維度的軟提示,應用於開源LLM以生成黑盒LLM的指令。在所提出的方法InstructZero的每個迭代中,將軟提示轉換為指令,使用開源LLM,然後將其提交給黑盒LLM進行零樣本評估,並將性能發送到貝葉斯優化以生成改進零樣本性能的新軟提示。我們在不同組合的開源LLMs和API上對InstructZero進行評估,包括Vicuna和ChatGPT。我們的結果顯示,在各種下游任務中,InstructZero優於SOTA自動指令方法。我們的程式碼和數據可在https://github.com/Lichang-Chen/InstructZero 公開獲取。
English
Large language models~(LLMs) are instruction followers, but it can be
challenging to find the best instruction for different situations, especially
for black-box LLMs on which backpropagation is forbidden. Instead of directly
optimizing the discrete instruction, we optimize a low-dimensional soft prompt
applied to an open-source LLM to generate the instruction for the black-box
LLM. On each iteration of the proposed method, which we call InstructZero, a
soft prompt is converted into an instruction using the open-source LLM, which
is then submitted to the black-box LLM for zero-shot evaluation, and the
performance is sent to Bayesian optimization to produce new soft prompts
improving the zero-shot performance. We evaluate InstructZero on different
combinations of open-source LLMs and APIs including Vicuna and ChatGPT. Our
results show that InstructZero outperforms SOTA auto-instruction methods across
a variety of downstream tasks. Our code and data are publicly available at
https://github.com/Lichang-Chen/InstructZero.