CLM-v0.1-8B
CLM-v0.1-8B is a Contrastive Language Model (CLM): two small projection heads (a state head and an action head) on top of a frozen Qwen3-8B encoder. The encoder embeds the state together with a question, and it embeds each option separately. The score of an option is the scaled cosine similarity between the projected state and option embeddings, and a softmax over the options of a question gives its answer distribution. Because options are embedded separately, their embeddings can be cached and reused.
NeMo AutoModel keeps the encoder frozen, because the released heads and the action cache of the Contrastive-LM
clm-serve server depend on its exact embedding space. The recipe embeds every unique state and option text once,
sharded across all GPUs, and caches the embeddings on disk. It then trains or evaluates only the heads (about 20M
parameters) on rank 0.
Post-Train CLM-v0.1-8B
Set up a source checkout of NeMo AutoModel as described in
Run Decision Models with NeMo AutoModel.
Then, from the repository root, generate the fictional alert-triage records that the example configuration reads.
The generator rejects an existing output directory, so skip this step if you already generated data/soc_triage for
another decision model:
For the record format, see Prepare Decision Records.
Evaluate the released heads to record the baseline, and then run supervised fine-tuning (SFT):
To continue with reinforcement learning (RL) on the per-option rewards, start from the SFT heads:
Each run writes metrics_validation.json and metrics_test.json to its output directory. Training runs also save the
heads with the best validation score for train.eval_metric as heads.pt. The RL command sets
--train.eval_metric reward, so the RL stage keeps the heads with the best validation reward. If no epoch improves on
the starting heads, heads.pt contains the starting heads. The file uses the checkpoint format of the
contrastive-lm package, so the Contrastive-LM clm-serve server can load it through the CLM_CKPT environment
variable, for example CLM_CKPT=runs/clm/rl/heads.pt clm-serve.
The SFT stage trains on the gold answers with the NeMo AutoModel decision objective: label-smoothed cross-entropy, a Brier term, and a ranked-probability term for ordinal questions. It does not implement the Contrastive-LM fine-tuning objective, which by default trains against annotator distributions (soft targets).
Choose a Workflow
Configuration
The cache key covers the encoder and tokenizer names and revisions, the input texts, the truncation, pooling,
normalization, attention, and precision settings, and the installed Transformers version. Changing any of them creates
a new cache instead of reusing stale embeddings. Set the encoder and tokenizer revisions to full 40-character commit
IDs. The recipe rejects other values, such as the branch name main.
Model Reference
Model Architecture
Available Models
Contrastive-LM/CLM-v0.1-8B: the released projection heads (CLM_v0.1-8B.pt). The recipe loads them at revisione939398d4556fcd9400c76fa8c5a513202f42b0a, and the example configuration pins the Qwen3-8B encoder to revisionb968826d9c46dd6066d109eabc6255188de91218.