Files
The same layout as jaredpalmer/kev-4b, so kev's own code loads it:
Table with columns: File| File | |
|---|
adapter_config.json, adapter_model.safetensors | PEFT LoRA r16 / α32 on Qwen/Qwen3.5-4B-Base @ 1001bb4d…, continued from the released kev-4b adapter |
head.pt | kev checkpoint metadata: the fine-tuned pointer head and the refit temperature (T = 1.906, fitted on Choice questions) |
s1bench-config.json, s1bench-metrics.json | the training run's configuration and its zero-shot / tuned results. Its figure for real-third-unjudged is agreement with LUX's own class, written before that draw was judged; the judged figure is in the table below |
lux_record.py | a LUX record → the fields that are passed → the text the model reads; and a cached, one-request-a-second client for LUX. Standard library only |
workflow-record-class.json | the decision as a chai workflow: the question, the six options, this model |
classify_lux_record.py | one LUX record, by its address or as text, through that workflow |
The decision
The state is the record as text, one field a line, only the fields the record has, always in this order:
Name: <the primary name>Other names: <variant>; <variant>Note: <a note>Note: <another note>Classified as: <category>; <category>Parents: <parent>; <parent>Dates: born 1853, died 1890Places: born at <place>, died at <place>People: <who carried out the event or made the thing>Coordinates: yes
The example under "Use" is a real record in that form. At most 8 other names, 3 notes of 300 characters, 8 classifications, 4 parents and 4 people. Parents is LUX's
broader, part_of and member_of in one field. The dates are born, died, formed, dissolved, began,
ended, active, made; the places born at, died at, formed at, dissolved at, took place at,
active at, lived at, made at. lux_record.py makes this text from a LUX record (render(slim(record))).
Three things a LUX record has are left out on purpose: its type, which is what is being judged; its URI; and its
links to other authority files, which are how a misfiled record got its type in the first place.
The question is Which class of record is this? and the options, with the descriptions the model was
trained with:
Table with columns: Key, Description| Key | Description |
|---|
person | one human being who lived: an artist, an author, a ruler, a saint, a collector |
group | people acting under one name: a company, an institution, a government or church body, a family or dynasty, a band, a tribal government |
place | somewhere on the earth: a town, a country, a river, a mountain, a building, a site, a street, a collecting locality |
concept | a category or a subject, not one particular thing: a kind of thing or of event, a topic about an event or a place, a language, a people or culture, a style, a species, a material, a genre, an occupation |
event | something that happened once, or a dated stretch of time: a battle, a war, a riot, a disaster, an expedition, a fair, a conference, an exhibition, a reign, a period of a country's history |
work_or_object | one particular creation, thing or collection: a book, a law, a treaty, a painting, a ship, an archive |
Six classes, not LUX's sixteen record types: languages, materials, currencies and units are concepts; a period is
an event, as in LUX's own Events tab; objects, works and collections are one class.
Data
11,612 synthetic catalogue records in that format, written by gemini-3.8-flash and checked without a model (the
form of a name, the fields a class can carry, dates, repeats). They come in 78 kinds: one class in one of the
forms LUX holds it in, such as a battle as a Library of Congress subject heading
(Hastings, Battle of, England, 1066), a conference as the name file enters it
(... (7th : 2006 : Vilnius, Lithuania)), or a collecting locality as a natural history museum writes it. The kinds
are weighted towards the ones LUX was seen to misfile, and each has its look-alike on the other side: a kind of event
(Sieges), a topic about an event (...--Personal narratives), a topic about a place (
England--Social life and customs
). By class: 3,481 events, 3,271 concepts, 2,024 groups, 1,200 works or objects, 948 places, 688 people.
The first round was 4,576 full records in 63 kinds. Scoring its model on real records showed two things, and
the second round answers them with 7,054 more records:
- Real records are far barer than the first training rows were: two events in three and every second group in LUX
are a name and nothing else. So most of the new records are bare names, written thirty to a call, and the rows of
each class are now cut to the shapes real records of that class have (name-only rows: events 55%, groups 57%).
- It missed or wavered on kinds the first round lacked: a dated stretch of a place's history as a subject heading
(
Rhode Island--History--1775-1865), ships and bare titles filed as concepts, a festival named with a role, a
conference's committee, a people as a heading. Fifteen kinds were added, each with its look-alike, and the calls
went to a kind in proportion to how badly the first model did on a pilot of it.
Three training names in a hundred carry a typing slip, as LUX's own strings do ("Knoledge and learning").
Each fuller record is shown cut down to what LUX might hold of it (as written, without its structured fields,
without its notes, its name and first note, its names alone, its name alone), and three in ten records of a kind
LUX misfiles are dressed as LUX would have them under the wrong class (a massacre with coordinates, a world's fair
with a founding date and the classification "Organization"), so that the model does not simply trust the fields a
misfiling leaves behind. Split by generator call: 13,016 training decisions, 1,229 for development, 1,125 for test,
and 244 from six kinds kept out of training whole.
The classes of the synthetic records are the ones the generator was asked for. An AI assistant (Claude) read 150
of the first round's and found none wrong, and samples of each new kind of the second round. No person has read
them. The second round is known to hold some wrong ones: types of ship written as ships, museums written as
buildings, era names written as style terms. How many is not measured.
Results
Share of records given the right class, and the model used as a flag: a record is flagged when the model's class
differs from the class LUX files it under, with at least 0.90 probability.
Table with columns: Test file, Records, jaredpalmer/kev-4b, untouched, first round (g1), this model| Test file | Records | jaredpalmer/kev-4b, untouched | first round (g1) | this model |
|---|
| Synthetic, held out (second round's) | 1,125 | 77.8% | 90.8% | 98.4% |
| Synthetic, six kinds held out of training | 244 | 93.0% | 94.7% | 98.4% |
| Real LUX records, drawn at random from every type | 485 | 90.1% | 98.6% | 97.5% |
| Real LUX records, hard cases found by search | 771 | 83.9% | 96.5% | 98.6% |
| Real LUX records, a second random draw | 301 | 88.7% | 97.3% | 98.7% |
| Real LUX records, a third random draw, judged blind | 469 | 85.7% | 96.6% | 98.1% |
Table with columns: As a flag at 0.90, Misfiled caught: untouched, first round, this model, Correctly filed flagged: untouched, first round, this model| As a flag at 0.90 | Misfiled caught: untouched | first round | this model | Correctly filed flagged: untouched | first round | this model |
|---|
| Random draw | 5 of 21 | 19 of 21 | 19 of 21 | 1 of 464 | 3 of 464 | 4 of 464 |
| Hard cases | 67 of 279 | 267 of 279 | 266 of 279 | 4 of 492 | 9 of 492 | 2 of 492 |
| Second random draw | 3 of 13 | 8 of 13 | 13 of 13 | 1 of 288 | 1 of 288 | 2 of 288 |
| Third random draw, blind | 3 of 24 | 16 of 24 | 18 of 24 | 1 of 445 | 3 of 445 | 2 of 445 |
How to read these:
- The class of every real record was judged by an AI assistant (Claude) reading the record against written
rules. No person has checked those judgements. Every figure on real records is agreement with that one reading.
93 records were left out of every score: those that could not be decided from what the record says, fragments,
deities and fictitious figures, records that are two things merged, and an association's own conference entered
under the association.
- Only the third random draw is a fair test of this model. It was fetched before the second round's data
existed and judged before any model had been shown it, and no training record has the name of one of its
records. The first three real files were read for the first model's misses and the second round was written to
fix those, so the gains there show that the fix took. The second and third draws hold concepts, places, groups
and events only.
- Two seeds were trained in each round. On the third draw the first round's got 96.6% and 96.6%, the second
round's 98.1% and 97.0%; over all 2,026 real records the first round's were wrong on 58 and 59, the second
round's on 36 and 50. This is the seed with 98.1%. It was chosen over the other on the first three real files,
but after every score, the third draw's too, had been seen: 98.1% is the better of two looks, and the size of
the improvement on unseen records is about a point, give or take a point. By loss on the synthetic development
split, the rule of the first round, the other seed would have been kept.
- It is slightly worse than the first round on the first random draw (12 wrong against 7), the only random
draw with people, objects and works in it.
- The hard cases are what 125 chosen searches returned (a word of one class searched for in another), not a sample
of LUX, so the share caught there says nothing about LUX as a whole. The third draw holds 24 misfiled records, so
"18 of 24" is anywhere from about 55% to 88%.
- Of the six held-out kinds, one (holidays, doctrines, awards, games) has two relatives in the second round's
training data and rose from 79% to 96%; the other five were at 95% to 100% in both rounds.
When it catches a misfiled record it nearly always names the class the record was judged to be: all 19 in the
random draw, all 266 among the hard cases, all 13 in the second draw, 17 of the 18 in the third.
What it gets wrong. Bare subject headings that could be titles, which it sometimes reads as works ("East Asia
Studies", "Data Mining and Knowledge Discovery"): the first round did not do this, and it comes from the bare
titles the second round added. Bare names of bodies with nothing to go on ("Zero Production"). Named one-off
affairs filed as subjects ("Dare Stone hoax"), which it leaves as concepts. Misfiled records it classes rightly
but below 0.90: a place at 83%, a named computer system as a work at 62%; at 0.50 it catches 23 of the 24 in the
third draw and flags 5 of 445. Festivals that recur, which the rules call events and a subject file calls
concepts.
What was not checked. It has not been run over LUX. Only 56 of the real records it was scored on are ones LUX
files as objects, works or collections (it gave 55 of them that class), against 36 million of them in LUX. Deities
and legendary or fictitious figures are in no data and no score. Four of the rules it follows go against something
LUX does by its sources' convention (ships, expeditions and festivals entered as groups; cities entered as groups;
museums entered as places), and a flag on those is a question for LUX's maintainers, not an error found.
Use
In chai-engine it is the model of a decision.DecisionClassifier
(pointer family; loads from the Hub on first use, ~135 MB plus the 4B base model):
from chai.result import ItemResultfrom chai.workflow import Workflow OPTIONS = { "person": "one human being who lived: an artist, an author, a ruler, a saint, a collector", "group": "people acting under one name: a company, an institution, a government or church body, a family or dynasty, a band, a tribal government", "place": "somewhere on the earth: a town, a country, a river, a mountain, a building, a site, a street, a collecting locality", "concept": "a category or a subject, not one particular thing: a kind of thing or of event, a topic about an event or a place, a language, a people or culture, a style, a species, a material, a genre, an occupation", "event": "something that happened once, or a dated stretch of time: a battle, a war, a riot, a disaster, an expedition, a fair, a conference, an exhibition, a reign, a period of a country's history", "work_or_object": "one particular creation, thing or collection: a book, a law, a treaty, a painting, a ship, an archive",} # A record LUX files among its concepts, as the model reads it: one field a line.STATE = """Name: White Oak Swamp, Battle of, Va., 1862Other names: Batalla de White Oak Swamp; bataille de White Oak Swamp; Battle of White Oak SwampNote: 1862 battle in the American Civil WarParents: Seven Days' Battles, Va., 1862; United States--History--Civil War, 1861-1865--Campaigns""" wf = Workflow({"type": "Workflow", "id": "lux_record_class", "steps": [{ "type": "decision.DecisionClassifier", "id": "class", "settings": {"model": "pointer/yale-cultural-heritage/kev-4b-lux-record-class", "device": "mps", # or cuda; omit for the CPU "question": "Which class of record is this?", "options": OPTIONS}}]})out = wf.run(ItemResult(STATE, metadata={"type": "TEXT"})).value[0]print(out.value, {k: round(p, 3) for k, p in out.metadata["probabilities"].items()})# ['event'] {'person': 0.0, 'group': 0.0, 'place': 0.001, 'concept': 0.001, 'event': 0.998, 'work_or_object': 0.0}
The same workflow is workflow-record-class.json in this repository, and classify_lux_record.py puts a real
record through it: it fetches the record from LUX, makes the text with lux_record.py, and says whether the
record would be flagged.
hf download yale-cultural-heritage/kev-4b-lux-record-class lux_record.py workflow-record-class.json classify_lux_record.py --local-dir lux-record-classpython lux-record-class/classify_lux_record.py concept/b2b01d67-b93a-4be0-b916-c48745779779 --device mpspython lux-record-class/classify_lux_record.py --text "Name: Paraguay" --filed-as grouppython lux-record-class/lux_record.py concept/b2b01d67-b93a-4be0-b916-c48745779779 # only the text the model would read
From a chai-engine checkout, chai's own runner takes the workflow file and a record as text:
python scripts/run_workflow.py /path/to/lux-record-class/workflow-record-class.json --text "Name: Pashto"
Or serve it with the kev repository, exactly as kev-4b. Ask it the way it
was trained: the state in the form above, the question and the six options with their descriptions as given
(key: description is how kev reads a described option), in any order. On an Apple M4 Max a decision takes about a
third of a second once the weights are in memory; training took 121 minutes on one H200 and 10 GiB.
The first round's model is the same repository at the tag g1; in chai, add "revision": "g1" to the settings.