Manuscript Offprint
arXiv:2609.31606Learning Robot Policies from Sparse Success Signals via STL-Guided Stein Variational Policy Gradient
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Hongrui Zheng , Cristian Ioan Vasile , Antonio Loquercio , Rahul Mangharam

Start
Incoming
Contact
Return
In target
Fig. 1. STL-SVPG combines Signal Temporal Logic (STL) robustness gradients and Stein Variational Gradient Descent (SVGD) to train low-level control policies in tasks with very sparse success signals, such as the drone's ping-pong task shown above. Shown is a successful real-world rollout of a policy trained in simulation with our approach. From left to right: initial hover, incoming ball, contact, ball return, and in target. Red circles highlight the ball.
Abstract—Learning robot policies for tasks with sparse success signals is challenging when completion depends on coordinated actions, precise contact outcomes, or satisfying several conditions together. Intricate physical interactions with the world further complicate these requirements. Prior work using conventional reward shaping mechanisms provides dense feedback but local progress might not translate into eventual task completion. We present Signal Temporal Logic-guided Stein Variational Policy Gradient (STL-SVPG), a population-based method that uses smooth STL robustness as a trajectory-level training objective. Differentiating this objective through the dynamics assigns credit to policy actions according to their effect on the complete task specification, rather than local progress alone. We evaluate the approach on six quadcopter and manipulator tasks that involves event-triggered responses, strictly ordered behavior, responses within specified deadlines, and physical interaction with the world. STL-SVPG achieves the highest mean success rate among the compared methods on five of six benchmarks. Simulation-trained policies trained in simulation transfer temporal and contact task behavior to the real world.
I. INTRODUCTION
Learning low-level robot control policies is challenging when task success signals are extremely sparse. Exploration may produce many unsuccessful trajectories before encountering a successful one, leaving little feedback to distinguish useful behavior or identify which actions matter. For example, a robot may need to coordinate several movements before completing an assembly, or strike an object so that it reaches a distant target. Ordering, timing, and simultaneous constraints can further restrict the set of successful trajectories.
Reward shaping [1] and model-based reinforcement learning are two common ways to assist learning in these settings. Handcrafted or automatically designed dense rewards [2] provide intermediate guidance, but require choices about which behaviors to encourage. Designing informative dense rewards is an iterative engineering process: changes to the task can require redesign and repeated training and evaluation. Automated reward design reduces manual effort but still relies on this feedback loop. Learned models in RL [3] can support lookahead and policy improvement with predicted experience, but do not by themselves provide informative task feedback. When useful outcomes require long action sequences, short planning horizons may miss them, while prediction errors can compound over longer model rollouts.
Therefore, for these sparse-completion tasks, informative feedback from unsuccessful trajectories is essential to practical learning efficiency: otherwise, policy improvement must wait for rare successful exploration. Signal Temporal Logic (STL) [4] does exactly this by specifying logical and temporal requirements over real-valued signals. The robustness semantics [5], [6] is a quantitative measure that assign the margin to success to a trajectory instead of a binary signal.
However, optimizing the robustness objectives through robot dynamics remains challenging: while smooth robustness makes gradients available, they remain concentrated on a few critical steps, vanishing over long trajectories [7], [8], [9]. STL-SVPIO [10] addresses these challenges by applying Stein variational optimization through differentiable STL robustness to optimize control sequences in nonlinear dynamical systems. However, similarly to prior work in STL planning [11], [7], it only finds open-loop control sequences from fixed initial conditions, with long computation time that makes online re-planning infeasible.
To amortize this computation, prior work trains a feedback policy using STL robustness as a reward [12], [13]. However, this leaves temporal credit assignment to exploration, while differentiable predictive controllers still rely on online trajectory prediction and backup mechanisms. These limitations motivate learning low-level feedback policies by differentiating trajectory-level robustness, where unsuccessful rollouts are still valuable training signals.
We propose STL-SVPG to learn low-level control policies
Equal Advising. Department of Electrical and Systems Engineering, University of Pennsylvania, Philadelphia, PA, USA. Mechanical Engineering and Mechanics Department, Lehigh University, Bethlehem, PA, USA. Correspond to hongruiz@engineering.upenn.edu.
for tasks with sparse success signals by exploiting an explicit STL specification of task completion. We use smooth STL robustness to quantify how trajectories satisfy or violate the specification. In contrast to reward engineering, the STL specification generates quantitative feedback from the same temporal requirements used to judge completion, reducing the need to design sub-task rewards. Like prior STL-based approaches for policy optimization [12], [13], we derive learning feedback from quantitative satisfaction of the task specification. In contrast to prior work, however, our approach couples trajectory-level robustness gradients with Stein Variational Gradient Descent (SVGD) [14], [15], resulting in a population of feedback policies that interact during learning: kernel-weighted updates share improvement directions between similar policies, while repulsive forces encourage diversity of behaviors. This strategy couples exploitation and exploration during optimization.
The goal of this paper is to leverage STL task specifications' ability to provide improvement signal even in unsuccessful rollouts to train low-level control policies for robots in tasks with sparse success signals. Empirically, our framework achieves the highest mean success among a set of reinforcement learning baselines with shaped dense rewards on five of six benchmarks. In addition, the policies trained with STL-SVPG in simulation transfer zero-shot to physical hardware. Overall, our contributions are as follows:
-
We introduce STL-SVPG, a specification driven policy learning framework that turns overall task requirements into actionable policy gradients for low-level feedback control even from unsuccessful trajectories.
-
A policy optimization method that shares information amongst a population of policy parameters that combines task-directed improvements with population-based exploration.
-
We investigate what makes this learning framework effective: how STL robustness gradients guide improvement and how population interactions expand exploration for better policies.
-
Validation of simulation-only trained STL-SVPG policies on two tasks in the real world.
Reward shaping: Potential based reward shaping [1] is the foundational work, it characterizes reward transformations that preserve optimal policies under their MDP assumptions. More recent advances in reward design with coding agents [2] generate and iteratively improve reward code using large language models and policy-training feedback. The dense reward for each task we used in our experiments is also defined using this approach. An adjacent approach is Hindsight Experience Replay (HER) [16]. It relabels achieved goals to learn from unsuccessful attempts rather than dense reward shaping. In contrast, our approach utilizes a smooth robustness surrogate of an STL specification, and we use automatic differentiation to generate policy gradients. This provides task-directed feedback before any success is even discovered, while reward shaping still requires successful or close to successful exploration, and HER turns alternative goals into successes.
Task-progress representations: Reward machines (RMs) [17], [18] represent task progression through finite-state representations. RMs can be decomposed into subproblems that are learned with off-policy Q-learning. Although a powerful approach for task decomposition, their use for training robotic policies [19] is still limited. LTL2Action [20] exploits LTL progression, which transforms the original non-Markovian problem into a Taskable MDP, then teaches agents to follow LTL-based instructions. Our approach does not need explicit decomposition of the original task. The STL specifications represent progression through different predicate functions and logical and temporal operators.
Learning with quantitative specifications: In the early years, Li et al. [12] has explored learning policies using the robustness of truncated linear temporal logic as a reward in RL. Varnai and Dimarogonas [21], [22] also proposed a general RL framework under STL signals. These works either used simplistic tasks or the benchmarks were limited to point-mass systems. Later, Saxena et al. [23] convert STL requirements into time-dependent shaped rewards and learns policies, using TD3 for continuous-action experiments. More recently, TGPO [24] has decomposed STL tasks into timed subgoals and invariant constraints, combining temporal search with policy learning. On the other hand, Smooth Operator [7] and STLCG(++) [8], [9] make STL specifications accessible to automatic differentiation. STLNPC [13] also uses this gradient. It trains a neural controller by maximizing predicted-trajectory robustness and uses predictive deployment with a backup policy. As we will show in the problem formulation, our population based method maximizes differential entropy of the learned policy distribution, which ends up bringing diversity in exploration. We will also show in comparison that our method is superior to using gradient descent alone.
III. BACKGROUND
A. Signal Temporal Logic (STL)
Syntax: Signal Temporal Logic (STL) [4] provides a compact representation for imposing spatiotemporal requirements over trajectories s. For example, we can express “Reach a goal within five seconds while remaining in a safe region throughout the episode” in a compact representation: , where and are predicate functions that measures whether the robot is in the goal, and being safe. In this work, we use STL formulae to express robotic task objectives. The STL syntax is
where is the truth value, is an atomic predicate, the value of the function determines the truth value of the predicate. Boolean operators and denotes “conjunction” and “negation” respectively. Temporal operator
U denotes “until”: formula has to hold until holds in the time interval . We can then use these primitives to define other operators. For example, disjunction is defined as ; “Eventually” is defined as ; “Always” is defined as ; And “Implication” is defined as .
Quantitative Semantics: STL uses robustness to measure how strongly a given trajectory satisfies or violates a specification . implies satisfaction and implies violation. Each predicate gives a signed satisfaction margin. Conjunction and always use the smallest relevant margin, whereas disjunction and eventually use the largest. Composing these operations yields one trajectory-level score whose sign indicates satisfaction or violation. We use the standard robustness semantics [5], [6] in this work.
Differentiable STL: Smooth max and min approximators [7] and parsing robustness evaluation into computation graphs [8], [9] have enabled automatic differentiation of the robustness value of a trajectory to the states in the trajectory. In conjunction with differentiable dynamics, we can compute gradients directly from robustness to the policy's actions.
B. Stein Variational Gradient Descent
SVGD [14] performs gradient descent by transporting a set of particles in the parameter space to match the target posterior representing the optimal objective. At each iteration m, SVGD updates the particles by , where is the set of initial particles, is the step size, and the function denotes optimal perturbation that maximally decreases the KL-divergence between the proposal distribution and the target posterior:
(2)
The two portions of the update directions represent the attraction force on the particles towards areas of higher expected score, with the kernel's value enabling “information sharing” between particles, and the repulsion force preventing mode collapse.
IV. PROBLEM FORMULATION
We formulate task-directed policy learning as variational inference (VI) over policy parameters. Let be a feedback policy and its induced finite-horizon trajectory, and be randomized initial conditions and task inputs. With a task STL specification , the policy objective is the expected robustness:
As in prior work for policy optimization with SVGD [25], [15], [26], we define the target distribution over policy parameters as the task-conditioned Gibbs density. The intuition behind this choice is that this distribution gives density to policies proportional to their expected return: the higher their Q function, the greater the density. By approximating this target distribution, we naturally find good performing policies. And by replacing the expected return with expected STL robustness, this gives us:
(4)
where is the temperature controlling the sharpness of the target distribution and is a normalizing factor that makes it a valid distribution. Let denote the variational approximation to this target. The VI objective is
over probability densities for which the objective is well-defined. By substituting into the KL-divergence definition, we can minimize the variational free energy
(6)
where is the differential entropy in policy parameter space. With these two terms, minimizing free energy maximizes both expected robustness and entropy, hence balancing exploitation and exploration. The target is optimal for this entropy-regularized objective. Note that the entropy here is in the policy parameter space, and not the usual policy action space. We use SVGD [14] to transport policy particles representing toward . In the next section, we discuss how we adapt this formulation to optimize a policy with an STL robustness score.
V. STL-GUIDED STEIN VARIATIONAL POLICY GRADIENT
Building on the target distribution in Equation (4), we represent the variational approximation q by a population of policy parameter particles . We consider a finite-horizon, discrete-time dynamical system
where , , and are the state, policy observation, and control input. Initial conditions and task inputs are sampled through , as in Section IV. A rollout is . For optimization, we replace the exact robustness in with a differentiable surrogate by using LogSumExp [7], [8], [9] as the smooth maximum operator:
For scalar inputs , we define the smooth maximum and minimum as
where controls the approximation sharpness and is distinct from the Gibbs temperature . Larger yields a closer approximation to the exact maximum and minimum, while smaller distributes gradient weight more broadly across the inputs. We use automatic differentiated simulation implemented with MuJoCo MJX [27] in JAX [28] with soft contact models to propagate robustness gradients through the trajectory to the controls. We use smoothed robustness only for training but not for evaluation, which is done via exact robustness.
Following SVGD [14] and SVPG [15], we derive the policy gradient. For the Gibbs target in Equation (4) in Section IV, the log-density gradient required by SVGD is the expected robustness gradient scaled by : . We therefore obtain the policy update by substituting this scaled robustness gradient into Equation (2). Thus, the Stein direction for policy optimization is:
The kernel-weighted score shares task-improving directions across particles, while the kernel derivative provides repulsion in parameter space.
Differentiating the smooth robustness through the simulated dynamics yields action gradients that can guide improvement even when a rollout does not satisfy the specification yet. We form the local policy-gradient estimate by multiplying these action gradients by the policy's action Jacobians, summing over time, and averaging over E rollouts.
Collected observations and sampled policy noise are held constant in this calculation. Thus, is a local approximation rather than the full closed-loop policy derivative. Storing the action gradients allows their contributions to be accumulated through randomized transition minibatches without repeatedly differentiating the simulator.
To measure behavioral differences between policies, we compare their actions on a shared, randomly sampled observation batch , rather than relying on parameter distances, which doesn’t necessarily reflect behavioral similarity [29]. With denoting the concatenated policy actions, we use
where is the bandwidth. We summarize the training procedure in Algorithm 1.
VI. EXPERIMENTAL SETUP
In the experiments, we select sparse success signal tasks on two different embodiments. These tasks combine continuous control with requirements for ordered actions, event-triggered responses, and contact interaction based outcomes. The chosen scenarios test whether the algorithm can learn successful physical behavior while also satisfying the logical and temporal specifications that result in extremely sparse success signals. We mainly test our learning algorithm on the Crazyflie [30] platform, but also show the same algorithm generalizing to a different embodiment on a Franka Emika Panda manipulator.
A. Robot Simulations
We simulate Crazyflie rigid-body dynamics in MuJoCo MJX [27], using a cascaded body-rate PID controller, first-order motor dynamics, and rotor-dependent aerodynamic drag
Algorithm 1 STL-SVPG
Require: STL formula , initial particles of policy weights , rollouts per particle, horizon , iterations , initial condition randomization , step size , temperature , kernel
1: for do
2: for do
▷ In parallel
3: Collect rollouts under and
4: Differentiate smooth trajectory robustness through the simulator and store action gradient with transitions:
5: Calculate policy action Jacobians:
6: Accumulate over randomized transition minibatches to get the local policy gradients:
7: end for
8: Sample shared kernel observations
9: Compute kernel with shared observation action similarities
10: Compute Stein direction
11: Simultaneously update for all
12: end for
13: return policy population; select a policy on separate validation cases
used in [31]. Actions in the simulation are normalized collective thrust and body rate commands expected at 100 Hz while control and physics run at 500 Hz.
The Panda environment uses the seven-joint model for forward kinematics and bounded joint velocity control provided by MuJoCo. Joint positions are integrated at 5 ms and an action is held for five steps, giving a 25 ms control interval.
B. Tasks
We use named predicates to keep the specifications compact: denotes occupancy of region X, and collects the embodiment's safety constraints. Times are in seconds relative to the enclosing operator; all windows are restricted to the episode, and an unsubscripted ranges over its remaining duration. The episode length of each scenario is chosen such that there is enough time to complete the task. The tasks are illustrated in Fig. 2.
(a) Crazyflie · Unlock

Start · 0.00 s

Enter A · 2.97 s

Unlock Q · 3.57 s

Cross Q · 5.54 s

Return home · 8.97 s
(b) Crazyflie · Random Cue

Cue A · 0.00 s

Wait outside · 2.00 s

Response opens · 3.00 s

Enter A · 4.06 s

Dwell complete · 4.56 s
(c) Crazyflie · Ping-Pong

Incoming ball · 0.00 s

Intercept · 0.38 s

Strike · 0.76 s

Return flight · 1.15 s

Target reached · 1.55 s
(d) Crazyflie · Pillar Pull

Start · 0.00 s

First engagement · 7.70 s

First pillar removed · 7.94 s

Two pillars removed · 8.84 s

Stable finish · 9.99 s
(e) Panda · Random Cue

Cue A · 0.00 s

Wait outside · 2.00 s

Response opens · 3.00 s

Enter A · 3.80 s

Dwell complete · 4.30 s
(f) Panda · Ping-Pong

Incoming ball · 0.00 s

Intercept · 0.39 s

Strike · 0.79 s

Return flight · 1.02 s

Target reached · 1.27 s
Fig. 2. Example of successful STL-SVPG rollout in all tasks. In Unlock and both Random Cue tasks, the policy learned stable control that satisfies the timing and order requirements. In Crazyflie and Panda Ping-pong, it learned the ball return strikes reliably. And finally in Pillar Pull, it learned to bump two pillars without disturbing the balance of the plate and the block, without specifying which two pillars to be removed.
a) Unlock: The Crazyflie must stay in A for 0.6 s to unlock, enter Q within 2 s of unlocking, then return home H within 10 s. Q is forbidden before activation:
Here, safety requires staying within world bounds. The 2 s entry deadline starts at the end of the dwell.
b) Random Cue: A random cue visible for 1 s selects A or B. The robot must first avoid the selected region, then stay inside it for 0.5 s by the 5 s deadline. Let denote the episode's cue chose X:
Safety denotes world bounds for the drone, and workspace, joint-limit, and keepout constraints for the arm.
c) Ping-pong: The robot redirects an incoming ball into a target volume. Let , , , and denote valid incoming contact, sufficient outgoing velocity, ball target occupancy, and ball-in-play conditions. Crazyflie requires a strike and subsequent target entry within 6 s:
(12)
Here is one evaluation step, enforcing post-contact events; safety is drone world bounds. The Panda Ping-pong benchmark scores target entry alone:
(13) d) Pillar Pull: Inspired by the game Jenga, this task requires the drone to remove any two of five supporting pillars within 10 s while preserving the plate and block:
The predicates encode drone world bounds, plate height and tilt, block stability and placement, and individual pillar removal. The conjunction inside requires both pillars to be out simultaneously. This is the hardest task out of all since it does not specify which two pillars to be removed, and can be any combination of 2 out of 5.
e) Branching: The Crazyflie may follow A→C or B→D, reaching the first region by 2 s and its corresponding goal within another 3 s:
Each route avoids the alternative first region throughout the episode. Safety uses world bounds. The disjunction tests population diversity across valid routes.
C. Evaluation Protocol
We measure performance by complete task success: a rollout succeeds when the full task specification has positive exact robustness. For each main benchmark, we evaluate the policies from six independent training seeds on a shared set of 1,000 held-out initial conditions. We report the mean success rate and sample standard deviation across training seeds. Policy evaluation uses deterministic actions, while TD-MPC2 uses its evaluation-mode planner. The Branching study additionally evaluates the policy population to measure coverage of alternative successful routes.
D. Baselines
We compare STL-SVPG with three reinforcement learning methods: proximal policy optimization (PPO) [32]; soft actor-critic (SAC) [33]; and TD-MPC2 [34], which learns a dynamics model and uses model-predictive control. In a similar style to prior work on reward engineering [2], we generate task-specific dense rewards for these baselines with an iterative process leveraging Codex. The resulting dense rewards combine progress shaping, completion bonuses, and control and safety penalties. STL-SVPG instead derives its training objective from the task specification alone. PPO and SAC use interaction budgets matched to the full STL-SVPG population in terms of simulation steps. TD-MPC2 instead matches the training time on GPU and has to use less simulation steps due to the large model it learns with planning in the loop.
VII. RESULTS
We aim to answer the following questions:
-
Can STL-SVPG learn policies for tasks with extremely sparse success signals?
-
What does direct STL robustness optimization contribute compared to a dense reward?
-
How much does maintaining a policy population contribute?
-
Does STL-SVPG learn multi-modal solutions to the task?
-
Does a policy learned in simulation transfer to real robots?
A. Learning With Sparse Success Signals
STL-SVPG delivers the highest mean task success on five of six benchmarks across two robot embodiments, the crazyflie drone (CF) and the Panda arm (Table I). The two only tasks where baselines achieve comparable performance are the Panda and CF Random Cue. Since they mainly consist of reaching a single goal in time, it is easy to design dense rewards for them. However, for the remaining tasks, where success requires longer time scales and/or interacting with the world with contact, our approach largely outperforms the baselines. On Unlock, it achieves success where PPO and SAC achieve zero and TD-MPC2 reaches . On CF Ping-Pong, it is the only method with non-zero success rate. In CF Pillar Pull, it is the only method to achieve a success rate greater than , while PPO and SAC completely fail, and TD-MPC2 has very rare success, and not on all seeds. Finally, it achieves over five times SAC's success on Panda Ping-Pong versus , while PPO completely failed and TD-MPC2 again only had rare successes. Overall, these results demonstrate that our approach is capable of training policies despite extremely sparse success signals.
B. Benefits of Direct STL Optimization
We run ablation on the optimization objective using the same SVPG procedure, but switch the gradient used for policy gradient with either automatically differentiated dense rewards, or via finite difference. Direct STL optimization strengthens learning beyond dense reward shaping (Table II). The STL objective nearly doubles Unlock success, from to , and enables Crazyflie Ping-Pong completion where dense return achieves zero. It also improves Random Cue from to . The dense finite difference baseline reaches at most . The consistent gains across tasks show that changing the optimizer alone is insufficient for tasks with sparse success signals. Instead, direct optimization of the trajectory-level STL specification, our core design choice, is essential to align the learning objective with the ordered events and downstream outcomes required for task completion.
TABLE II OBJECTIVE COMPARISON AND BLACK-BOX DENSE BASELINE USING TASK SUCCESS RATES (%, MEAN ± SAMPLE STANDARD DEVIATION OVER SIX TRAINING SEEDS). EVALUATION USES 1000 HELD-OUT EPISODES PER POLICY PER SEED.
| Task | STL-SVPG | Dense diff. | Dense FD |
|---|---|---|---|
| CF Unlock | |||
| CF Random Cue | |||
| CF Ping-Pong |
TABLE I OVERALL BASELINE COMPARISON USING TASK SUCCESS RATES (%, MEAN ± SAMPLE STANDARD DEVIATION OVER SIX TRAINING SEEDS). EVALUATION USES 1000 HELD-OUT EPISODES PER POLICY PER SEED.
| Task | STL-SVPG P64 | PPO | SAC | TD-MPC2 |
|---|---|---|---|---|
| CF Unlock | 87.67 ± 20.23 | 0.00 ± 0.00 | 0.00 ± 0.00 | 0.02 ± 0.04 |
| CF Random Cue | 71.93 ± 2.95 | 13.98 ± 4.18 | 19.53 ± 9.72 | 74.33 ± 17.14 |
| CF Ping-Pong | 11.30 ± 4.36 | 0.00 ± 0.00 | 0.00 ± 0.00 | 0.00 ± 0.00 |
| CF Pillar Pull | 5.35 ± 4.09 | 0.00 ± 0.00 | 0.00 ± 0.00 | 0.78 ± 1.56 |
| Panda Random Cue | 99.98 ± 0.04 | 83.33 ± 40.82 | 25.00 ± 41.83 | 96.72 ± 2.98 |
| Panda Ping-Pong | 35.78 ± 12.99 | 0.00 ± 0.00 | 6.70 ± 9.23 | 0.32 ± 0.38 |
C. Benefits of Population-Based Learning
In this ablation, we experiment using only a single particle in the training instead of 64. This is essentially a comparison to directly using gradient descent on the STL gradients. Maintaining a policy population substantially expands STL-SVPG's learning capability (Table III). Increasing from one to 64 particles raises mean success on every benchmark, taking Unlock from zero to and Panda Ping-Pong from to . Crazyflie Ping-Pong success increases nearly threefold, while Panda Random Cue reaches near-perfect completion. These results establish the practical value of population-based search: the full method discovers successful behaviors on tasks where the single-policy variant fails and improves performance across both embodiments.
TABLE III POPULATION ABLATION WITH THE SAME PER-PARTICLE ROLLOUT AND ITERATION SCHEDULE USING TASK SUCCESS RATES (%, MEAN ± SAMPLE STANDARD DEVIATION OVER SIX TRAINING SEEDS). EVALUATION USES 1000 HELD-OUT EPISODES PER POLICY PER SEED.
| Task | STL-SVPG P64 | STL-SVPG P1 |
|---|---|---|
| CF Unlock | 87.67 ± 20.23 | 0.00 ± 0.00 |
| CF Random Cue | 71.93 ± 2.95 | 68.63 ± 9.79 |
| CF Ping-Pong | 11.30 ± 4.36 | 4.03 ± 5.00 |
| CF Pillar Pull | 5.35 ± 4.09 | 0.00 ± 0.00 |
| Panda Random Cue | 99.98 ± 0.04 | 93.22 ± 9.58 |
| Panda Ping-Pong | 35.78 ± 12.99 | 7.78 ± 10.46 |
D. Diverse Successful Policy Populations
We use the Branching task specifically to visualize whether our proposed algorithm learns multiple solutions to the task. STL-SVPG learns a diverse population of successful solutions, retaining both Branching routes in every one of six runs. When evaluated on 128 held-out initial conditions, the mean success rate of the final chosen policy is . When inspecting the behavior of all policies in the population (Figure 3), we see an average split of 34 A–C and 30 B–D policies out of 64 particles. Thus, high task success coexists with distinct, consistently executed strategies.
E. Sim-to-Real Transfer on Crazyflie
We test Crazyflie Random Cue and Ping-pong on real hardware. Since Ping-pong requires physical contact with the ball, we attach a 3D printed cage around the brushless version of the Crazyflie. We train new deployment policies using new scene and drone cage geometries and brushless motor dynamics. For Ping-pong, We also change task success to only

Fig. 3. Top-down view of all 64 policies on one reset from a Branching training instance: 30 A–C successes, 29 B–D successes, and five failures.
when the ball enters the target through the top face to simulate a box. These changes significantly decreased simulated success rate in Ping-pong due to more unpredictable contact physics and stricter success requirement. We use a launcher to throw the ball, and track its trajectory with a Realsense depth camera.
STL-SVPG's learned behavior carries over to physical Crazyflie execution. The simulation-trained Random Cue policy completes 37 of 60 hardware episodes successfully at a success rate of . Figure 4 shows the trajectory executed by the cue-conditioned temporal task on the real robot. Furthermore, the simulation trained policy transfer to contact in real world. We run the policy for 60 real world episodes. Compared to contact rate, valid strike rate, and success rate in simulation, we achieve the contact rate, valid strike rate, and on the
— Cue visible (0–1 s) — No entry (1–3 s) — Entry allowed (3–5 s) — In target (3-5s)
Task space

Fig. 4. Real world policy rollout trajectory of Crazyflie Random Cue from two starting positions. Gray, red, blue, and green portions of the trajectory denotes different phases of the task.
real platform. 2 of the real world episodes ends up sending the ball into the target, but in one of those episodes the drone did not recover and crashed after contact. An example successful real world rollout is shown in Figure 1.
VIII. LIMITATIONS AND CONCLUSION
STL specifications offer more than a monitor of whether a robot succeeds: their quantitative structure can guide policy learning toward complete task execution even in unsuccessful trials. Our results suggest that combining this feedback with population-based policy optimization is a promising direction for tasks where improving local progress does not necessarily improve overall success. Nevertheless, this approach depends on informative quantitative specifications and sufficiently accurate differentiable dynamics. Hardware results also reveal a gap between transferring component behaviors and completing the full task: Random Cue achieves temporal-task success, whereas Ping-pong transfers contact and occasional valid strikes but not complete target delivery. Closing this gap will require better treatment of contact-model uncertainty, better domain randomization, and more reliable credit assignment across successive task events during training. These challenges motivate future work in STL-guided policy-learning algorithms that retain performance under real-world uncertainty.
ACKNOWLEDGMENT
OpenAI Codex was used for improving clarity on non-technical sections of the manuscript and assist in implementing experimental code and plotting. All technical content, experimental design, results, and conclusions were developed, verified, and carefully vetted by the authors.
REFERENCES
[1] A. Y. Ng, D. Harada, and S. J. Russell, “Policy Invariance Under Reward Transformations: Theory and Application to Reward Shaping,” in Proceedings of the Sixteenth International Conference on Machine Learning, ser. ICML '99. San Francisco, CA, USA: Morgan Kaufmann Publishers Inc., Jun. 1999, pp. 278–287.
[2] Y. J. Ma, W. Liang, G. Wang, D.-A. Huang, O. Bastani, D. Jayaraman, Y. Zhu, J. Fan, and A. Anandkumar, “Eureka: Human-Level Reward Design via Coding Large Language Models,” International Conference on Learning Representations, vol. 2024, pp. 26516–26560, May 2024.
[3] M. Janner, J. Fu, M. Zhang, and S. Levine, “When to Trust Your Model: Model-Based Policy Optimization,” in Advances in Neural Information Processing Systems, vol. 32. Curran Associates, Inc., 2019.
[4] O. Maler and D. Nickovic, “Monitoring Temporal Properties of Continuous Signals,” in Proceedings of FORMATS-FTRTFT, ser. LNCS, vol. 3253, 2004.
[5] A. Donzé and O. Maler, “Robust satisfaction of temporal logic over real-valued signals,” in International conference on formal modeling and analysis of timed systems. Springer, 2010.
[6] G. E. Fainekos and G. J. Pappas, “Robustness of temporal logic specifications for continuous-time signals,” Theoretical Computer Science, vol. 410, 2009.
[7] Y. V. Pant, H. Abbas, and R. Mangharam, “Smooth operator: Control using the smooth robustness of temporal logic,” in 2017 IEEE Conference on Control Technology and Applications (CCTA), 2017.
[8] K. Leung, N. Aréchiga, and M. Pavone, “Backpropagation through signal temporal logic specifications: Infusing logical structure into gradient-based methods,” The International Journal of Robotics Research, vol. 42, 2023.
[9] P. Kapoor, K. Mizuta, E. Kang, and K. Leung, “Stlcg++: A masking approach for differentiable signal temporal logic specification,” IEEE Robotics and Automation Letters, vol. 10, 2025.
[10] H. Zheng, Z. Zang, A. Amine, C. I. Vasile, and R. Mangharam, “STL-SVPIO: Signal Temporal Logic guided Stein Variational Path Integral Optimization,” Mar. 2026, arXiv:2603.13333 [cs.RO].
[11] V. Raman, A. Donzé, D. Sadigh, R. M. Murray, and S. A. Seshia, “Reactive synthesis from signal temporal logic specifications,” in Proceedings of the 18th International Conference on Hybrid Systems: Computation and Control, ser. HSCC '15. New York, NY, USA: Association for Computing Machinery, 2015.
[12] X. Li, C.-I. Vasile, and C. Belta, “Reinforcement learning with temporal logic rewards,” in 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Sep. 2017, pp. 3834–3839, iSSN: 2153-0866.
[13] Y. Meng and C. Fan, “Signal temporal logic neural predictive control,” IEEE Robotics and Automation Letters, vol. 8, 2023.
[14] Q. Liu and D. Wang, “Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithm,” in Advances in Neural Information Processing Systems, vol. 29. Curran Associates, Inc., 2016.
[15] Y. Liu, P. Ramachandran, Q. Liu, and J. Peng, “Stein variational policy gradient,” arXiv preprint arXiv:1704.02399, 2017.
[16] M. Andrychowicz, F. Wolski, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, O. Pieter Abbeel, and W. Zaremba, “Hindsight Experience Replay,” in Advances in Neural Information Processing Systems, vol. 30. Curran Associates, Inc., 2017.
[17] R. T. Icarte, T. Klassen, R. Valenzano, and S. McIlraith, “Using Reward Machines for High-Level Task Specification and Decomposition in Reinforcement Learning,” in Proceedings of the 35th International Conference on Machine Learning. PMLR, Jul. 2018, pp. 2107–2116.
[18] R. T. Icarte, T. Q. Klassen, R. Valenzano, and S. A. McIlraith, “Reward Machines: Exploiting Reward Function Structure in Reinforcement Learning,” Journal of Artificial Intelligence Research, vol. 73, pp. 173–208, Jan. 2022.
[19] A. Camacho, J. Varley, D. Jain, A. Iscen, and D. Kalashnikov, “Disentangled Planning and Control in Vision Based Robotics via Reward Machines,” Dec. 2020.
[20] P. Vaezipoor, A. C. Li, R. A. T. Icarte, and S. A. Mcilraith, “LTL2Action: Generalizing LTL Instructions for Multi-Task RL,” in Proceedings of the 38th International Conference on Machine Learning. PMLR, Jul. 2021, pp. 10497–10508.
[21] P. Varnai and D. V. Dimarogonas, “Prescribed Performance Control Guided Policy Improvement for Satisfying Signal Temporal Logic Tasks,” in 2019 American Control Conference (ACC), Jul. 2019, pp. 286–291, iSSN: 2378-5861.
[22] P. V. Dimos and D. V. Dimarogonas, “A Learning Framework for Versatile STL Controller Synthesis,” in 2019 IEEE 58th Conference on Decision and Control (CDC), Dec. 2019, pp. 4596–4600, iSSN: 2576-2370.
[23] N. Saxena, S. Gorantla, and P. Jagtap, “Funnel-Based Reward Shaping for Signal Temporal Logic Tasks in Reinforcement Learning,” IEEE Robotics and Automation Letters, vol. 9, no. 2, pp. 1373–1379, Feb. 2024.
[24] Y. Meng, F. Chen, and C. Fan, “TGPO: Temporal Grounded Policy Optimization for Signal Temporal Logic Tasks,” Oct. 2025.
[25] B. D. Ziebart, J. A. Bagnell, A. K. Dey et al., “Maximum entropy inverse reinforcement learning.” 2008.
[26] B. Lei, K. Daniilidis, and A. Loquercio, “Reinforcement learning for flow-matching policies with density transport,” arXiv preprint arXiv:2606.08602, 2026.
[27] E. Todorov, T. Erez, and Y. Tassa, “Mujoco: A physics engine for model-based control,” in 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE, 2012, pp. 5026–5033.
[28] J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, Y. Katariya, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, and Q. Zhang, “JAX: composable transformations of Python+NumPy programs,” 2018.
[29] J. Peters and S. Schaal, “Reinforcement learning of motor skills with policy gradients,” Neural networks, vol. 21, no. 4, pp. 682–697, 2008.
[30] “Crazyflie 2.1+ | Bitcraze.”
[31] V. Pasumarti, L. Bianchi, and A. Loquercio, “Agile Flight Emerges from Multi-Agent Competitive Racing,” Dec. 2025.
[32] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, “Proximal Policy Optimization Algorithms,” Aug. 2017, arXiv:1707.06347 [cs].
[33] T. Haarnoja, A. Zhou, K. Hartikainen, G. Tucker, S. Ha, J. Tan, V. Kumar, H. Zhu, A. Gupta, P. Abbeel, and S. Levine, “Soft Actor-Critic Algorithms and Applications,” Dec. 2018.
[34] N. Hansen, H. Su, and X. Wang, “TD-MPC2: Scalable, Robust World Models for Continuous Control,” International Conference on Learning Representations, vol. 2024, pp. 47 376–47 405, May 2024.