Web Analytics

s3

⭐ 731 stars Turkish by pat-jj

🌐 Dil

s3 - RL ile Verimli ve Etkili Arama Ajanı Eğitimi

Bir Arama Ajanı Eğitmek İçin O Kadar Fazla Veriye İhtiyacınız Yok

arXiv

Performans Genel Bakışı:

performance_overview

s3 nedir?

framework

s3 Çerçevesi

s3, arama ajanlarını geri alma ile artırılmış üretim (RAG) kapsamında eğitmek için basit ama güçlü bir çerçevedir. Dil modellerine, üreticiyi değiştirmeden daha etkili arama yapmayı öğretir. Yalnızca arama bileşenine odaklanarak, s3 önceki yöntemlere kıyasla kullanılan verinin sadece küçük bir kısmıyla QA görevlerinde yüksek performans elde eder. Modülerdir, verimlidir ve herhangi bir kara kutu LLM ile sorunsuz çalışacak şekilde tasarlanmıştır.

İçindekiler

📦 Kurulum

Arama ve Üretici Ortamı

conda create -n s3 python=3.9

install torch [or you can skip this step and let vllm to install the correct version for you]

pip install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu121

install vllm

pip3 install vllm==0.6.3 # or you can install 0.5.4, 0.4.2 and 0.3.1 pip3 install ray

verl

cd code

pip install -e .

flash attention 2

pip3 install flash-attn --no-build-isolation

we use pyserini for efficient retrieval and evaluation

pip install pyserini # the version we used is 0.22.1

quality of life

pip install wandb IPython matplotlib huggingface_hub
Retriever Ortamı

conda create -n ret python=3.10
conda activate ret

conda install pytorch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 pytorch-cuda=12.1 -c pytorch -c nvidia pip install transformers datasets pyserini conda install -c pytorch -c nvidia faiss-gpu=1.8.0 pip install uvicorn fastapi

💡 Hazırlık

Dizin ve Korpus İndir

python scripts/download.py --save_path $save_path
cat $save_path/part_* > $save_path/e5_Flat.index
gzip -d $save_path/wiki-18.jsonl.gz

Naif RAG Başlatmasını Önceden Hesapla (veya işlenmiş verimizi buradan indirebilirsiniz: huggingface)

# deploy retriever
bash scripts/deploy_retriever/retrieval_launch.sh # or scripts/deploy_retriever/retrieval_launch_mirage.sh for MedCorp corpus.

deploy generator

bash generator_llms/host.sh # modify tensor-parallel-size to the number of GPUs you use

run precompute

bash scripts/precompute.sh # this step will take a while, as it will precompute the naïve RAG Cache for training

🏋️ Antrenmanı Başlat

Bu adım S3'ün eğitimi içindir

# deploy retriever
bash scripts/deploy_retriever/retrieval_launch.sh 

deploy generator

bash generator_llms/host.sh

run training

bash scripts/train/train_s3.sh

🔍 Arama/Alma İşlemini Çalıştırın

Bu adım, s3 / temel modeller için bağlam toplama içindir

s3

# deploy retriever
bash scripts/deploy_retriever/retrieval_launch.sh 

run s3 inference

bash scripts/s3_inference/evaluate-8-3-3.sh
Temel Değerler

RAG

bash scripts/deploy_retriever/retrieval_launch.sh # or retrieval_launch_bm25.sh # deploy retriever
bash scripts/baselines/rag.sh # run RAG 
DeepRetrieval DeepRetrieval
bash retrieval_launch_bm25.sh # deploy BM25 Model
bash generator_llms/deepretrieval.sh # deploy DeepRetrieval Model
bash scripts/baselines/deepretrieval.sh # run DeepRetrieval Query Rewriting + Retrieval
Ara-R1

bash retrieval_launch.sh # deploy e5 retriever
bash scripts/baselines/search_r1.sh # run Search-R1
IRCoT

bash retrieval_launch.sh # deploy e5 retriever
python scripts/baselines/ircot.py
Arama-o1

bash retrieval_launch.sh # deploy e5 retriever
bash scripts/baselines/search_o1.sh # run Search-o1

📈 Değerlendirme Çalıştırma

Bu adım s3 / temel modellerin değerlendirmesi içindir

bash scripts/evaluation/run.sh

Soru&Cevap

Özelleştirilmiş Veri?

S3'ü kendi korpusunuz/veri setiniz üzerinde test etmek istiyorsanız, kendi hattınızı nasıl kurmanız gerektiğini görmek için şu commite başvurabilirsiniz: commit 8420538

Sonuçların Yeniden Üretilmesi?

Birçok geliştirici sonuçlarımızı başarıyla yeniden üretti. Sorularınız varsa veya bir sorunla karşılaşırsanız, issue açmaktan çekinmeyin — pratik destek sağlamaktan mutluluk duyarız (bkz. bu örnek).

Modeli kendinizin yeniden üretmesi oldukça kolaydır — ve aslında sıfırdan eğitmenizi tavsiye ediyoruz, çünkü değerlendirme çoğu zaman eğitimden daha fazla zaman alabiliyor — ayrıca referans bir kontrol noktası da sunuyoruz: s3-8-3-3-20steps, yaklaşık bir saatte eğitilmiştir.

Teşekkür

Aşağıdaki projelere teşekkür etmek isteriz: verl, RAGEN, Search-R1, DeepRetrieval, PySerini.

Atıf

@article{jiang2025s3,
  title={s3: You Don't Need That Much Data to Train a Search Agent via RL},
  author={Jiang, Pengcheng and Xu, Xueqiang and Lin, Jiacheng and Xiao, Jinfeng and Wang, Zifeng and Sun, Jimeng and Han, Jiawei},
  journal={arXiv preprint arXiv:2505.14146},
  year={2025}
}
Çalışmamıza gösterdiğiniz ilgi için teşekkür ederiz!

--- Tranlated By Open Ai Tx | Last indexed: 2025-10-06 ---