🚀 rank1-3b: 情報検索における再ランキングのテスト時計算
rank1は、関連性判断を行う前に「思考」する推論再ランキングモデルです。この30億パラメータのモデルは、Qwen2.5-3Bベースモデルから学習され、文書がクエリに関連するかどうかを判断する前に、テスト時計算を利用して推論チェーンを生成します。
📄 論文 | 🚀 GitHubリポジトリ
🚀 クイックスタート
rank1は、関連性判断を行う前に明示的な推論チェーンを生成することで、情報検索に新しいアプローチを導入しました。従来の再ランキングモデルが直接スコアを出力するのとは異なり、rank1は以下の手順を行います。
- クエリと文書のペアを受け取る
<think>...</think>
セクション内で推論チェーンを生成する
- 二値の関連性判断(
true
またはfalse
)を行う
- 真/偽トークンのロジットに基づいて信頼度スコアを返す
このアプローチにより、モデルは複雑な関連性判断を論理的なステップに分解し、多様な検索タスクでのパフォーマンスを向上させます。
✨ 主な機能
モデルファミリー
量子化バリアント
関連データとリソース
📦 インストール
詳細なインストール手順については、GitHubを参照してください。
💻 使用例
基本的な使用法
公式の使用方法はGitHubに記載されており、エッジケースも考慮されています。しかし、単純な使用例では、以下の最小限の例が機能します。
クリックして展開: vLLMを使用した最小限の例
from vllm import LLM, SamplingParams
import math
model = LLM(
model="jhu-clsp/rank1-3b",
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-3b")
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は、MTEBベンチマークフレームワークと互換性があります。
from mteb import MTEB
from rank1 import rank1
model = rank1(
model_name_or_path="jhu-clsp/rank1-3b",
num_gpus=1,
device="cuda"
)
evaluation = MTEB(tasks=["NevIR"])
results = evaluation.run(model)
📚 ドキュメント
rank1-3bは、検索ベンチマークで強力なパフォーマンスを示しており、特に複雑な推論を必要とするタスクで有効です。モデルが関連性判断を「考え抜く」能力は、微妙なトピックに対して特に有効です。
具体的なベンチマーク結果と他のモデルとの比較については、論文と公式GitHubリポジトリを参照してください。
📄 ライセンス
MITライセンス
引用
もしあなたの研究で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},
}
モデル情報
属性 |
详情 |
模型类型 |
再ランカー |
训练数据 |
jhu-clsp/rank1-training-data |
基础模型 |
Qwen/Qwen2.5-3B |
许可证 |
MIT |
任务类型 |
テキストランキング |
标签 |
再ランカー、検索 |
库名称 |
transformers |