Spaces:
Running
Running
File size: 5,382 Bytes
c2ba4d5 77811e3 c2ba4d5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# Varco Arena
๋ฐ๋ฅด์ฝ ์๋ ๋๋ ํ
์คํธ์
๋ช
๋ น์ด๋ณ๋ก ๋น๊ตํ ๋ชจ๋ธ๋ค์ ํ ๋๋จผํธ๋ฅผ ์ํํ์ฌ ์ ํํ๊ฒ ๋ชจ๋ธ๋ค์ ์์๋ฅผ ๋งค๊น๋๋ค. ์ด๊ฒ์ reference ์์ํ๊ณผ ๋น๊ตํ์ฌ ์น๋ฅ ์ ๋งค๊ธฐ๋ ๋ฐฉ๋ฒ๋ณด๋ค ์ ํํ๋ฉฐ ์กฐ๊ธ ๋ ์ ๋ ดํฉ๋๋ค.
๋ ์์ธํ ๋ด์ฉ์ ๋ํด์๋ ์๋์ ๋งํฌ๋ฅผ ์ฐธ์กฐํ์๋ฉด ๋ฉ๋๋ค.
* [๋
ผ๋ฌธ](https://huggingface.co/papers/2411.01281)
* [์์จ์ํํธ ํ
ํฌ๋ธ๋ก๊ทธ (KR)](https://ncsoft.github.io/ncresearch/12cc62c1ea0d981971a8923401e8fe6a0f18563d)
## Quickstart
### ๋ก์ปฌ์์ ์คํธ๋ฆผ๋ฆฟ ์ฑ์ผ๋ก ์์ํ๊ธฐ (์ถ์ฒ!)
```bash
git clone [THIS_REPO]
# install requirements below. we recommend miniforge to manage environment
cd streamlit_app_local
bash run.sh
```
๋ ์์ธํ ๋ด์ฉ์ `[THIS_REPO]/streamlit_app_local/README.md` ์ ์ฐธ์กฐํ์ธ์!
### CLI ์ฌ์ฉ
* cli์ ์น ์ฑ์ ์๋ก ๊ฐ์ ์ฝ๋๋ฅผ ํ์ฉํ๋ฉฐ, ์๋์ ๋๋ ํ ๋ฆฌ์ ์์ต๋๋ค.
* `varco_arena/`
* vscode ์์์ ๋๋ฒ๊น
์ ์ํ ํ๋ฆฌ์
ํ๋กฌํํธ๋ณ ํ
์คํธ ๋ช
๋ น์ด๋ ๋ค์ ํ์ผ์ ์ ํ์์ต๋๋ค.
* `varco_arena/.vscode/launch.json`
```bash
## gpt-4o-mini as a judge
python main.py -i "./some/dirpath/to/jsonl/files" -o SOME_REL_PATH_TO_CREATE -m tournament -e "gpt-4o-mini"
## vllm-openai served LLM as a judge
python main.py -i "./some/dirpath/to/jsonl/files" -o SOME_REL_PATH_TO_CREATE -e SOME_MODEL_NAME_SERVED -m tournament -u "http://url_to/your/vllm_openai_server:someport"
# dbg lines
## openai api judge dbg
python main.py -i "rsc/inputs_for_dbg/dbg_400_error_inputs/" -o SOME_WANTED_TARGET_DIR -e gpt-4o-mini
## other testing lines
python main.py -i "rsc/inputs_for_dbg/[SOME_DIRECTORY]/" -o SOME_WANTED_TARGET_DIR -e gpt-4o-mini
## dummy judge dbg (checking errors without api requests)
python main.py -i "rsc/inputs_for_dbg/dbg_400_error_inputs/" -o SOME_WANTED_TARGET_DIR -e debug
```
## Requirements
`python = 3.11.9` ์์์ ํ
์คํธ ํจ. `requirements.txt`
```
openai>=1.17.0
munch
pandas
numpy
tqdm>=4.48.0
plotly
scikit-learn
kaleido
tiktoken>=0.7.0
pyyaml
transformers
streamlit>=1.40.2
openpyxl
fire==0.6.0
git+https://github.com/shobrook/openlimit.git#egg=openlimit # do not install this by pypi
# Linux์ธ ๊ฒฝ์ฐ
uvloop
# Windows์ธ ๊ฒฝ์ฐ
winloop
```
#### Argument
- -i, --input : ์
๋ ฅ ํ์ผ or ๋๋ ํ ๋ฆฌ or ํ์ผ๋ช
์ ๋ํ ์ ๊ท ํํ์
- -o, --output_dir : ์ถ๋ ฅ ํ์ผ์ด ์ ์ฅ๋๋ ๋๋ ํ ๋ฆฌ
- -e, --evaluation : ํ๊ฐ ๋ชจ๋ธ (e.g. "gpt-4o-2024-05-13", "gpt-4o-mini", vllm์์ ๋์ด ๋ชจ๋ธ ๋ช
๋ฑ)
- -m, --matching_method: ๋งค์น ๋ฐฉ์ (๊ธฐ๋ณธ๊ฐ "tournament", "league" (๋น์ถ์ฒ) )
- -k, --openai_api_key : OpenAI API Key
- -u, --openai_url: ๋ก์ปฌ vLLM OpenAI ์๋ฒ ์ฌ์ฉ ์ URL(ip์ฃผ์+ํฌํธ)
#### advanced
- -j, --n_jobs : asyncio.semaphore()์ ์ ๋ฌ๋ ์ธ์. Arena๊ฐ ์งํ๋์ง ์๋๋ค๋ฉด ๊ธฐ๋ณธ๊ฐ์ธ 32 ์ดํ๋ก ๋ด๋ ค๋ณด์
- -p, --evalprompt : [ํด๋น ๋๋ ํ ๋ฆฌ ์ฐธ์กฐ](./varco_arena/prompts/*.yaml)
- -lr, --limit_requests : vLLM OpenAI ์๋ฒ ์์ฒญ ์ ํ (default: 7,680)
- -lt, --limit_tokens : vLLM OpenAI ์๋ฒ ํ ํฐ ์ ํ (default: 15,728,640)
#### Input Data Format
[input jsonl ๊ฐ์ด๋ ๋งํฌ](./streamlit_app_local/guide_mds/input_jsonls_kr.md)
## Contributing & Customizing
#### git clone ๋ฐ dependency ์ค์น ํ์ ํ ์ผ
```bash
pip install pre-commit
pre-commit install
```
#### commit ํ๊ธฐ ์ ์ ํ ์ผ
```bash
bash precommit.sh # ์ด๊ฒ ์ฝ๋๋ค์ ๋ค ๋ฆฌํฌ๋งทํด์ค๊ฑฐ์
```
๋ฌธ์: ์์ ์ผ
* ๋ด๊ฐ ๋ง๋ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ด์
* [`./varco_arena/prompts/`](./varco_arena_core/prompts/__init__.py) ์์ ๊ฐ์ข
ํ๋กฌํํธ ํด๋์ค ๋ฐ `yaml` ํ์ผ ํํ๋ก ์ ์๋ ํ๋กฌํํธ๋ฅผ ๋ก๋ํฉ๋๋ค. ํ๋ฆฌ์
์ ์ฐธ์กฐํ์ฌ ์์ฑํ์๋ฉด ๋ฉ๋๋ค.
* ํ
์คํธ์
๋ณ๋ก ๋ค๋ฅธ ํ๊ฐ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ด์ (e.g. ์์
์ ๋ฐ๋ผ ๋ค๋ฅธ ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ด์)
* ์ ๊ฑธ์ด๋๋ฆฐ ๋งํฌ์ `load_prompt` ๋ฅผ ํตํด์ `promptname` + `task` ํํ๋ก [`./varco_arena_core/manager.py:async_run`](./varco_arena_core/manager.py) ํ๋กฌํํธ๊ฐ ๋ก๋๋๋๋ก ํด๋์์ต๋๋ค.
* ์ ๊ฐ ์ฌ์ฉํ๊ณ ์ถ์ ์
๋ ฅํ์ผ์ `instruction`, `source`, `generated` ์ด์ธ์ ๋ค๋ฅธ ํ๋๋ฅผ ์ถ๊ฐํด์ ์ฌ์ฉํ๊ณ ์ถ์ด์.
* ์กฐ๊ธ ๋ณต์กํด์ง๋๋ฐ ๋ค์ ๋ถ๋ถ์ ๊ณ ์ณ์ฃผ์ธ์
* `varco_arena/eval_utils.py` ์์ `async_eval_w_prompt` ๋ถ๋ถ์ ์๋ด์ผํ ์ ์์ต๋๋ค (์ฌ๊ธฐ์์ PROMPT_OBJ.complete_prompt()์ ํธ์ถํจ)
* ๊ทธ ์ธ ์ฐ๊ด๋ ๋ถ๋ถ์ ํ๊ณ ํ๊ณ ๊ณ ์ณ์ฃผ์
์ผ...
## Special Thanks to (contributors)
- ์ด๋ฏผํธ (@๋ํ๋ชจ๋ธํ, NCSOFT) [github](https://github.com/minolee/)
- query wrapper
- rag prompt
- ์ค์ฃผ๋ฏผ (@์์ฑ๋ชจ๋ธํ, NCSOFT)
- overall prototyping of the system in haste
## Citation
์ ํฌ ์์
๋ฌผ์ด ๋์์ด ๋์๋ค๋ฉด ์ ํฌ๋ ๋์์ ๋ฐ์๋ณผ ์ ์์๊น์?๐
```
@misc{son2024varcoarenatournamentapproach,
title={Varco Arena: A Tournament Approach to Reference-Free Benchmarking Large Language Models},
author={Seonil Son and Ju-Min Oh and Heegon Jin and Cheolhun Jang and Jeongbeom Jeong and Kuntae Kim},
year={2024},
eprint={2411.01281},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2411.01281},
}
```
|