Authors: Nabila P.R. Siregar, Phong Le, and Raquel G. Alhama
We present a computational framework to investigate whether artificial agents in a foraging environment develop a communication protocol with features of the honeybee waggle dance. Our game design is a form of referential game with two agents, a sender and a receiver, that are collaborating so the receiver can effectively identify the target landmark (food) from a set of landmarks in a graph-based environment. The sender’s objective is to communicate a message that helps the receiver to identify the target landmark. The sender has complete knowledge of the graph, including the positions of both the food and nest within the graph. However, the receiver is only aware of the location of the nest and must rely on messages from the sender, along with locally observed edge attributes (distance and direction) to make decisions.
This project is organized as follows:
-
graph/— Dataset generation & environment- Code for generating datasets and visualizing the environment/graph.
- CLI modules like
graph.datasetandgraph.draw.
-
archs/— Agents’ architecture & communication channel- Model definitions, architecture, and the communication channel between agents.
-
utils/— Utilities- Helper functions (e.g. collate function), model checkpointing/saving, results saving, and other common utilities.
-
game.py— Training script- Core training loop and game mechanics.
-
experiment.py— Experiment runner- Runs different experiment configurations built on top of
game.py.
- Runs different experiment configurations built on top of
-
analysis.ipynb— Analysis notebook- Code to reproduce the figures reported in the paper.
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
git clone git@github.com:facebookresearch/EGG.git
cd EGG
pip install -e .
cd ..
Important: the following manual edit to EGG/core/interaction.py is required: change line 209
aux_input[k] = _check_cat([x.aux_input[k] for x in interactions])
to
values = [x.aux_input[k] for x in interactions]
try:
aux_input[k] = _check_cat(values)
except Exception:
aux_input[k] = values
After making the changes, reinstall EGG to reflect the modifications:
cd EGG
pip install -e .
cd ..
To visualize the environment, run:
python -m graph.draw
The graph is represented as a Data object where x is a node feature matrix using one-hot encoding to indicate the type of each node (nest, food or distractor), edge_index is a 2-row tensor that defines the directed edges between nodes (which nodes are connected and in what direction), and edge_attr holds the distance and direction between connected nodes.
Example:
python -m graph.dataset --num_samples 30000 --num_landmarks 10 --seed 2025 --graph_type same-graph --train_output data/train_data.pt --test_output data/test_data.pt
Example:
python -m experiment --num_bins 36
