FLEX: an Adaptive Exploration Algorithm for Nonlinear Systems

Matthieu Blanke, Marc Lelarge

Introduction

Model-based reinforcement learning (RL) relies heavily on accurate dynamics models, but gathering the data required to train these models is notoriously expensive. To address this, researchers have introduced FLEX, a fast, adaptive exploration algorithm. FLEX uses optimal experimental design to actively select the most informative actions step-by-step, achieving state-of-the-art sample efficiency with only a fraction of the computational cost of existing methods.

The Challenge of Active Exploration

For an AI agent to effectively control a physical system—such as a robot arm or an aircraft—it needs a mathematical model of how that system behaves. Learning this model from scratch requires "active exploration": deliberately taking actions to excite the system and collect informative data.

However, exploring nonlinear systems is incredibly challenging. Existing approaches, which often use Gaussian processes or neural network ensembles to measure uncertainty, are computationally heavy and memory-intensive. This makes them nearly impossible to run on real-time embedded systems. Furthermore, these methods often plan "episodically" by simulating trajectories over long time horizons. If the environment's dynamics change over time, an episodic planner will waste time executing a long, outdated plan based on a flawed model. The authors set out to build an exploration algorithm that is highly expressive (compatible with neural networks), sample-efficient, computationally lightweight, and capable of adapting step-by-step.

The FLEX Algorithm

The authors frame exploration through the lens of D-optimal experimental design, a statistical framework that seeks to maximize the information gain (specifically, the Fisher information) of new data points.

While D-optimal design is well-understood for simple linear models, applying it to complex nonlinear models like neural networks is mathematically tricky. FLEX bridges this gap with a few clever approximations:

  1. Jacobian as Features: FLEX linearizes the neural network model with respect to its parameters using Jacobians (computed via automatic differentiation). This allows the algorithm to treat the neural network locally like a linear model.
  2. Greedy, One-Step Planning: Instead of planning over a long horizon, FLEX calculates a predicted information gain for just the next time step.
  3. Rank-One Approximation: To avoid heavy matrix math, the authors use the Matrix Determinant Lemma to simplify the information gain objective.
  4. Fast Optimization: The algorithm linearizes the objective with respect to the state, reducing the action-selection process to a simple quadratic optimization problem subject to an amplitude constraint. This is solved analytically in milliseconds using an eigenvalue decomposition and scalar root-finding.

The model is then updated online at every single time step using gradient descent.

Experimental Setup

The authors evaluated FLEX on several simulated environments:

  • Classical Control: Pendulum, Quadrotor, Cartpole, and a Robot Arm (double pendulum).
  • Time-Varying Environment: A custom scenario featuring a spaceship navigating a repulsive force field around a moving star, testing the algorithm's ability to adapt to changing dynamics.
  • High-Dimensional Environment: A custom chain of $N$ coupled damped pendulums (up to 100 state dimensions) to test scalability and underactuation.

Key Insights

  • Greedy planning can yield coherent behavior: Even though FLEX only plans one step ahead, it surprisingly produces inputs with long-term temporal coherence. For example, it naturally learns to excite a pendulum at its resonant frequency to gather data from larger, more informative amplitudes.
  • Adaptivity beats episodic planning: In time-varying environments, planning over long horizons is detrimental. By updating the model and the exploration policy at every single time step, FLEX successfully tracks changing dynamics that episodic planners completely lose sight of.
  • Jacobians bridge the gap to deep learning: By treating the gradients of a neural network as the "features" of a linear model, classical optimal experimental design techniques can be elegantly and cheaply extended to modern deep learning architectures.

Performance and Results

  • Sample Efficiency: FLEX consistently outperformed random, uniform, and periodic exploration baselines across all benchmark environments, rapidly minimizing model error.
  • Downstream Control: The ultimate goal of exploration is to use the model for control. When applied to a Cartpole swing-up task, models trained via FLEX required only 50 samples to solve the task. For comparison, Receding Horizon Curiosity (RHC) required 500 samples, and Soft Actor-Critic (SAC) required over 2,000.
  • Computational Speed: FLEX averaged 4ms per observation on Cartpole, compared to 8ms for RHC and 100ms for MAX, making it highly suitable for real-time control loops.
  • High-Dimensional Scaling: In the coupled pendulum task, FLEX's sample complexity scaled linearly with the state dimension. Random exploration failed entirely as dimensions increased, exhibiting super-linear sample complexity.

Limitations and Future Directions

While highly effective, FLEX has a few limitations. The current method assumes the full state of the environment is observable; extending FLEX to partially observed systems (POMDPs) by combining it with state estimation is a primary direction for future work. Additionally, while the optimization step is incredibly fast, calculating the Jacobians via automatic differentiation remains a computational bottleneck. Finally, the paper uses standard online gradient descent to update the neural networks. More sophisticated, bounded-memory online learning rules are needed to strictly meet the hardware constraints of real embedded systems, and future work could integrate the FLEX objective as an exploration bonus in standard RL algorithms to balance exploring the environment and exploiting known rewards.

Summary updated

BibTeX
@inproceedings{blanke2023flex,
  author = {Matthieu Blanke and Marc Lelarge},
  title = {{FLEX: an Adaptive Exploration Algorithm for Nonlinear Systems}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=j9q5fadNpg},
}
Figure