Control Improvisation

Daniel J. Fremont, Alexandre Donzé, Sanjit A. SeshiaarXiv 2017

Abstract

Control Improvisation (CI) is a formal framework for generating random sequences that are guaranteed to satisfy hard constraints, adhere to quantitative soft constraints, and maintain a specified level of diversity. This paper provides a rigorous theoretical foundation for CI, demonstrating that while the general problem is #P-hard, efficient polynomial-time algorithms exist for common specifications like deterministic finite automata (DFAs) and unambiguous context-free grammars (UCFGs).

Introduction

In domains ranging from music composition to software testing, there is a recurring need to generate random data that follows specific rules. Standard random sampling often fails to balance strict rules with qualitative desires and diversity. For instance, a music improviser must follow rhythmic and harmonic "hard constraints" while remaining "similar" to a reference piece (a "soft constraint") and avoiding repetitive outputs (randomness requirements).

This paper formalizes this challenge as the Control Improvisation problem. It maps the mathematical landscape of building such "improvisers," defining them as probabilistic algorithms that generate strings within specified length bounds while satisfying both logical and statistical properties.

Methodology

A CI instance is defined by a tuple $(H, S, m, n, \epsilon, \lambda, \rho)$, where $H$ is the hard constraint, $S$ is the soft constraint, $[m, n]$ are length bounds, $\epsilon$ is the allowed error probability for the soft constraint, and $[\lambda, \rho]$ are the lower and upper bounds on the probability of any single output.

The authors prove a Feasibility Theorem, showing that an improviser exists if and only if the sizes of the sets of valid and admissible strings satisfy specific inequalities. Central to their approach is a generic improvisation scheme. If a specification supports five basic operations in polynomial time, the CI problem can be solved efficiently.

Five basic operations required for the generic improvisation scheme.

These operations allow the construction of an improviser by counting and sampling from the sets of strings that satisfy the constraints. The authors instantiate this for DFAs and UCFGs. For larger systems, they propose Symbolic CI, which utilizes SAT solvers and approximate model counting to find near-optimal improvisers.

Complexity and Key Insights

The research reveals a "complexity cliff" based on the determinism of the constraints. If constraints are represented as DFAs or UCFGs, the problem is solvable in polynomial time. However, if they are non-deterministic (NFAs) or ambiguous (CFGs), the problem becomes #P-hard—equivalent in difficulty to counting solutions to a logic formula.

A key insight is the asymmetry of constraints: hard constraints define the support of the distribution, while soft constraints shape the distribution's mass. Furthermore, the feasibility of an improvisation problem is determined entirely by the cardinalities of the underlying string sets, simplifying what might otherwise be a complex optimization problem into a counting task.

Applications and Examples

The framework is tested using various models, including factor oracles. These are data structures used in music improvisation to represent sub-words of a reference melody, serving as a basis for hard constraints.

An example automaton representing constraints, such as a factor oracle used in music improvisation.

The paper also demonstrates the utility of Symbolic CI in scaling to massive state spaces, such as robotic path planning, where explicit automata representation would be computationally prohibitive.

Conclusion and Future Work

The paper establishes definitive complexity results and develops efficient algorithms for several CI variants. However, challenges remain, such as handling multiple soft constraints simultaneously, which is shown to be #P-hard even for DFAs. Future research directions include extending the framework to infinite-length sequences using Linear Temporal Logic (LTL) and developing "reactive" improvisation for environments that change in real-time.

Summary updated

BibTeX
@misc{fremont2017control,
  author = {Daniel J. Fremont and Alexandre Donzé and Sanjit A. Seshia},
  title = {{Control Improvisation}},
  year = {2017},
  eprint = {1704.06319},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1704.06319},
}
Figure