PyTorch
nli
roberta
energy-based-model
laser-edit

LaSEr Edit β€” NLI Energy Model

RoBERTa-large energy checkpoint used by LaSEr Edit for contradiction avoidance (NLI) locate and EBM edit.

This is not a standard transformers from_pretrained folder. LaSEr Edit loads it via EncoderModel + torch.load("best_model_pearsonr.pth").

License

Released under CC BY-NC 4.0 (attribution, non-commercial).

Upstream components (for attribution / awareness):

Usage (LaSEr Edit)

Download the checkpoint, then load it with EncoderModel (not transformers.from_pretrained):

huggingface-cli download hayleyson/laser-edit-nli-energy --local-dir ./laser-edit-nli-energy
import json
import torch
from laser_edit.ebm_training.nli.models.encoder import EncoderModel

model_dir = "./laser-edit-nli-energy"
device = "cuda" if torch.cuda.is_available() else "cpu"

with open(f"{model_dir}/config.json") as f:
    model_config = json.load(f)
model_config["device"] = device
model_config["model_path"] = f"{model_dir}/best_model_pearsonr.pth"
# optional locate mode used by LaSEr Edit: "gradnorm" or "attention"
model_config["locate"]["type"] = "gradnorm"

model = EncoderModel(params=model_config)
model.load_state_dict(
    torch.load(model_config["model_path"], weights_only=True),
    strict=False,
)
model.eval()
model.to(device)
tokenizer = model.tokenizer

Required files:

  • best_model_pearsonr.pth β€” trained energy network state dict
  • config.json β€” LaSEr Edit EncoderModel config (energynet.base_model: roberta-large)
  • classification_threshold.json β€” optional decision threshold file determined by optimizing a classification performance metric (e.g., precision, F1, recall) on the validation dataset; not used in the LaSEr-Edit paper

For training details, please refer to the LaSEr-Edit paper: LaSEr-Edit: Localized Span-level Error Editing with Energy-based Localization.

Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for hayleyson/laser-edit-nli-energy

Finetuned
(483)
this model

Datasets used to train hayleyson/laser-edit-nli-energy

Paper for hayleyson/laser-edit-nli-energy