Instructions to use artefactory/BERTJudge-Free-CR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use artefactory/BERTJudge-Free-CR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="artefactory/BERTJudge-Free-CR", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("artefactory/BERTJudge-Free-CR", trust_remote_code=True) model = AutoModelForSequenceClassification.from_pretrained("artefactory/BERTJudge-Free-CR", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- EuroBERT/EuroBERT-210m
|
| 4 |
+
datasets:
|
| 5 |
+
- hgissbkh/BERTJudge-Dataset
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
library_name: transformers
|
| 9 |
+
pipeline_tag: text-classification
|
| 10 |
+
---
|
| 11 |
+
# BERTJudge-Free-CR
|
| 12 |
+
|
| 13 |
+
BERT-as-a-Judge is a family of encoder-based models designed for efficient, reference-based evaluation of LLM outputs. Moving beyond rigid lexical extraction and matching, these models evaluate semantic correctness, accommodating variations in phrasing and formatting while using only a fraction of the computational resources required by LLM-as-a-Judge approaches.
|
| 14 |
+
|
| 15 |
+
## Model Summary
|
| 16 |
+
- **Paper:** [BERT-as-a-Judge: A Robust Alternative to Lexical Methods for Efficient Reference-Based LLM Evaluation](https://huggingface.co/papers/2604.09497)
|
| 17 |
+
- **Code:** [https://github.com/artefactory/BERT-as-a-Judge](https://github.com/artefactory/BERT-as-a-Judge)
|
| 18 |
+
- **Model Type:** Encoder-based Judge (EuroBERT-210m backbone)
|
| 19 |
+
- **Language:** English
|
| 20 |
+
|
| 21 |
+
## Intended Use
|
| 22 |
+
|
| 23 |
+
BERTJudge models are designed as sequence classifiers that output a sigmoid score reflecting answer correctness. For inference, we suggest using the [BERT-as-a-Judge](https://github.com/artefactory/BERT-as-a-Judge) package.
|
| 24 |
+
|
| 25 |
+
### Installation
|
| 26 |
+
|
| 27 |
+
```zsh
|
| 28 |
+
git clone https://github.com/artefactory/BERT-as-a-Judge.git
|
| 29 |
+
cd BERT-as-a-Judge
|
| 30 |
+
pip install -e .
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
### Usage
|
| 34 |
+
|
| 35 |
+
Example:
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
from bert_judge.judges import BERTJudge
|
| 39 |
+
|
| 40 |
+
# 1) Initialize the judge
|
| 41 |
+
judge = BERTJudge(
|
| 42 |
+
model_path="artefactory/BERTJudge",
|
| 43 |
+
trust_remote_code=True,
|
| 44 |
+
dtype="bfloat16",
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
# 2) Define one question, one reference, and several candidate answers
|
| 48 |
+
question = "What is the capital of France?"
|
| 49 |
+
reference = "Paris"
|
| 50 |
+
candidates = [
|
| 51 |
+
"Paris.",
|
| 52 |
+
"The capital of France is Paris.",
|
| 53 |
+
"I'm hesitating between Paris and London. I would say Paris.",
|
| 54 |
+
"London.",
|
| 55 |
+
"The capital of France is London.",
|
| 56 |
+
"I'm hesitating between Paris and London. I would say London.",
|
| 57 |
+
]
|
| 58 |
+
|
| 59 |
+
# 3) Predict scores (one score per candidate)
|
| 60 |
+
scores = judge.predict(
|
| 61 |
+
questions=[question] * len(candidates),
|
| 62 |
+
references=[reference] * len(candidates),
|
| 63 |
+
candidates=candidates,
|
| 64 |
+
batch_size=1,
|
| 65 |
+
)
|
| 66 |
+
|
| 67 |
+
print(scores)
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## Naming Convention Breakdown
|
| 71 |
+
|
| 72 |
+
Models follow a standardized naming structure: `BERTJudge-<Candidate_Format>-<Input_Structure>-<Additional_Info>`.
|
| 73 |
+
|
| 74 |
+
* **Candidate Format:**
|
| 75 |
+
* `Free`: Trained on unconstrained model generations.
|
| 76 |
+
* `Formatted`: Trained on outputs that adhere to specific structural constraints. For optimized evaluation under the formatted setup, candidate outputs should ideally conclude with `"Final answer: <final_answer>"` (see the paper for details).
|
| 77 |
+
* **Input Structure:**
|
| 78 |
+
* `QCR`: The input sequence consists of [Question, Candidate, Reference].
|
| 79 |
+
* `CR`: The input sequence consists only of [Candidate, Reference].
|
| 80 |
+
* **Additional Info:**
|
| 81 |
+
* `OOD`: Indicates evaluation of Out-of-Distribution performance (where specific generative models were withheld during training).
|
| 82 |
+
* `100k/200k/500k`: Denotes the total training steps (default regime being 1 million).
|
| 83 |
+
|
| 84 |
+
**Note: For optimal evaluation performance, we recommend using `BERTJudge-Free-QCR`, available as `artefactory/BERTJudge`.**
|
| 85 |
+
|
| 86 |
+
## Citation
|
| 87 |
+
|
| 88 |
+
If you find this model useful for your research, please consider citing:
|
| 89 |
+
|
| 90 |
+
```
|
| 91 |
+
@article{gisserotboukhlef2026bertasajudgerobustalternativelexical,
|
| 92 |
+
title={BERT-as-a-Judge: A Robust Alternative to Lexical Methods for Efficient Reference-Based LLM Evaluation},
|
| 93 |
+
author={Gisserot-Boukhlef, Hippolyte and Boizard, Nicolas and Malherbe, Emmanuel and Hudelot, C{\'e}line and Colombo, Pierre},
|
| 94 |
+
year={2026},
|
| 95 |
+
eprint={2604.09497},
|
| 96 |
+
archivePrefix={arXiv},
|
| 97 |
+
primaryClass={cs.CL},
|
| 98 |
+
url={https://arxiv.org/abs/2604.09497}
|
| 99 |
+
}
|
| 100 |
+
```
|