Skip to content

Testing and Reproducibility

Sudhanshu edited this page Nov 23, 2026 · 3 revisions

Testing and Reproducibility

The repository includes unit/integration tests under tests/, and an offline demonstration script intended to pretrain, fine-tune and compare weights using synthetic examples.

Unit tests

python -m pytest -q

Review the tests for architecture, data filtering, tokenizer/data behavior, training strategy and SFT labels. Tests demonstrate code invariants, not clinical correctness.

Offline two-stage pipeline test

python -m scripts.two_stage_smoke --pretrain-steps 3 --sft-steps 3

The smoke-test script uses data/byte_tokenizer.json, data/synthetic_healthcare_corpus.jsonl, and data/medical_demo.jsonl; the unit tests also use data/demo.txt. These small synthetic fixtures are included in the repository's data/ folder. When prerequisites are met, the script writes outputs under checkpoints/two_stage_smoke/ and checks that Stage 2 changes model weights relative to Stage 1. The demonstration model is not intended for medical inference.

Reproducibility record

For each meaningful run, capture:

  • Git commit SHA and relevant dependency versions.
  • Tokenizer JSON checksum and vocabulary size.
  • Exact model configuration JSON and training command.
  • Dataset ID, configuration, split, revision and filtering policy.
  • Random seed, optimizer settings, scheduled learning rates and checkpoint step.
  • Held-out evaluation criteria and token/sample counts.
  • Whether training resumed and any known data-order differences.

Checkpoint integrity

A checkpoint file should be tested for readability and checked against the architecture it was saved with. When continuing training, ensure optimizer-state restoration and expected step numbering. No claim of exact stream-position restoration is made by the current implementation.

Clone this wiki locally