Pruning Large Action Spaces with Semantic Priors

77 concepts54 papers1 proposal

In reinforcement learning (RL), an agent learns by trial and error. In simple environments with discrete, low-dimensional action spaces—like controlling an Atari joystick—the agent can afford to explore randomly. But when an agent confronts open-ended environments, text-based games, or complex strategy simulations, the action space undergoes a combinatorial explosion.

Consider a text adventure game. If an agent must generate a three-word command from a vocabulary of 1,000 words, it faces one billion possible actions at every single step. Random exploration ($\epsilon$-greedy) fails completely here; the probability of randomly typing a coherent, useful command like "open iron mailbox" is practically zero. The agent gets trapped in an endless loop of trying nonsensical actions like "eat rusty sword" or "go sky".

To solve this "needle in a haystack" problem, a powerful paradigm has emerged: semantic action filtering. By leveraging the common-sense world knowledge embedded in natural language text and pre-trained language models, agents can prune away irrational choices before they are ever evaluated, narrowing the search space to a tractable set of contextually plausible actions.


The Core Intuition: Decoupling Plausibility from Strategy

The fundamental reason semantic action filtering works is that it decouples the decision-making process into two distinct, specialized layers:

  1. The Semantic Filter (What makes sense to do?): A language prior evaluates the current state and filters out actions that are grammatically incorrect, physically impossible, or contextually absurd.
  2. The Strategic Policy (What is the best thing to do?): An RL policy or tree-search algorithm evaluates the remaining high-potential actions to optimize for the actual task goal.
[ Massive Raw Action Space ] (e.g., Billions of word combinations)
             │
             ▼
┌──────────────────────────┐
│     Semantic Filter      │ ◄── Powered by Language Models / Manuals
└──────────────────────────┘
             │
             ▼
[ Pruned Candidate Actions ] (e.g., 5-10 common-sense options)
             │
             ▼
┌──────────────────────────┐
│     Strategic Policy     │ ◄── Powered by RL / Value Estimation / MCTS
└──────────────────────────┘
             │
             ▼
      [ Final Action ]

By introducing the semantic filter, the RL agent no longer needs to waste millions of training steps learning basic world logic (such as the fact that keys unlock doors, or that you cannot pick up a house). Instead, it begins its exploration already possessing human-like common sense.


Sourcing the Prior: From Manuals to Pre-trained Models

The knowledge used to filter action spaces can come from explicit external text or implicit pre-trained representations.

Reading Instructional Text

Early foundations in this area focused on reading human-written text to extract strategic constraints. Regina Barzilay demonstrated that high-level natural language instructions can serve as a heuristic prior to narrow down expansive search spaces in sequential decision tasks. Extending this to complex strategy games, S. R. K. Branavan et al. incorporated strategic advice directly from official game manuals in Non-Linear Monte-Carlo Search in Civilization II. By automatically extracting text priors, their algorithm successfully pruned massive action spaces, focusing computational resources only on moves aligned with human advice.

Leveraging Pre-trained Common Sense

Modern architectures substitute explicit manuals with the implicit "world sense" of pre-trained language models. As surveyed by Philip Osborne and Heido Nõmm in A Survey of Text Games for Reinforcement Learning informed by Natural Language, relevance networks can score action strings based on semantic alignment rather than generating text word-by-word.

Ishika Singh et al. showed in Pre-trained Language Models as Prior Knowledge for Playing Text-based Games that leveraging the object affordance knowledge within pre-trained transformers allows agents to prioritize semantically plausible interactions. Similarly, Keerthiram Murugesan and Mattia Atzeni demonstrated in Text-based RL Agents with Commonsense Knowledge: New Challenges, Environments and Baselines that external common sense narrows the action space to human-like choices, drastically reducing sample complexity and avoiding exhaustive exploration of unproductive state-action pairs.


Implementation Mechanics: Token Truncation and Proposing Candidates

How is this filtering mathematically or architecturally enforced during training?

Dynamic Vocabulary Truncation

When generating language actions token-by-token, the action space is the entire vocabulary. Alice Martin et al. introduced TrufLL in Learning Natural Language Generation with Truncated Reinforcement Learning, which uses a task-agnostic language model to dynamically prune the vocabulary at each time step. By restricting the RL policy to a subset of syntactically and semantically plausible tokens, the agent can learn complex generation tasks from scratch without any supervised task-specific data.

The Propose-and-Evaluate Pipeline

In discrete but large action spaces, Large Language Models (LLMs) can act as a high-level candidate generator. Adish Singla et al. designed a hybrid system in Towards Generalizable Agents in Text-Based Educational Environments: A Study of Integrating RL with LLMs where an LLM suggests a subset of contextually sensible actions, which the RL agent then evaluates. This prunes contextually irrelevant options while maintaining goal-oriented logic.

[ Current State ] ──► [ LLM Filter ] ──► [ Top-K Plausible Actions ] ──► [ RL Policy / Value Function ] ──► [ Executed Action ]

This dual-stage approach is echoed across several domains:


Constraining Search and Tracking Affordances

Semantic filtering is equally effective when integrated directly into planning algorithms like Monte Carlo Tree Search (MCTS) or structured via environmental affordances.

In high-dimensional action spaces, standard MCTS suffers from severe combinatorial explosion. Ryan Shea and Zhou Yu 0005 demonstrated in A Fairness-Driven Method for Learning Human-Compatible Negotiation Strategies that constraining search algorithms with human-like move suggestions from an LLM significantly reduces computational complexity. This ensures that the tree search only explores trajectories that adhere to social norms and human expectations.

Tracking Affordances and Knowledge Graphs

Instead of querying an LLM at every step, agents can maintain an explicit representation of what actions are physically possible based on known objects. Prithviraj Ammanabrolu et al. developed KG-DQN in Playing Text-Adventure Games with Graph-Based Deep Reinforcement Learning, which builds a dynamic Knowledge Graph of the world. The agent filters out impossible commands by focusing exploration strictly on known objects and valid spatial paths.

Similarly, as highlighted by Timothy Atkinson et al. in The Text-Based Adventure AI Competition, agents can use word embeddings to pair nouns extracted from environment text with a pre-filtered set of functional verbs, calculating semantic similarity to identify valid environmental affordances.


Scaling to Hierarchical and Multi-Agent Systems

As tasks grow longer in horizon and involve multiple actors, semantic filtering scales by shifting from low-level action pruning to high-level skill and subgoal prioritization.

Hierarchical Skill Selection

In long-horizon tasks, choosing among low-level primitives is inefficient. Bharat Prakash et al. introduced LLMxHRL in Using LLMs for Augmenting Hierarchical Agents with Common Sense Priors, where an LLM outputs a probability distribution over a library of pre-trained skills. This biases the high-level policy toward semantically relevant actions and filters out causally irrelevant behaviors early in training.

A similar mechanism is utilized in the BOSS framework by Jesse Zhang et al. in Bootstrap Your Own Skills: Learning to Solve New Tasks with Large Language Model Guidance, where an LLM suggests semantically meaningful sequences of actions during robotic practice sessions, filtering out nonsensical or repetitive transitions.

Multi-Agent State Space Pruning

In multi-agent reinforcement learning (MARL), the joint action space grows exponentially with the number of agents. To bypass this complexity, language models can be used to decompose goals or identify critical subgoals:


Why It Works: A Summary of Benefits

By filtering action spaces semantically, agents achieve several distinct advantages over traditional, unfiltered reinforcement learning:

  • Sample Efficiency: Agents do not waste time executing random or chaotic actions. Leonard Adolphs demonstrated in LeDeepChef Deep Reinforcement Learning Agent for Families of Text-Based Games that providing standard RL models with pre-filtered, high-level action sets tripled the success rate of baseline models, proving that exploration—not optimization—is often the primary bottleneck.
  • Resistance to Environmental Noise: Traditional curiosity-driven exploration can easily be distracted by irrelevant environmental entropy or stochastic noise (the "noisy TV" problem). As shown by Nicolas Bougie and Narimasa Watanabe in Exploring Beyond Curiosity Rewards: Language-Driven Exploration in RL, semantic filters naturally discard trajectories that cannot be described as coherent, task-oriented behavior, keeping the agent focused on meaningful interactions.
  • Robust Grounding: By forcing an agent to operate within a language-constrained action space, the underlying models learn to ground abstract linguistic concepts into functional environmental policies, accelerating convergence and enhancing generalization across complex, open-ended tasks.

Key Foundational Work

Non-Linear Monte-Carlo Search in Civilization II (2011) — contributed 1 concept elements to this direction.
Learning to Behave by Reading (2012) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_semantic_action_filtering_c16f9f23,
  title = {semantic action filtering},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/semantic-action-filtering/rdr_c16f9f238d114c79a8c95071de31a436},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_semantic_action_filtering_c16f9f23_v1,
  title = {semantic action filtering},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/semantic-action-filtering/rdr_c16f9f238d114c79a8c95071de31a436/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake