[Paper Review] PyKEEN 1.0: A Python Library for Training and Evaluating Knowledge Graph Embeddings
PyKEEN 1.0 is a redesigned Python library that offers fully composable knowledge graph embedding models, automatic memory optimization, and extensive hyper-parameter optimization for training and evaluating KGEs.
Recently, knowledge graph embeddings (KGEs) received significant attention, and several software libraries have been developed for training and evaluating KGEs. While each of them addresses specific needs, we re-designed and re-implemented PyKEEN, one of the first KGE libraries, in a community effort. PyKEEN 1.0 enables users to compose knowledge graph embedding models (KGEMs) based on a wide range of interaction models, training approaches, loss functions, and permits the explicit modeling of inverse relations. Besides, an automatic memory optimization has been realized in order to exploit the provided hardware optimally, and through the integration of Optuna extensive hyper-parameter optimization (HPO) functionalities are provided.
Motivation & Objective
- Motivate the need for a highly configurable and reusable KG embedding toolkit that supports diverse model components.
- Provide a unified, composable architecture for interaction models, loss functions, training approaches, and inverse relations.
- Enable fair and reproducible evaluation with standardized metrics and extensible benchmarking datasets.
- Incorporate automated memory optimization and advanced HPO to improve scalability and robustness.
- Foster community-driven development and maintainability through open-source practices and tooling.
Proposed method
- Define KGEMs as compositions of four components: interaction model, loss function, training approach, and inverse relations handling.
- Provide 23 interaction models, seven loss functions, four regularizers, two training approaches, and 13 built-in datasets to enable flexible model construction.
- Enable explicit modeling of inverse relations for applicable interaction models.
- Uniform APIs (pykeen.model.Model, pykeen.loss.Loss, pykeen.training.TrainingLoop) to ensure full composability and replaceability of components.
- Integrate Optuna for hyper-parameter optimization with early stopping and an HPO workflow for robust validation, training, and testing.
- Implement automatic memory optimization to compute maximum feasible training/evaluation batch sizes given hardware, adapting sub-batches as needed.
Experimental results
Research questions
- RQ1How can KG embedding models be made fully composable to allow independent evaluation of components?
- RQ2What mechanisms are needed to optimize memory usage automatically during training and evaluation?
- RQ3How can hyper-parameter optimization be effectively integrated into KG embedding workflows?
- RQ4What evaluation capabilities (metrics, datasets, inverses) are necessary for robust, reproducible KGEM assessment?
- RQ5How can PyKEEN be extended and maintained as an open-source community project?
Key findings
- PyKEEN 1.0 supports 23 interaction models, seven loss functions, four regularizers, two training approaches, six evaluation metrics, and 13 built-in benchmarking datasets.
- The framework enables explicit modeling of inverse relations and full composability via unified APIs for models, losses, and training loops.
- An automatic memory optimization ensures memory-efficient training and evaluation by adjusting batch sizes to available hardware.
- Integrated Optuna-based hyper-parameter optimization with early stopping improves robustness across validation and test runs.
- The library emphasizes reproducibility and maintainability with automated testing, CI, and documentation, and is released under the MIT License.
- PyKEEN 1.0 is positioned as more composable and feature-rich than related KGEM libraries, with emphasis on extensibility and memory management.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.