File size: 2,263 Bytes
9f50319
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 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:

![llm4ph](llm4ph.png)

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 settings
- `main.py`: Run the benchmark with specified configurations
- `evaluate_code/`: Contains evaluation logic and scoring metrics
- `datasets/`: Stores the benchmark datasets
- `results/`: Output directory for evaluation results

## Installation

Install dependencies:
```bash

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:

```bash

touch .env

```

Add your API keys to the `.env` file:
```

OPENAI_API_KEY=your_key_here

ANTHROPIC_API_KEY=your_key_here

```

## Usage

1. Configure your desired task and model in `config.py`
2. Run the benchmark:
```bash

python main.py

```

## Citation

If you use this benchmark in your research, please cite our paper:
```



```