Matrix Cognition

AI engineering, with the receipts.

Tutorials that ship their code, paper readings that name the arXiv id and say what was actually measured, and news that links the primary source. No hype cycle commentary, no invented benchmarks.

October 2026

3 articles
  1. Tutorials12 min read

    Hybrid search in Python: BM25 plus embeddings, measured

    BM25 and two embedding models fused by RRF and by a weighted blend on SciFact. A published blend weight helped one model and hurt the other.

  2. Evaluation13 min read

    Is your test set in the training data? Four overlap rules, measured

    The GPT-3, PaLM, Llama 2 and GPT-4 contamination rules in one stdlib script. On GSM8K, 13-word overlap caught 69.1-95.6% of edited copies, 0.8% of rewordings.

  3. Paper Readings15 min read

    TORQUE re-implemented: where keeping outliers around a rotation pays

    A reading of arXiv 2609.36032v1, re-run on Qwen2.5-0.5B: keeping outliers cut activation error at every budget; the KV-cache gain faded once its bits were paid.

September 2026

13 articles
  1. Tutorials5 min read

    Counting tokens before the bill: six tokenizers, six kinds of text

    The same 20,000 characters came to 4,716 to 33,502 tokens depending on language and tokenizer. Measured counts, the divide-by-four rule tested, a forecast script.

  2. Systems11 min read

    What a quantisation format actually costs, derived from the source

    Q4_K is not four bits per weight. Exact costs derived from ggml-common.h, joined to llama.cpp's measured size and perplexity tables, and the dominated formats named.

  3. Paper Readings8 min read

    Where should a document live: context, KV cache, or weights?

    A reading of arXiv 2609.17346v1, which compares in-context documents, KV-cache injection and fine-tuning on five benchmarks. Tables re-derived, code included.

  4. Tutorials9 min read

    LLM-as-judge done carefully: position bias, length, and agreement

    A pairwise judge harness run in both orders over a 48-item golden set, with swap tests, a padding probe, and Cohen's kappa. Code and data included.

Earlier in September

  1. · Tutorials

    A golden test set for a chatbot, scored without an LLM judge
  2. · Tutorials

    An agent tool-use loop from scratch: states and stop rules
  3. · Tutorials

    Structured output that never breaks: JSON Schema, validation, retries
  4. · Tutorials

    A minimal retrieval pipeline in Python: chunking, TF-IDF, evaluation
  5. · Systems

    KV cache arithmetic: memory per token, batch size, and context cost
  6. · News and Releases

    Gemini 3.8 Flash released: what changed, from the primary sources
  7. · Evaluation

    Bootstrap CIs for eval deltas: is a 4-point gap on 500 items real?
  8. · Paper Readings

    EarlyEval explained: stopping agent benchmark runs early
  9. · Paper Readings

    Covert Indirect Prompt Injection (ICoA) explained