Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programs

06/05/2023
by   Alexander K. Lew, et al.
0

Even after fine-tuning and reinforcement learning, large language models (LLMs) can be difficult, if not impossible, to control reliably with prompts alone. We propose a new inference-time approach to enforcing syntactic and semantic constraints on the outputs of LLMs, called sequential Monte Carlo (SMC) steering. The key idea is to specify language generation tasks as posterior inference problems in a class of discrete probabilistic sequence models, and replace standard decoding with sequential Monte Carlo inference. For a computational cost similar to that of beam search, SMC can steer LLMs to solve diverse tasks, including infilling, generation under syntactic constraints, and prompt intersection. To facilitate experimentation with SMC steering, we present a probabilistic programming library, LLaMPPL (https://github.com/probcomp/LLaMPPL), for concisely specifying new generation tasks as language model probabilistic programs, and automating steering of LLaMA-family Transformers.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/18/2018

Automatic Alignment of Sequential Monte Carlo Inference in Higher-Order Probabilistic Programs

Probabilistic programming is a programming paradigm for expressing flexi...
research
09/29/2020

ParaMonte: A high-performance serial/parallel Monte Carlo simulation library for C, C++, Fortran

ParaMonte (standing for Parallel Monte Carlo) is a serial and MPI/Coarra...
research
02/25/2017

Monte Carlo Action Programming

This paper proposes Monte Carlo Action Programming, a programming langua...
research
03/19/2016

Neurally-Guided Procedural Models: Amortized Inference for Procedural Graphics Programs using Neural Networks

Probabilistic inference algorithms such as Sequential Monte Carlo (SMC) ...
research
05/26/2023

With a Little Push, NLI Models can Robustly and Efficiently Predict Faithfulness

Conditional language models still generate unfaithful output that is not...
research
09/28/2021

Generating texts under constraint through discriminator-guided MCTS

Large pre-trained language models (LM) based on Transformers allow to ge...
research
09/21/2021

Flexible and efficient Bayesian pharmacometrics modeling using Stan and Torsten, Part I

Stan is an open-source probabilistic programing language, primarily desi...

Please sign up or login with your details

Forgot password? Click here to reset