arXiv:2609.07111cs.ROSep 2026

Manuscript Offprint

arXiv:2609.07111

From LLM-Generated Specifications to Learned Quadruped Locomotion

Merve Atasever, Keyan Azbijari, Cagan Bakirci, Alfredo Reina Corona, Tolga Izdas, Richard Yang, Erdem Biyik, Jyotirmoy V. Deshmukh

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Merve Atasever*, Keyan Azbijari*, Cagan Bakirci*, Alfredo Reina Corona*, Tolga Izdas*, Richard Yang†, Erdem Biyik*, Jyotirmoy V. Deshmukh*

*Department of Computer Science University of Southern California Los Angeles, CA, USA

{atasever, azbijari, cbakirci, reinacor, izdas, biyik, jdeshmuk}@usc.edu

†University of Florida Gainesville, FL, USA yangrichard@ufl.edu

Abstract—Quadruped robot locomotion policies are often trained using reinforcement learning, which in turn relies heavily on hand-crafted reward functions. Designing reward functions requires substantial manual engineering, and it is often unclear which local rewards will induce the desired global behavior. Shaped rewards from formal specifications in languages like Signal Temporal Logic (STL) can make rewards more interpretable, but writing STL specifications itself still requires domain expertise. We study whether large language models (LLMs) can fill this gap by generating Parametric Signal Temporal Logic (PSTL) specifications that are subsequently used for policy learning. Given a natural language locomotion objective and a constrained specification grammar, GPT-5.5 and Qwen 3.6 independently propose STL templates for command tracking, safety, and gait structure. We instantiate the parameters of the generated PSTL templates using expert trajectories and retain only specifications that are consistent with demonstrated expert behavior. The resulting specifications are then transformed into smooth, finite-history reward functions and used to train a quadruped locomotion policy with Proximal Policy Optimization (PPO) in MuJoCo XLA (MJX). We evaluate both gait-aware and gait-agnostic settings. The former specifies walking-trot, trot, and bound regimes, while the latter allows contact patterns to emerge from the task objective. We compare against hand-engineered rewards, Text2Reward-style LLM-generated reward code, and an expert-switching oracle. Gait-aware Qwen 3.6 specifications achieved 100% survival and command success across all tested speeds (0.3–2.1 m/s) and matched the target gait at high speeds, whereas Text2Reward achieved 0% for both metrics at ≥ 1.9 m/s. Videos: https://stl-locomotion.github.io/

Index Terms—quadrupedal locomotion, reinforcement learning, signal temporal logic, large language models, reward design

I. INTRODUCTION

Deep RL has enabled quadruped robots to learn agile locomotion from simulations and expert demonstrations, but performance still depends strongly on reward engineering [1]–[7]. A typical locomotion reward is a weighted sum of instantaneous tracking, posture, smoothness, contact, and energy terms. Although such rewards can produce performant policies, selecting various reward components and coefficients requires substantial domain knowledge and empirical tuning, with design choices often justified through ablations rather

than first principles [4], [8], [9]. Moreover, the resulting numerical, local rewards do not explicitly describe the global temporal behavior it is intended to induce. This is especially problematic for multi-gait locomotion: walking, trotting, and bounding differ not only in speed, but also in contact timing and support patterns. Alternatives such as inverse RL and preference-based RL reduce reliance on manually specified rewards by inferring objectives from demonstrations or human feedback, but introduce an additional reward-learning or optimization stage [10]–[15]. Our approach also uses expert trajectories, but only to calibrate and validate an explicit set of symbolic, global specifications whose structure is proposed by an LLM.

Another approach is to describe desired behavior explicitly using formal logic and convert specification-satisfaction into a learning signal. Prior work on logic-guided RL has leveraged Linear Temporal Logic (LTL) and Signal Temporal Logic (STL) for reward shaping and policy learning, while also exploring the inference of temporal-logic specifications from demonstrations, particularly in navigation and manipulation tasks. [16]–[21]. Formal specifications have similarly been incorporated into planning and control for legged robots, including locomotion over cluttered terrain, stability constraints, and STL-informed control for bipedal walking and push recovery [22]–[26]. For quadrupeds, however, comparable continuous temporal-logic formulations remain limited. Existing logic-driven gait-learning approaches largely employ discrete logical rules or reward machines defined over foot-contact propositions and operating primarily on contact-level logic and stepwise signals [27], [28].

Signal Temporal Logic or STL [29] is well suited to this problem because it expresses bounded time-horizon properties directly over real-valued trajectories and associates each specification with a quantitative robustness value measuring its margin of satisfaction or violation [30], [31]. These quantitative semantics makes it possible to use STL not merely as a post hoc verifier, but as a dense reward signal for RL [17], [19], [32], [33]. Unlike conventional rewards, an STL specification can explicitly encode temporal relationships such as how long a condition should persist, how events should be ordered, or how contact patterns should evolve over a finite horizon.

In our previous work, we manually defined parametric STL templates for quadruped safety, command tracking, and gait behavior and calibrated their numerical thresholds from expert rollouts [34]. While this formulation improves interpretability and gait control relative to heuristic rewards, it leaves the burden of manual specification design unresolved.

Recent LLM-based reward-design methods address a closely related problem by generating executable dense reward functions directly from natural-language task descriptions [35], [36]. In parallel, language models have increasingly been used to translate natural language requirements into temporal logic representations [37]. We combine these ideas differently. Instead of asking an LLM to produce the numerical reward itself, we ask it to propose a symbolic temporal specification. Expert trajectories are then used to fit the specification parameters and reject candidates that disagree with demonstrated behavior. The retained specifications are subsequently converted into dense learning signals through STL robustness.

We investigate this design using Google's Barkour quadruped. GPT-5.5 and Qwen 3.6 are prompted with the same locomotion objective and STL grammar, but are not provided numerical thresholds [38], [39]. Each model proposes Parametric STL (PSTL) specifications. We fit the values of these parameters from expert trajectories and retain only specifications that are consistent with those trajectories. During policy learning, we compute smooth trailing-window STL robustness online and use it as a PPO reward [40], [41]. We evaluate the approach in both gait-aware (multi-gait) locomotion, where speed regimes activate gait-specific specifications, and gait-agnostic locomotion, where no gait is prescribed and the robot is free to discover its own contact pattern.

References (46)