SetFit with basel/ATTACK-BERT

This is a SetFit model that can be used for Text Classification. This SetFit model uses basel/ATTACK-BERT as the Sentence Transformer embedding model. A LogisticRegression instance is used for classification.

The model has been trained using an efficient few-shot learning technique that involves:

  1. Fine-tuning a Sentence Transformer with contrastive learning.
  2. Training a classification head with features from the fine-tuned Sentence Transformer.

Model Details

Model Description

  • Model Type: SetFit
  • Sentence Transformer body: basel/ATTACK-BERT
  • Classification head: a LogisticRegression instance
  • Maximum Sequence Length: 384 tokens
  • Number of Classes: 2 classes

Model Sources

Model Labels

Label Examples
negative
  • 'ANSI X9.31 Appendix A.2.4 PRNG key AES 128-bit key Internally generated Never exits the module Plaintext in volatile memory Rebooting the modules Seeding the FIPS-Approved ANSI X9.31 PRNG'
  • 'PRNG seed key Continually polled from various system resources to accrue entropy.'
  • 'module stores RNG and DRBG state values only in RAM.'
positive
  • "The PRNG's seed key is encrypted with a device-specific key and securely stored in non-volatile memory."
  • 'An RNG key compliant with ANSI X9.31 AES 128-bit standards is used by the underlying encryption algorithm and stored in plaintext within tamper-protected memory during factory setup.'
  • 'The PRNG seed key is pre-loaded during manufacturing and compiled directly into the binary code.'

Uses

Direct Use for Inference

First install the SetFit library:

pip install setfit

Then you can load this model and run inference.

from setfit import SetFitModel

# Download from the 🤗 Hub
model = SetFitModel.from_pretrained("yasirdemircan/setfit_rng_v3")
# Run inference
preds = model("The private key component of an ANSI X9.31-compliant PRNG is stored securely in NVRAM.")

Training Details

Training Set Metrics

Training set Min Median Max
Word count 6 18.8444 59
Label Training Sample Count
negative 21
positive 24

Training Hyperparameters

  • batch_size: (16, 16)
  • num_epochs: (4, 4)
  • max_steps: -1
  • sampling_strategy: oversampling
  • body_learning_rate: (2e-05, 1e-05)
  • head_learning_rate: 0.01
  • loss: CosineSimilarityLoss
  • distance_metric: cosine_distance
  • margin: 0.25
  • end_to_end: False
  • use_amp: False
  • warmup_proportion: 0.1
  • l2_weight: 0.01
  • seed: 42
  • eval_max_steps: -1
  • load_best_model_at_end: True

Training Results

Epoch Step Training Loss Validation Loss
0.0149 1 0.2442 -
0.7463 50 0.1714 -
1.0 67 - 0.1785
1.4925 100 0.0029 -
2.0 134 - 0.1880
2.2388 150 0.0004 -
2.9851 200 0.0003 -
3.0 201 - 0.1818
3.7313 250 0.0003 -
4.0 268 - 0.1837

Framework Versions

  • Python: 3.10.15
  • SetFit: 1.2.0.dev0
  • Sentence Transformers: 3.3.1
  • Transformers: 4.45.2
  • PyTorch: 2.5.1+cu124
  • Datasets: 2.19.1
  • Tokenizers: 0.20.1

Citation

BibTeX

@article{https://doi.org/10.48550/arxiv.2209.11055,
    doi = {10.48550/ARXIV.2209.11055},
    url = {https://arxiv.org/abs/2209.11055},
    author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
    keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
    title = {Efficient Few-Shot Learning Without Prompts},
    publisher = {arXiv},
    year = {2022},
    copyright = {Creative Commons Attribution 4.0 International}
}
Downloads last month
1
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.

Model tree for yasirdemircan/setfit_rng_v3

Base model

basel/ATTACK-BERT
Finetuned
(1)
this model