LLM-based Listwise Reranking under the Effect of Positional Bias
Paper โข 2604.03642 โข Published
How to use JFJFJFen/DebiasFirst-Zephyr7B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="JFJFJFen/DebiasFirst-Zephyr7B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("JFJFJFen/DebiasFirst-Zephyr7B")
model = AutoModelForCausalLM.from_pretrained("JFJFJFen/DebiasFirst-Zephyr7B", device_map="auto")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use JFJFJFen/DebiasFirst-Zephyr7B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "JFJFJFen/DebiasFirst-Zephyr7B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "JFJFJFen/DebiasFirst-Zephyr7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/JFJFJFen/DebiasFirst-Zephyr7B
How to use JFJFJFen/DebiasFirst-Zephyr7B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "JFJFJFen/DebiasFirst-Zephyr7B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "JFJFJFen/DebiasFirst-Zephyr7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "JFJFJFen/DebiasFirst-Zephyr7B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "JFJFJFen/DebiasFirst-Zephyr7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use JFJFJFen/DebiasFirst-Zephyr7B with Docker Model Runner:
docker model run hf.co/JFJFJFen/DebiasFirst-Zephyr7B
Use the reranking code from the paper repository โ it handles prompt construction, the sliding window and batching:
python scripts/rerank_llm.py --model JFJFJFen/DebiasFirst-Zephyr7B \
--dataset scifact --data_type beir --data_dir ../data/beir \
--output_dir ../data/beir/scifact/rank_100.json \
--rerank_output_dir ../outputs/beir/scifact/rerank.json \
--use_logits 1 --use_alpha 1 --llm_top_k 100 \
--window_size 20 --step_size 10 --do_batched 1
@article{debiasfirst2026,
title = {LLM-based Listwise Reranking under the Effect of Positional Bias},
journal = {arXiv preprint arXiv:2604.03642},
year = {2026}
}
Base model
mistralai/Mistral-7B-v0.1