Efficient Few-Shot Learning Without Prompts
Paper • 2209.11055 • Published • 7
How to use fefofico/crisis_trained_f2llm_5ep_1e-5_5e-3 with setfit:
from setfit import SetFitModel
model = SetFitModel.from_pretrained("fefofico/crisis_trained_f2llm_5ep_1e-5_5e-3")How to use fefofico/crisis_trained_f2llm_5ep_1e-5_5e-3 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("fefofico/crisis_trained_f2llm_5ep_1e-5_5e-3")
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]This is a SetFit model that can be used for Text Classification. This SetFit model uses codefuse-ai/F2LLM-v2-80M 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:
| Label | Examples |
|---|---|
| positive |
|
| negative |
|
| Label | F1_Macro | F1_Binary |
|---|---|---|
| all | 0.9345 | 0.9273 |
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("fefofico/crisis_trained_f2llm_5ep_1e-5_5e-3")
# Run inference
preds = model("Emergency meetings are being held, but solutions remain elusive as the crisis deepens.")
| Training set | Min | Median | Max |
|---|---|---|---|
| Word count | 3 | 15.7035 | 56 |
| Label | Training Sample Count |
|---|---|
| negative | 808 |
| positive | 676 |
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0043 | 1 | 0.3918 | - |
| 0.0862 | 20 | 0.3979 | - |
| 0.1724 | 40 | 0.3983 | - |
| 0.2586 | 60 | 0.3653 | - |
| 0.3448 | 80 | 0.344 | - |
| 0.4310 | 100 | 0.3002 | - |
| 0.5172 | 120 | 0.2741 | - |
| 0.6034 | 140 | 0.2519 | - |
| 0.6897 | 160 | 0.2428 | - |
| 0.7759 | 180 | 0.2342 | - |
| 0.8621 | 200 | 0.2227 | - |
| 0.9483 | 220 | 0.1991 | - |
| 1.0 | 232 | - | 0.1802 |
| 1.0345 | 240 | 0.1653 | - |
| 1.1207 | 260 | 0.1322 | - |
| 1.2069 | 280 | 0.1038 | - |
| 1.2931 | 300 | 0.0778 | - |
| 1.3793 | 320 | 0.0593 | - |
| 1.4655 | 340 | 0.0426 | - |
| 1.5517 | 360 | 0.0269 | - |
| 1.6379 | 380 | 0.0194 | - |
| 1.7241 | 400 | 0.0125 | - |
| 1.8103 | 420 | 0.0107 | - |
| 1.8966 | 440 | 0.0097 | - |
| 1.9828 | 460 | 0.0067 | - |
| 2.0 | 464 | - | 0.0954 |
| 2.0690 | 480 | 0.006 | - |
| 2.1552 | 500 | 0.0047 | - |
| 2.2414 | 520 | 0.0051 | - |
| 2.3276 | 540 | 0.0052 | - |
| 2.4138 | 560 | 0.0035 | - |
| 2.5 | 580 | 0.003 | - |
| 2.5862 | 600 | 0.004 | - |
| 2.6724 | 620 | 0.0035 | - |
| 2.7586 | 640 | 0.0032 | - |
| 2.8448 | 660 | 0.0031 | - |
| 2.9310 | 680 | 0.0037 | - |
| 3.0 | 696 | - | 0.0972 |
| 3.0172 | 700 | 0.0027 | - |
| 3.1034 | 720 | 0.0032 | - |
| 3.1897 | 740 | 0.0033 | - |
| 3.2759 | 760 | 0.0022 | - |
| 3.3621 | 780 | 0.0022 | - |
| 3.4483 | 800 | 0.0028 | - |
| 3.5345 | 820 | 0.0017 | - |
| 3.6207 | 840 | 0.0017 | - |
| 3.7069 | 860 | 0.0023 | - |
| 3.7931 | 880 | 0.0023 | - |
| 3.8793 | 900 | 0.0024 | - |
| 3.9655 | 920 | 0.003 | - |
| 4.0 | 928 | - | 0.0982 |
| 4.0517 | 940 | 0.0031 | - |
| 4.1379 | 960 | 0.0022 | - |
| 4.2241 | 980 | 0.0019 | - |
| 4.3103 | 1000 | 0.0016 | - |
| 4.3966 | 1020 | 0.002 | - |
| 4.4828 | 1040 | 0.0019 | - |
| 4.5690 | 1060 | 0.0028 | - |
| 4.6552 | 1080 | 0.0019 | - |
| 4.7414 | 1100 | 0.0024 | - |
| 4.8276 | 1120 | 0.0022 | - |
| 4.9138 | 1140 | 0.0021 | - |
| 5.0 | 1160 | 0.0026 | 0.0990 |
@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}
}
Base model
Qwen/Qwen3-0.6B-Base