LLM

02 / UNDERSTAND

Understand language models through concepts, papers and experiments.

START HERE

Series overview · suggested reading order

  1. Mechanisms

    KV Cache explained — why send the conversation history again?

    Derive K/V reuse from causal attention, calculate cache memory, and separate inference caching from prefix reuse and chat history.

    10 MINPublished
  2. Mechanisms

    LLM mechanics I: should changing future tokens affect earlier outputs?

    From a two-row hand calculation to a two-layer numeric experiment: causal masks, softmax and future-information leakage.

    8 MINPublished
  3. Mechanisms

    LLM mechanics II: what does KV caching save, and how do we verify it?

    Compare prefix recomputation, token decoding and chunk caching with output errors, projected-row counts and actual array payloads.

    8 MINPublished
  4. Mechanisms

    LLM mechanics III: why is a four-slot cache not four-token recomputation?

    Separate absolute positions, cache slots and retained representations with a two-layer sliding-attention experiment.

    8 MINPublished
  5. Mechanisms

    LLM mechanics (4): when a prefix changes, is the old KV cache still valid?

    Three seeds and six conditions compare unchecked and keyed prefix reuse; numerical equality does not establish permission to share across scopes.

    9 MINPublished
  6. Mechanisms

    LLM mechanics (5): after editing history, can we recompute only the changed suffix?

    27 fixed conditions and 81 raw arrays test longest-prefix cropping, continuation positions, sliding-window fallback and scope isolation.

    10 MINPublished
  7. Mechanisms

    LLM mechanics (6): why can a larger prefix cache still get zero hits?

    324 requests across cold-start traces and 648 arrays test byte-bounded prefix checkpoints, working sets, isolation and LRU eviction.

    11 MINPublished
  8. Mechanisms

    LLM mechanics (7): why is caching slower even when it saves computation?

    4,860 measured queries compare three admission policies, connecting byte budgets, working sets, computation and local elapsed time.

    12 MINPublished
  9. Experiment reviews

    Does moving an answer into the middle make a model miss it? An interrupted controlled trial

    Six synthetic cases, four context conditions and 29 recorded requests. A Java experiment that separates retrieval results from HTTP 429 failures.

    12 MINPublished
  10. Engineering cases

    LLM experiment II: make the comparison valid before interpreting position

    A Java 8 paired-block protocol with 24 live Agnes 3.0 requests, independently audited scores and reported token usage, including the limits of a perfect observed score.

    16 MINPublished
  11. Engineering cases

    After 24 correct answers: designing a more discriminating context experiment

    Remove wording and identifier shortcuts, freeze 128 similar-distractor requests, and verify the materials with Java 8 and an independent audit. Offline preparation is not a new model result.

    10 MINPublished
  12. Mechanisms

    Profiling KV reuse: saved work versus added overhead

    Profile 909 queries across signatures, lookup, copying and continuation, including the remaining slowdown.

    9 MINPublished
  13. Mechanisms

    Tiled attention: preserving results without a full score matrix

    Derive online softmax from a failing block-average baseline and separate smaller temporaries from measured speed.

    9 MINPublished
  14. Mechanisms

    KV quantization: how many bytes, and at what error?

    Compare tensor and row-wise int8 quantization, including scale bytes and attention error under outliers.

    9 MINPublished
  15. Mechanisms

    KV quantization axes: why Key and Value need separate reasoning

    162 archived INT8 comparisons examine tensor, token and K-channel/V-token scales, including cases where the hybrid loses.

    10 MINPublished
  16. Mechanisms

    Packed KV groups: what does 4-bit actually save?

    Store real nibbles and audit group-scale overhead, padding bytes and attention output error.

    10 MINPublished
  17. Mechanisms

    KV residual windows: do recent tokens deserve higher precision?

    Compare early-focused and recent-focused attention to explain unequal gains from the same float32 window.

    10 MINPublished
  18. Mechanisms

    Block KV decoding: less workspace, more time

    Separate cache payload, work arrays and observed runtime, retaining 810 timings including slower block decoding.

    10 MINPublished

PROJECTS

Related projects

  1. PROJECT / 002

    Java LLM Practice

    Reproducible Java conversation, retry and persistence boundaries, alongside attention, cache-cost and quantization-error experiments.

    Building
Related experiments
  1. LAB / 005

    L1 / Context position: an interrupted trial

    Can the model retrieve the same fact at different positions?

    INCONCLUSIVE
  2. LAB / 015

    L2–L4 / Attention and cache mechanics

    From a two-row hand calculation to a two-layer numeric experiment: causal masks, softmax and future-information leakage.

    Completed
  3. LAB / 019

    L5 / Prefix-cache invalidation

    Three seeds and six conditions compare unchecked and keyed prefix reuse; numerical equality does not establish permission to share across scopes.

    Completed
  4. LAB / 022

    LLM mechanics (5): after editing history, can we recompute only the changed suffix?

    27 fixed conditions and 81 raw arrays test longest-prefix cropping, continuation positions, sliding-window fallback and scope isolation.

    Completed
  5. LAB / 025

    LLM mechanics (6): why can a larger prefix cache still get zero hits?

    324 requests across cold-start traces and 648 arrays test byte-bounded prefix checkpoints, working sets, isolation and LRU eviction.

    Completed
  6. LAB / 028

    LLM mechanics (7): why is caching slower even when it saves computation?

    4,860 measured queries compare three admission policies, connecting byte budgets, working sets, computation and local elapsed time.

    Completed
  7. LAB / 033

    Profiling KV reuse: saved work versus added overhead

    Profile 909 queries across signatures, lookup, copying and continuation, including the remaining slowdown.

    Completed
  8. LAB / 034

    Tiled attention: preserving results without a full score matrix

    Derive online softmax from a failing block-average baseline and separate smaller temporaries from measured speed.

    Completed
  9. LAB / 035

    KV quantization: how many bytes, and at what error?

    Compare tensor and row-wise int8 quantization, including scale bytes and attention error under outliers.

    Completed
  10. LAB / 040

    KV quantization axes: why Key and Value need separate reasoning

    162 archived INT8 comparisons examine tensor, token and K-channel/V-token scales, including cases where the hybrid loses.

    Completed
  11. LAB / 043

    Packed KV, residual windows and block cost

    144 comparisons and 810 timings. Recent float32 windows help recent-focused attention more; block decoding reduces work arrays but is slower on this CPU run.

    Completed

Paper reading guides

Related news

Published updates from external sources.

arXiv cs.CL · Original text · Translation unavailable

Attention, Dynamic Wave and Hybrid Sequence Mixers in Language Models ↗

Large Language Models (LLMs) rely on Multi-Head Attention (MHA) for sequence modeling, but scaling to long contexts is constrained by the quadratic cost of attention, motivating…

Original source
AIHOT · Original text · Translation unavailable

OpenRouter 教程:用 LLM 从 PDF 中抽取表格 ↗

OpenRouter 发布教程,讲解如何把 PDF 以文件形式连同严格 JSON schema 发给能读文件的模型,让表格以带类型的行返回,括号亏损、千分位和脚注标记等清理都写进字段描述。

Original source

Browse all AI news →

Learning path & planned topics

These are future topics, not completed experiments.

  1. What is a token? · PLANNED
  2. Context Window · PLANNED
  3. Embedding · PLANNED
  4. Attention · PLANNED
  5. Transformer · PLANNED
  6. LLM Evaluation · PLANNED
  7. Sampling / Inference · PLANNED

Continue along a learning path →

Try it · Context capacity

Expand to explore in your browser. Link to this exercise ↗