TL;DR
The TWOSOME framework aligns Large Language Models (LLMs) with specific embodied environments by using Reinforcement Learning (PPO) and parameter-efficient fine-tuning (LoRA). It allows LLMs to overcome "hallucinated" actions and environment-specific constraints, achieving superior sample efficiency and generalization compared to training from scratch or using prompt-tuning alone.
What Problem Does This Paper Address?
While LLMs possess vast "common sense" knowledge, they often stumble when placed in specific decision-making environments—a problem the authors call misalignment. This manifests in two ways:
- Invalid Actions: An LLM might suggest picking up a "cucumber" in a game where only tomatoes and onions exist.
- Constraint Ignorance: An LLM might try to place a second item on a cutting board, unaware that the environment's logic only allows one item at a time.
Conversely, traditional Reinforcement Learning (RL) agents are perfectly aligned with their environments because they learn from scratch, but they are notoriously sample-inefficient because they start with zero prior knowledge. This paper seeks to bridge the gap: giving RL the "brain" of an LLM while giving the LLM the "grounding" of RL.
Methods
The authors introduce TWOSOME (True knoWledge cOmeS frOM practicE), an online framework that treats an LLM as an embodied agent.
- Valid Policy Generation: Instead of letting the LLM generate free-form text (which leads to invalid actions), TWOSOME queries the LLM for the log-likelihood scores of a set of valid action strings provided by the environment.
- Action Prompt Normalization: LLMs naturally assign lower probabilities to longer strings. To fix this bias, the authors proposed Word Normalization, dividing the joint log-probability of an action by the number of words it contains. This prevents the model from unfairly favoring short, simple actions over more complex, correct ones.
- Parameter-Efficient Architecture: The system uses a frozen LLaMA-7B model. They add LoRA (Low-Rank Adaptation) layers to act as the "Actor" and a small MLP head to act as the "Critic."
- PPO Fine-tuning: The agent is trained using Proximal Policy Optimization (PPO). Crucially, only the LoRA weights and the critic head are updated, making the process computationally feasible.
Datasets
The framework was evaluated in two distinct simulated environments:
- Overcooked: A grid-world environment requiring the agent to sequence tasks like fetching, chopping, and plating ingredients (Tomato and Lettuce salads).
- VirtualHome: A complex 3D household simulator where the agent performs multi-step tasks like "Food Preparation" (heating a pancake) and "Entertainment" (setting up to watch TV with snacks).
- NLP Benchmarks: To ensure the LLM didn't lose its general intelligence (catastrophic forgetting), the authors tested the fine-tuned models on ARC_C, HellaSwag, PIQA, and MMLU.
Key Insights and Ideas
- The "Word" is the Magic Unit: The authors found that normalizing by tokens was slightly excessive, while normalizing by words perfectly balanced the action distribution. This is because LLMs treat multi-token words as integrated symbols during training.
- Prompting Principles: The paper identifies four key design principles for embodied prompts, such as ensuring observation and action prompts are cohesive for concatenation and including "preferred" actions in the observation text to nudge the LLM's initial policy.
- Zero-Shot Generalization: Because the agent understands the semantics of the actions, a model trained to "heat a pancake" can generalize to "heat a pizza" almost instantly just by changing the text prompt. Traditional RL agents would require total retraining.
- No "Brain Drain": Fine-tuning the LLM for specific embodied tasks using LoRA did not degrade its performance on standard language understanding benchmarks. In some cases, it even slightly improved them.
Key Results
- Success Rate: TWOSOME achieved a 100% success rate across all tasks in Overcooked and VirtualHome, significantly outperforming SayCan (a popular prompt-tuning baseline) and vanilla PPO.
- Sample Efficiency: In the "Tomato-Lettuce Salad" task, TWOSOME converged much faster than PPO from scratch, leveraging its linguistic prior knowledge to skip the "random flailing" phase of early RL.
- Generalization: When tested on eight unseen tasks (e.g., making a hamburger instead of a pancake), TWOSOME maintained high performance (e.g., a 97% success rate in crossover tests), whereas non-finetuned LLMs struggled to complete the tasks.
Limitations and Future Work
The authors acknowledge a major hurdle: computational cost. Training a PPO agent with an LLM in the loop is significantly slower and more expensive than training a small, dedicated RL network. Every action sampling requires feeding all valid actions through the LLM, which limits batch sizes and increases wall-clock time.
Future work may involve scaling this to multi-agent environments or real-world robotics where the "open-vocabulary" nature of LLMs could allow for more natural human-robot interaction.
Summary updated