10 research outputs found
Automatic Prompt Optimization with "Gradient Descent" and Beam Search
Large Language Models (LLMs) have shown impressive performance as general
purpose agents, but their abilities remain highly dependent on prompts which
are hand written with onerous trial-and-error effort. We propose a simple and
nonparametric solution to this problem, Automatic Prompt Optimization (APO),
which is inspired by numerical gradient descent to automatically improve
prompts, assuming access to training data and an LLM API. The algorithm uses
minibatches of data to form natural language ``gradients'' that criticize the
current prompt. The gradients are then ``propagated'' into the prompt by
editing the prompt in the opposite semantic direction of the gradient. These
gradient descent steps are guided by a beam search and bandit selection
procedure which significantly improves algorithmic efficiency. Preliminary
results across three benchmark NLP tasks and the novel problem of LLM jailbreak
detection suggest that Automatic Prompt Optimization can outperform prior
prompt editing techniques and improve an initial prompt's performance by up to
31\%, by using data to rewrite vague task descriptions into more precise
annotation instructions
Recommended from our members
Stimulus-response signaling dynamics characterize macrophage polarization states.
The functional state of cells is dependent on their microenvironmental context. Prior studies described how polarizing cytokines alter macrophage transcriptomes and epigenomes. Here, we characterized the functional responses of 6 differentially polarized macrophage populations by measuring the dynamics of transcription factor nuclear factor κB (NF-κB) in response to 8 stimuli. The resulting dataset of single-cell NF-κB trajectories was analyzed by three approaches: (1) machine learning on time-series data revealed losses of stimulus distinguishability with polarization, reflecting canalized effector functions. (2) Informative trajectory features driving stimulus distinguishability (signaling codons) were identified and used for mapping a cell state landscape that could then locate macrophages conditioned by an unrelated condition. (3) Kinetic parameters, inferred using a mechanistic NF-κB network model, provided an alternative mapping of cell states and correctly predicted biochemical findings. Together, this work demonstrates that a single analytes dynamic trajectories may distinguish the functional states of single cells and molecular network states underlying them. A record of this papers transparent peer review process is included in the supplemental information