TL;DR
As sequential decision-making agents tackle longer planning horizons, learning becomes exponentially harder due to the challenge of credit assignment. This paper introduces ACTIONPIECE, a method that borrows tokenization techniques from NLP (like Byte Pair Encoding) to dynamically "chunk" frequently used action sequences into high-level macro-actions during training. This approach significantly accelerates exploration and mode discovery, particularly when paired with diversity-seeking algorithms like Generative Flow Networks (GFlowNets).
What Problem Does This Paper Address?
In reinforcement learning (RL) and generative flow networks (GFlowNets), agents learn to construct objects or sequences by taking a series of discrete actions. However, as the target trajectories grow longer, two major issues arise:
- Credit Assignment: It becomes incredibly difficult for the agent to understand which specific action in a sequence of hundreds led to a final reward.
- Exploration Blind Spots: In vast search spaces, agents can easily get stuck in local optima or fail to discover diverse high-reward states (modes).
While humans naturally overcome this by "chunking" small actions into high-level habits or concepts (e.g., driving a car involves a macro-action of "turning left" rather than thinking about individual muscle movements), standard AI agents still plan at the level of atomic actions. Previous attempts to introduce macro-actions often required offline datasets or rigid heuristics, which frequently hindered rather than helped performance.
Methods
The authors propose ACTIONPIECE, an online action abstraction mechanism that dynamically expands an agent's action space during training.
The training operates in a dual-loop fashion:
- Inner Loop (Sampler Training): The agent interacts with the environment using its current action space to generate trajectories.
- Outer Loop (Abstraction): High-reward trajectories are collected into an action corpus. An NLP tokenization algorithm—specifically Byte Pair Encoding (BPE) or WordPiece—identifies frequently occurring subsequences of actions and merges them into a single macro-action (a "chunk").
The authors introduce two variants for updating the action space:
- ACTIONPIECE-INCREMENT: Gradually adds the single most frequent chunk to the action space.
- ACTIONPIECE-REPLACE: Periodically replaces the entire macro-action space with the top $M$ most frequent chunks, reducing redundancy.
To handle a dynamically changing action space, the policy network uses an LSTM action encoder to map action sequences to continuous embeddings, rather than relying on a fixed-size final linear layer. Additionally, they introduce ShortParse, a novel backward policy for GFlowNets that explicitly encourages the model to prefer shorter, more compressed trajectories.
Datasets
The method was evaluated across four distinct compositional environments:
- FractalGrid: A 2D grid world with a highly complex, fractal-like reward landscape designed to trap local exploration.
- RNA Binding ($L14\_RNA1$): A practical task involving the generation of RNA sequences (lengths 14 and 50) where rewards mimic biological binding affinity.
- Bit Sequence: Generating long bit strings (lengths 64 and 128) optimized to contain specific target "words."
- Graph Generation: Constructing graphs to maximize the number of cycles, utilizing relative edge-addition actions to ensure structural patterns could be tokenized.
Key Insights and Ideas
- The GFlowNet Synergy: A standout finding is that action chunking works exceptionally well with diversity-seeking algorithms like GFlowNets, but can actually harm standard RL algorithms like SAC or A2C. Because standard RL is greedy, it quickly over-samples a single discovered mode, chunks it, and creates a negative feedback loop that destroys sample diversity. GFlowNets, which explicitly sample proportionally to rewards, avoid this trap.
- Emergent Latent Structure: The discovered chunks are highly interpretable. For example, in the RNA task, the algorithm naturally rediscovered three-nucleotide sequences reminiscent of biological codons. In FractalGrid, it learned complex "zigzag" macro-actions required to navigate the landscape efficiently.
- Chunk Transferability: Macro-actions learned on one task (e.g., $L14\_RNA1$) successfully generalized to accelerate learning on entirely new target distributions ($L14\_RNA2$ and $L14\_RNA3$), proving that the abstractions capture fundamental environmental properties rather than just memorizing solutions.
Key Results
- Accelerated Mode Discovery: In the difficult FractalGrid environment, baseline atomic samplers completely stalled after finding the first few modes. ACTIONPIECE successfully unlocked the exploration required to find far-away modes.
- Better Density Estimation: For GFlowNets, incorporating ACTIONPIECE-INCREMENT significantly improved density estimation, leading to lower Jensen-Shannon Divergence (JSD) and smaller ELBO gaps compared to baseline atomic models.
Limitations and Future Work
While powerful, ACTIONPIECE currently relies on standard text tokenizers (like BPE) which process actions as rigid strings. This means it cannot easily capture permutation-invariant abstractions (e.g., adding edge A then edge B is structurally identical to adding edge B then edge A, but BPE treats them as distinct).
The authors suggest that future work should focus on learning task-conditioned abstraction libraries and exploring applications in automated code generation, where discovering the right hierarchical functions is key to solving complex tasks.
Summary updated