LLM Prompting

LLM: Large Language Model

Overview

The field studies how the wording and structure of inputs affect what language models understand, generate, and reliably follow. Common approaches include zero- and few-shot in-context learning, chain-of-thought and task decomposition, retrieval-augmented context, and structured prompts using schemas, roles, or constraints. Researchers also develop automated prompt search, feedback-driven refinement, and methods that adapt examples or context to each input, testing them on tasks such as reasoning, classification, code generation, and information extraction. Prompting can improve performance without changing model weights, but its effects vary across models and tasks: added instructions can hurt, and gains in accuracy may trade off with reliability, diversity, safety, or cost.

Latest papers

452 papers23 papers in the last four weeks, down 41% on the four weeks before. 0.2% of all new papers.

Apr 12, 2024

Budgeted Prompt-Set Expansion and Refinement for Language Models via Simulation Optimization

A prompt is an instruction or description provided by the user to guide a generative language model toward outputs that meet application requirements. When these requirements change, existing prompts may need to be adapted and improved. Evaluating candidate prompts requires time and computational resources. We therefore study how to expand and refine an initial set of prompts under a limited evaluation budget through simulation optimization, aiming to maximize a pre-defined task score for a fixed language model. Specifically, we propose a two-stage framework. In the first stage, we expand the initial set of prompts into a finite candidate set, where each prompt is represented by a moderate-dimensional vector. In the subsequent stage of evaluation and selection, we construct a surrogate model of the score for moderate-dimensional vectors representing the prompts. We propose sequentially selecting prompts for evaluation using the constructed surrogate model. We prove the consistency of the sequential evaluation procedure in our framework. We further introduce a refinement procedure that uses the collected scores to search beyond the initial candidate set. We also conduct numerical experiments to demonstrate the advantages of our method over baseline prompt selection methods, with higher prompt scores, especially when the budget for calling language models to evaluate prompts is limited.
Apr 3, 2024

An Incomplete Loop: Deductive, Inductive, and Abductive Reasoning in Language Models

Modern language models (LMs) can learn to perform new tasks in different ways: in instruction following, the target task is described explicitly in natural language; in few-shot prompting, the task is specified implicitly with a small number of examples; in instruction inference, LMs are presented with in-context examples and are then prompted to generate a natural language task description before making predictions. Each of these procedures may be thought of as invoking a different form of reasoning: instruction following involves deductive reasoning, few-shot prompting involves inductive reasoning, and instruction inference involves abductive reasoning. How do these different capabilities relate? Across four LMs (from the gpt and llama families) and two learning problems (involving arithmetic functions and machine translation) we find a strong dissociation between the different types of reasoning: LMs can sometimes learn effectively from few-shot prompts even when they are unable to explain their own prediction rules; conversely, they sometimes infer useful task descriptions while completely failing to learn from human-generated descriptions of the same task. Our results highlight the non-systematic nature of reasoning even in some of today's largest LMs, and underscore the fact that very different learning mechanisms may be invoked by seemingly similar prompting procedures.