Rank1 14b
模型简介
该模型基于Qwen2.5-14B基础模型训练,专门用于信息检索中的重排序任务。与传统方法不同,它在做出相关性判断前会生成推理链,从而提升复杂检索任务的准确性。
模型特点
测试时计算
在判断文档相关性前生成推理链,使决策过程更加透明和可解释
多规模变体
提供从5亿到320亿参数的不同规模模型,适应不同计算资源需求
量化支持
提供AWQ量化版本,降低部署资源需求
模型能力
信息检索
文档重排序
相关性判断
推理链生成
使用案例
搜索引擎优化
搜索结果重排序
对搜索引擎返回的前100个结果进行智能重排序,提升最相关结果的排名
相比传统方法,能更准确地识别微妙的相关性
问答系统
答案候选排序
在问答系统中对候选答案进行相关性排序
通过推理链分析,减少错误答案的排名
🚀 rank1-14b:信息检索重排的测试时计算模型
rank1是一个推理重排模型,它在做出相关性判断之前会进行“思考”。这个拥有140亿参数的模型基于Qwen2.5 - 14B基础模型进行训练,并利用测试时计算在决定文档是否与查询相关之前生成推理链。
🚀 快速开始
rank1是一个推理重排模型,在进行相关性判断前会“思考”。该模型基于Qwen2.5 - 14B基础模型训练,利用测试时计算生成推理链,以决定文档与查询的相关性。
✨ 主要特性
- 创新的信息检索方法:rank1在进行相关性判断之前会生成明确的推理链。与直接输出分数的传统重排器不同,rank1会接收查询和文档对,在
<think>...</think>
部分生成推理链,做出二元相关性判断(true
或false
),并根据真假标记的对数几率返回置信度分数。这种方法有助于模型将复杂的相关性决策分解为逻辑步骤,提高了在各种检索任务中的性能。 - 多模型变体:提供了多种不同参数规模的模型变体,包括
rank1 - 0.5b
、rank1 - 1.5b
、rank1 - 3b
、rank1 - 7b
、rank1 - 14b
、rank1 - 32b
、rank1 - mistral - 2501 - 24b
和rank1 - llama3 - 8b
,还有对应的量化版本。 - 丰富的关联数据和资源:有来自MS MARCO的所有R1输出示例、训练数据、预计算的运行文件等,并且有官方的GitHub仓库。
- 良好的性能:rank1 - 14b在检索基准测试中表现出色,尤其在需要复杂推理的任务上。其“思考”相关性决策的能力使其在处理细微主题时特别有效。
- MTEB集成:rank1与 MTEB基准测试框架 兼容。
📦 安装指南
详细的安装说明请参考 GitHub仓库。
💻 使用示例
基础用法
请注意,官方使用方法可在Github上找到,其中考虑了边缘情况。但对于简单用例,以下最小示例即可。
点击展开:使用vLLM的最小示例
from vllm import LLM, SamplingParams
import math
# Initialize the model with vLLM
model = LLM(
model="jhu-clsp/rank1-14b",
tensor_parallel_size=1, # Number of GPUs
trust_remote_code=True,
max_model_len=16000, # Context length
gpu_memory_utilization=0.9,
dtype="float16",
)
# Set up sampling parameters
sampling_params = SamplingParams(
temperature=0,
max_tokens=8192,
logprobs=20,
stop=["</think> true", "</think> false"],
skip_special_tokens=False
)
# Prepare the prompt
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>"
)
# Example usage
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."
# Generate prediction
prompt = create_prompt(query, document)
outputs = model.generate([prompt], sampling_params)
# Extract score
output = outputs[0].outputs[0]
text = output.text
final_logits = output.logprobs[-1]
# Get token IDs for "true" and "false" tokens
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("jhu-clsp/rank1-14b")
true_token = tokenizer(" true", add_special_tokens=False).input_ids[0]
false_token = tokenizer(" false", add_special_tokens=False).input_ids[0]
# Calculate relevance score (probability of "true")
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}")
高级用法
from mteb import MTEB
from rank1 import rank1 # From the official repo
# Initialize the model
model = rank1(
model_name_or_path="jhu-clsp/rank1-14b",
num_gpus=1,
device="cuda"
)
# Run evaluation on specific tasks
evaluation = MTEB(tasks=["NevIR"])
results = evaluation.run(model)
📚 详细文档
模型家族
模型 | 基础模型 | 描述 |
---|---|---|
[rank1 - 0.5b](https://huggingface.co/jhu - clsp/rank1 - 0.5b) | Qwen2.5 - 0.5B | 最小变体(050亿参数) |
[rank1 - 1.5b](https://huggingface.co/jhu - clsp/rank1 - 1.5b) | Qwen2.5 - 1.5B | 较小变体(150亿参数) |
[rank1 - 3b](https://huggingface.co/jhu - clsp/rank1 - 3b) | Qwen2.5 - 3B | 较小变体(300亿参数) |
[rank1 - 7b](https://huggingface.co/jhu - clsp/rank1 - 7b) | Qwen2.5 - 7B | 较小变体(700亿参数) |
[rank1 - 14b](https://huggingface.co/jhu - clsp/rank1 - 14b) | Qwen2.5 - 14B | 当前模型(1400亿参数) |
[rank1 - 32b](https://huggingface.co/jhu - clsp/rank1 - 32b) | Qwen2.5 - 32B | 最大变体(3200亿参数) |
[rank1 - mistral - 2501 - 24b](https://huggingface.co/jhu - clsp/rank1 - mistral - 2501 - 24b) | Mistral - Small 2501 24B | 基于Mistral基础模型训练 |
[rank1 - llama3 - 8b](https://huggingface.co/jhu - clsp/rank1 - llama3 - 8b) | Llama 3.1 8B | 基于Llama 3.1基础模型训练 |
量化变体
模型 | 描述 |
---|---|
[rank1 - 7b - awq](https://huggingface.co/jhu - clsp/rank1 - 7b - awq) | rank1 - 7b的量化版本 |
[rank1 - 14b - awq](https://huggingface.co/jhu - clsp/rank1 - 14b - awq) | rank1 - 14b的量化版本 |
[rank1 - 32b - awq](https://huggingface.co/jhu - clsp/rank1 - 32b - awq) | rank1 - 32b的量化版本 |
[rank1 - mistral - 2501 - 24b - awq](https://huggingface.co/jhu - clsp/rank1 - mistral - 2501 - 24b - awq) | rank1 - mistral - 24b的量化版本 |
[rank1 - llama3 - 8b - awq](https://huggingface.co/jhu - clsp/rank1 - llama3 - 8b - awq) | rank1 - llama3 - 8b的量化版本 |
关联数据和资源
资源 | 描述 |
---|---|
[rank1 - r1 - msmarco](https://huggingface.co/datasets/jhu - clsp/rank1 - r1 - msmarco) | 来自MS MARCO的所有R1输出示例 |
[rank1 - training - data](https://huggingface.co/datasets/jhu - clsp/rank1 - training - data) | 用于rank1模型的训练数据 |
[rank1 - run - files](https://huggingface.co/datasets/jhu - clsp/rank1 - run - files) | 用于前100文档重排的预计算运行文件 |
GitHub仓库 | 官方rank1仓库 |
📄 许可证
🔖 引用
如果您在研究中使用了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},
}
Phi 2 GGUF
其他
Phi-2是微软开发的一个小型但强大的语言模型,具有27亿参数,专注于高效推理和高质量文本生成。
大型语言模型 支持多种语言
P
TheBloke
41.5M
205
Roberta Large
MIT
基于掩码语言建模目标预训练的大型英语语言模型,采用改进的BERT训练方法
大型语言模型 英语
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基础模型的蒸馏版本,在保持相近性能的同时更轻量高效,适用于序列分类、标记分类等自然语言处理任务。
大型语言模型 英语
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一个多语言大语言模型,针对多语言对话用例进行了优化,在常见的行业基准测试中表现优异。
大型语言模型 英语
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基于100种语言的2.5TB过滤CommonCrawl数据预训练的多语言模型,采用掩码语言建模目标进行训练。
大型语言模型 支持多种语言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基于Transformer架构的英语预训练模型,通过掩码语言建模目标在海量文本上训练,支持文本特征提取和下游任务微调
大型语言模型 英语
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI发布的开放预训练Transformer语言模型套件,参数量从1.25亿到1750亿,旨在对标GPT-3系列性能,同时促进大规模语言模型的开放研究。
大型语言模型 英语
O
facebook
6.3M
198
1
基于transformers库的预训练模型,适用于多种NLP任务
大型语言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多语言大语言模型系列,包含8B、70B和405B参数规模,支持8种语言和代码生成,优化了多语言对话场景。
大型语言模型
Transformers 支持多种语言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基础版是由Google开发的文本到文本转换Transformer模型,参数规模2.2亿,支持多语言NLP任务。
大型语言模型 支持多种语言
T
google-t5
5.4M
702
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98