Skip to content
Back to skills

Modeling And Tokenization

ASecurity

"Use when inspecting ColBERT checkpoints, ColBERTConfig

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
ai-agentsdebuggingapi

Works with

  • api

Security analysis

A100/100

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

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill modeling-and-tokenization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Modeling And Tokenization?

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

Security grade badge for Modeling And Tokenization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-modeling-and-tokenization/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-modeling-and-tokenization)

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: modeling-and-tokenization
description: "Use when inspecting ColBERT checkpoints, ColBERTConfig
  model/tokenizer fields, QueryTokenizer or DocTokenizer behavior,
  query/document max lengths, marker tokens, punctuation masking, embedding
  dimensions, or safe model/tokenizer import diagnostics."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Modeling and Tokenization

Use this sub-skill when an agent needs to reason about ColBERT model checkpoints, tokenizer behavior, config compatibility, text-to-token tensorization, or query/document embedding shapes before indexing, searching, or training.

## Route Here For

- Inspecting `Checkpoint(name, colbert_config=None, verbose=3)` loading behavior and `checkpoint.colbert_config` values.
- Changing or debugging `ColBERTConfig` fields such as `query_maxlen`, `doc_maxlen`, `dim`, `mask_punctuation`, `attend_to_mask_tokens`, `query_token_id`, or `doc_token_id`.
- Understanding how `QueryTokenizer` and `DocTokenizer` insert `[Q]` and `[D]` markers, truncate text, pad queries with `[MASK]`, and return IDs/masks.
- Explaining `Checkpoint.queryFromText()` and `Checkpoint.docFromText()` output shapes, `to_cpu`, `keep_dims`, `return_tokens`, and packed document outputs.
- Diagnosing checkpoint metadata, tokenizer downloads, local-vs-Hugging Face model names, CPU/GPU model loading caveats, or missing optional dependencies.

## Start With

1. Read `references/modeling-and-tokenization.md` for the conceptual model, checkpoint/config merge behavior, marker tokens, tokenization, and embedding outputs.
2. Read `references/config-reference.md` before changing shape-sensitive fields such as `query_maxlen`, `doc_maxlen`, or `dim`.
3. Read `references/api-reference.md` for verified imports, constructor signatures, tensorizer methods, encoding outputs, and shape invariants.
4. Use `scripts/inspect_checkpoint_config.py` when you need a safe ColBERTConfig summary; pass `--allow-remote` only when remote Hugging Face access is intentional.
5. Use `scripts/tokenization_smoke.py` when a local checkpoint or explicitly allowed model name should be checked for marker placement, truncation, and tensor shapes.
6. Read `references/troubleshooting.md` when imports, checkpoint metadata, Hugging Face downloads, max-length truncation, punctuation masking, or device behavior is surprising.

## Boundaries

- This sub-skill covers modeling, config, checkpoint, tokenizer, and embedding-inspection tasks.
- For full indexing/search orchestration, index roots, ranking, or `Indexer`/`Searcher` usage, route to the indexing-and-search sub-skill.
- For training, triples, distillation, optimizer settings, checkpoint creation, or `Trainer`, route to the training-and-distillation sub-skill.
- For collection/query/ranking file schemas beyond text passed into tokenizers, route to the data-and-evaluation sub-skill.

## Operating Cautions

- Prefer local checkpoint directories for deterministic inspection. Hugging Face model names such as `colbert-ir/colbertv2.0` or `bert-base-uncased` can require network/cache access.
- `ColBERTConfig.load_from_checkpoint()` can return `None` for a generic Hugging Face backbone or a checkpoint directory missing ColBERT `artifact.metadata`.
- Query and document marker IDs are inserted at column `1`; do not pre-insert marker IDs before calling ColBERT tensorizers.
- Query tensor width is normally `query_maxlen`; document tensor width is capped by `doc_maxlen` but may be the longest sequence in the batch, not always exactly `doc_maxlen`.
- CPU-only import/config inspection is safe; full model loading can compile a small CPU extension, download tokenizer/model files, or hit torch/transformers compatibility issues.

Files in this skill

  • SKILL.md3.7 KB
  • references/api-reference.md6.7 KB
  • references/config-reference.md5.9 KB
  • references/modeling-and-tokenization.md6.5 KB
  • references/troubleshooting.md7 KB
  • scripts/inspect_checkpoint_config.py3.8 KB
  • scripts/tokenization_smoke.py5.7 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.