infly / inf-query-aligner

huggingface.co
Total runs: 289
24-hour runs: 0
7-day runs: -298
30-day runs: -298
Model's Last Updated: January 05 2026
reinforcement-learning

Introduction of inf-query-aligner

Model Details of inf-query-aligner

INF-Query-Aligner

Rank Hugging Face License

📖 Overview

INF-Query-Aligner is a specialized component of the INF-X-Retriever framework, designed to distill the core retrieval intent from complex, verbose, or reasoning-intensive queries. Built upon the Qwen2.5-7B-instruct foundation and fine-tuned via Reinforcement Learning, it transforms raw user queries into concise, search-optimized queries for dense retrieval systems.

This model is a key enabler for INF-X-Retriever 's state-of-the-art performance, currently holding the No. 1 position on the BRIGHT Benchmark (as of Dec 17, 2025).

For more details on the full framework, please visit the INF-X-Retriever Repository .


Requirements
transformers==4.51.0
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer

# Load model and tokenizer
model_name = "infly/inf-query-aligner"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Define input query
prompt = "Claim in article about why insects are attracted to light\nIn this article they are addressing the reason insects are attracted to light when they say\nHeat radiation as an attractive component is refuted by the effect of LED lighting, which supplies negligible infrared radiation yet still entraps vast numbers of insects.\nI don't see why attraction to LEDs shows they're not seeking heat. Could they for example be evolutionarily programmed to associate light with heat? So that even though they don't encounter heat near/on the LEDs they still \"expect\" to?"

QUERY_WRITER_PROMPT = (
    "For the input query, formulating a concise search query for dense retrieval by distilling the core intent from a complex user prompt and ignoring LLM instructions."
    "The response should be less than 200 words"
)
messages = [
    {
        "role": "system",
        "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant.",
    },
    {
        "role": "user",
        "content": (
            f"{QUERY_WRITER_PROMPT}\n\n"
            f"**Input Query:**\n{prompt}\n"
            f"**Your Output:**\n"
        ),
    },
]

# Apply chat template
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer(
    [text], 
    truncation=True, 
    max_length=8192, 
    return_tensors="pt"
).to(model.device)

# Generate rewritten query
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

print(response)

🖊️ Citation

If you find this model useful, please consider citing our work:

@misc{inf-x-retriever-2025,
    title        = {INF-X-Retriever},
    author       = {Yichen Yao, Jiahe Wan, Yuxin Hong, Mengna Zhang, Junhan Yang, Zhouyu Jiang, Qing Xu, Yinghui Xu, Wei Chu, Yuan Qi},
    year         = {2025},
    url          = {https://yaoyichen.github.io/INF-X-Retriever},
    publisher    = {GitHub repository}
}

📬 Contact

Project Lead: Yichen Yao ( [email protected] )

Runs of infly inf-query-aligner on huggingface.co

289
Total runs
0
24-hour runs
-17
3-day runs
-298
7-day runs
-298
30-day runs

More Information About inf-query-aligner huggingface.co Model

More inf-query-aligner license Visit here:

https://choosealicense.com/licenses/apache-2.0

inf-query-aligner huggingface.co

inf-query-aligner huggingface.co is an AI model on huggingface.co that provides inf-query-aligner's model effect (), which can be used instantly with this infly inf-query-aligner model. huggingface.co supports a free trial of the inf-query-aligner model, and also provides paid use of the inf-query-aligner. Support call inf-query-aligner model through api, including Node.js, Python, http.

inf-query-aligner huggingface.co Url

https://huggingface.co/infly/inf-query-aligner

infly inf-query-aligner online free

inf-query-aligner huggingface.co is an online trial and call api platform, which integrates inf-query-aligner's modeling effects, including api services, and provides a free online trial of inf-query-aligner, you can try inf-query-aligner online for free by clicking the link below.

infly inf-query-aligner online free url in huggingface.co:

https://huggingface.co/infly/inf-query-aligner

inf-query-aligner install

inf-query-aligner is an open source model from GitHub that offers a free installation service, and any user can find inf-query-aligner on GitHub to install. At the same time, huggingface.co provides the effect of inf-query-aligner install, users can directly use inf-query-aligner installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

inf-query-aligner install url in huggingface.co:

https://huggingface.co/infly/inf-query-aligner

Url of inf-query-aligner

inf-query-aligner huggingface.co Url

Provider of inf-query-aligner huggingface.co

infly
ORGANIZATIONS

Other API from infly

huggingface.co

Total runs: 151
Run Growth: 0
Growth Rate: 0.00%
Updated:April 30 2025
huggingface.co

Total runs: 17
Run Growth: 10
Growth Rate: 62.50%
Updated:July 25 2024
huggingface.co

Total runs: 12
Run Growth: 3
Growth Rate: 30.00%
Updated:July 25 2024