Improve model card: Update paper link, license, add library_name and sample usage
#2
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
---
|
| 2 |
-
license: other
|
| 3 |
-
license_name: qwen
|
| 4 |
-
license_link: LICENSE
|
| 5 |
-
datasets:
|
| 6 |
-
- julien31/soar_arc_train_5M
|
| 7 |
base_model:
|
| 8 |
- Qwen/Qwen2.5-72B-Instruct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
pipeline_tag: text-generation
|
|
|
|
| 10 |
tags:
|
| 11 |
- text-generation
|
| 12 |
- code-generation
|
|
@@ -16,15 +19,16 @@ tags:
|
|
| 16 |
- arc-agi
|
| 17 |
- soar
|
| 18 |
---
|
|
|
|
| 19 |
# SOAR-ARC Models: Self-Improving Language Models for Program Synthesis
|
| 20 |
|
| 21 |
<p align="center">
|
| 22 |
-
🤗 <a href="https://huggingface.co/collections/julien31/soar-arc-6856d27681fce01d9af4c4a3">Hugging Face (data and model)</a>   |    📑 <a href="https://
|
| 23 |
</p>
|
| 24 |
|
| 25 |
This repository contains one of the models fine-tuned using the **SOAR** (**S**elf-improving **O**perators for **A**utomated program **R**efinements) framework, as presented in the paper:
|
| 26 |
|
| 27 |
-
> [**Self-Improving Language Models for Evolutionary Program Synthesis: A Case Study on ARC-AGI**](https://
|
| 28 |
>
|
| 29 |
> Julien Pourcel, Cédric Colas, Pierre-Yves Oudeyer.
|
| 30 |
> *Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025.*
|
|
@@ -66,10 +70,61 @@ This process creates a powerful feedback loop: the fine-tuned model becomes bett
|
|
| 66 |
|
| 67 |
The primary use of this model is to generate a Python function that solves an ARC task. The input to the model should be a formatted prompt containing the training and test examples of the ARC task.
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
For a complete, end-to-end example of how to format the prompt, run inference, execute the generated code, and visualize the results, please refer to the official repository and notebook:
|
| 70 |
|
| 71 |
* **Official SOAR GitHub Repository**: [https://github.com/flowersteam/SOAR](https://github.com/flowersteam/SOAR)
|
| 72 |
* **Inference & Visualization Notebook**: [https://github.com/flowersteam/SOAR/blob/main/notebook/inference_visualisation.ipynb](https://github.com/flowersteam/SOAR/blob/main/notebook/inference_visualisation.ipynb)
|
| 73 |
|
| 74 |
-
<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/made
|
| 75 |
-
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- Qwen/Qwen2.5-72B-Instruct
|
| 4 |
+
datasets:
|
| 5 |
+
- julien31/soar_arc_train_5M
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
metrics:
|
| 10 |
+
- accuracy
|
| 11 |
pipeline_tag: text-generation
|
| 12 |
+
library_name: transformers
|
| 13 |
tags:
|
| 14 |
- text-generation
|
| 15 |
- code-generation
|
|
|
|
| 19 |
- arc-agi
|
| 20 |
- soar
|
| 21 |
---
|
| 22 |
+
|
| 23 |
# SOAR-ARC Models: Self-Improving Language Models for Program Synthesis
|
| 24 |
|
| 25 |
<p align="center">
|
| 26 |
+
🤗 <a href="https://huggingface.co/collections/julien31/soar-arc-6856d27681fce01d9af4c4a3">Hugging Face (data and model)</a>   |    📑 <a href="https://huggingface.co/papers/2507.14172">Paper</a>    |    📑 <a href="https://julienp.netlify.app/posts/soar/">Blog</a>
|
| 27 |
</p>
|
| 28 |
|
| 29 |
This repository contains one of the models fine-tuned using the **SOAR** (**S**elf-improving **O**perators for **A**utomated program **R**efinements) framework, as presented in the paper:
|
| 30 |
|
| 31 |
+
> [**Self-Improving Language Models for Evolutionary Program Synthesis: A Case Study on ARC-AGI**](https://huggingface.co/papers/2507.14172)
|
| 32 |
>
|
| 33 |
> Julien Pourcel, Cédric Colas, Pierre-Yves Oudeyer.
|
| 34 |
> *Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025.*
|
|
|
|
| 70 |
|
| 71 |
The primary use of this model is to generate a Python function that solves an ARC task. The input to the model should be a formatted prompt containing the training and test examples of the ARC task.
|
| 72 |
|
| 73 |
+
You can load the model using the `transformers` library:
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 77 |
+
import torch
|
| 78 |
+
|
| 79 |
+
model_id = "julien31/Soar-qwen-72b"
|
| 80 |
+
|
| 81 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 82 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 83 |
+
model_id,
|
| 84 |
+
torch_dtype=torch.bfloat16, # or torch.float16 if bfloat16 is not supported by your GPU
|
| 85 |
+
device_map="auto",
|
| 86 |
+
)
|
| 87 |
+
|
| 88 |
+
# Example prompt structure for an ARC task (simplified)
|
| 89 |
+
# For full ARC problem formatting and inference details,
|
| 90 |
+
# refer to the official SOAR repository and notebook.
|
| 91 |
+
prompt = """
|
| 92 |
+
Below are examples of input-output pairs for an ARC task:
|
| 93 |
+
|
| 94 |
+
Input: [[0,0,0,0,0],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,0,0,0]]
|
| 95 |
+
Output: [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]
|
| 96 |
+
|
| 97 |
+
Write a Python function `solve(input_grid)` that transforms the input grid based on the provided examples.
|
| 98 |
+
```python
|
| 99 |
+
def solve(input_grid):
|
| 100 |
+
# Your code here
|
| 101 |
+
```
|
| 102 |
+
"""
|
| 103 |
+
|
| 104 |
+
messages = [
|
| 105 |
+
{"role": "user", "content": prompt},
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
+
# Apply chat template (Qwen2.5 chat format)
|
| 109 |
+
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 110 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 111 |
+
|
| 112 |
+
# Generate code
|
| 113 |
+
generated_ids = model.generate(
|
| 114 |
+
model_inputs.input_ids,
|
| 115 |
+
max_new_tokens=512,
|
| 116 |
+
do_sample=True,
|
| 117 |
+
temperature=0.7,
|
| 118 |
+
top_p=0.8,
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
generated_text = tokenizer.batch_decode(generated_ids[:, model_inputs.input_ids.shape[1]:], skip_special_tokens=True)[0]
|
| 122 |
+
print(generated_text)
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
For a complete, end-to-end example of how to format the prompt, run inference, execute the generated code, and visualize the results, please refer to the official repository and notebook:
|
| 126 |
|
| 127 |
* **Official SOAR GitHub Repository**: [https://github.com/flowersteam/SOAR](https://github.com/flowersteam/SOAR)
|
| 128 |
* **Inference & Visualization Notebook**: [https://github.com/flowersteam/SOAR/blob/main/notebook/inference_visualisation.ipynb](https://github.com/flowersteam/SOAR/blob/main/notebook/inference_visualisation.ipynb)
|
| 129 |
|
| 130 |
+
<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/made%20with%20unsloth.png" width="20%" />
|
|
|