TL;DR
Fine-tuning Vision-Language Model (VLM) agents with online reinforcement learning (RL) typically suffers from an exponential explosion of the text exploration space. This paper introduces CoSo (Counterfactual Soft Reinforcement Learning), a method that uses counterfactual reasoning to identify and prioritize exploration on only the action-critical tokens. This targeted approach significantly improves sample efficiency and task success across mobile control, gaming, and embodied AI environments with minimal computational overhead.
What Problem Does This Paper Address?
Vision-Language Models (VLMs) are increasingly deployed as autonomous agents to interact with digital and physical environments—such as navigating smartphone user interfaces or controlling robotic arms. To adapt these agents to dynamic environments, researchers use online Reinforcement Learning (RL).
However, standard RL exploration methods (like uniform entropy regularization) break down when applied to VLMs. VLMs operate in an open-ended textual action space, generating long sequences of thoughts, planning, and actions. Crucially, this process is non-end-to-end: the generated text must be passed through a deterministic parsing function ($f_{parse}$) to extract an executable environment command. Because most tokens (such as formatting tags or redundant words) do not alter the final parsed action, treating all tokens as equally important causes the exploration space to explode exponentially ($|V|^n$). Naive RL agents waste immense training time exploring semantically meaningless text variations or generating invalid formats.
Methods
The authors propose Counterfactual Soft Reinforcement Learning (CoSo) to align token-level text exploration with action-level environmental impact.
The framework introduces three core components:
- Token-to-Action Causality: CoSo explicitly models the text-to-action generation pipeline as a structured causal process, evaluating how individual tokens causally influence the final parsed action.
- Counterfactual Reasoning: To calculate token importance, CoSo performs a "what-if" analysis. It systematically replaces a target token with a null value ($y_{null}$) and measures the shift in the output probability distribution of the parsed action. This is handled efficiently by a lightweight Structural Causal Model (SCM)—a 0.01B parameter BERT network trained via cross-entropy alongside the VLM.
- Causal-Weighted Entropy Regularization: Instead of applying uniform entropy regularization across the entire vocabulary space, CoSo scales the entropy term by each token's counterfactual causal weight. Tokens that decisively shape the action receive high exploration priority, while low-impact tokens are suppressed.
CoSo is highly flexible and plugs directly into existing online RL fine-tuning objectives, such as Advantage-Weighted Regression (AWR) or Proximal Policy Optimization (PPO).
Datasets
The authors evaluated CoSo across a diverse set of multi-step agent benchmarks:
- Android-in-the-Wild (AitW): Real-world mobile control tasks divided into General (e.g., app navigation, information search) and WebShopping (e.g., product searching and purchasing) on Android emulators.
- Gym Cards: Virtual card-based reasoning environments (NumberLine, EZPoints, Points24, and Blackjack) requiring numerical understanding and arithmetic operations under uncertainty.
- ALFWorld: An embodied AI suite combining visual and textual reasoning for multi-step household tasks (e.g., Pick&Place, Clean&Place).
- AlfredTWEnv: A purely text-based version of ALFWorld used to verify CoSo's extensibility to text-only Large Language Model (LLM) agents.
Key Insights and Ideas
- The 80/20 Rule of VLM Tokens: Empirical counterfactual analysis revealed that less than 10% of generated tokens are action-critical. Conversely, over 80% of tokens have a causal weight below 0.2, indicating they have virtually no impact on the final environment action.
- Bridging the Non-End-to-End Gap: Traditional soft RL assumes a direct, vectorized mapping to actions. CoSo bridges the non-end-to-end gap introduced by text parsers, ensuring that text-space exploration directly mirrors meaningful action-space exploration.
- Targeted Error Recovery: When an agent makes a mistake, naive entropy exploration often causes it to output invalid formats or repeat the same error. By focusing uncertainty exclusively on action-critical tokens, CoSo allows the agent to efficiently sample valid alternative recovery actions (like pressing "Home" or "Back").
Key Results
CoSo consistently outperformed state-of-the-art online RL fine-tuning baselines (DigiRL and RL4VLM):
- Android-in-the-Wild (AitW): Achieved a 72.9% average success rate, yielding a 12.3% relative improvement over DigiRL.
- Gym Cards: Boosted average success to 49.3% (a 9.3% gain over RL4VLM), achieving a perfect 100% success rate on the NumberLine task.
- ALFWorld: Reached a 26.5% success rate, outperforming RL4VLM by 16.7%.
- Negligible Computational Overhead: Despite the counterfactual calculations, the lightweight 0.01B parameter SCM adds minimal cost: less than 0.2% extra parameters, less than 2% additional GPU memory (0.7 GB), and less than 4% extra training time (0.5 H100 GPU hours).
Limitations and Future Work
- Utterance Length Constraints: The longest text sequences evaluated in this paper contained fewer than 300 tokens. The effectiveness of CoSo on ultra-long Chain-of-Thought (CoT) reasoning paths remains unexplored.
- Hierarchical Scaling: For ultra-long sequences, tracking token-to-action causality directly might become difficult. The authors suggest that integrating hierarchical reasoning strategies to manage long-term token dependencies is a promising future direction.
Summary updated