Libra-Guard is a safeguard model for Chinese large language models (LLMs). Libra-Guard adopts a two-stage progressive training process: first, it uses scalable synthetic samples for pretraining, then employs high-quality real-world data for fine-tuning, thus maximizing data utilization while reducing reliance on manual annotation. Experiments show that Libra-Guard significantly outperforms similar open-source models (such as ShieldLM) on Libra-Test and is close to advanced commercial models (such as GPT-4o) in multiple tasks, providing stronger support and evaluation tools for Chinese LLM safety governance.
Meanwhile, we have developed the Libra-Guard series of models in different parameter scales based on multiple open-source models. This repository is dedicated to Libra-Guard-Qwen2.5-3B-Instruct.
To run Libra-Guard-Qwen2.5-3B-Instruct, please make sure you meet the above requirements and then execute the following pip commands to install the dependent libraries.
In the multi-scenario evaluation on Libra-Test, the Libra-Guard series outperforms similar open-source models such as ShieldLM, and is on par with advanced commercial models like GPT-4o in multiple tasks. The table below shows a comparison of Libra-Guard-Qwen2.5-3B-Instruct on some key metrics:
Below is a brief example showing how to use Libra-Guard-Qwen2.5-3B-Instruct for inference in order to conduct safety checks or generate responses based on input text.
If you use this project in academic or research scenarios, please cite the following references:
bibtex
1@misc{libra,
2 title = {Libra: Large Chinese-based Safeguard for AI Content},
3 url = {https://github.com/caskcsg/Libra/},
4 author= {Li, Ziyang and Yu, Huimu and Wu, Xing and Lin, Yuxuan and Liu, Dingqin and Hu, Songlin},
5 month = {January},
6 year = {2025}
7}