This repository refers to the work Grounding LTL Tasks in Sub-Symbolic RL Environments for Zero-Shot Generalization presented at the main track of Reinforcement Learning Conference (RLC) 2026.
In this work we address the problem of training a Reinforcement Learning agent to follow multiple temporally-extended instructions expressed in Linear Temporal Logic in sub-symbolic environments. Previous multi-task work has mostly relied on knowledge of the mapping between raw observations and symbols appearing in the formulae. We drop this unrealistic assumption by jointly training a multi-task policy and a symbol grounder with the same experience. The symbol grounder is trained only from raw observations and sparse rewards via Neural Reward Machines in a semi-supervised fashion. Experiments on vision-based environments show that our method achieves performance comparable to using the true symbol grounding and significantly outperforms the only other previous method for multi-task learning that does not assume knowledge of the true symbol grounding.
This project extends the LTL2Action framework to train Reinforcement Learning (RL) agents that can follow multiple temporally extended tasks expressed in Linear Temporal Logic (LTL) without requiring access to the environment's labelling function. This is done through the usage of Neural Reward Machines, which enable to provide an indirect supervision signal to a grounder module neural network from the comparison between the ground-truth reward signals and the expected reward signals using the predicted symbols.
-
Clone the repository:
git clone https://github.com/KRLGroup/SymGroundMultiTask
-
Create a new conda environment with Python 3.7.16 and the dependencies specified in
environment.ymlandrequirements.txt:cd ./SymGroundMultiTask conda env create -f environment.yml conda activate symgroundmultitask -
(optional) Install MONA if you need to create new automata:
sudo apt install -y mona
-
(optional) Replace
LTLf2DFAwith its parallelizable version to create automata more efficently:pip uninstall ltlf2dfa git clone https://github.com/matteopannacci/multi-LTLf2DFA.git pip install ./multi-LTLf2DFA
-
(optional) Install Safety-Gym Environment (requires mujoco 2.1.0):
pip install -e envs/safety/safety-gym/
Create the datasets of formulas and automata needed for training the grounder:
python -m datasets.create_datasets --name <dataset> --workers <num_workers>-
(optional) Pretrain the GNN using the configuration in
ltl_bootcamp_config.py:python -m lab.run_ltl_bootcamp --device <device>
-
(optional) Pretrain the grounder using the configuration in
train_grounder_config.py:python -m lab.run_train_grounder --device <device>
-
Train the agent using the configuration in
train_agent_config.py:python -m lab.run_train_agent --device <device>
-
Evaluate the grounder:
python test_grounder.py --model_dir <model_name> --device <device>
-
Evaluate the agent:
python test_agent.py --model_dir <model_name> --device <device>
-
Visualize the agent playing in the environment:
python visualize_agent.py --model_dir <model_name> --device <device>
@article{pannacci2026grounding,
title={Grounding LTL Tasks in Sub-Symbolic RL Environments for Zero-Shot Generalization},
author={Matteo Pannacci and Andrea Fanti and Elena Umili and Roberto Capobianco},
journal={Reinforcement Learning Journal},
volume={7},
pages={},
year={2026}
}