Explaining Patterns in Data with Language Models via Interpretable Autoprompting

Chandan Singh, John X. Morris, Jyoti Aneja, Alexander M. Rush, Jianfeng Gao
10/4/2022
cs.LGcs.AIcs.CL

Official code: csinva/imodelsX (177 stars, Python, MIT, PyTorch, last commit 2026-04-22). 1 more implementation below.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
csinva/imodelsXOfficial177PythonMIT2026-04-22
csinva/ipromptCommunity48Jupyter Notebook–2023-10-30
csinva/imodelsXOfficial100%
PyTorchMIT

Interpret text data with LLMs (sklearn compatible).

17729Python, Jupyter NotebookOct 4, 20227 months agoMIT
aideep-learningexplainabilityhuggingfaceinterpretability+12 more
csinva/ipromptCommunity100%

Finding semantically meaningful and accurate prompts.

488Jupyter Notebook, PythonAug 24, 20223 years ago
aiautopromptdeep-learningexplainabilityexplainable-ai+11 more

Similar Papers

Cite this paper

@article{singh2022explaining,
  title  = {Explaining Patterns in Data with Language Models via Interpretable Autoprompting},
  author = {Chandan Singh and John X. Morris and Jyoti Aneja and Alexander M. Rush and Jianfeng Gao},
  year   = {2022},
  eprint = {2210.01848},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.01848}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.01848.svg)](https://codeofpaper.com/paper/2210.01848)

Discussion