Skip to content
Back to skills

Training And Distillation

ASecurity

"Train or fine-tune ColBERT models, prepare and validate triples,

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
toolspythonapi

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill training-and-distillation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Training And Distillation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Training And Distillation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-training-and-distillation/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-training-and-distillation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: training-and-distillation
description: "Train or fine-tune ColBERT models, prepare and validate triples,
  use scored distillation examples, and plan GPU/resource settings. Use when
  tasks mention ColBERT Trainer, fine-tuning checkpoints, training triples,
  distillation scores, nway/bsize/accumsteps choices, or training-file
  validation."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# ColBERT Training And Distillation

Use this sub-skill when the user needs to configure or troubleshoot ColBERT training. It covers the `Trainer` API, JSONL examples/triples, scored distillation examples, resource planning, and safe helper scripts. Do not use it for post-training indexing/search, evaluation benchmarks, or tokenizer internals.

## Route Tasks

- For a runnable training starting point, read `references/training-workflows.md` and generate a script with `scripts/training_template.py`.
- For API details, checkpoint precedence, data shapes, and config fields, use `references/api-reference.md`.
- For validation before GPU work, run `scripts/validate_training_files.py` against triples, queries, and collection files.
- For launch, data, scored-example, OOM, and dependency failures, use `references/troubleshooting.md`.
- For indexing or searching a trained checkpoint, switch to the `indexing-and-search` sub-skill.
- For ranking metrics, LoTTE/MS MARCO evaluation, qrels, and dataset conventions outside training, switch to the `data-and-evaluation` sub-skill.
- For tokenization behavior, max lengths, dimensions, and model architecture details, switch to the `modeling-and-tokenization` sub-skill.

## Core API

The verified public training entry point is:

```python
from colbert import Trainer
from colbert.infra import ColBERTConfig, Run, RunConfig

with Run().context(RunConfig(nranks=1, experiment="my-training-run")):
    config = ColBERTConfig(bsize=32, nway=2, accumsteps=1)
    trainer = Trainer(triples="triples.train.jsonl", queries="queries.train.tsv", collection="collection.tsv", config=config)
    trainer.train(checkpoint="bert-base-uncased")
    checkpoint_path = trainer.best_checkpoint_path()
```

Important behavior: `Trainer.train(checkpoint=...)` is the checkpoint source used by training. If `ColBERTConfig(checkpoint=...)` is also set, the explicit `train(checkpoint=...)` argument wins.

## Bundled Helpers

- `scripts/validate_training_files.py` checks JSONL triples/examples plus query and collection TSV files for parseability, ID references, duplicate IDs, scored-example shape, and likely `nway` mismatches before launching training.
- `scripts/training_template.py` emits a safe argparse-based ColBERT training script template and warns about resource choices such as `bsize % nranks`, large `nway`, and GPU expectations.

## Training Scope

Basic ColBERTv1-style training usually uses unscored `[qid, positive_pid, negative_pid]` JSONL examples with `nway=2`. Advanced ColBERTv2-style training often uses many-way examples such as 64-way scored JSONL, `use_ib_negatives=True`, `distillation_alpha`, `doc_maxlen=180`, `dim=128`, and a source checkpoint such as `colbert-ir/colbertv1.9`.

Practical training requires CUDA/GPU resources. CPU-only environments are useful for imports, file validation, and template generation, but real fine-tuning, distillation scoring, and distributed training are GPU-heavy.

Files in this skill

  • SKILL.md3.3 KB
  • references/api-reference.md5.1 KB
  • references/training-workflows.md5 KB
  • references/troubleshooting.md4.6 KB
  • scripts/training_template.py7.9 KB
  • scripts/validate_training_files.py10.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.