LUT Optimization for Piecewise Linear Approximations in Embedded Systems via Reinforcement Learning
LUT, PWL, Reinforcement Learning, PPO, MaskablePPO, MDP formulation, Embedded Systems, Function Approximation.
In many scenarios, nonlinear functions are required in embedded systems for measuring or generating output signals. However, implementing these functions can be computationally intensive in architectures with hardware constraints, particularly limited resolution, fixed-point arithmetic, and limited memory. In such cases, it is common to use look-up tables (LUTs), in which precomputed values of the function are stored and accessed at runtime. In their direct form, these LUTs perform 1:1 mapping, that is, they store an output value for each possible input. In this context, the goal is to determine the minimum number of breakpoints that preserves the validity of the approximation, striking a balance between precision and resource usage. To this end, various approaches have been proposed, including evolutionary computation, numerical methods, and other optimization strategies.
In this work, we propose a formulation based on deep reinforcement learning for constructing PWL (Piecewise Linear Approximation — PWL) approximations with error constraints, using the Proximal Policy Optimization (PPO) algorithm, with invalid action masking (MaskablePPO). The approach is evaluated on the problem of approximating the sine function in the first quadrant, and the results are presented for different input resolutions and output value representations.