LLM4PH: Large Language Models as Topological Thinkers
This repository contains the benchmark code for our NeurIPS paper: "Large Language Models as Topological Thinkers: A Benchmark on Graph Persistent Homology".
Overview
LLM4PH is a comprehensive benchmark designed to evaluate the capabilities of Large Language Models (LLMs) in understanding and reasoning about topological concepts, specifically focusing on graph persistent homology.
Dataset
The benchmark consists of four difficulty levels of tasks:
Each level is designed to progressively challenge the model's understanding of topological concepts.
Code Structure
The codebase is organized as follows:
LLM4PH/
├── config.py # Configuration settings for tasks and models
├── main.py # Main entry point for running the benchmark
├── datasets/ # Dataset files for different difficulty levels
├── evaluate_code/ # Evaluation scripts and metrics
├── results/ # Directory for storing evaluation results
└── .env # Environment variables for API keys (create if needed)
Key components:
config.py: Configure task parameters and model settingsmain.py: Run the benchmark with specified configurationsevaluate_code/: Contains evaluation logic and scoring metricsdatasets/: Stores the benchmark datasetsresults/: Output directory for evaluation results
Installation
Install dependencies:
pip install -r requirements.txt
Configuration
The benchmark can be configured through config.py:
- Task configuration: Set difficulty levels and evaluation parameters
- Model configuration: Choose between local and API-based models
API Key Setup
For closed-source models, create a .env file in the root directory:
touch .env
Add your API keys to the .env file:
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here
Usage
- Configure your desired task and model in
config.py - Run the benchmark:
python main.py
Citation
If you use this benchmark in your research, please cite our paper:
