Instructions to use Affectosphere-Group/Affeline-1-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Affectosphere-Group/Affeline-1-8B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Affeline-1-8B
Affeline is a text-emotion foundation model: a single set of weights that solves 15 heterogeneous affective tasks — discrete-emotion classification, dimensional (VAD) regression, intensity regression, interpersonal judgments (irony, hate speech, stance), an aspect-level applied task, and multilingual emotion detection — in English, Japanese, and multilingual data.
This is Affeline-1-8B, the first release. The series is versioned (Affeline-1,
Affeline-2, …) and sized (-8B).
Weights only. No training text is distributed with this model (see License & data). Research / non-commercial use only (CC BY-NC 4.0). Not a diagnostic tool. Do not use for clinical, psychiatric, or any individual-level consequential decision.
Architecture
- Backbone:
Qwen/Qwen3-8B-Base, frozen. - Adapter: LoRA (
r=32,alpha=64) on all seven linear projections (q,k,v,o,gate,up,down); 88.7 M trainable parameters (~334 MB). - Late-Read input format:
[txt: <body>] <ch> labels: <names> </ch> [READ]. The channel (label schema) is placed after the body, so under causal masking the body's hidden states are provably independent of the channel; the final[READ]state attends to both and is task-schema conditioned. - Multi-depth readout: the
[READ]hidden state is concatenated from layers{-1, -9, -17}(dim 12288), with a trained[READ]embedding delta. - Heads: one linear head per task on top of the shared representation.
How to use
The inference package (affeline/) ships inside this repo. Download the repo and put it
on your path, then load the weights:
from huggingface_hub import snapshot_download
import sys
repo = snapshot_download("Affectosphere-Group/Affeline-1-8B")
sys.path.insert(0, repo) # make the bundled `affeline` package importable
from affeline import Affeline
model = Affeline.from_pretrained(repo, device="cuda") # base Qwen3-8B-Base is fetched automatically
out = model.predict("I'm so grateful for today!", task="M01_GoEmotions")
print(out.top_labels) # e.g. ['gratitude', 'joy']
out = model.predict("What a terrible, infuriating day.", task="M06_TweetEval_Emotion")
print(out.top_labels) # e.g. ['anger']
Provide task=<task_id> (or its public name). Open-label zero-shot for an arbitrary
unseen label set is not a capability of this checkpoint (see the paper's future work).
Requirements: torch, transformers, peft, safetensors, huggingface_hub; a GPU is
recommended for the 8B backbone.
Results
A single Affeline model is compared against an entire suite of same-capacity specialists — the identical Qwen3-8B-Base LoRA-adapted to each task alone (one dedicated 8B model per task, the strongest fair upper bound). On a normalized aggregate score (per task: floor = constant-predictor baseline, ceiling = best model), the one shared model
- retains 99.4 % of the whole specialist suite's score (0.959 vs. 0.964),
- stays within a 0.05 normalized margin on 11 of 15 tasks (and within 0.08 on 14/15),
- is strictly better on 7 of 15 —
while replacing 15 separate specialists with one 334 MB adapter, and adding a representation that transfers to unseen tasks (see below) — something no specialist provides.
Per-task scores (test set, mean ± SD over 3 seeds)
Higher is better except EmoBank (MAE, ↓). Boldface marks the better of the two per row; the specialist column is a per-task upper bound (a dedicated 8B model trained for that task alone).
| Task | Metric | Affeline (ours) | Specialist (8B) |
|---|---|---|---|
| GoEmotions | macro-F1 | 0.511 ± 0.006 | 0.546 |
| WRIME-reader | Pearson r | 0.660 ± 0.007 | 0.689 |
| WRIME-writer | Pearson r | 0.513 ± 0.006 | 0.533 |
| SemEval-2025 Track A | macro-F1 | 0.784 ± 0.005 | 0.779 |
| SemEval-2025 Track B (intensity) | Pearson r | 0.781 ± 0.004 | 0.824 |
| MELD | weighted-F1 | 0.660 ± 0.003 | 0.662 |
| TweetEval-Emotion | macro-F1 | 0.823 ± 0.004 | 0.819 |
| EI-reg | Pearson r | 0.741 ± 0.004 | 0.793 |
| EmoBank (VAD) | MAE ↓ | 0.168 ± 0.003 | 0.155 |
| ABSA Restaurant | accuracy | 0.897 ± 0.012 | 0.870 |
| Irony | macro-F1 | 0.833 ± 0.011 | 0.640 |
| HateXplain | macro-F1 | 0.683 ± 0.007 | 0.679 |
| EmpatheticDialogues | accuracy | 0.350 ± 0.006 | 0.352 |
| FinancialPhraseBank | macro-F1 | 0.983 ± 0.008 | 0.978 |
| Stance (5 topics) | F (favor/against) | 0.802 ± 0.008 | 0.768 |
Where the single model trails, the gap is small and concentrated on a few high-resource tasks (EI-reg, Track B intensity) — exactly where a task-dedicated model is expected to win. On the low-resource tasks the shared model leads (Stance +0.03, ABSA +0.03, Financial +0.005; the large irony margin partly reflects unstable specialist training on that task). Per-seed stability is high — the largest per-task seed SD is 0.012. A 560M XLM-RoBERTa fine-tuned per task is reported in the paper as an external reference.
Transfer to unseen tasks — the foundation-model property
The headline property is reusability. With Affeline retrained on 12 tasks and three held out entirely, a linear head on the frozen Affeline representation far exceeds the same probe on the plain Qwen3-8B-Base representation and approaches a task-dedicated specialist:
| Held-out task | Metric | 1 % of labels | 100 % of labels |
|---|---|---|---|
| TweetEval-Emotion | macro-F1 | 0.683 vs. 0.209 (base) | 0.815 vs. 0.463 (base) |
A single frozen representation that a linear probe turns into a strong model for a task it never saw is precisely what distinguishes a foundation model from a bag of specialists.
Limitations
- Not for clinical / diagnostic use or any individual-level consequential decision.
- Hate-speech / toxicity heads over-flag. HateXplain macro-F1 is 0.68; benign text can be misclassified. Do not deploy as a moderation oracle.
- GoEmotions (28-class multi-label), MELD (conversational), and EmpatheticDialogues (32-way) are the hardest tasks and are below specialist/published bests.
- English-centric overall; Japanese is covered only by the two WRIME tasks.
- Emotion labels encode a perspective rather than a single ground truth; error rises on sentences where annotators disagree.
License & data
- Model weights: CC BY-NC 4.0 (research / non-commercial). The most restrictive training-data license (WRIME v2, non-commercial) is inherited.
- No training text is included. Tasks derived from X/Twitter (TweetEval, EI-reg,
irony, stance) ship no text; WRIME and MELD text are not redistributed. Only adapter
weights, task heads, the
[READ]delta, and inference code are released. - Reconstruct any dataset from its original source; recorded body-text hashes allow a later check of identity.
Citation
A paper describing Affeline is under review; citation is provisional.
@misc{affeline2026,
title = {Affeline: A Late-Read Foundation Model for Transferable Text Emotion Understanding},
note = {Under review; model at Hugging Face},
year = {2026}
}
- Downloads last month
- -
Model tree for Affectosphere-Group/Affeline-1-8B
Base model
Qwen/Qwen3-8B-Base