NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

RLingua: Improving Reinforcement Learning Sample Efficiency in Robotic Manipulations With Large Language Models

Liangliang Chen, Yutian Lei, Shiyu Jin, Ying Zhang, Liangjun Zhang · DOI

Abstract

Reinforcement learning (RL) has demonstrated its capability in solving various tasks but is notorious for its low sample efficiency. In this paper, we propose RLingua, a framework that can leverage the internal knowledge of large language models (LLMs) to reduce the sample complexity of RL in robotic manipulations. To this end, we first present a method for extracting the prior knowledge of LLMs by prompt engineering so that a preliminary rule-based robot controller for a specific task can be generated in a user-friendly manner. Despite being imperfect, the LLM-generated robot controller is utilized to produce action samples during rollouts with a decaying probability, thereby improving RL's sample efficiency. We employ TD3, the widely-used RL baseline method, and modify the actor loss to regularize the policy learning towards the LLM-generated controller. RLingua also provides a novel method of improving the imperfect LLM-generated robot controllers by RL. We demonstrate that RLingua can significantly reduce the sample complexity of TD3 in four robot tasks of panda_gym and achieve high success rates in 12 sampled sparsely rewarded robot tasks in RLBench, where the standard TD3 fails. Additionally, We validated RLingua's effectiveness in real-world robot experiments through Sim2Real, demonstrating that the learned policies are effectively transferable to real robot tasks.

Introduction

Reinforcement Learning (RL) is a powerful paradigm for robotic control, yet its practical application is often hindered by extreme sample inefficiency. Learning even basic manipulation tasks can require millions of environment interactions. This challenge is particularly acute in environments with sparse rewards, where a robot receives feedback only upon successful task completion. Without a dense reward signal, an agent may spend an impractical amount of time exploring the state space randomly before encountering a reward.

While Learning from Demonstrations (LfD) can mitigate this, it typically relies on expensive, human-collected data. RLingua addresses this by asking: can we utilize the "common sense" motion knowledge embedded in Large Language Models (LLMs) to guide the robot's exploration and learning?

The RLingua Framework

RLingua bridges the gap between the high-level reasoning of LLMs and the low-level control required for RL. The framework operates in two primary stages:

1. LLM Controller Generation

We use LLMs (specifically GPT-4) to generate Python-based, rule-based controllers. Unlike prior works that use LLMs as high-level planners for pre-defined primitives, RLingua generates low-level control logic (e.g., direct gripper displacements). We employ two prompting strategies: human feedback and structured code templates. These ensure that the LLM's output is executable and physically grounded, even if the initial logic is imperfect.

2. Guided Reinforcement Learning

The LLM-generated controller is used to jumpstart a Twin Delayed DDPG (TD3) agent through two mechanisms:

  • Guided Exploration: During initial training, the robot selects actions from the LLM controller with a probability $p^{LLM}$ that decays over time. This directs early exploration toward high-reward regions.
  • Regularized Learning: The RL agent's loss function is augmented with an imitation loss, encouraging the learned policy to stay close to the LLM's suggestions while optimizing for environmental rewards.
The RLingua framework (b) addresses the trade-off (a) between the ease of LLM communication and the performance of RL controllers.

Experimental Evaluation

We evaluated RLingua across three distinct settings: the panda_gym suite, 12 complex tasks from RLBench, and real-world Sim2Real transfer.

Key Results and Insights

  • Massive Speedup: In PandaReach, RLingua reached an 80% success rate using less than 25% of the environment steps required by standard TD3.
  • Solving the "Unsolvable": In RLBench, standard TD3 failed completely (0% success) on 10 out of 12 tasks. RLingua achieved >80% success on all 12 tasks.
  • The "Mediocre Expert" Advantage: An LLM does not need to be perfect. Even if a controller has a 0% success rate due to minor errors (e.g., obstacle collisions), its intent provides enough guidance for the RL agent to find rewards and subsequently learn to avoid those errors.
Success rate comparison between RLingua (TD3 with GPT-4 Guidance), standard TD3, and the standalone LLM controller across various Panda tasks.

Conclusion

RLingua demonstrates that LLMs can serve as effective "common sense" priors for reinforcement learning in robotics. By converting LLM knowledge into executable code and using it to guide exploration and regularize learning, we can drastically reduce sample complexity. Future work will explore the use of Multi-modal LLMs to automate state extraction from visual data, further reducing the human effort required for task specification.

Summary updated

BibTeX
@misc{chen2024rlingua,
  author = {Liangliang Chen and Yutian Lei and Shiyu Jin and Ying Zhang and Liangjun Zhang},
  title = {{RLingua: Improving Reinforcement Learning Sample Efficiency in Robotic Manipulations With Large Language Models}},
  year = {2024},
  eprint = {2403.06420},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.06420},
}
Figure