AGENT SKILL

modeling-and-tokenization

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.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
modeling-and-tokenization
license
MIT
metadata
{ "disco-role": "operating" }
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

02 资源文件 6

03 SKILL.md 正文

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.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351