An encoder that reads one roleplay (RP) reply and its previous post and returns which simulation events happen in the reply, where (character spans), and how strong (damage severity, food fullness). One forward pass, no generation.
Status: experimental. One test (T60) of the PsyCet project (team rpDungeon). The goal is extracting structured state/events from RP text for downstream tools; this model is a step towards that, not a finished component.
Input: [CLS] previous post (last 1,500 chars) [SEP] reply [SEP]. Events are extracted from the reply only.
| Event type | Span marks | Value |
|---|---|---|
moved |
the place reached (or left) | - |
clothing_off |
the piece of clothing or accessory | - |
clothing_on |
the piece of clothing or accessory | - |
damage |
the injury or the hurt body part | severity 0-100 (1 = scratch, 50 = serious wound, 100 = deadly) |
ate |
the food or drink | fullness 0-100 (5 = a sip or bite, 50 = a normal meal, 100 = stuffed) |
Only events that actually happen count (not plans, wishes, memories or hypotheticals). Small moves within one place are
not moved.
Three heads on one pass of the encoder:
damage and ate, read at the first token of a span.from huggingface_hub import snapshot_download
import sys
path = snapshot_download("rpDungeon/experimental-rp-event-extractor-ultrabert-380m")
sys.path.insert(0, path)
from extract import extract, load
tok, model = load(path)
print(extract(tok, model, previous_post, reply))
# {"types": {"moved": 0.01, ..., "ate": 0.97}, "events": [{"type": "ate", "start": 43, "end": 47, "value": 19.2}, ...]}
start/end are character offsets into the reply. types and events come from different heads and can disagree;
types is the more reliable output (see Results). The base model uses remote code (trust_remote_code=True); its
configuration_ultrabert.py and modeling_ultrabert.py are included. model.safetensors holds the fp32 weights of the
whole module (enc.* = encoder, types.*, bio.*, value.* = heads); label_map.json holds the order of types,
valued types and BIO tags.
moved 3,028, clothing_off 217, clothing_on 258, damage 811,
ate 1,191; 6,099 replies without events.Full fine-tune of dmis-lab/UltraBERT-380M (commit 671a38c).
Loss = BCE (types) + cross-entropy (BIO) + MSE (values). AdamW, lr 1e-5, weight decay .01, 6% linear warm-up,
gradient clip 1.0, batch 16, 20 epochs, bf16 autocast. The released weights are the best epoch by validation (type
macro F1 + span micro F1), epoch 14 of 20. 2.7 h on one RTX 3090, 7.1 GB peak VRAM.
Test split (1,095 replies), compared with the same recipe on ModernBERT-large (lr 5e-5, the earlier extractor). F1 against the GLM-4.7 labels; span F1 is token-level overlap on reply tokens.
| Metric | ModernBERT-large (395M) | UltraBERT-380M (this model) |
|---|---|---|
| Event type macro F1 | .707 | .746 |
| Event type micro F1 | .811 | .838 |
| Span micro F1 | .537 | .577 |
| Span macro F1 | .390 | .429 |
| Value MAE damage / ate (0-100) | 11.5 / 4.4 | 10.7 / 5.2 |
| Throughput (items/s, RTX 3090, bf16) | 108.5 | 116 |
Per type (type F1 / span F1, test support in replies):
| Type | Support | ModernBERT-large | UltraBERT-380M |
|---|---|---|---|
moved |
276 | .836 / .571 | .847 / .617 |
clothing_off |
16 | .571 / .392 | .571 / .355 |
clothing_on |
27 | .524 / .076 | .605 / .208 |
damage |
84 | .707 / .262 | .783 / .281 |
ate |
128 | .897 / .648 | .923 / .683 |
UltraBERT is +.04 better on both main metrics and 1.07x faster, so it replaced ModernBERT-large as our extractor. The released safetensors reproduce these test numbers on CPU in fp32 (type macro .745, span micro .576).
All runs that led to this model. Test ids (T3, T60, ...) are our internal test numbers. All results are experimental and measure agreement with GLM-4.7 labels. Speeds are batched inference on one RTX 3090 (bf16); VRAM is peak training memory.
Setups differ between rows, so compare within a row or between rows with the same test set:
| Test | Question | Setup | Type macro F1 | Span micro F1 | Cost | Verdict |
|---|---|---|---|---|---|---|
| T3 | Can a ~400M encoder extract events without generation? | ModernBERT-large (395M), full fine-tune, 3k labels, 20 epochs | .56 (micro .78) | .47 | 104 items/s; 42 min, 7.4 GB | Yes for common types (ate .90, moved .80); rare types and spans limited by data |
| T13 | Which encoder size? | ModernBERT-base 150M / ModernBERT-large 395M / Ettin-encoder-1B 1,028M; 3k labels, 3-5 epochs | .24 / .19 / .73 | 0 / 0 / .42 | 2.9 / 7.4 / 19.2 GB; 1B is 2x slower than large | With little data and few epochs only the 1B learned events: it is more sample-efficient |
| T14 | Which fine-tuning method? | ModernBERT-large, 3k labels, 3 epochs: full / LoRA (7.2M trainable) / frozen encoder + heads | .19 / .33 / .07 | 0 / .03 / .12 | 7.4 / 3.6 / 1.9 GB | LoRA best on this short schedule; a frozen encoder does not work. Later runs use full fine-tuning with more epochs |
| T15 | Is a zero-shot extractor enough? | GLiNER2-large, no training, event types as entity labels; 3k test split | .32-.36 | .20 | 0.22 items/s (CPU) | No: far below the fine-tuned T3 model (.56 / .47) on the same replies; labels are needed |
| T30 | Do 4x more labels fix rare types and spans? | ModernBERT-large, 11k labels, 20 epochs, lr 5e-5 | .70 (micro .82) | .54 | 107 items/s; 2.7 h, 7.4 GB | Yes, mostly: damage .54 → .77, clothing_off 0 → .48; clothing still data-limited. A retrain gave .707 / .537 (the baseline in Results) |
| T38 | Does a 1B extractor beat ModernBERT-large with 11k labels? | Ettin-encoder-1B (1,028M), 11k labels (other split), 8 epochs, lr 2e-5 | .71 (micro .83) | .58 | 51 items/s; 2.9 h, 19.2 GB | No: equal on types, +.04 on spans, at half the speed and 2.6x the VRAM |
| T42 | Can the shared tracker replace the dedicated extractor? | Shared ModernBERT-large tracker, reply only, 11k event labels | .64 (micro .82) | .41 | 88 items/s for all nine stats; 34 min, 13.0 GB | No: −.06 type macro vs the extractor (.70), the gap is in the rare types. With 3k event labels the shared model had .42 |
| T45 | Does the previous post close that gap? | As T42, input previous post + reply | .47 (micro .78) | .37 | 54 items/s; 59 min, 13.0 GB | No, worse. The extractor's lead comes from being a dedicated model, not from its input |
| T58 | Which backbone for the shared tracker? | ModernBERT-large 395M / Ettin-encoder-1B 1,028M / UltraBERT-380M 378M / NeoMME-800M 794M; same recipe | .42 / .52 / .52 / .39 | .45 / .43 / .47 / .37 | 88 / 48 / 112 / 60 items/s; 13.0 / 19.2 / 13.5 / 15.9 GB | UltraBERT matches the 1B (also on the other stats) at 2.3x its speed: new default backbone. NeoMME dropped |
| T60 | Is an UltraBERT extractor as good as ModernBERT-large and faster? | UltraBERT-380M, 11k labels, 20 epochs, lr 1e-5 | .746 (micro .838) | .577 | 116 items/s; 2.7 h, 7.1 GB | Yes: +.04 on both main metrics and 1.07x faster. This model |
Model size vs event quality (top) and speed (bottom). Blue: dedicated extractors trained on the 11k labels, scored on the same 1,095-reply test split (T30 retrain, T60); the hollow 1B point (T38) used a slightly different split. Orange: the shared nine-stat tracker with 3k event labels (T58), scored on its own split; its F1 is not comparable with the blue points, only between the orange points. Its speed covers all nine stats.
Lessons:
damage (.54 → .77) and clothing_off (0 → .48) gained most.Next (planned, not run):
Research on measuring and structuring RP: tagging RP posts with events as features for other evaluators, data analysis, and experiments towards keeping state (location, clothing, injuries, food) from RP text. English only.
Apache-2.0, the same as the base model dmis-lab/UltraBERT-380M (its code files are included unchanged). The training texts were generated by psyonic-cetacean-20B and labelled by GLM-4.7 (MIT); the texts themselves are not released.
dmis-lab/UltraBERT-380M