Source-linked AI summary

ExpertPrompting: Instructing Large Language Models to be Distinguished Experts

Benfeng Xu, An Yang, Junyang Lin, Quan Wang, Chang Zhou, Yongdong Zhang, Zhendong Mao

arXiv:2305.14688v2cs.CLcs.AI

TL;DR

Prompt crafting can substantially affect the quality of aligned LLM answers. ExpertPrompting automatically generates detailed, instruction-specific expert identities with In-Context Learning and conditions answers on them, yielding higher-quality data and an open-source assistant that reaches approximately 96% of original ChatGPT capability.

  • Problem

    Prompt wording can cause the same communicative intent to receive either a comprehensive, detailed response or a less helpful one.

  • Method

    ExpertPrompting uses In-Context Learning to automatically synthesize a detailed expert identity for each instruction, then conditions the LLM's answer on that identity.

  • Results

    Expert data is preferred over vanilla answers, and ExpertLLaMA outperforms existing open-source assistants while achieving approximately 96% of original ChatGPT's capability.

  • Takeaways & Limitations

    ExpertPrompting provides a generalized and simple strategy for producing higher-quality instruction-following data and training a competitive open-source chat assistant.

  • Takeaways & Limitations

    Generated answers can occasionally include mixed content involving the supplied expert identity, requiring recognizable patterns to be removed in postprocessing.

Abstract

from arXiv · show

The answering quality of an aligned large language model (LLM) can be drastically improved if treated with proper crafting of prompts. In this paper, we propose ExpertPrompting to elicit the potential of LLMs to answer as distinguished experts. We first utilize In-Context Learning to automatically synthesize detailed and customized descriptions of the expert identity for each specific instruction, and then ask LLMs to provide answer conditioned on such agent background. Based on this augmented prompting strategy, we produce a new set of instruction-following data using GPT-3.5, and train a competitive open-source chat assistant called ExpertLLaMA. We employ GPT4-based evaluation to show that 1) the expert data is of significantly higher quality than vanilla answers, and 2) ExpertLLaMA outperforms existing open-source opponents and achieves 96\% of the original ChatGPT's capability. All data and the ExpertLLaMA model will be made publicly available at https://github.com/OFA-Sys/ExpertLLaMA.

1 Introduction

ExpertPrompting addresses prompt-sensitive answer quality by having LLMs answer as distinguished experts selected for each instruction. The method automatically generates detailed expert identities and produces expert instruction-following data with GPT-3.5.

  • Prompt construction can make the same communicative intent receive either a comprehensive response or a less helpful one.
  • ExpertPrompting selects a distinguished expert agent suited to each instruction and conditions the answer on that expert identity.
  • The method automatically generates detailed, instruction-specific expert identities through In-Context Learning.
  • ExpertPrompting is designed to generalize across domains and genres while remaining simple to implement.
  • GPT-3.5 expert prompting on 52k Alpaca instructions produces expert data with improved answering quality and supports training ExpertLLaMA.

2 Method

ExpertPrompting first generates an expert identity for an instruction, then uses that identity with the original instruction to obtain an augmented answer. The identities are customized and detailed, while generated identity-related text can require postprocessing.

  • 2 Method: Given instruction q, an aligned LLM produces an answer a, which ExpertPrompting seeks to improve with an expert identity.
  • 2.1 Expert Identity: Expert identities should be specialized to the instruction, informative about the agent, and generated automatically rather than manually annotated.
  • 2.1 Expert Identity: In-Context Learning generates new identities from manually revised instruction–identity exemplars prepended to the prompt.
  • 2.2 Expert Prompting: The original instruction is paired with its expert identity to request an augmented answer.
  • 2.2 Expert Prompting: LLMs can occasionally include the supplied identity in the answer, so recognizable patterns are removed during postprocessing.
  • 2.2 Expert Prompting: The authors apply standard and ExpertPrompting strategies to Alpaca instructions and train ExpertLLaMA with the resulting GPT-3.5 answers.

3 Evaluation

The evaluation compares expert, vanilla, and fixed-description prompting, then assesses instruction-following data and chat assistants using GPT4-based judgments and Vicuna80. ExpertPrompting answers receive stronger preference, while ExpertLLaMA outperforms the compared open-source assistants.

  • Experimental Setting: GPT4-based evaluation compares expert answers against vanilla answers on 500 randomly sampled instructions from the 52k Alpaca set.The study also compares ExpertPrompting with a fixed Static DESC baseline and evaluates trained assistants on Vicuna80.
  • Baselines: ExpertLLaMA is compared with Alpaca, LLaMA-GPT4, LLaMA-GPT-3.5, LLaMA-GPT-3.5+, Vicuna, ChatGPT, and Bard.The comparisons use released or reproduced answers and models trained with corresponding answer-generation strategies.
  • Data Evaluation: Expert answers are significantly longer than vanilla answers despite no explicit request for longer responses or word-count restriction.Table 1 reports average answer lengths for prompting strategies using GPT-3.5-Turbo on the 52k Alpaca instructions.
  • Data Evaluation: ExpertPrompting answers are preferred 48.5% of the time, compared with 23% for vanilla answers.Figure 3 reports these preferences from GPT4-based evaluation.
  • Model Evaluation: On Vicuna80, ExpertLLaMA consistently outperforms existing open-source chat assistants and remains inferior only to ChatGPT.The authors report approximately 96% of ChatGPT’s capability, while noting that this conclusion needs more rigorous validation.

4 Conclusion

The paper proposes ExpertPrompting, an automatic strategy that conditions LLM responses on distinguished expert identities, and trains ExpertLLaMA on the resulting data. GPT4-based evaluation reports higher-quality answers and ExpertLLaMA at 96% of ChatGPT’s capability.

  • Conclusion: ExpertPrompting instructs LLMs to answer like distinguished experts through an automatic, generalized, and simple augmented prompting strategy.The strategy produces expert-conditioned instruction-following data using GPT-3.5.
  • Conclusion: ExpertLLaMA is an open-source chat assistant trained on instruction-following data generated with ExpertPrompting.The model is trained using an open LLM and is released with the expert answers for future research.
  • Conclusion: 96% of the original ChatGPT’s capability is reported for ExpertLLaMA, alongside higher-quality ExpertPrompting answers in GPT4-based evaluation.The authors state that future work will enlarge the instruction-data scale beyond 52k Alpaca examples.

A Prompt Template

The section presents prompt templates for producing expert identities and applying ExpertPrompting. The templates include in-context learning for expert-identity generation and a GPT-4-based evaluation setup.

  • Prompting and Evaluation: The listed templates cover in-context expert-identity generation, ExpertPrompting, and GPT-4-based automatic evaluation.The paper identifies these as Figures 6, 7, and 8, respectively.
  • In-Context Learning: In-context learning is used to produce a detailed expert identity for each instruction.The template asks for a high-quality description of the most capable and suitable agent, written in second person.
  • In-Context Learning: An example pairs a deforestation instruction with an environmental-scientist agent description covering ecological and human impacts.The description names expertise in biodiversity, climate change, soil quality, water resources, and human health.
Loading 2305.14688v2…