This book takes the GPT-style autoregressive large model architecture as its main thread, systematically sorting out the important progress in the field of large language models since the advent of ChatGPT. It strives to build a closer bridge between algorithm theory and coding practice.
This book emphasizes visual understanding of algorithms. Faced with the complex mechanisms in GPT, such as attention computation, positional encoding, and inference acceleration strategies, the author has carefully created a large number of illustrations. Using the philosophy that "a picture is worth a thousand words," these diagrams help readers intuitively grasp the essence of the algorithms.
This book strives to present the academic and engineering context as clearly as possible, drawing extensively on and citing first-hand sources in detail. These include original papers for key algorithms, official resources for major open-source projects, technical blogs by renowned research teams and engineers worldwide, and in-depth analyses that have exerted broad influence within the community. Whether covering the evolutionary details of the transformer architecture or engineering insights in inference optimization, the author aims to provide clear citations for all sources. This not only enables readers to trace and verify information but also encourages further exploration, helping them develop a holistic understanding of the developmental trajectory of LLM technology.
In parallel, this book emphasizes empirical open-source engineering. The author has not only tracked and organized representative open-source projects from recent years—including high-performance inference engines, efficient fine-tuning and reinforcement learning frameworks and components, and innovative applications such as RAG—but also embedded real code snippets in key chapters, guiding readers from comprehension to hands-on implementation.
Structurally, the book maintains a rigorous organization with a focus on practical application. Each chapter concludes with carefully designed review questions and exercises, suitable for both self-assessment and instructional use. They are intended to encourage hands‑on practice and visual‑to‑implementation learning, supporting a more solid and in-depth grasp of the material.
Nonetheless, limited by the author’s theoretical and technical expertise, errors and omissions are inevitable. Readers are sincerely invited to offer corrections and feedback. Important related works and advancements may also have been unintentionally overlooked, for which the author welcomes input. Furthermore, due to space constraints, many significant contributions can only be briefly introduced rather than explored in depth. Readers are encouraged to follow the cited sources and conduct further investigation according to their own interests and needs.
A great technical book should be more than just an accumulation of knowledge; it should serve as a starting point for deep thinking and continuous practice. May this book accompany you on your journey of exploring LLM. May you not only gain a profound understanding of technical principles and a solid improvement in application skills, but also develop a keen technical intuition through practice, experience those enlightening “aha!” moments on key issues, and keep progressing with joy.