Instructions to use vector-institute/Factuality-Alignment-Qwen2.5-14B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use vector-institute/Factuality-Alignment-Qwen2.5-14B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/qwen2.5-14b-instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "vector-institute/Factuality-Alignment-Qwen2.5-14B") - Transformers
How to use vector-institute/Factuality-Alignment-Qwen2.5-14B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vector-institute/Factuality-Alignment-Qwen2.5-14B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("vector-institute/Factuality-Alignment-Qwen2.5-14B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vector-institute/Factuality-Alignment-Qwen2.5-14B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vector-institute/Factuality-Alignment-Qwen2.5-14B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vector-institute/Factuality-Alignment-Qwen2.5-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vector-institute/Factuality-Alignment-Qwen2.5-14B
- SGLang
How to use vector-institute/Factuality-Alignment-Qwen2.5-14B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "vector-institute/Factuality-Alignment-Qwen2.5-14B" \ --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": "vector-institute/Factuality-Alignment-Qwen2.5-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "vector-institute/Factuality-Alignment-Qwen2.5-14B" \ --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": "vector-institute/Factuality-Alignment-Qwen2.5-14B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use vector-institute/Factuality-Alignment-Qwen2.5-14B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vector-institute/Factuality-Alignment-Qwen2.5-14B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for vector-institute/Factuality-Alignment-Qwen2.5-14B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for vector-institute/Factuality-Alignment-Qwen2.5-14B to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="vector-institute/Factuality-Alignment-Qwen2.5-14B", max_seq_length=2048, ) - Docker Model Runner
How to use vector-institute/Factuality-Alignment-Qwen2.5-14B with Docker Model Runner:
docker model run hf.co/vector-institute/Factuality-Alignment-Qwen2.5-14B
Factuality-Alignment-Qwen2.5-14B
A factuality-aligned Large Language Model fine-tuned using Factuality-Aware Direct Preference Optimization (Factual-DPO) to reduce hallucinations while preserving preference alignment.
Website: Project Page | Paper: arXiv | Dataset: Hugging Face | Code: Github
π§ Background & Motivation
Large Language Models optimized via preference learning (e.g., DPO, RLHF) often over-prefer fluent but hallucinated responses, especially when factual correctness is not explicitly supervised.
Factuality-Alignment-Qwen2.5-14B addresses this limitation by applying Factual-DPO, a factuality-aware extension of Direct Preference Optimization that:
- Integrates explicit binary factuality supervision
- Penalizes preferences that favor hallucinated responses
- Introduces margin-based factual penalties (Ξ) for controllable hallucination suppression
This model is fine-tuned from Qwen2.5-14B-Instruct using a large-scale, balanced, and synthetic factuality-aware preference dataset derived from Skywork Reward-Preference-80K.
π§ What Is Factual-DPO?
Standard DPO optimizes preference alignment without distinguishing whether the preferred response is factual.
Factual-DPO modifies the DPO objective by introducing factuality indicators:
- Each preference pair includes factuality labels
(h_w, h_l) - A margin penalty
Ξis applied when the preferred response is less factual - Optimization pressure shifts toward factually correct preferences
β‘οΈ Result:
Lower hallucination rates without sacrificing preference win-rate or fluency.
β¨ Key Contributions
- π Binary factuality supervision integrated into preference learning
- π§ͺ Synthetic hallucination inversion to balance factual vs hallucinated pairs
- π Ξ-margin factual penalties for controllable hallucination suppression
- βοΈ Config-driven, reproducible training and evaluation pipelines
- π Multi-model Γ multi-Ξ benchmarking at scale
π§ͺ Training Overview
- Base model: Qwen2.5-14B-Instruct
- Training method: Factuality-Aware DPO (QLoRA, 4-bit NF4)
- Frameworks: TRL, Unsloth, Accelerate
- Hardware: A100 / A40 GPUs
- Objective: Reduce hallucinations while maintaining preference alignment
Each Ξ value produces a separate fine-tuned checkpoint, enabling controlled factualityβpreference trade-offs.
π Evaluation
Evaluation is performed using GPT-4o-mini as an LLM-as-a-Judge.
Metrics
| Metric | Description |
|---|---|
| factuality | Mean factual score |
| halluc_rate | % outputs below factual threshold |
| win_rate | Preference win-rate vs baseline |
| count | Number of evaluated prompts |
The Factual-DPO variants consistently show:
- β hallucination rate
- β factuality score
- Comparable or improved preference win-rate
π Usage Example
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "vector-institute/Factuality-Alignment-Qwen2.5-14B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
prompt = "What are the causes of Type 1 diabetes?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.7,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Citation: If you use this model please cite us
@article{FactualAlignment2026,
title={Reducing Hallucinations in LLMs via Factuality-Aware Preference Learning},
author={Sindhuja Chaduvula, Ahmed Radwan, Azib Farooq, Yani Ioannou, Shaina Raza},
journal={arXiv preprint arXiv:2601.03027},
year={2026}
}
- Downloads last month
- 1
Model tree for vector-institute/Factuality-Alignment-Qwen2.5-14B
Base model
Qwen/Qwen2.5-14B