neurallambda commited on
Commit
f2522dd
1 Parent(s): 1553fae

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +91 -34
README.md CHANGED
@@ -1,34 +1,91 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: input
5
- sequence: string
6
- - name: output
7
- dtype: string
8
- splits:
9
- - name: train_small
10
- num_bytes: 17574
11
- num_examples: 100
12
- - name: test_small
13
- num_bytes: 17799
14
- num_examples: 100
15
- - name: train_large
16
- num_bytes: 172002
17
- num_examples: 100
18
- - name: test_large
19
- num_bytes: 171585
20
- num_examples: 100
21
- download_size: 155156
22
- dataset_size: 378960
23
- configs:
24
- - config_name: default
25
- data_files:
26
- - split: train_small
27
- path: data/train_small-*
28
- - split: test_small
29
- path: data/test_small-*
30
- - split: train_large
31
- path: data/train_large-*
32
- - split: test_large
33
- path: data/test_large-*
34
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Arithmetic Puzzles Dataset
3
+
4
+ A collection of arithmetic puzzles with heavy use of variable assignment. Current LLMs struggle with variable indirection/multi-hop reasoning, this should be a tough test for them.
5
+
6
+ Inputs are a list of strings representing variable assignments (`c=a+b`), and the output is the integer answer.
7
+
8
+ Outputs are filtered to be between [-100, 100], and self-reference/looped dependencies are forbidden.
9
+
10
+ Splits include:
11
+
12
+ - `train_small/test_small` which includes 10k total examples of puzzles with up to 10 variables.
13
+ - `train_large/test_large` which includes 10k total examples of puzzles with up to 100 variables.
14
+
15
+ Conceptually the data looks like this:
16
+
17
+ ```python
18
+ Input:
19
+
20
+ a=1
21
+ b=2
22
+ c=a+b
23
+ solve(c)=
24
+
25
+ Output:
26
+ 3
27
+ ```
28
+
29
+ In actuality it looks like this:
30
+
31
+ ```python
32
+ {
33
+ "input": ['var_0=1', 'var_1=2', 'var_2=a+b', 'solve(var_2)='],
34
+ "output": 3
35
+ }
36
+ ```
37
+
38
+
39
+ ### Loading the Dataset
40
+
41
+ ```python
42
+ from datasets import load_dataset
43
+
44
+ # Load the entire dataset
45
+ dataset = load_dataset("neurallambda/arithmetic_puzzles")
46
+
47
+ # Load specific splits
48
+ train_small = load_dataset("neurallambda/arithmetic_puzzles", split="train_small")
49
+ test_small = load_dataset("neurallambda/arithmetic_puzzles", split="test_small")
50
+ train_large = load_dataset("neurallambda/arithmetic_puzzles", split="train_large")
51
+ test_large = load_dataset("neurallambda/arithmetic_puzzles", split="test_large")
52
+ ```
53
+
54
+ ### Preparing Inputs
55
+
56
+ To prepare the inputs as concatenated strings, you can do this:
57
+
58
+ ```python
59
+ def prepare_input(example):
60
+ return {
61
+ "input_text": "
62
+ ".join(example["input"]),
63
+ "output": example["output"]
64
+ }
65
+
66
+ # Apply the preparation to a specific split
67
+ train_small_prepared = train_small.map(prepare_input)
68
+
69
+ # Example of using the prepared dataset
70
+ for example in train_small_prepared.select(range(5)): # Show first 5 examples
71
+ print("Input:", example["input_text"])
72
+ print("Output:", example["output"])
73
+ print()
74
+ ```
75
+
76
+ This will produce output similar to:
77
+
78
+ ```
79
+ Input: var_0=5
80
+ var_1=2
81
+ var_2=-2 + -8
82
+ var_3=3
83
+ var_4=4
84
+ var_5=var_2
85
+ var_6=var_3 * 10
86
+ var_7=var_2 - var_0
87
+ var_8=var_1
88
+ var_9=-2 - 9
89
+ solve(var_3)=
90
+ Output: 3
91
+ ```