Learning Extrapolative Sequence Transformations from Markov Chains
Sophia Hager, Aleem Khan, Andrew Wang, Nicholas Andrews
TL;DR
This work presents a data-driven framework to learn extrapolative sequence transformations by training an autoregressive model $q_ heta$ on carefully selected Markov-chain states produced by Metropolis-Hastings sampling with mask-infilling proposals. The model is finetuned to iteratively transform an initial sequence toward higher target scores, using a two-phase setup: (1) construct an energy-based surrogate via $p(x) \\propto \,\exp(s(x))$ with intractable $Z$, and (2) train $q_ heta$ on short training episodes that condition on history and scores. Across protein engineering (ACE2 ddG stability), sentiment control on Yelp data, and text anonymization, $q_ heta$ achieves competitive or superior extrapolation performance with substantially fewer iterations than MCMC, and in some cases surpasses the best MCMC results. The approach leverages pre-trained denoising language models as proposals, enabling scalable, sample-efficient extrapolation and offering practical benefits for sequence design and controllable generation.
Abstract
Most successful applications of deep learning involve similar training and test conditions. However, tasks such as biological sequence design involve searching for sequences that improve desirable properties beyond previously known values, which requires novel hypotheses that \emph{extrapolate} beyond training data. In these settings, extrapolation may be achieved by using random search methods such as Markov chain Monte Carlo (MCMC), which, given an initial state, sample local transformations to approximate a target density that rewards states with the desired properties. However, even with a well-designed proposal, MCMC may struggle to explore large structured state spaces efficiently. Rather than relying on stochastic search, it would be desirable to have a model that greedily optimizes the properties of interest, successfully extrapolating in as few steps as possible. We propose to learn such a model from the Markov chains resulting from MCMC search. Specifically, our approach uses selected states from Markov chains as a source of training data for an autoregressive model, which is then able to efficiently generate novel sequences that extrapolate along the sequence-level properties of interest. The proposed approach is validated on three problems: protein sequence design, text sentiment control, and text anonymization. We find that the autoregressive model can extrapolate as well or better than MCMC, but with the additional benefits of scalability and significantly higher sample efficiency.
