Kermt Add Cmim Pretrain
NVIDIAOfficialPublished by NVIDIA
- Skill
- Workflow
- Software development
- Apache-2.0
- Medium risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This workflow converts an existing grover_base checkpoint (encoder-only or with vocab heads) into a hybrid model by adding a randomly-initialized cMIM decoder and latent distribution. It then proceeds to continue pretraining on the user's provided corpus. This process allows users to incorporate contrastive objectives into their models without the computational cost of restarting pretraining from scratch.
What it does
- Validates the input checkpoint to ensure it is suitable for hybrid conversion.
- Prepares the training data and builds a fresh vocabulary from the user's corpus.
- Upgrades the checkpoint by adding a cMIM decoder and latent distribution.
- Launches a detached pretraining run using the newly created hybrid checkpoint.
- Provides audit logs and provenance for the upgraded checkpoint.
When to use it
- When you have a grover_base checkpoint and want to add SMILES-reconstruction contrastive objectives.
- When you want to extend an existing model's capabilities without performing a full from-scratch pretraining run.
- When you need to adapt a pretrained encoder to a new corpus while maintaining hybrid training objectives.
Advantages
- Saves significant time compared to restarting pretraining from scratch.
- Enables the use of contrastive learning objectives on existing encoder-only models.
- Maintains provenance by capturing upgrade summaries and input manifests.
- Ensures data integrity through automated validation of checkpoints and corpora.
Usage examples
- “Upgrade my grover_base checkpoint at ./models/base.pt to a hybrid model using my new dataset at ./data/corpus.csv.”
- The agent validates the checkpoint, prepares the data, creates an upgraded hybrid checkpoint, and initiates the continue-pretraining process.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/kermt-add-cmim-pretrain/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip kermt-add-cmim-pretrain.zip -d .agents/skills
Documentation by NVIDIA
kermt-add-cmim-pretrain
Convert a grover_base checkpoint (legacy original-GROVER grover.encoders.*
or modern kermt.encoders.*, with or without vocab heads) into a fully-formed
hybrid (cMIM + vocab) checkpoint, then continue pretraining on the user's
corpus as hybrid.
This is a thin wrapper: upgrade_to_hybrid.py produces a new ckpt that
classifies as model_type: hybrid via check_checkpoint.py, and the rest of
the workflow is identical to kermt-continue-pretrain.
Status: experimental. This workflow is functional end-to-end but has not been benchmarked against the manuscript's from-scratch hybrid training (which produces the released checkpoint). Use as an experimental alternative to
kermt-pretrain-scratchwhen you want to extend an existing grover_base checkpoint rather than restart from random init. Validate downstream performance on your own benchmark before relying on the upgraded ckpt for production work.
Skill and runtime paths
Set SKILL_DIR to the absolute path of this installed skill directory. Export
KERMT_REPO as the absolute path to the KERMT checkout used for model
execution. The bundled container helper mounts that checkout at
/workspace and this skill at /skill (read-only). Commands inside
the container use /skill/scripts/; defaults are bundled in config/.
Hardware requirements
Same as kermt-continue-pretrain (the cMIM decoder adds parameters but not
substantially; VRAM headroom should be fine). The upgrade step itself is
fast (~5 s) and CPU-only — only the subsequent continue-pretrain consumes
GPU.
When to invoke
User has a grover_base checkpoint (encoder-only or with vocab heads) and wants to extend it into a hybrid (vocab + cMIM contrastive) pretrain.
Useful for adding the SMILES-reconstruction contrastive objective to a pretrained encoder without restarting pretraining from scratch (which
kermt-pretrain-scratchwould do at days-scale).
For continuing an existing hybrid or cmim ckpt: use kermt-continue-pretrain
directly. For training a fresh model on a custom corpus: use
kermt-pretrain-scratch.
Inputs
Required:
--ckpt <path>— grover_base ckpt to upgrade. Validated viacheck_checkpoint.py --mode upgrade_to_hybrid; rejected if the ckpt already has a contrast head or task FFN.--csv <path>— pretrain corpus CSV. Same shape askermt-continue-pretrain's--csvinput.
Optional (same as kermt-continue-pretrain):
--val-csv <path>— separate validation CSV. Without it, prepare_data auto-splits by--val-frac 0.1.Training-hyperparameter overrides (
--epochs N,--batch-size N, lr triple,--warmup-epochs F, etc.).--vocab-loss-weight F/--latent-dim N/--contrastive-temperature F.--wandb-project NAME/--wandb-run-name NAME— optional Weights & Biases logging (run name honored only alongside a project). Off by default.--gpus 0,2.
Workflow
Let $KERMT_REPO be the path to your kermt repo checkout.
Pre-flight: check_system (same as
kermt-continue-pretrainstep 1).Compute run directory:
RUN_DIR=$KERMT_REPO/runs/add-cmim-pretrain_$(date -u +%Y-%m-%dT%H-%M-%SZ)Validate the input ckpt with
check_checkpoint --mode upgrade_to_hybrid. Abort onok: false. The validator rejects ckpts that already have contrast head (suggestkermt-continue-pretrain) or task FFN heads (the ckpt has been finetuned; suggest using the original pretrain checkpoint).Validate the corpus via
check_data --mode pretrain. Abort onok: false.Prepare the data with
--mode pretrain— without--vocab-dir. The upgrade builds fresh vocab heads sized to the corpus's vocab, so we wantprepare_datato produce a new vocab from the corpus rather than passing through the ckpt's old vocab (which may not even exist for encoder-only legacy grover_base ckpts):"$SKILL_DIR/scripts/kermt_container.sh" run --data <user-csv> --run-dir $RUN_DIR -- \ "python /skill/scripts/prepare_data.py --mode pretrain \\ --csv /data/<basename> --out /runs/data \\ [--val-csv /data/<val-basename>] [--val-frac 0.1] [--seed 0]"The output manifest has
vocab_source: "built_fresh"and includes asmiles_vocab(built from the corpus, needed for the new decoder).Upgrade the ckpt.
"$SKILL_DIR/scripts/kermt_container.sh" run --ckpt <user-ckpt> --run-dir $RUN_DIR -- \ "python /skill/scripts/upgrade_to_hybrid.py \\ --ckpt /ckpt \\ --prepare-manifest /runs/data/prepare_data.json \\ --out /runs/upgraded.pt"Surface the JSON summary to the user — especially
warnings[], which includes any encoder-arch drift notes (e.g. legacy GROVER had two extraact_func_*keys that modern KERMTEmbedding doesn't) and the pretrain_ddp.py--backboneargparse-restriction note if the upgraded ckpt's backbone is anything other thangtrans.Estimate runtime + confirm with the user. Same heuristic as
kermt-continue-pretrain(corpus size × epochs × GPU count → wall time).Launch the runner detached.
"$SKILL_DIR/scripts/kermt_container.sh" run_detached \\ --name kermt-add-cmim-pretrain-<ts> \\ --run-dir $RUN_DIR -- \\ "python /skill/scripts/run_pretrain_local.py \\ --ckpt /runs/upgraded.pt \\ --prepare-manifest /runs/data/prepare_data.json \\ --out /runs \\ [--epochs N --batch-size N ...]"The runner sees the upgraded ckpt as
model_type: hybrid, so it auto-dispatches--pretrain_mode hybrid --vocab_loss_weight 1.0with smiles_vocab plumbed through.Report to the user with the upgraded ckpt path + the same run.json pointer / log path / tensorboard URL pattern as
kermt-continue-pretrain.
Hard rules
Never modify the user's input ckpt. The upgrade writes a new file at
<run_dir>/upgraded.pt; the source ckpt stays untouched.Vocab heads are always fresh. Even if the input grover_base has vocab heads, they're discarded and rebuilt sized to the new corpus's vocab. Continue-pretraining the upgraded ckpt will train those new heads alongside the decoder.
Don't auto-relax
--backbonechoices. If the upgrade warning fires because the input ckpt's backbone isn'tgtrans(e.g. legacydualtrans), surface the warning and ask the user. Do NOT silently modify parsing.py to add the legacy backbone to the choices list.
Common errors
check_checkpoint rejected the ckptwith model_type=hybrid or cmim → user's ckpt already has a contrast head. Redirect tokermt-continue-pretrain.check_checkpoint rejected the ckptwith task_ffn=true → the ckpt has been finetuned. The upgrade workflow only supports pretrain checkpoints.prepare manifest missing smiles_vocab→ prepare_data was invoked with--skip-vocabor some equivalent that omitted the smiles vocab. Re-run prepare without those flags.unexpected key(s) in encoder loadwarning → legacy GROVER architectures saved a couple ofact_func_*weights that modern KERMTEmbedding doesn't use. Benign; the rest of the encoder loaded correctly.
What's in run.json after a successful run
Same reproducibility fields as kermt-continue-pretrain, plus the upgrade step's
summary.json is captured under the inputs.upgrade_summary path so the
provenance of the upgraded ckpt is auditable.
Replayability
Same as kermt-continue-pretrain: cmd_replay rebuilds the
run_pretrain_local.py --ckpt <upgraded.pt> ... invocation. To redo the
full add-cmim flow end-to-end, the user also needs the input grover_base
ckpt and the corpus — both are captured in the prepare_data and upgrade
manifests by absolute path.
Files
- ATTRIBUTION.mdAdded by AutoGineer853 B
- BENCHMARK.md7.6 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md8.4 KiB
- config/defaults_pretrain.json2.6 KiB
- evals/evals.json5.6 KiB
- scripts/_utils.pyScript14.1 KiB
- scripts/check_checkpoint.pyScript20.1 KiB
- scripts/check_data.pyScript11.9 KiB
- scripts/kermt_container.shScript18.9 KiB
- scripts/prepare_data.pyScript36.5 KiB
- scripts/run_pretrain_local.pyScript34.8 KiB
- scripts/upgrade_to_hybrid.pyScript18.2 KiB
- skill-card.md4.4 KiB
- skill.oms.sig6.3 KiB
BENCHMARK.md
Skill Benchmark: kermt-add-cmim-pretrain
✅ Overall verdict: PASS — Recommended for publication
Publication Recommendation
Recommended for publication based on the completed evaluation evidence in this report.
Evaluation Metadata
Skill:
kermt-add-cmim-pretrainEvaluation date: 2026-09-14
Evaluator version:
1.5.6Agents: Claude Code (
aws/anthropic/bedrock-claude-opus-4-8), Codex (openai/openai/gpt-5.5)Tasks: 4 evaluation tasks (3 positive, 1 negative)
Dataset digest:
sha256:67190f2c3c6d387ac214662edede46001c6cf423a2cd1b21f2ba57a5584b1e42(skill-evaluator-dataset-snapshot/1)Attempts per task: 3
Environment:
k8s-sandboxTier 2 evidence: required for publication
Tier 3 evidence: required for publication
Each task attempt ran in its own isolated sandbox pod.
What This Report Answers
The three-tier evaluation checks whether the skill:
is safe to use;
produces correct answers;
is discovered and activated when needed;
helps the agent complete the user's goal and expected workflow; and
avoids wasted skill and tool usage.
Results at a Glance
| Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) |
|---|---|---|
| Overall | 87.8% — baseline ran, but no comparable score was available; uplift unavailable | 82.7% — baseline ran, but no comparable score was available; uplift unavailable |
| Security | 100.0% → 100.0% (±0.0 points) | 50.0% → 100.0% (+50.0 points) |
| Correctness | 13.3% → 100.0% (+86.7 points) | 91.4% → 85.0% (-6.4 points) |
| Discoverability | 99.3% — baseline ran, but no comparable score was available; uplift unavailable | 83.3% — baseline ran, but no comparable score was available; uplift unavailable |
| Effectiveness | 20.0% → 55.6% (+35.6 points) | 47.1% → 65.0% (+17.9 points) |
| Efficiency | 84.2% — baseline ran, but no comparable score was available; uplift unavailable | 80.2% — baseline ran, but no comparable score was available; uplift unavailable |
How to read this table: baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points.
Example: 47.0% → 92.0% (+45.0 points) means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline.
A partial dimension was calculated from only the available configured signals; review the detailed report before relying on it.
Token Usage
Actual Tier 3 execution usage is reported for every observed agent/case pair and both conditions.
| Agent | Dataset case | With skill | Without skill | Delta | Change | Coverage |
|---|---|---|---|---|---|---|
| claude-code | All cases | 1,843,834 | 1,470,837 | N/A | N/A | skill 4/4; base 9/9 |
| claude-code | kermt-add-cmim-pretrain-001 | 367,265 | 665,452 | N/A | N/A | skill 1/1; base 3/3 |
| claude-code | kermt-add-cmim-pretrain-002 | 279,378 | 344,760 | N/A | N/A | skill 1/1; base 2/2 |
| claude-code | kermt-add-cmim-pretrain-003 | 574,222 | 331,621 | N/A | N/A | skill 1/1; base 3/3 |
| claude-code | kermt-add-cmim-pretrain-004 | 622,969 | 129,004 | +493,965 | +382.91% | skill 1/1; base 1/1 |
| codex | All cases | 1,104,206 | 3,185,479 | N/A | N/A | skill 4/4; base 7/7 |
| codex | kermt-add-cmim-pretrain-001 | 123,118 | 1,434,461 | N/A | N/A | skill 1/1; base 3/3 |
| codex | kermt-add-cmim-pretrain-002 | 72,697 | 455,195 | N/A | N/A | skill 1/1; base 2/2 |
| codex | kermt-add-cmim-pretrain-003 | 655,766 | 1,189,781 | -534,015 | -44.88% | skill 1/1; base 1/1 |
| codex | kermt-add-cmim-pretrain-004 | 252,625 | 106,042 | +146,583 | +138.23% | skill 1/1; base 1/1 |
| ALL AGENTS | Dataset aggregate | 2,948,040 | 4,656,316 | N/A | N/A | skill 8/8; base 16/16 |
Prompt tokens include cached reads, so total tokens are prompt + completion (cached is not added twice). The Efficiency score uses (prompt - cached) + completion. N/A means the relevant trajectory counters were not available; coverage is never estimated.
Tier Status
| Tier | Purpose | Status | Evidence |
|---|---|---|---|
| Tier 1 | Static validation | PASSED WITH OBSERVATIONS | 11 validator(s); 50 finding(s) |
| Tier 2 | Semantic deduplication | PASSED | 2 validator(s); 0 finding(s) |
| Tier 3 | Live agent evaluation | PASS | 2 agent(s); 4 task(s) |
Findings and Observations
<details> <summary>Show detailed findings and successful checks</summary>
MEDIUM QUALITY/quality_correctness: No documented scripts in table format (
skills/kermt-add-cmim-pretrain/SKILL.md)MEDIUM QUALITY/quality_correctness: Instructions don't mention 'run_script' (
skills/kermt-add-cmim-pretrain/SKILL.md)MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.author' (
skills/kermt-add-cmim-pretrain/SKILL.md)MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.tags' (
skills/kermt-add-cmim-pretrain/SKILL.md)MEDIUM SCHEMA/metadata_key_style: Metadata key 'risk_tier' is not kebab-case (
skills/kermt-add-cmim-pretrain/SKILL.md)45 additional finding(s) are available in the full evaluation artifacts.
</details>
Scoring Methodology
<details> <summary>Show dimension definitions, source signals, and thresholds</summary>
| Dimension | Question | Scored signals |
|---|---|---|
| Security | Is it safe to use? | security (100%) |
| Correctness | Is the answer correct? | accuracy (100%) |
| Discoverability | Was the right skill loaded when needed? | skill_execution (100%) |
| Effectiveness | Did the skill help complete the task? | goal_accuracy (50%) + behavior_check (50%) |
| Efficiency | Did it avoid wasted tool calls and token usage? | skill_efficiency (50%) + token_efficiency (50%) |
Dimension bands: PASS at 50% or above; NEUTRAL from 40% to below 50%; FAIL below 40%.
Overall Tier 3 lift: PASS at +5 points or more; FAIL at -10 points or less; values between those bands are NEUTRAL.
Overall verdict: PASS only when every configured dimension passes for at least one supported agent. Lift is reported as diagnostic evidence and does not override this gate.
The 50% attempt pass threshold is a separate per-task gate; it is not the dimension pass threshold.
Effectiveness is the equal-weight mean of goal completion (
goal_accuracy) and expected workflow adherence (behavior_check).Efficiency is 50% tool-call productivity (the backward-compatible
skill_efficiencywire id) and 50%token_efficiency. Positive-case skill routing is scored under Discoverability, not Efficiency; a negative case without a routing target is N/A. N/A sources are omitted, remaining weights are renormalized, and the dimension is marked partial.
Signals present in this run:
security(Security): unsafe operations, secret leakage, and unauthorized access.skill_execution(Skill Execution): whether the expected skill was selected, decoys were avoided, and the workflow executed.skill_efficiency(Tool Productivity): tool-call productivity (legacy wire id; routing is scored under Discoverability).accuracy(Accuracy): final-answer correctness against the reference answer.goal_accuracy(Goal Accuracy): whether the user's goal was achieved.behavior_check(Behavior Check): whether the expected workflow behavior was followed.token_efficiency(Token Efficiency): actual uncached prompt plus completion usage (50% of Efficiency).
</details>
Freshness
Regenerate this benchmark when the skill, evaluation dataset, target agent/model, evaluator version, environment, or scoring policy changes.
Requirements and compatibility
Written for: Claude Code, OpenAI Codex
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
The author says: Requires docker, nvidia-container-toolkit, and a CUDA-capable NVIDIA GPU. Designed for Claude Code, Codex, and Nemotron.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- NVIDIA
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/bionemo-kermt-add-cmim-pretrain · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download kermt-add-cmim-pretrain.zip