This repository contains the data and scripts for the paper: A Compositional Model of Semantic Fluency.
Authors: Surabhi S Nath, Alireza Modirshanechi, Peter Dayan
The ability to recall semantically connected concepts---be it animals, summer fruits, or cities in Italy---is a remarkable capacity of the human mind. Such semantic fluency is thought to rely on traversing a mental space in which concepts are represented in terms of their meanings. However, the structure, properties, and navigability of this representational space remain enigmatic and highly debated. Existing approaches rely either on complex, uninterpretable distributional word-embeddings or on rigid, hand-crafted category norms. Here, we exploit the strengths of both, introducing Conceptome: a version of a compositional, interpretable, feature-based representation of semantic concepts, constructed by leveraging large language models. We use Conceptome to develop Conceptome-search, an auto-regressive model of how humans explore semantic spaces. We validate Conceptome and Conceptome-search using an animal fluency task, showing that they outperform state-of-the-art models in predicting human choices and capture key behavioral patterns such as interference. Our work, hence, offers new insights into the mechanisms underlying semantic fluency and memory retrieval. More broadly, our approach provides a general framework for constructing high-quality representations, with potential applications across cognition, including exploration, navigation, and creative thinking.
csvscontain the csv data filesfigurescontain the final figures used in the paperfilescontain all config and auxillary files used in the codefitscontain the fit pickle filesmodelscontain the model classes scripts and the main runner scriptplotscontain all plots for each figure, which were used to make the figuresscriptscontain analysis scriptssimulationscontain the simulation pickle files
We recommend setting up a python virtual environment and installing all the requirements. Please follow these steps:
git clone https://github.com/surabhisnath/Compositional_Fluency.git
cd Compositional_Fluency
python3 -m venv .env
# On macOS/Linux
source .env/bin/activate
# On Windows
.env\Scripts\activate
pip install -r requirements.txtmodels/runner.py is the main runner script for the following analyses. All settings can be set using arguments of runner.py.
Before you being, ensure all models you wish to run are set to 1 in files/modeltorun.json.
-
To replicate Figure 1C: run
cd scripts/Main; python make_TSNE.py. To plot the histogram of feature categories in Figure 1B: runcd scripts/main; python plot_feature_categories.py. All plots will be saved inplots/Figure1/ -
To analyse features and replicate Figure 2: run the notebook at
scripts/Main/Model-free_Analysis.ipynb. All plots will be saved inplots/Figure2/ -
To replicate Figure 3: run
cd scripts/Main; python model_NLLs.pyto plot Figure 3B, and runcd scripts/Main/; python model_BLEUs.pyto plot Figure 3C.model_nlls.pngandmodel_bleus.pngwill be saved inplots/Figure3/To re-run model fitting and simulation: run
cd models; python runner.py --fit --simulate(run overnight) -
To replicate Figure 4: First perform feature ablation by running:
cd models; python runner.py --ablation. Ablations saved asfits/ablations/ablations_Activity.pkandfits/ablations/ablations_HS.pkThen plot the figure:cd models; python runner.py --visweights. Plot saved asplots/Figure4/visweights.png -
To replicate RT modelling in Figure 5 and Figure 6: Run:
cd models; python runner.py --RT_analysis. -
To replicate Figure 6 plots: Run:
cd models; python runner.py --ARS. Plots saved asplots/Figure6/meanlogRT_transitions.pngandplots/Figure6/meanprob_transitions.png
If you found this work useful, please consider citing us:
@article{nathcompositional,
title={A Compositional Model of Semantic Fluency},
author={Nath, Surabhi S and Modirshanechi, Alireza and Dayan, Peter},
year={2026},
publisher={OSF},
url={https://osf.io/preprints/psyarxiv/adwzp_v1},
}