Gradient-Descent for Randomized Controllers under Partial Observability

Linus Heck, Jip Spel, Sebastian Junges, Joshua Moerman, Joost-Pieter KatoenarXiv 2021 · arXiv

This paper introduces a highly efficient method for designing randomized controllers in complex, uncertain environments by leveraging gradient descent—a staple of modern machine learning—applied to the formal verification of probabilistic systems. By showing how to compute gradients efficiently within parametric Markov chains, the authors achieve a performance leap that outperforms existing state-of-the-art synthesis tools by at least an order of magnitude.

TL;DR

The authors present a novel approach to synthesize randomized controllers for partially observable systems by applying gradient descent to parametric Markov chains (pMCs). Their method efficiently computes gradients through linear equation systems, enabling the synthesis of controllers with thousands of parameters and outperforming current state-of-the-art techniques by over 10x in speed and scalability.

What Problem Does This Paper Address?

Designing controllers for systems that only have partial information about their environment (like a robot with noisy sensors) is notoriously difficult. Randomization is a key strategy for making these controllers robust, but finding the "right" amount of randomness is a complex optimization problem.

Formally, this is often framed as parameter synthesis for parametric Markov chains (pMCs). The goal is to find specific values for symbolic probabilities in a model so that the system meets a requirement, such as "the probability of a crash is less than 0.01%."

Fig. 1. Verification and (syntax-guided) synthesis for controllers

The challenge is that this problem is ETR-complete (as hard as finding roots of multivariate polynomials), and existing exact methods fail when the number of parameters grows beyond a few dozen. Real-world applications, however, often require thousands of parameters.

Methods

The core contribution is a principled way to evaluate gradients in pMCs efficiently. The authors demonstrate two equivalent ways to characterize the gradient of an expected reward (or reachability probability) with respect to a parameter:

  1. Equation-System Based: The gradient is the solution to a linear equation system derived by applying the product and sum rules to the standard equations for expected rewards.
  2. Automaton Based: The gradient can be viewed as the expected reward of a "derived" weighted finite automaton (WFA).
A sample pMC (left) and its corresponding derived weighted automaton (right) used for gradient calculation.

By solving these linear systems numerically (using methods like GMRES), they can compute the gradient at a specific point in the parameter space very quickly. They then evaluate several flavors of gradient descent, including:

  • Classical methods: Plain GD, Momentum, and Nesterov accelerated GD.
  • Adaptive methods: Adam, RMSProp, and RAdam.
  • Sign methods: Variants that only use the sign of the gradient, not its magnitude.

To ensure parameters remain valid probabilities (between 0 and 1), they compared three restriction methods: Projection (clipping values to the boundary), Barrier Functions (adding a penalty near boundaries), and Logistic Functions (mapping unrestricted space to [0,1]).

Datasets

The authors evaluated their approach on a diverse set of benchmarks derived from:

  • POMDPs: Including classic problems like drone, refuel, 4x4grid, and maze.
  • Bayesian Networks: Such as hailfinder and child.
  • Network Protocols: Specifically the nrp (network repair protocol) and network2-prios.

These benchmarks ranged from small models to massive ones like maze2, which contains nearly 30,000 parameters and over 60,000 states.

Key Insights and Ideas

  • Momentum-Sign is the Winner: Surprisingly, a simple "Momentum-Sign" method (which ignores the gradient's magnitude and only uses its direction combined with momentum) performed best. This is likely because many parameters in these models are "easy"—they naturally want to be at 0 or 1—and the sign-based approach pushes them there efficiently without getting bogged down by vanishingly small gradients.
  • Projection is Robust: While barrier functions are popular in optimization, the authors found that simple projection was more effective. Barrier functions often pushed the search away from the edges of the parameter space, where optimal solutions frequently reside.
  • Efficiency via Linear Algebra: The realization that gradients can be computed by solving $(|V| + 1)$ linear systems (where $|V|$ is the number of parameters) allows the method to scale linearly with the number of parameters, a massive improvement over symbolic methods.

Key Results

  • Speedup: The proposed Gradient Descent method (specifically Momentum-Sign with Projection) outperformed existing baselines like Particle Swarm Optimization (PSO) and Quadratically-Constrained Quadratic Programming (QCQP) by at least one order of magnitude on most benchmarks.
  • Scalability: The method successfully found feasible controllers for the maze2 benchmark with 29,749 parameters, a scale previously unreachable by state-of-the-art synthesis tools.
  • Reliability: Unlike PSO, which sometimes failed due to internal errors or memory limits on larger models, the GD approach proved to be highly stable across the entire benchmark suite.
Comparison of different gradient descent methods, showing Momentum-Sign typically achieves the best runtimes.

Limitations and Future Work

While powerful, the authors note a few areas for improvement:

  • Local Optima: Like all gradient-based methods, it can get stuck in local optima. The authors currently handle this with random restarts, but more sophisticated global search strategies could be explored.
  • Parameter Ordering: The order in which parameters are updated in mini-batch settings might affect convergence speed. Investigating "parameter influence" could lead to better update schedules.
  • Preprocessing: Integrating monotonicity checking (determining if a property always increases/decreases with a parameter) could further prune the search space before optimization begins.

Summary updated

Abstract

Randomization is a powerful technique to create robust controllers, in particular in partially observable settings. The degrees of randomization have a significant impact on the system performance, yet they are intricate to get right. The use of synthesis algorithms for parametric Markov chains (pMCs) is a promising direction to support the design process of such controllers. This paper shows how to define and evaluate gradients of pMCs. Furthermore, it investigates varieties of gradient descent techniques from the machine learning community to synthesize the probabilities in a pMC. The resulting method scales to significantly larger pMCs than before and empirically outperforms the state-of-the-art, often by at least one order of magnitude.
BibTeX
@misc{heck2021gradient,
  author = {Linus Heck and Jip Spel and Sebastian Junges and Joshua Moerman and Joost-Pieter Katoen},
  title = {{Gradient-Descent for Randomized Controllers under Partial Observability}},
  year = {2021},
  eprint = {2111.04407},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.04407},
}
Figure