[1/2] Prompt Engineering for LLMs (AI column)
For the most part, I read the popular holiday. book about prompt engineering , which came out ~2 years ago. In it, John Berriman and Albert Ziegler talked about how to “talk” to large language models. (LLMs). The authors are interesting to read, as they are the creators of one of the most successful AI products. (GitHub Copilot) They're on the subject.
In 2024 During the year, the topic of prompt engineering was hot, it was much discussed and this book became one of the first guides - from basics to advanced topics, it also had ready-made templates with examples of code. This made the book a valuable tool for developers. If we talk more about the content of the book, it consists of three parts.
1ы Fundamentals of LLMThe structure and evolution of models, their training and transition to dialogue. The first part was 4 chapter 1. Introduction to Prompt Engineering Why LLMs look like "magic," a brief evolution of language models, and where in this picture prompt engineering is an engineering discipline. 2. Understanding LLMs LLM as completion engine: tokens/tokenization, autoregression, hallucinations, temperature/probabilities, transformer fundamentals; why text order and “load” on the model really affect quality. 3. Moving to Chat Moving from completion to chat: RLHF (how he's going)Instructor vs chat, “alignment tax,” the evolution of APIs and why the next stop is tools. The idea of prompting as "staging a play" (scenes/roles/remarks). 4. Designing LLM Applications - key frame: LLM loop (Transferring the user problem to the model domain → completion → post-processing back). Inside: retrieval → snippetizing → scoring → prompt assembly; where state, external context, depth of reasoning, tools and eval are added.
2евые Key techniquesFew-shot examples, adding external data (Retrieval-Augmented Generation) to reduce hallucinations, formatting long requests The second part was 3 chapter 5. Prompt Content What to “build” from: static (instructions, few-shot + typical risks) vs dynamic (context); RAG (lexical vs neural)embeddings/vector storage; summation (including hierarchical) and the choice of "general" vs "for the task". 6. Assembling the Prompt How to package everything within the context limit: the “anatomy” of the prompt, the choice of the document format (advice conversation / analytic report / structured doc)Formatting snippets and few-shots, elastic snippets, dependencies between pieces (position/importance/dependency). Plus important practice: the middle of the prompt often “sinks” (valley of meh)It is best to keep the important thing near the end. 7. Taming the Model Anatomy completion: preamble, recognizable start/end, postscript; stop-sequence/streaming; logprobs for confidence/classification; how to choose a model (quality/price/latency/features).
In continuation I will talk about advanced topics, as well as share my thoughts on the relevance of the book in 2026 year.
#AI #DevOps #Software #Engineering #Architecture