CFG (context free grammar), which is explained in the book, is used here together with LLMs: https://tree-diffusion.github.io
joblib.Memory provides caching functions and works by explicitly saving the inputs and outputs to files. It is designed to work with non-hashable and potentially large input and output data types such as numpy arrays.
"""
From https://pypi.org/project/diskcache/