Skip to content

Model card metadata - #560

Merged
KartikP merged 50 commits into
masterfrom
nt/historical-models-2
Oct 2, 2026
Merged

KartikP merged 50 commits into
masterfrom
nt/historical-models-2

Conversation

@nnt-git13

Copy link
Copy Markdown
Contributor

Author: Nathan Teshome

Summary

This PR adds structured model metadata to the vision model detail page, including:

  • Architecture, parameters, and training details
  • Training and evaluation datasets
  • Creators, organizations, and licensing
  • Intended use, limitations, and biases
  • Input/output specifications
  • Metadata provenance and model lineage

Model cards are backed by a six-table CSV catalog containing 78 curated vision models. A workbook conversion script generates the catalog, and a management command supports importing it into the new metadata database tables. The current model-card implementation reads the CSV catalog directly.

Models present in the catalog display their curated fields. Models without a matching entry fall back to the existing submission metadata, with available values marked as probable and missing values shown as Not documented. Catalog coverage is partial, and even curated models may have undocumented fields.=

Features Implemented

At-a-Glance — Model Detail Page

  • Architecture description and parameter count.
  • Input resolution, recurrence, and supervision information.
  • Weights provider, trainable layers, and checkpoint details.
  • Training process and datasets, with dataset-role labels.
  • Training objective, loss, learning rate, batch size, and preprocessing when documented.
  • Creators, organizations, and licensing information.

Intended Use and Evaluation

  • Recommended applications and target users.
  • Known limitations and biases.
  • Test and validation datasets.
  • Input format, output format, tokenizer, and model version.
  • Empty-state labels and collapsible controls for undocumented sections.

Metadata Provenance

  • Counts of verified, probable, uncertain, and undocumented assertions.
  • A visual provenance summary in the sidebar.
  • Field-level confidence indicators for probable and uncertain values.
  • Submission-derived fallback values marked as probable rather than verified.

Model Lineage

  • An ancestor chain based on direct base-model relationships.
  • Related variants containing sibling and child models.
  • Links to model cards when public model IDs can be resolved.
  • Comparison links for related models with resolved IDs.
  • A show-more/show-fewer control for related variants; its visibility bug is tracked below.

Metadata Pipeline

  • A workbook-to-CSV conversion script: scripts/build_model_metadata_catalog.py.
  • Six catalog tables:
    • Models
    • Model datasets
    • Intended use
    • Contributors
    • Model relationships
    • Assertions
  • Django models and a management command for database import.
  • A migration joining the metadata and upstream materialized-view migration histories without renaming either existing 0027 migration.

Metadata Sources and Fallback Behavior

The model identifier determines whether the card uses curated catalog data or submission metadata. Lookup tolerates casing differences, but distinct checkpoint variants remain separate entries.

Examples with curated metadata include:

  • resnet-50-robust
  • vit_base_patch16_clip_224:openai_ft_in1k

The variant vit_base_patch16_clip_224:openai_ft_in12k_in1k is not currently in the catalog and therefore displays the sparser submission fallback.

The database importer is preparatory infrastructure: importing records does not currently change what the CSV-backed cards display.

UX Improvements

  • Added a model-card header with key metadata chips.
  • Added leaderboard filter links for supported architecture and parameter fields.
  • Added a Compare this model link.
  • Grouped metadata into cards for training, intended use, evaluation, provenance, and lineage.
  • Added confidence indicators and explicit missing-value labels.
  • Added responsive metadata layouts.
  • Added disabled Edit placeholders for a future curation workflow; editing is not implemented.

Next Steps

UI Cleanup

  • Fix the related-variant collapse behavior.
  • Distinguish submission fallback data from curated metadata in the section heading.
  • Reduce empty-field clutter for models with sparse metadata.
  • Review long values, sidebar spacing, and mobile behavior on the full model page.
  • Make confidence indicators and section expansion controls keyboard accessible.
  • Decide whether to retain disabled Edit controls before editing is available.

Data and Testing

  • Expand catalog coverage and validate identifiers against the public model list.
  • Review probable and uncertain assertions and capture field-level primary-source references.
  • Add metadata-specific tests for catalog loading, fallback behavior, lineage, identifier casing, and imports.
  • Validate migrations against a disposable PostgreSQL database.
  • Exercise complete model pages and comparison navigation using the supported Django version.

Known Bugs and Limitations

  • Lineage visibility: the related-list display: flex rule overrides the default styling of the hidden attribute. Additional variants remain visible when the control is collapsed.
  • Misleading fallback heading: the card says Curated model metadata even when its values come only from the submission record.
  • Partial coverage: models without catalog entries show sparse metadata, and curated entries can still contain missing fields.
  • Empty-import deletion risk: importing an empty models.csv without --wipe leaves an empty Q() filter that can delete all existing metadata records. Add an empty-catalog guard before relying on the importer.
  • CSV/database mismatch: training objective, loss, learning rate, batch size, input/output format, and tokenizer are displayed from CSV data but are not persisted as scalar fields by the database models/importer.
  • Lineage identifier casing: database resolution of lineage links uses exact names, so casing mismatches can leave existing model pages unlinked.
  • Catalog caching: catalog changes require a worker restart or explicit cache invalidation.

Final Visualization Demo

Screen.Recording.2026-09-29.at.4.42.52.AM.mov

nnt-git13 and others added 30 commits April 16, 2026 02:57
Resolved conflicts:
- benchmarks/models.py: kept both ModelMonthlyAggregate/MonthBenchmarkEdge
  (this branch) and ResourceUsage (master) -- independent model classes.
- benchmarks/tests/test_ag_grid.py: took master's refactor, which replaces
  brittle hard-coded top-5 rank/model/score expectations with
  data-refresh-robust invariants (assert_scores_descending). Supersedes
  the V1/V2/IT case fix from d903207.

Renumbered the master-side migration 0023_resourceusage_* to 0025_* and
re-pointed its dependency at 0024_modelmonthlyaggregate_coverage_leaves_added_vs_prev
so the chain is linear: 0022 -> 0023 (mma+edge) -> 0024 (coverage_leaves) -> 0025 (resourceusage).
The trend tables were numbered 0024/0025 and collided with master's
0024_resourceusage. Renumber to 0025/0026 and depend on master's 0024
so the migration graph resolves to a single leaf.
The compare-page trend endpoint had no auth and returned any model's
monthly aggregates by id. Gate mid_a/mid_b to public models in the
domain and 404 otherwise, matching the public-only compare page.
Cache the public rank frame instead of rebuilding the model-by-month
matrix per model-card load, batch the per-month scored-leaf queries
into one, drop the identity rank remap, and keep only the prior
month's coverage sets during recompute.
The trend panel showed misleading vision-only copy on language model
pages; render it only for vision. Guard the hover script against a
missing BrainScoreTrendHover, matching compare-trend.js.
The attribution sidebar grew the row as its content grew on the model
card; cap it to the plot height and scroll internally (the compare page
already did this). Add a draggable divider so the plot and attribution
columns can be resized on both pages -- keyboard-accessible and synced
across the Scores/Rankings tabs.
Rewrite the hover/idle sidebar copy to be shorter and more scannable:
proper singular/plural, merged value+delta lines, dropped the summary
that duplicated the bullets below it, Mon-YYYY dates, 3-dp scores, and
plain-word rank moves. Rank movement text now names only model changes;
benchmark churn is shown once as bullets. Tests updated to the new strings.
Give the attribution sidebar a readable hierarchy (bold headline, semibold
section labels, muted dot bullets, spacing) via per-line classes assigned
in renderAttributionList; render the classed default on wire so the idle
state matches hover. Default the plot/attribution columns to 2/3 and 1/3.
…month

Extract the shared Plotly axis/template/config into helpers used by both
the single-model and compare builders; move the duplicated responsive
resize into trend-hover.js. Memoize the max-month cache key (was queried
on every cache access) and cache the month list.
Convert model-trend.css to model-trend.sass, import it from main.sass so it
compiles through django-compressor, and drop the per-page raw <link> tags.
Compiled output is unchanged.
Compare content had no max-width, so its width:100% charts stretched with
the viewport. Wrap it in a left-aligned 1500px .compare-layout. The D3 and
Plotly charts also sized themselves once at load and never recomputed;
give them debounced window-resize handlers that redraw at the current
width, and drop the Plotly responsive:true that reflowed inconsistently.
@KartikP

KartikP commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Model cards now read curated metadata from PostgreSQL, and the CSV importer preserves every catalog field. This update also incorporates the reviewed model-page layout and schema preview.

  • Added migration 0029_complete_model_metadata after the existing 0028 merge. It adds the missing training and I/O fields, widens dataset/source text storage, normalizes confidence statuses, and enforces case-insensitive model identifiers.
  • Added complete catalog validation, a dry-run/public-model check, transactional imports, stable model-record IDs, and preservation of unrelated metadata. Empty or invalid catalogs fail before any writes.
  • Switched runtime metadata reads from CSV files to the database, preserving submission fallback for missing records and public-only lineage links.
  • Updated the header with concise architecture, supervision, and license labels. Code and weights licenses remain distinct where needed. Contributor, reference, GitHub, and Compare controls share a row, followed by an icon-based metadata strip.
  • Moved Scores and How to use above At-a-glance. The sidebar order is layer commitment, visual angle, model lineage, then metadata provenance. Added keyboard-accessible disclosures and mobile layout fixes.
  • Made Schema v2.0 open an annotated proposed metadata.yaml template. The download control remains hidden pending supporting infrastructure; YAML ingestion is not implemented yet.
  • Fixed the leaderboard tutorial button's obsolete markup lookup and repaired model-page test selectors.

Validation: 68 Django tests and 59 JavaScript tests passed, with no missing model migrations. Browser checks passed at desktop, tablet, and mobile widths. Fresh migrations and upgrades from both existing 0027 histories were rehearsed locally.

Dev rollout is complete: a full backup was taken, migrations 0028 and 0029 were applied, and all 78 models, 225 datasets, 520 intended-use rows, 138 contributors, 71 relationships, and 2,418 assertions were imported. Every imported value matched the CSV catalog. All 2,261 existing model rows and 181,755 score rows exactly matched the pre-migration backup. Representative model pages and the real dev leaderboard were checked locally against dev data. This does not deploy the application to the hosted dev site.

Before production: rehearse the migration/import against staging with a backup, verify real pages and scores, and deploy the application after its database schema is ready. The known unmatched public identifier Resnext101_32x8d remains unresolved; no alias was guessed. Field-level source curation and a validated YAML submission/editing workflow remain follow-up work. Staging and production databases have not been changed.

Commits: 40eda71c and ed47a80e.

@KartikP KartikP closed this Oct 1, 2026
@KartikP KartikP reopened this Oct 1, 2026
@KartikP

KartikP commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Updated in 9852df6: preserve the maintainer-confirmed workbook color provenance during catalog conversion and YAML export. Green means curator verified; yellow means Claude inference from source material; red means Claude inference without source material; gray means undocumented. Exported evidence retains the workbook, sheet, cell address and derivation. Gray cells are excluded from facts while their original content is retained in the evidence ledger.

Validation: 73 metadata editing/publication, model metadata and export tests passed. All seven CvT proposals also passed schema and recorded-evidence checks against the approved core SHA.

The seven-model publisher rehearsal passed on a disposable dev-database copy: retry created no duplicate revisions, existing legacy metadata was preserved, and all 181,755 score rows and displayed leaderboard ranks remained unchanged. Shared dev was read-only; live publication still needs the protected deployment setup and independent head-specific approval.

Reproduction and publication evidence.

@KartikP
KartikP merged commit 0d783fa into master Oct 2, 2026
2 checks passed
@KartikP KartikP mentioned this pull request Oct 8, 2026
4 tasks
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