Large language models (LLMs) have displayed an impressive ability to harness natural language to perform complex tasks. In this work, we explore whether we can leverage this learned ability to find and explain patterns in data. Specifically, given a pre-trained LLM and data examples, we introduce interpretable autoprompting (iPrompt), an algorithm that generates a natural-language string explaining the data. iPrompt iteratively alternates between generating explanations with an LLM and reranking them based on their performance when used as a prompt. Experiments on a wide range of datasets, from synthetic mathematics to natural-language understanding, show that iPrompt can yield meaningful insights by accurately finding groundtruth dataset descriptions. Moreover, the prompts produced by iPrompt are simultaneously human-interpretable and highly effective for generalization: on real-world sentiment classification datasets, iPrompt produces prompts that match or even improve upon human-written prompts for GPT-3. Finally, experiments with an fMRI dataset show the potential for iPrompt to aid in scientific discovery. All code for using the methods and data here is made available on Github.
翻译:大型语言模型(LLMs)展现了利用自然语言执行复杂任务的显著能力。本研究探讨能否利用这种学习能力来发现并解释数据中的模式。具体而言,针对预训练LLM和数据样本,我们提出可解释自动提示(iPrompt)算法,该算法能生成解释数据的自然语言字符串。iPrompt通过迭代交替执行以下两个步骤:利用LLM生成解释,以及根据这些解释作为提示时的表现对其进行重新排序。从合成数学到自然语言理解的广泛数据集实验表明,iPrompt能通过准确发现数据集的真实描述来产生有意义的洞察。此外,iPrompt生成的提示既具备人类可解释性,又对泛化高度有效:在真实世界的情感分类数据集上,iPrompt生成的提示与GPT-3的人工编写提示表现相当甚至更优。最后,基于fMRI数据集的实验展示了iPrompt在辅助科学发现方面的潜力。所有方法及数据的使用代码均已在GitHub上公开。