nielsr's picture
nielsr HF Staff
Improve model card with metadata, abstract, and sample usage
f71df3b verified
|
raw
history blame
4.22 kB
metadata
base_model:
  - meta-llama/Llama-3.1-8B-Instruct
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
tags:
  - reasoning
  - agent
  - program
  - code

CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis

This model was presented in the paper CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis.

Abstract

Inductive program synthesis, or programming by example, requires synthesizing functions from input-output examples that generalize to unseen inputs. While large language model agents have shown promise in programming tasks guided by natural language, their ability to perform inductive program synthesis is underexplored. Existing evaluation protocols rely on static sets of examples and held-out tests, offering no feedback when synthesized functions are incorrect and failing to reflect real-world scenarios such as reverse engineering. We propose CodeARC, the Code Abstraction and Reasoning Challenge, a new evaluation framework where agents interact with a hidden target function by querying it with new inputs, synthesizing candidate functions, and iteratively refining their solutions using a differential testing oracle. This interactive setting encourages agents to perform function calls and self-correction based on feedback. We construct the first large-scale benchmark for general-purpose inductive program synthesis, featuring 1114 functions. Among 18 models evaluated, o3-mini performs best with a success rate of 52.7%, highlighting the difficulty of this task. Fine-tuning LLaMA-3.1-8B-Instruct on curated synthesis traces yields up to a 31% relative performance gain. CodeARC provides a more realistic and challenging testbed for evaluating LLM-based program synthesis and inductive reasoning. Our code, data, and models are publicly available at this https URL

Project Links

Sample Usage

To get started with the model and run evaluation:

  1. Setting Up the Environment: Create and activate a Conda environment and install dependencies:

    conda create -y -n CodeARC python=3.10.12
    conda activate CodeARC
    pip install -r requirements.txt
    
  2. Set API keys: Ensure you have valid API keys for the required services:

    export OPENAI_API_KEY=<your_openai_api_key>
    export ANTHROPIC_API_KEY=<your_anthropic_api_key>
    export TOGETHER_API_KEY=<your_together_api_key>
    
  3. Running Main Evaluation: You can run an evaluation with a supported model. For testing purposes, you can limit the evaluation to fewer problems using --total_idx.

    python3 run.py --model_name openai/gpt-4o-mini --total_idx 20
    

    (Supported models include OpenAI models (e.g., openai/gpt-4o), Anthropic models (e.g., anthropic/claude-3-7-sonnet-20250219), and models served by Together AI (e.g., meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo).)

    To summarize results:

    python3 src/compute_metrics.py
    

Citation

If you use this model or repository in your research, please cite the corresponding paper:

@article{wei2025codearc,
  title={CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis},
  author={Wei, Anjiang and Suresh, Tarun and Cao, Jiannan and Kannan, Naveen and Wu, Yuheng and Yan, Kai and Teixeira, Thiago SFX and Wang, Ke and Aiken, Alex},
  journal={arXiv preprint arXiv:2503.23145},
  year={2025}
}

License

This project is licensed under the Apache 2.0 License.