Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# Weaver Distilled - MMLU Pro (ModernBERT-large)
|
| 3 |
+
|
| 4 |
+
This is a distilled cross-encoder model based on ModernBERT-large, trained to predict the correctness of answers across multiple domains. This general-purpose verifier was trained on a combined dataset of 35 different verifiers and reward models aggregated using Weaver.
|
| 5 |
+
|
| 6 |
+
## Model Details
|
| 7 |
+
|
| 8 |
+
- **Base Model**: [answerdotai/ModernBERT-large](https://huggingface.co/answerdotai/ModernBERT-large)
|
| 9 |
+
- **Architecture**: Cross-encoder with MLP head (1024 → 512 → 256 → 1)
|
| 10 |
+
- **Max Sequence Length**: 4096
|
| 11 |
+
- **Training Data**: Combined dataset from 35 different LM Judges and reward models aggregated with Weaver
|
| 12 |
+
- **Training Objective**: Binary classification (correct/incorrect answer prediction)
|
| 13 |
+
|
| 14 |
+
## Usage
|
| 15 |
+
|
| 16 |
+
```python
|
| 17 |
+
from custom_crossencoder import CustomCrossEncoder, TrainingConfig
|
| 18 |
+
|
| 19 |
+
# Initialize model
|
| 20 |
+
config = TrainingConfig(
|
| 21 |
+
model_name="answerdotai/ModernBERT-large",
|
| 22 |
+
max_length=4096,
|
| 23 |
+
mlp_hidden_dims=[1024, 512, 256]
|
| 24 |
+
)
|
| 25 |
+
model = CustomCrossEncoder(config)
|
| 26 |
+
|
| 27 |
+
# Load checkpoint
|
| 28 |
+
model.load_state_dict(torch.load("hazyresearch/Weaver_Distilled_ModernBERT_Large_for_MMLU-Pro"))
|
| 29 |
+
model.eval()
|
| 30 |
+
|
| 31 |
+
# Get prediction
|
| 32 |
+
instruction = "Your instruction here"
|
| 33 |
+
answer = "Your answer here"
|
| 34 |
+
encoded = model.tokenizer(
|
| 35 |
+
text=instruction,
|
| 36 |
+
text_pair=answer,
|
| 37 |
+
truncation=True,
|
| 38 |
+
max_length=4096,
|
| 39 |
+
padding="max_length",
|
| 40 |
+
return_tensors="pt"
|
| 41 |
+
)
|
| 42 |
+
with torch.no_grad():
|
| 43 |
+
prediction = model(encoded["input_ids"], encoded["attention_mask"])
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Running Evaluation
|
| 47 |
+
|
| 48 |
+
TODO: ADD EVALUATION_SIMPLE COMMAND HERE
|
| 49 |
+
|
| 50 |
+
## License
|
| 51 |
+
|
| 52 |
+
[Your chosen license]
|
| 53 |
+
|
| 54 |
+
## Citation
|
| 55 |
+
|
| 56 |
+
If you use this model in your research, please cite:
|
| 57 |
+
|
| 58 |
+
```bibtex
|
| 59 |
+
TODO
|
| 60 |
+
```
|