Lysyi, P. O.P. O.Lysyi2026-02-262026-02-262025-07-17Lysyi, P. O. (2025). Principles of Large Language Models (LLM). Journal of Numerical and Applied Mathematics(1), 63–76. https://doi.org/10.17721/2706-9699.2025.1.0610.17721/2706-9699.2025.1.06https://ir.library.knu.ua/handle/15071834/10878This paper explores the operational principles of large language models (LLMs), focusing in particular on the mechanism of next-token generation within the process of autoregressive modeling. It outlines the theoretical foundations of neural language models, the transformer architecture with its self-attention mechanism, and the roles of tokenization and embedding in forming the input representation of text. The study analyzes the main methods for selecting the next token (greedy decoding, top-k sampling, top-p sampling, temperature), their impact on the stochasticity of results, and the trade-off between coherence and creativity. It also examines context length limitations, sources of training data, and challenges related to interpretability and the likelihood of «hallucinations». The article provides a comprehensive overview of the architectural and algorithmic foundations behind text generation in LLMs.У статтi дослiджено принципи роботи великих мовних моделей (LLM), зокрема механiзм генерацiї наступного токена в процесi автогресивного моделювання. Описано теоретичнi основи нейронних мовних моделей, трансформерну архiтектуру з механiзмом самоуваги, а також роль токенiзацiї та ембеддингу у формуваннi вхiдного представлення тексту. Проаналiзовано основнi методи вибору наступного токена (жадiбне декодування, top-k, top-p семплiнг, температура), їхнiй вплив на стохастичнiсть результатiв i баланс мiж узгодженiстю та креативнiстю. Розглянуто обмеження довжини контексту, джерела тренувальних даних i виклики, пов’язанi з iнтерпретованiстю та ймовiрнiстю «галюцинацiй». Стаття є цiлiсним оглядом архiтектурних та алгоритмiчних рiшень, що лежать в основi генерацiї тексту LLM.uklarge language modelstransformerautoregressive generationtokenizationtemperatureprobabilistic text modelingвеликi мовнi моделiтрансформеравтогресивна генерацiятокенiзацiятемператураймовiрнiсне моделювання текстуPrinciples of Large Language Models (LLM)Принципи роботи великих мовних моделей (LLM)Стаття