🚀 rank1-0.5b: 情報検索における再ランキングのテスト時計算
このモデルは、情報検索における関連性判断の前に「思考」する推論型再ランキングモデルです。0.5Bのパラメータを持ち、Qwen2.5-0.5Bをベースに訓練されています。
📄 論文 | 🚀 GitHubリポジトリ
🚀 クイックスタート
rank1は、関連性判断を行う前に明示的な推論チェーンを生成することで、情報検索に新しいアプローチを導入します。このモデルは、複雑な関連性判断を論理的なステップに分解し、様々な検索タスクでのパフォーマンスを向上させます。
✨ 主な機能
- 関連性判断前に明示的な推論チェーンを生成することで、複雑な関連性判断を論理的なステップに分解します。
- 従来の再ランキングモデルとは異なり、直接スコアを出力するのではなく、推論チェーンを生成してから二値の関連性判断(
true
またはfalse
)を行い、そのロジットに基づいて信頼度スコアを返します。
📦 インストール
詳細なインストール手順については、GitHubリポジトリを参照してください。
💻 使用例
基本的な使用法
クリックして展開: vLLMを使用した最小限の例
from vllm import LLM, SamplingParams
import math
model = LLM(
model="jhu-clsp/rank1-0.5b",
tensor_parallel_size=1,
trust_remote_code=True,
max_model_len=16000,
gpu_memory_utilization=0.9,
dtype="float16",
)
sampling_params = SamplingParams(
temperature=0,
max_tokens=8192,
logprobs=20,
stop=["</think> true", "</think> false"],
skip_special_tokens=False
)
def create_prompt(query, document):
return (
"Determine if the following passage is relevant to the query. "
"Answer only with 'true' or 'false'.\n"
f"Query: {query}\n"
f"Passage: {document}\n"
"<think>"
)
query = "What are the effects of climate change?"
document = "Climate change leads to rising sea levels, extreme weather events, and disruptions to ecosystems. These effects are caused by increasing greenhouse gas concentrations in the atmosphere due to human activities."
prompt = create_prompt(query, document)
outputs = model.generate([prompt], sampling_params)
output = outputs[0].outputs[0]
text = output.text
final_logits = output.logprobs[-1]
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/rank1-0.5b")
true_token = tokenizer(" true", add_special_tokens=False).input_ids[0]
false_token = tokenizer(" false", add_special_tokens=False).input_ids[0]
true_logit = final_logits[true_token].logprob
false_logit = final_logits[false_token].logprob
true_score = math.exp(true_logit)
false_score = math.exp(false_logit)
relevance_score = true_score / (true_score + false_score)
print(f"Reasoning chain: {text}")
print(f"Relevance score: {relevance_score}")
📚 ドキュメント
モデル概要
rank1は、関連性判断を行う前に明示的な推論チェーンを生成することで、情報検索に新しいアプローチを導入します。このモデルは、以下のステップで動作します。
- クエリとドキュメントのペアを受け取ります。
<think>...</think>
セクション内で推論チェーンを生成します。
- 二値の関連性判断(
true
またはfalse
)を行います。
- 真偽トークンのロジットに基づいて信頼度スコアを返します。
モデルファミリー
量子化バリアント
関連データとリソース
MTEB統合
rank1は、MTEBベンチマークフレームワークと互換性があります。
from mteb import MTEB
from rank1 import rank1
model = rank1(
model_name_or_path="jhu-clsp/rank1-0.5b",
num_gpus=1,
device="cuda"
)
evaluation = MTEB(tasks=["NevIR"])
results = evaluation.run(model)
引用
もしあなたが研究でrank1を使用する場合は、以下のように引用してください。
@misc{weller2025rank1testtimecomputereranking,
title={Rank1: Test-Time Compute for Reranking in Information Retrieval},
author={Orion Weller and Kathryn Ricci and Eugene Yang and Andrew Yates and Dawn Lawrie and Benjamin Van Durme},
year={2025},
eprint={2502.18418},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2502.18418},
}
📄 ライセンス
MITライセンス