|
1 | | -<div align= "center"> |
2 | | - <h1> <img src="./assets/logo.jpg" height=40 align="texttop"> GitAgent</h1> |
3 | | -</div> |
| 1 | +# Enhancing Large Language Model’s Capabilities in Open Domains via Autonomous Tool Integration from GitHub |
4 | 2 |
|
5 | | -Code coming soon |
| 3 | +Code for paper "Enhancing Large Language Model’s Capabilities in Open Domains via Autonomous Tool Integration from GitHub", presented at Proceedings of ACL 2025. |
6 | 4 |
|
7 | | -[paper](https://arxiv.org/abs/2312.17294) |
| 5 | +## Abstract |
| 6 | + |
| 7 | +Large Language Models (LLMs) excel in traditional natural language processing tasks but struggle with problems that require complex domain-specific calculations or simulations. While equipping LLMs with external tools to build LLM-based agents can enhance their capabilities, existing approaches lack the flexibility to address diverse and ever-evolving user queries in open domains. Currently, there is also no existing dataset that evaluates LLMs on open-domain knowledge that requires tools to solve. Notably, the largest open-domain platform is GitHub. To this end, we introduce **OpenAct** based on human expert consult and repositories in GitHub. It comprises 339 questions spanning 7 diverse domains that need to be solved with domain-specific methods. In our experiments, even state-of-the-art LLMs and LLM-based agents demonstrate shallow success rates on OpenAct, underscoring the need for a novel approach. Based on the characteristics of this task, we present **OpenAgent**, a novel LLM-based Agent system that can tackle evolving queries in open domains through autonomously integrating specialized tools from GitHub. OpenAgent employs (1) a hierarchical framework where specialized agents handle specific tasks and can assign tasks to inferior agents, (2) a bi-level experience learning mechanism to learn from both humans' and its own experiences to tackle tool flaws. Experiments demonstrate OpenAgent's superior effectiveness and efficiency that significantly outperforms current methods. |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +To set up the environment, you'll need Python, Docker, a GitHub Token and the required dependencies. You can create the environment and install the required packages using the following commands: |
| 12 | + |
| 13 | +```bash |
| 14 | +conda create -n openact python=3.9.19 |
| 15 | +conda activate openact |
| 16 | +pip install -r requirements.txt |
| 17 | +docker build -t condaimage . |
| 18 | +export GITHUB_TOKEN="<YOUR TOKEN HERE>" |
| 19 | +``` |
| 20 | + |
| 21 | +## Run |
| 22 | + |
| 23 | +You can refer to the following bash script for a test under the `src/scripts` folder. |
| 24 | + |
| 25 | +```bash |
| 26 | +#!/bin/bash |
| 27 | + |
| 28 | +# Define a list of queries |
| 29 | +queries=( "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market to train an LightGBM model, with the goal of forecasting market conditions for 2018 to 2019, and get its backtest result. You should give me the back test result.", |
| 30 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market (csi500) to train a LightGBM model. You should give me the back test result.", |
| 31 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market (csi300) to train a LightGBM model. You should give me the back test result.", |
| 32 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market (csi500) spanning from 2008 to 2018 to train an LightGBM model, with the goal of forecasting market conditions for 2018 to 2019, and get its backtest result. You should not only give me the back test result, but also the transaction details in csv format of how to get such result.", |
| 33 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market spanning from 2008 to 2018 to train a model, with the goal of forecasting market conditions for 2018 to 2019, and get its backtest result. You should not only give me the back test result, but also the transaction details of how to get such result.", |
| 34 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to train an LightGBM model, with the goal of forecasting market conditions for 2018 to 2019, and get its backtest result. You should give me the back test result.", |
| 35 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market spanning from 2008 to 2018 to train an LightGBM model, with the goal of forecasting market conditions for 2018 to 2019, and get its backtest result. You should give me the back test result.", |
| 36 | + "Please use qlib(https://github.com/microsoft/qlib) to fulfill this task: I am a fintech researcher aiming to utilize data from the A market to train an LightGBM model and get its backtest result. You should not only give me the back test result, but also the transaction details of how to get such result." |
| 37 | + ) |
| 38 | +gpt_version="""gpt-4-0125-preview""" |
| 39 | + |
| 40 | +# Loop through each query and run the Python script |
| 41 | +for query in """${queries[@]}""" |
| 42 | +do |
| 43 | + echo """Processing: $query""" |
| 44 | + docker rmi $(docker images -f "dangling=true" -q) |
| 45 | + docker rm $(docker ps -a -f "status=exited" -q) |
| 46 | + python main.py --query "$query" --gpt_version $gpt_version --name "qlib_cot" |
| 47 | +done |
| 48 | +``` |
| 49 | + |
| 50 | +## Citation |
| 51 | + |
| 52 | +If you think that this OpenAct/OpenAgent is helpful, please cite it with: |
| 53 | + |
| 54 | +``` |
| 55 | +@inproceedings{ |
| 56 | +anonymous2025enhancing, |
| 57 | +title={Enhancing Large Language Model{\textquoteright}s Capabilities in Open Domains via Autonomous Tool Integration from GitHub}, |
| 58 | +author={Anonymous}, |
| 59 | +booktitle={The 63rd Annual Meeting of the Association for Computational Linguistics}, |
| 60 | +year={2025}, |
| 61 | +url={https://openreview.net/forum?id=cDppq8dYFA} |
| 62 | +} |
| 63 | +``` |
0 commit comments