Action abstractions for amortized sampling

Oussama Boussif, Léna Néhale Ezzine, Joseph D. Viviano, Michal Koziarski, Moksh Jain, Nikolay Malkin, Emmanuel Bengio, Rim Assouel, Yoshua Bengio

As reinforcement learning (RL) and Generative Flow Network (GFlowNet) agents tackle increasingly complex tasks, assigning credit to early actions over long trajectories becomes exponentially harder. To address this, researchers have introduced ACTIONPIECE, a method that borrows tokenization techniques from Natural Language Processing (NLP) to automatically discover and "chunk" frequent action sequences into new, high-level macro-actions during training. This dynamic action abstraction shortens trajectories, accelerating the discovery of diverse, high-reward solutions and improving the agent's ability to model target distributions.

The Credit Assignment Challenge

In sequential decision-making frameworks, agents build solutions—like a graph, a molecule, or a path—one atomic step at a time. As the desired objects get larger, the trajectories get longer. This introduces a severe credit assignment problem: it becomes incredibly difficult for the algorithm to figure out which specific actions early in a 100-step sequence actually led to the final reward.

Furthermore, exploring a vast state space one tiny step at a time is highly inefficient. Imagine trying to write a novel by sampling individual letters rather than whole words. The core question is: how can an agent automatically learn higher-level "macro-actions" (or chunks) on the fly to shorten trajectories, making exploration and learning significantly easier?

Methodology: ACTIONPIECE

To solve this, the authors propose ACTIONPIECE, a framework that dynamically augments the agent's action space during training. The core idea is inspired by cognitive psychology (chunking) and Large Language Models (tokenization).

The ACTIONPIECE framework showing the inner loop of sampler training and the outer loop of action abstraction.

The process works in a continuous loop:

  1. Generating an Action Corpus: The agent periodically gathers a set of high-reward action trajectories it has recently generated.
  2. Chunking via BPE: It applies Byte Pair Encoding (BPE)—the exact same algorithm used to tokenize text in LLMs—to this corpus to identify the most frequently co-occurring sequences of actions.
  3. Augmenting the Action Space: These frequent sequences are added to the agent's action space as single, executable "chunks." To handle this dynamically growing action space, the policy network uses an LSTM-based action encoder to generate embeddings for new chunks.

The paper tests two variants of this augmentation:

  • ACTIONPIECE-INCREMENT: Adds only the single most frequent chunk to the action space at a time, acting as a curriculum.
  • ACTIONPIECE-REPLACE: Replaces the entire learned action space with the top $M$ chunks all at once.

Additionally, for GFlowNets, the authors introduce ShortParse, a novel backward policy explicitly designed to favor the most compact backward trajectories (i.e., those using the fewest steps).

Experimental Setup

The authors evaluate their approach on a mix of synthetic and practical environments:

  • FractalGrid: A 2D grid navigation task with a fractal-like reward landscape (grid sizes up to 257x257).
  • Bit Sequence Generation: Generating bit strings (lengths 64 and 128) that contain specific 8-bit "words."
  • Graph Generation: Generating graphs where the reward is based on the number of cycles.
  • RNA Binding: A practical biological sequence design task aimed at generating RNA sequences that bind to specific targets.

Key Results and Insights

Applying BPE to action sequences proved to be a highly effective, unsupervised way to discover meaningful temporal abstractions.

Mode discovery across FractalGrid, RNA Binding, and Bit Sequence tasks. ACTIONPIECE-INCREMENT significantly accelerates the discovery of high-reward modes.
  • Accelerated Mode Discovery: Across all tasks, ACTIONPIECE (specifically the INCREMENT variant) allowed GFlowNets to discover high-reward modes much faster than the atomic baseline. In the massive FractalGrid, atomic samplers got stuck in local optima, while chunking unlocked the ability to fetch faraway modes.
  • Exploration is Crucial for Good Chunks: Standard RL algorithms (like SAC and A2C) actually struggle with chunking in some environments. Because they greedily exploit high-reward modes, they learn highly specific, non-reusable chunks that hurt diversity. GFlowNets, which are inherently diversity-seeking, learn highly reusable, structural chunks that map to the true latent structure of the environment.
  • Better Density Estimation and Compression: Chunking improved the agent's ability to model the target distribution. The learned libraries effectively compressed the description length of high-reward samples. GFlowNets achieved the shortest parse lengths, proving they learned the most efficient, generalizable vocabularies.
  • Increment > Replace: ACTIONPIECE-INCREMENT consistently outperformed ACTIONPIECE-REPLACE. Updating the action space too rapidly (REPLACE) destabilized the policy, whereas adding one chunk at a time allowed the agent to smoothly adapt.
  • Transferability: The learned macro-actions aren't just random shortcuts. In the RNA task, the chunks naturally align with biological building blocks. Furthermore, a library of chunks learned on one RNA binding target gave agents a massive head start when training on a different, structurally similar RNA target.

Limitations and Future Work

While highly effective, the REPLACE strategy proved too abrupt for stable learning. Furthermore, the negative feedback loop observed in standard RL methods—where greedy sampling leads to overly specific chunks, which further narrows exploration—remains a hurdle for applying this outside of entropy-seeking frameworks like GFlowNets.

Future work will explore task-conditioned libraries (where chunks are context-aware) and mathematically formulating the problem to jointly model the distribution of objects and the library of abstractions. The authors also highlight code generation as a highly promising future application, as finding the right abstractions naturally simplifies complex programming tasks.

Summary updated

BibTeX
@inproceedings{boussif2024action,
  author = {Oussama Boussif and Léna Néhale Ezzine and Joseph D. Viviano and Michal Koziarski and Moksh Jain and Nikolay Malkin and Emmanuel Bengio and Rim Assouel and Yoshua Bengio},
  title = {{Action abstractions for amortized sampling}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=TAO5kqivpj},
}
Figure