Large language models (LLMs) are highly capable at a variety of tasks given the right prompt, but writing one is still a difficult and tedious process. In this work, we introduce ConstitutionalExperts, a method for learning a prompt consisting of constitutional principles (i.e. rules), given a training dataset. Unlike prior methods that optimize the prompt as a single entity, our method incrementally improves the prompt by surgically editing individual principles. We also show that we can improve overall performance by learning unique prompts for different semantic regions of the training data and using a mixture-of-experts (MoE) architecture to route inputs at inference time. We compare our method to other state of the art prompt-optimization techniques across six benchmark datasets. We also investigate whether MoE improves these other techniques. Our results suggest that ConstitutionalExperts outperforms other prompt optimization techniques by 10.9% (F1) and that mixture-of-experts improves all techniques, suggesting its broad applicability.
翻译:大语言模型(LLMs)在给定恰当提示的情况下,能高效完成多种任务,但编写提示仍是一个困难且繁琐的过程。本研究提出ConstitutionalExperts方法,该方法利用训练数据集学习由宪法原则(即规则)构成的提示。与先前将提示作为单一实体进行优化的方法不同,本方法通过精准编辑单个原则来逐步改进提示。我们还证明,通过为训练数据的不同语义区域学习独特提示,并在推理时采用混合专家(MoE)架构进行输入路由,可以提升整体性能。我们将本方法与六项基准数据集上的其他最新提示优化技术进行比较,并探究MoE是否有助于改进这些技术。结果表明,ConstitutionalExperts的F1值比其他提示优化技术高出10.9%,且混合专家架构能提升所有技术的性能,这彰显了其广泛适用性。