Skip to content

[DISCUSS] Add TrainingProvenanceRecord: which datasets a model was trained on - #10

Merged
jgoodyear merged 3 commits into
mainfrom
model-usage-record
Oct 18, 2026
Merged

jgoodyear merged 3 commits into
mainfrom
model-usage-record

Conversation

@ANierbeck

Copy link
Copy Markdown
Contributor

Draft, for discussion on dev@. Not meant to be merged before the list has agreed to the scope.

What

A ProvenanceRecord describes a dataset. This adds a second record type, TrainingProvenanceRecord, for the model side: this model was trained on these datasets. It is asserted by whoever produced the model, so dataset records stay untouched and never point back at models.

{
  "@context": "https://sourcelume.apache.org/context/0.0.1/sourcelume.jsonld",
  "id": "https://sourcelume.apache.org/records/dfm-mimir-v1/training",
  "type": "TrainingProvenanceRecord",
  "identifier": "https://huggingface.co/danish-foundation-models/DFM-Mimir",
  "name": "DFM Mímir v1",
  "creator": [{ "type": "schema:Organization", "name": "Danish Foundation Models", "role": "originator" }],
  "created": "2026-10-13T00:00:00Z",
  "disclosure": "partial",
  "trainingData": [
    {
      "dataset": "https://sourcelume.apache.org/records/dfm-mimir-v1/laerebogen",
      "phase": "pretraining",
      "tokens": 8320000000,
      "share": 0.1181
    }
  ]
}
  • The model is described with the terms a dataset record already uses (identifier, name, version, creator).
  • trainingData[].dataset is an IRI, normally the id of a ProvenanceRecord. phase, tokens and share are optional.
  • disclosure is complete, partial or undisclosed. trainingData may only be left out for undisclosed.
  • Whether a referenced record exists, and in which state, is looked up when the model record is read. It is not stored in either record, and there is no approved flag.

Why a separate record rather than a field on the dataset record: the claim is the model producer's, not the dataset producer's, and a back-reference would let third parties write into someone else's record.

Example

examples/dfm-mimir-v1-training.jsonld refers to 12 DFM Mímir v1 dataset records (first commit, taken over from the unmerged stress-tests branch with the canonical @context). It is partial: the technical report lists 161 datasets and only these 12 have a record, about 43 percent of the sampled tokens. It is illustrative, authored from the public report, not attested by the producer.

Commits

  1. The 12 Mímir dataset records as examples.
  2. The record type: context, schema, shapes, validator, tests, spec text, changelog, SPDX crosswalk.
  3. The two training record examples.

Each commit passes tools/validate.py, the unit tests and mvn verify.

Checks

  • tools/validate.py: 14 examples pass; it now picks the schema by type.
  • 14 new unit tests that check the JSON Schema and the SHACL shapes against each other.
  • The shapes were also run with Jena SHACL 6.2.0, which the registry uses: 16 valid documents conform and 9 invalid variants are rejected, the same result as pyshacl. (Scratch runner outside the repo: a Graph parsed with RDFParser + ShaclValidator.get().validate(shapes, graph); easy to re-run against schema/0.0.1/sourcelume.shacl.ttl with the context inlined.)
  • share is xsd:double: rdflib creates an xsd:decimal literal with a float value for a JSON number, which pyshacl then rejects.

Not in this PR

  • ProvenanceRecord and its schema are unchanged.
  • Registry: ShaclRecordValidator only accepts graphs with a sl:ProvenanceRecord node and the JSON Schema plugin loads one schema, so ingesting the new type needs a follow-up there.
  • Audit results (e.g. memorisation audits) and what happens to a model's weights after training (merging, editing) stay out of scope. The non-goals say so.
  • Signing, as before.

Open questions

  1. Should this be in the spec, and before a first release?
  2. Name: TrainingProvenanceRecord.
  3. Is disclosure worth having? It lets a producer state that the data is not disclosed.
  4. Phases: pretraining, fine-tuning, alignment, evaluation. Closed list or open?
  5. One record per model version, or per training run?

Apache-ai: Yes
Generated-by: pi (claude-sonnet-5-5)
Reviewed-by: anierbeck

Twelve ProvenanceRecords for datasets that DFM Mímir v1 is trained on,
authored from Table 10 (Appendix A) of its technical report, arXiv
2608.13517. Together they are about 43 percent of the sampled tokens and
cover every form the report uses for the Danish data: curated,
reformatted, translated, synthetic and agreement-supplied.

They come from the stress-test work on the stress-tests branch, which is
not merged. The only change is the @context, which is now the canonical
context IRI that the schema requires. The next commit adds a record that
refers to them.

Apache-ai: Yes
Generated-by: pi (claude-sonnet-5-5)
Reviewed-by: anierbeck
A ProvenanceRecord describes a dataset and says nothing about the models
trained on it. That is a claim by the model's producer, so it gets its
own record type instead of a back-reference on the dataset record.

A TrainingProvenanceRecord describes the model with the terms a dataset
record already uses (identifier, name, version, creator) and lists the
datasets in trainingData. Each entry refers to a dataset by IRI, normally
the id of a ProvenanceRecord, and may carry a phase, a token count and a
share. disclosure states whether the producer lists all, some or none of
its training data; trainingData may be omitted only for undisclosed.

Whether a referenced record exists, and in which state, is looked up when
the model record is read. It is not stored in either record, and there is
no approved flag, in line with the existing non-goals.

- context: the new type and the terms trainingData, dataset, phase,
  tokens, share, disclosure and note. share is xsd:double because
  rdflib creates a decimal literal with a float value for a JSON number,
  which pyshacl then rejects as xsd:decimal.
- schema: sourcelume-training.schema.json, separate from the
  ProvenanceRecord schema, whose type is fixed. ProvenanceRecord and its
  schema are unchanged.
- shapes: TrainingProvenanceRecordShape and TrainingDataEntryShape in the
  existing shapes file. The shapes were checked with pyshacl and with
  Jena SHACL, which the registry uses: 16 valid documents conform and 9
  invalid variants are rejected by both.
- tools/validate.py picks the schema by the record's type and fails on an
  unknown type. render-docs.py still renders only the ProvenanceRecord
  schema.
- tests: 14 tests that check the schema and the shapes against each other.
- spec, changelog, README and SPDX crosswalk (trainedOn / testedOn).

The spec's non-goal on usage metadata is replaced: training usage is now
covered, audit results and weight-level lineage are still out of scope.

Apache-ai: Yes
Generated-by: pi (claude-sonnet-5-5)
Reviewed-by: anierbeck
…d model

dfm-mimir-v1-training.jsonld describes DFM Mímir v1 and refers to the
twelve dataset records from the first commit, with the token counts and
shares from Table 10 of the technical report. Its disclosure is partial:
the report lists 161 datasets and only these 12 have a record, together
about 43 percent of the sampled tokens. The record says so in its note.

acme-undisclosed-model.jsonld shows the undisclosed case, which has no
trainingData. It uses example.org and a made-up producer; no real model
is stated to be undisclosed.

Both are illustrative: they are authored from the public report, not
attested by the model's producer.

Apache-ai: Yes
Generated-by: pi (claude-sonnet-5-5)
Reviewed-by: anierbeck
@ANierbeck
ANierbeck requested a review from jgoodyear October 15, 2026 19:53
@ANierbeck
ANierbeck marked this pull request as ready for review October 18, 2026 09:45
@ANierbeck

Copy link
Copy Markdown
Contributor Author

No further discussion on this, therefore ready for review

@jgoodyear
jgoodyear merged commit b5ab8e7 into main Oct 18, 2026
2 checks passed
@jgoodyear
jgoodyear deleted the model-usage-record branch October 18, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants