File size: 3,133 Bytes
693768c 8573843 bcb0b3e 0d40985 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 0d40985 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 bcb0b3e 8573843 | 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | ---
license: mit
configs:
- config_name: default
data_files:
- split: test
path: "dataset.parquet"
---
# WARP-benchmark
The benchmark to test logical reasoning and pattern generalisation in large language models through formal SMT constraints.
## Overview
We propose a benchmark designed to evaluate a language model's ability to generalise worst-case path constraints for all input sizes. Each example asks a model to generate a formal constraint for a specific target size after being shown examples of constraints for smaller input sizes.
## Github Repository
You can find the link here at: [WARP-benchmark](https://github.com/dannkoh/warp-benchmark)
## Dataset Statistics
### Basic Statistics
- **Total samples**: 671
- **Format**: Parquet file
- **Difficulty tiers**:
- Small: 333 samples (49.6%)
- Medium: 333 samples (49.6%)
- Large: 5 samples (0.7%)
### Token Statistics (using Qwen2.5-3B tokenizer)
| | Questions | Answers |
|----------------|-----------|---------|
| Minimum | 117 | 27 |
| Maximum | 4,086 | 14,476 |
| Mean | 1,684 | 994 |
| Median | 1,521 | 493 |
| Total tokens | 1,130,153 | 666,709 |
### Target N Distribution
- Range: 5 to 30
- Mean: 19.9
- Median: 20
- Unique values: 25 different values
### Examples Per Question
- Range: 3 to 18 examples
- Mean: 6.7
- Median: 6
- Most common: 3 examples (168 questions)
## Dataset Structure
Each example in the dataset follows this structure:
- **Question**: A prompt showing examples of constraints for smaller input sizes N, asking for constraints at target N
- **Answer**: The formal constraint for the target size
- **Constants**: Variable declarations for the target size
- **Tier**: Difficulty level ("small", "medium", or "large")
Example question format:
```
Given the following examples of constraints for increasing input sizes:
N=3: (assert (and (and ...)))
N=4: (assert (and (and ...)))
...
What is the constraint for N={target}?
```
## Dataset Creation
The dataset is generated from SMT2 files using the following process:
1. **Discovery**: Finds SMT2 files following the naming pattern `{prefix}.{problem}_{number}.smt2`
2. **Combination Generation**: For each problem and target N value, generates combinations of smaller N values to use as examples
3. **Prompt Construction**: Creates prompts with selected examples and targets, ensuring they fit within token limits
4. **Difficulty Assignment**: Assigns difficulty tiers based on the "jump" between example N and target N:
- Small: ≤ 5
- Medium: 6-15
- Large: > 15
5. **Balanced Sampling**: Uses reservoir sampling to balance the dataset across difficulty tiers
## Dataset Profiling
Use the included profiler to analyze the dataset:
```bash
python profiler.py dataset.parquet --visualize
```
This will generate comprehensive statistics and visualizations about token lengths, difficulty distribution, and other metrics.
## Dependencies
- pandas
- pyarrow
- transformers (Qwen2.5-3B tokenizer)
- tqdm
- matplotlib (for visualization)
- seaborn (for visualization)
|