Instructions to use voidism/SelfCite-8B-CC-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use voidism/SelfCite-8B-CC-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="voidism/SelfCite-8B-CC-SFT", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("voidism/SelfCite-8B-CC-SFT") model = AutoModelForCausalLM.from_pretrained("voidism/SelfCite-8B-CC-SFT", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use voidism/SelfCite-8B-CC-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "voidism/SelfCite-8B-CC-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "voidism/SelfCite-8B-CC-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/voidism/SelfCite-8B-CC-SFT
- SGLang
How to use voidism/SelfCite-8B-CC-SFT 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 "voidism/SelfCite-8B-CC-SFT" \ --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": "voidism/SelfCite-8B-CC-SFT", "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 "voidism/SelfCite-8B-CC-SFT" \ --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": "voidism/SelfCite-8B-CC-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use voidism/SelfCite-8B-CC-SFT with Docker Model Runner:
docker model run hf.co/voidism/SelfCite-8B-CC-SFT
SelfCite-8B-CC-SFT
Paper: SelfCite: Self-Supervised Alignment for Context Attribution in Large Language Models
Authors: Yung-Sung Chuang†, Benjamin Cohen-Wang†, Shannon Zejiang Shen†, Zhaofeng Wu†, Hu Xu‡, Xi Victoria Lin‡, James Glass†, Shang-Wen Li‡, Wen-tau Yih‡
† Massachusetts Institute of Technology, ‡ Meta AI
This is the intermediate ContextCite supervised fine-tuning (CC-SFT) checkpoint used in the fully self-supervised setting of the SelfCite paper. It is initialized from Llama-3.1-8B-Instruct and trained on SFT data generated with ContextCite using 256 ContextCite calls.
This checkpoint is the model before SimPO preference optimization. For the resulting SelfCite model after SimPO, use voidism/SelfCite-8B-from-CC.
Please refer to the SelfCite repository for training and usage details.
Training details
- Base model:
meta-llama/Llama-3.1-8B-Instruct - Training examples: 11,185
- Learning rate:
7e-6 - Epochs: 1
- Per-device batch size: 1
- Number of devices: 8
- Effective batch size: 8
- Scheduler: cosine with a 0.1 warmup ratio
- Precision: bfloat16
- Transformers: 4.44.2
- PyTorch: 2.4.1+cu121
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "voidism/SelfCite-8B-CC-SFT"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
Citation
Please cite SelfCite and LongCite if they are helpful to your work.
@inproceedings{chuang2025selfcite,
title={SelfCite: Self-Supervised Alignment for Context Attribution in Large Language Models},
author={Yung-Sung Chuang and Benjamin Cohen-Wang and Shannon Zejiang Shen and Zhaofeng Wu and Hu Xu and Xi Victoria Lin and James Glass and Shang-Wen Li and Wen-tau Yih},
journal={arXiv preprint arXiv:2502.09604},
year={2025}
}
@article{zhang2024longcite,
title={LongCite: Enabling LLMs to Generate Fine-grained Citations in Long-context QA},
author={Jiajie Zhang and Yushi Bai and Xin Lv and Wanjun Gu and Danqing Liu and Minhao Zou and Shulin Cao and Lei Hou and Yuxiao Dong and Ling Feng and Juanzi Li},
journal={arXiv preprint arXiv:2409.02897},
year={2024}
}
- Downloads last month
- 315
