# One training path for nine projector modalities

> How TrainKit aligns feature exports, XTuner packing, and serving-compatible checkpoints.

---

LLMS index: [llms.txt](/Sage-SciPerception/llms.txt)

---

The nine released projectors share the `atom` architecture, with task-specific feature widths and optional components. The first public TrainKit recipe trained an NEU06 sleep-staging projector. The general recipe extends the same training contract across all nine modalities while retaining the strict NEU06 recipe.

## Hand off frozen features through a common export

A `sage-training-data-v1` manifest points to split JSONL files and a feature cache. Each training row names its objects by `array_index`. The cache holds frozen feature rows and their offsets, and can supply discrete columns or side features for components that require them. The [public training samples](https://huggingface.co/datasets/internlm/Sage-SciPerception-Training) show how the files are organized.

The component configuration drives the projector and prompt layout, including multi-object or numbered payloads. TrainKit builds the supervision mask and collates the scientific inputs so they can be inserted into the packed token sequence. XTuner runs FSDP, the optimizer, and the loss against the frozen language model.

## Check the actual packs before launch

`scip-train preflight` uses the recipe's XTuner dataset, sampler, and collator to check the data and payload alignment. It reports pack count, dropped packs, and resulting steps. Sequence parallelism constrains the pack length, and data parallelism constrains the global batch size. With `round_up=False`, a tail smaller than one global batch is dropped. The two-row public NEU06 example uses a packing chunk size of one to produce two packs for one global batch.

## Export the interface used by inference

`recipes/projector_sft.py` handles the nine published variants. `recipes/neu06_projector.py` applies the strict NEU06 checks. A saved step exports `projector.safetensors` and a `config.json` that records the component interface and training provenance. The public loader and the vLLM prompt adapter use this same format, and EvalKit scores the predictions from the resulting service. The [training chapter](/book/05-training-new-modality/) shows how to run preflight on the sample.
