Skip to content

Commit 89c2009

Browse files
authored
Merge branch 'main' into martas/1434
2 parents 628086e + febb7c4 commit 89c2009

95 files changed

Lines changed: 5881 additions & 149 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/gh-stack/SKILL.md

Lines changed: 856 additions & 0 deletions
Large diffs are not rendered by default.

benchmarks/gdpval/config.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
# Comparison mode (pairwise ELO vs a reference model's deliverables):
1111
# ++gdpval_resources_server.resources_servers.gdpval.reward_mode=comparison \
1212
# ++gdpval_resources_server.resources_servers.gdpval.reference_deliverables_dir=/path/to/fork
13+
#
14+
# Multi-reference comparison mode (anchored Bradley-Terry MLE ELO over N
15+
# references — each reference is judged separately and the eval model's rating
16+
# is fit globally, with per-reference + total win stats reported):
17+
# ++gdpval_resources_server.resources_servers.gdpval.reward_mode=comparison \
18+
# ++gdpval_resources_server.resources_servers.gdpval.reference_models.kimi.deliverables_dir=/gdpval/refs/kimi \
19+
# ++gdpval_resources_server.resources_servers.gdpval.reference_models.kimi.elo=1290 \
20+
# ++gdpval_resources_server.resources_servers.gdpval.reference_models.gpt5.deliverables_dir=/gdpval/refs/gpt5 \
21+
# ++gdpval_resources_server.resources_servers.gdpval.reference_models.gpt5.elo=1320
1322

1423
# Judge model — proxy to NVIDIA inference API for Gemini 3.1 Pro.
1524
gdpval_judge_model:
@@ -28,9 +37,14 @@ gdpval_resources_server:
2837
domain: other
2938
verified: false
3039
reward_mode: rubric
40+
# Single-reference (legacy) comparison fields.
3141
reference_deliverables_dir: null
32-
num_comparison_trials: 4
3342
reference_elo: 1000.0
43+
# Multi-reference comparison: map of reference id -> {deliverables_dir, elo}.
44+
# When set, the eval model's ELO is fit via anchored Bradley-Terry MLE
45+
# across all references and per-reference win stats are reported.
46+
reference_models: {}
47+
num_comparison_trials: 4
3448
preconvert_office_to_pdf: true
3549
preconvert_max_concurrent: 1
3650
judge_model_server:

environments/arc_agi/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# ARC-AGI
2+
3+
Abstraction and Reasoning Corpus for Artificial General Intelligence ([ARC-AGI](https://github.com/fchollet/ARC-AGI/)) is a benchmark with training and evaluation data to test general reasoning. It consists of grid-based puzzles, providing a few input output pairs and the system must infer the underlying abstract transformation rule and apply it to a new input. "ARC can be seen as a general artificial intelligence benchmark, as a program synthesis benchmark, or as a psychometric intelligence test. It is targeted at both humans and artificially intelligent systems that aim at emulating a human-like form of general fluid intelligence."
4+
5+
### Launch local vllm server
6+
```bash
7+
pip install -U "vllm>=0.12.0"
8+
9+
wget https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16/resolve/main/nano_v3_reasoning_parser.py
10+
11+
vllm serve nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16 \
12+
--max-num-seqs 8 \
13+
--tensor-parallel-size 1 \
14+
--max-model-len 262144 \
15+
--port 10240 \
16+
--trust-remote-code \
17+
--tool-call-parser qwen3_coder \
18+
--reasoning-parser-plugin nano_v3_reasoning_parser.py \
19+
--reasoning-parser nano_v3
20+
```
21+
22+
### Set env.yaml in `Gym/`:
23+
```
24+
policy_base_url: http://localhost:10240/v1
25+
policy_api_key: EMPTY
26+
policy_model_name: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16
27+
```
28+
29+
### Create datasets:
30+
```
31+
cd Gym/
32+
33+
# ARC-AGI-1
34+
git clone https://github.com/fchollet/ARC-AGI
35+
cd environments/arc_agi
36+
python prepare.py
37+
38+
# ARC-AGI-2
39+
git clone https://github.com/arcprize/ARC-AGI-2
40+
cd environments/arc_agi
41+
python prepare.py --version 2
42+
```
43+
44+
### Install Gym:
45+
```
46+
cd Gym/
47+
uv venv
48+
source .venv/bin/activate
49+
uv sync
50+
```
51+
52+
### Start ARC-AGI environment (we can reuse the same one for ARC-AGI-1 and 2):
53+
```bash
54+
ng_run "+config_paths=[environments/arc_agi/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]"
55+
```
56+
57+
58+
### Collect rollouts:
59+
60+
ARC-AGI-1 example rollouts:
61+
```bash
62+
ng_collect_rollouts +agent_name=arc_agi_simple_agent +input_jsonl_fpath=environments/arc_agi/data/example_1.jsonl +output_jsonl_fpath=environments/arc_agi/data/example_1_rollouts.jsonl
63+
```
64+
65+
ARC-AGI-2 example rollouts:
66+
```bash
67+
ng_collect_rollouts +agent_name=arc_agi_simple_agent +input_jsonl_fpath=environments/arc_agi/data/example_2.jsonl +output_jsonl_fpath=environments/arc_agi/data/example_2_rollouts.jsonl
68+
```
69+
70+
For training, see the [docs](https://docs.nvidia.com/nemo/gym/latest/training-tutorials/nemo-rl-grpo/index.html).

environments/arc_agi/__init__.py

Whitespace-only changes.

environments/arc_agi/config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
arc_agi_resources_server:
2+
resources_servers:
3+
arc_agi:
4+
entrypoint: app.py
5+
domain: knowledge
6+
verified: false
7+
description: Abstract reasoning tasks from the ARC-AGI benchmark. See https://arcprize.org/arc-agi.
8+
value: Evaluate and improve abstract reasoning capabilities.
9+
arc_agi_simple_agent:
10+
responses_api_agents:
11+
simple_agent:
12+
entrypoint: app.py
13+
resources_server:
14+
type: resources_servers
15+
name: arc_agi_resources_server
16+
model_server:
17+
type: responses_api_models
18+
name: policy_model
19+
datasets:
20+
- name: example
21+
type: example
22+
jsonl_fpath: environments/arc_agi/data/example.jsonl
23+
- name: training_1
24+
type: validation
25+
jsonl_fpath: environments/arc_agi/data/arc_agi_1_training.jsonl
26+
gitlab_identifier:
27+
dataset_name: arc_agi
28+
version: 0.0.1
29+
artifact_fpath: arc_agi_1_training.jsonl
30+
license: Apache 2.0
31+
- name: evaluation_1
32+
type: validation
33+
jsonl_fpath: environments/arc_agi/data/arc_agi_1_evaluation.jsonl
34+
gitlab_identifier:
35+
dataset_name: arc_agi
36+
version: 0.0.1
37+
artifact_fpath: arc_agi_1_evaluation.jsonl
38+
license: Apache 2.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*train.jsonl
2+
*validation.jsonl
3+
*train_prepare.jsonl
4+
*validation_prepare.jsonl
5+
*example_prepare.jsonl
6+
arc_agi_*.jsonl

environments/arc_agi/data/example.jsonl

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "example",
3+
"type": "example",
4+
"jsonl_fpath": "resources_servers/arc_agi/data/example.jsonl",
5+
"num_repeats": 1,
6+
"gitlab_identifier": null,
7+
"license": null,
8+
"Number of examples": 5,
9+
"Number of tools": {
10+
"Total # non-null values": 0,
11+
"Average": 0.0,
12+
"Min": 0.0,
13+
"Max": 0.0,
14+
"Median": 0.0,
15+
"Standard deviation": 0.0
16+
},
17+
"Json-dumped number of words (proxy for token count)": {
18+
"Total # non-null values": 5,
19+
"Average": 2071.0,
20+
"Min": 110.0,
21+
"Max": 6135.0,
22+
"Median": 1386.0,
23+
"Standard deviation": 2386.43
24+
},
25+
"Number of turns": {
26+
"Total # non-null values": 5,
27+
"Average": 1.0,
28+
"Min": 1.0,
29+
"Max": 1.0,
30+
"Median": 1.0,
31+
"Standard deviation": 0.0
32+
},
33+
"Temperature": {
34+
"Total # non-null values": 0,
35+
"Average": 0.0,
36+
"Min": 0.0,
37+
"Max": 0.0,
38+
"Median": 0.0,
39+
"Standard deviation": 0.0
40+
},
41+
"task_id": {
42+
"unique_count": 5,
43+
"total_count": 5
44+
}
45+
}

environments/arc_agi/data/example_rollouts.jsonl

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.

environments/arc_agi/prepare.py

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import argparse
16+
import json
17+
from pathlib import Path
18+
19+
20+
def format_grid(grid):
21+
return "\n".join([" ".join(map(str, row)) for row in grid])
22+
23+
24+
def create_arc_prompt(task_data, task_id, version=1):
25+
prompt = f"You are solving ARC-AGI{'-' + str(version) if version != 1 else ''} task {task_id}.\n\n"
26+
prompt += "Here are the training examples that demonstrate the pattern:\n\n"
27+
28+
for i, example in enumerate(task_data["train"]):
29+
prompt += f"Example {i + 1}:\n"
30+
prompt += "Input:\n"
31+
prompt += format_grid(example["input"])
32+
prompt += "\n\nOutput:\n"
33+
prompt += format_grid(example["output"])
34+
prompt += "\n\n"
35+
36+
test_input = task_data["test"][0]["input"]
37+
prompt += "Now solve this test case following the same pattern:\n"
38+
prompt += "Test Input:\n"
39+
prompt += format_grid(test_input)
40+
prompt += (
41+
"\n\nProvide your solution as a 2D array inside \\boxed{} in this exact format: \\boxed{[[row1],[row2],...]}"
42+
)
43+
prompt += "\nFor example: \\boxed{[[1,2,3],[4,5,6],[7,8,9]]}"
44+
45+
return prompt
46+
47+
48+
def create_dataset(version=1):
49+
data_base = f"../../ARC-AGI{'-' + str(version) if version != 1 else ''}"
50+
training_dir = Path(f"{data_base}/data/training")
51+
evaluation_dir = Path(f"{data_base}/data/evaluation")
52+
53+
Path("data").mkdir(exist_ok=True)
54+
55+
training_dataset = []
56+
print(f"Processing {len(list(training_dir.glob('*.json')))} training tasks...") # 400 tasks
57+
58+
for task_file in sorted(training_dir.glob("*.json")):
59+
task_id = task_file.stem
60+
61+
with open(task_file) as f:
62+
task_data = json.load(f)
63+
64+
prompt = create_arc_prompt(task_data, task_id, version)
65+
expected_output = task_data["test"][0]["output"]
66+
test_input = task_data["test"][0]["input"]
67+
68+
entry = {
69+
"responses_create_params": {"input": [{"role": "user", "content": prompt}]},
70+
"train": task_data["train"],
71+
"test_input": test_input,
72+
"expected_output": expected_output,
73+
"task_id": task_id,
74+
}
75+
76+
training_dataset.append(entry)
77+
78+
training_output_file = Path(f"data/arc_agi_{version}_training.jsonl")
79+
with open(training_output_file, "w") as f:
80+
for entry in training_dataset:
81+
f.write(json.dumps(entry) + "\n")
82+
83+
print(f"Created training dataset with {len(training_dataset)} tasks at {training_output_file}")
84+
85+
evaluation_dataset = []
86+
print(f"Processing {len(list(evaluation_dir.glob('*.json')))} evaluation tasks...") # 400 tasks
87+
88+
for task_file in sorted(evaluation_dir.glob("*.json")):
89+
task_id = task_file.stem
90+
91+
with open(task_file) as f:
92+
task_data = json.load(f)
93+
94+
prompt = create_arc_prompt(task_data, task_id, version)
95+
expected_output = task_data["test"][0]["output"]
96+
test_input = task_data["test"][0]["input"]
97+
98+
entry = {
99+
"responses_create_params": {"input": [{"role": "user", "content": prompt}]},
100+
"train": task_data["train"],
101+
"test_input": test_input,
102+
"expected_output": expected_output,
103+
"task_id": task_id,
104+
}
105+
106+
evaluation_dataset.append(entry)
107+
108+
evaluation_output_file = Path(f"data/arc_agi_{version}_evaluation.jsonl")
109+
with open(evaluation_output_file, "w") as f:
110+
for entry in evaluation_dataset:
111+
f.write(json.dumps(entry) + "\n")
112+
113+
print(f"Created evaluation dataset with {len(evaluation_dataset)} tasks at {evaluation_output_file}")
114+
115+
example_output_file = Path(f"data/example_{version}.jsonl")
116+
with open(example_output_file, "w") as f:
117+
for entry in evaluation_dataset[:5]:
118+
f.write(json.dumps(entry) + "\n")
119+
120+
print(f"Created example dataset with 5 tasks at {example_output_file}")
121+
122+
123+
if __name__ == "__main__":
124+
parser = argparse.ArgumentParser(description="Create ARC-AGI dataset")
125+
parser.add_argument("--version", type=int, default=1, choices=[1, 2], help="ARC-AGI version (1 or 2)")
126+
args = parser.parse_args()
127+
128+
create_dataset(version=args.version)

0 commit comments

Comments
 (0)