# LLM 训练与推理的基本理解

DevFeed: [LLM 训练与推理的基本理解](<https://devfeed.tech/articles/llm-40974.md>)

Original publisher: [Read original article](<https://blog.joway.io/posts/deep-into-llm/>)

Author: Joway

Published: 2026-05-17T00:00:00Z

Content type: tutorial

Language: zh

Sources: [Random Thoughts](<https://devfeed.tech/sources/random-thoughts.md>)

Topics: [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Language models](<https://devfeed.tech/topics/language-models.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>)

Tags: [embedding](<https://devfeed.tech/tags/embedding.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [language](<https://devfeed.tech/tags/language.md>), [large-language-model](<https://devfeed.tech/tags/large-language-model.md>), [llm](<https://devfeed.tech/tags/llm.md>), [model](<https://devfeed.tech/tags/model.md>), [query](<https://devfeed.tech/tags/query.md>), [tech](<https://devfeed.tech/tags/tech.md>), [token](<https://devfeed.tech/tags/token.md>), [value](<https://devfeed.tech/tags/value.md>)

## AI overview

This Chinese tutorial explains foundational LLM training and inference concepts, including vector operations, linear layers, Softmax, LayerNorm, tokenization, token IDs, BPE, token and positional embeddings, and the initial steps of self-attention using Q, K, and V vectors.

## Source excerpt

学习一个技术最好的方式就是能够写一片文章把这个技术的原理解释清楚，本文记录了我在阅读 《Build a Large Language Model (From Scratch)》一书以及和 Claude Code 对话过程中的笔记，仅供参考。 术语解释 向量点积 定义：向量点积为标量 a = (a1, a2, a3) b = (b1, b2, b3) a - b = a1*b1 + a2*b2 + a3*b3 几何意义： a - b = |a| |b| cos(theta) 其中 theta 是两个向量的夹角。