Reward model spanish_without_ties
A pairwise reward model for jokes: given a news item and two candidate jokes, it scores each so that the one humans preferred gets the higher reward. Trained for a thesis on humour generation with reinforcement learning; code and experiment logs live in the thesis repository under reward-model/.
- Experiment tag:
spanish_without_ties - Variant:
RewardModelWithoutTies(Bradley-Terry over strict preferences; tied pairs were dropped) - Base model:
dccuchile/bert-base-spanish-wwm-cased - Language:
spanish
What is in this repo
| Folder | Contents |
|---|---|
best_trial/ |
The single-seed model of the best Optuna trial, chosen by its mean score over the cross-validation folds of the train split. The weights are those of its last fold model, trained on the other folds. Replaced every time a trial beats the previous best, so earlier bests are in the commit history. |
ensemble/ |
The final model: the winning configuration retrained on the whole train split once per seed, with rewards averaged across members. Use this one. |
Best trial (best_trial/)
- Trial number: 81
- Cross-validated objective: 0.7054
| Hyperparameter | Value |
|---|---|
batch_size |
128 |
dropout |
0.1557 |
encoder_learning_rate |
3.491e-05 |
epochs |
5 |
freeze_strategy |
last_6 |
head_learning_rate |
6.95e-05 |
layer_lr_decay |
0.9507 |
max_length |
256 |
micro_batch_size |
None |
model_name |
dccuchile/bert-base-spanish-wwm-cased |
scheduler_type |
cosine |
warmup_ratio |
0.001637 |
weight_decay |
0 |
Final ensemble (ensemble/)
- Members: 3
- Seeds: 42, 43, 44
Test-set metrics
| model | non_tied_preference_accuracy |
eval_loss |
mean_margin |
|---|---|---|---|
RewardModelWithoutTies_seed_42 |
0.6813 | 0.6491 | 0.7449 |
RewardModelWithoutTies_seed_43 |
0.6562 | 0.6899 | 0.7831 |
RewardModelWithoutTies_seed_44 |
0.6782 | 0.6605 | 0.7678 |
seeds_mean |
0.6719 | 0.6665 | 0.7653 |
seeds_std |
0.01119 | 0.01716 | 0.01571 |
RewardModelWithoutTies_ensemble |
0.6677 | 0.6561 | 0.7653 |
Training data
- train: 1408 pairs
- test: 954 pairs
- Split seed: 42
- Ties kept: no
- Source CSV sha256:
68a17263085470cbd7d76413d2bcfe5f0d82b95ef801d1372152e30c40212a97
How to load
The weights are a standard transformers sequence-classification checkpoint plus a small wrapper config, so load them through the thesis code, which restores the wrapper (max length, tie threshold, ...) exactly as it was trained:
git clone https://github.com/carlos-musetti/tesis
cd tesis/reward-model && uv sync
import sys; sys.path.insert(0, 'code')
from hub_upload import load_ensemble_from_hub, load_best_trial_from_hub
model = load_ensemble_from_hub('spanish_without_ties') # the final model
trial = load_best_trial_from_hub('spanish_without_ties') # the best single trial
reward = model.score(news_text, joke_text)
Set HF_HUB_NAMESPACE to the user or organisation that owns this repo if it is not your own account.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for cbmusetti/reward-model-spanish_without_ties
Base model
dccuchile/bert-base-spanish-wwm-cased