kleos-gliner

A 194M entity extractor for agent memory: a fine-tune of fastino/gliner2.5-base-v1 (GLiNER2.5, DeBERTa-v3-base encoder, boundary architecture) on the mentions an agent's memory needs from conversation:

label what it finds
person named people ("Anna", "Dr. Patel")
location named places ("Lisbon", "Austin City Limits")
organization named organisations ("Google", "Wells Fargo")
relative one specific person referred to by relation or role to the speaker ("my sister", "Mom", "my boss")

It is the default extractor of kleos, which runs it natively (Rust/candle, CPU or Metal, f32/f16/q8) inside remember: names become entity nodes, first-person relatives become a person node plus an edge (user -[sister]-> node), and a name next to its relative ("my sister Anna") is merged into that node.

Use

The prompt must match training: the four bare labels above, in that order, no descriptions, gliner2's word splitter. gliner2 lowercases the text before the model sees it, so case checks have to read the original text.

from gliner2 import GLiNER2
m = GLiNER2.from_pretrained("Mazino0/kleos-gliner")
m.extract_entities("My sister Anna moved to Lisbon to work at Google.",
                   ["person", "location", "organization", "relative"])

In kleos: db.enable_extractor("gliner") (auto-downloads this repo), then remember derives entities whenever the caller passes none.

Recommended per-label thresholds (tuned on the validation split): person 0.8, location 0.9, organization 0.8, relative 0.5. kleos additionally keeps person/location/organization spans only if they contain a capital letter in the original text when the message is mixed-case (all-lowercase text needs โ‰ฅ 0.9).

Evaluation

200 hand-checked conversational claims (150 random LongMemEval/LoCoMo claims + 50 picked for kinship words), F1 per label, same thresholds and capital filter for every model:

model person location organization relative all names (P / R / F)
gliner2.5-small-v1, zero-shot 0.86 0.88 0.65 0.23 0.71 / 0.89 / 0.79
gliner2.5-base-v1, zero-shot 0.90 0.77 0.75 0.14 0.77 / 0.87 / 0.82
kleos-gliner (per claim) 1.00 0.92 0.79 0.87 0.83 / 0.96 / 0.90
kleos-gliner (per message, kleos default) 1.00 0.96 0.79 0.87 F 0.91

The Rust port in kleos matches gliner2 2.1.0 stage by stage (encoder hidden states within 3e-6, identical spans) and gives zero label flips at f16 and q8.

Caveats: the gold set is small and was drafted by an LLM before hand correction; one training seed; thresholds were tuned on LLM (silver) labels. Classification heads (statement type, store-or-skip) were trained jointly but did not beat simple rules and are not recommended.

Training

  • Data: 2,700 claims from LongMemEval_S sessions (MIT) that appear in no evaluation haystack, plus 1,288 synthetic chat claims. Silver labels from GLM-4.7-Flash, filtered (lower-case "names", pronouns and mentions that do not match whole words removed). No LoCoMo text was used for training.
  • Recipe: gliner2 trainer, 3 epochs, batch 4 ร— accumulation 2, encoder LR 1e-5, task LR 5e-5, linear schedule with 10% warm-up, token-embedding table frozen; about 96 minutes on an Apple M3 (Metal).

Limitations

  • English conversational text; trained on bare labels, so other label sets behave like the zero-shot base (or worse: domain ontologies should use the upstream model or their own fine-tune).
  • relative also fires on third-person forms ("his wife"); kleos attributes those to the possessor, not the speaker.
  • Products, events, dates and quantities are not covered.

Licence

Apache-2.0, the licence of the base model (fastino/gliner2.5-base-v1). The DeBERTa-v3 encoder is MIT. Training text: LongMemEval (MIT); labels generated with GLM-4.7-Flash.

Downloads last month
35
Safetensors
Model size
0.2B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Mazino0/kleos-gliner

Finetuned
(11)
this model

Dataset used to train Mazino0/kleos-gliner