{"id":481493,"date":"2026-05-29T06:10:55","date_gmt":"2026-05-29T06:10:55","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=481493"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=481493","title":{"rendered":"\u041f\u043e\u0447\u0435\u043c\u0443 RAG \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u00bb: latency, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u0432\u044b\u0431\u043e\u0440 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 retrieval"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2><\/h2>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435: RAG\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u043f\u043e\u0438\u0441\u043a + LLM\u00bb. \u0412\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u00a0\u0432\u00a0vector\u00a0DB, \u0430\u00a0\u0432\u00a0embedding \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0440\u043e\u0441\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 prompt \u0438\u00a0\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. Top-k, chunk size \u0438\u00a0retrieval mode \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u00a0\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0430\u00a0\u043d\u0435\u00a0\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u00ab\u043f\u043e\u00a0\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434: \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e retrieval \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e\u0434 \u0442\u0438\u043f \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, latency budget \u0438\u00a0\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043f\u0440\u043e RAG, \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c LLM-\u0441\u0438\u0441\u0442\u0435\u043c\u0443: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u0434\u0435\u0438 \u0438 \u0442\u0435\u043e\u0440\u0438\u0438 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 RAG &#8212; \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043e\u0433\u0430\u0442\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443, \u0440\u0430\u0437\u043c\u0435\u0440 prompt, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e input tokens, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u0430, SLA \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u042f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u044d\u0442\u043e \u043d\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043e\u0431\u0449\u0438\u0445 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439, \u0430 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435: \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u043a\u0430\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 (latency), \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 (retrieval) \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u0438\u043f\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043d\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u0411\u0414, \u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u0432 \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 RAG.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0442.\u043a. \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435. \u0427\u0430\u0441\u0442\u044c \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0434\u0430\u043d\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 &#8212; \u0438\u043b\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0438\u043b\u0438 \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0435 \u0438 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 (\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 &#8212; LLM).<\/p>\n<h3>\u0421\u0442\u0435\u043d\u0434 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>LLM: mistral:7b<\/p>\n<\/li>\n<li>\n<p>embedding \u043c\u043e\u0434\u0435\u043b\u044c: qwen3-embedding:0.6b<\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435: Chroma<\/p>\n<\/li>\n<li>\n<p>runtime: Ollama + local Chroma<\/p>\n<\/li>\n<li>\n<p>GPU: RTX 3090 Ti 24 GB<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 reranking<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 tools \/ agents<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0440\u043f\u0443\u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (corpus) \u0431\u044b\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c: \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u043e retrieval, embeddings, latency, \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Chroma, Ollama, API \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a, \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0447\u0430\u0441\u0442\u044c \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u043b\u0430\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0433\u043b\u0430 \u0437\u043d\u0430\u0442\u044c \u0441\u0430\u043c\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u0443\u044e \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0433\u043e \/ \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e (production \/ enterprise) RAG, \u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 RAG \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043a\u043e\u0440\u043f\u0443\u0441\u0430 \u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u044f \u0443\u0442\u043e\u0447\u043d\u0438\u043b \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e \u043a\u043e\u0440\u043f\u0443\u0441\u0430 \u0438 \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u0430\u0436\u043d\u044b\u043c: \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e latency \u0438 overhead \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c, \u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0430 \u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0443.<\/p>\n<p>\u042f \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u043d\u043e \u0438 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438:<\/p>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 (latency):<\/p>\n<ul>\n<li>\n<p>TTFT<\/p>\n<\/li>\n<li>\n<p>E2E latency<\/p>\n<\/li>\n<li>\n<p>prompt eval duration<\/p>\n<\/li>\n<li>\n<p>decode time<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 (retrieval):<\/p>\n<ul>\n<li>\n<p>query embedding time<\/p>\n<\/li>\n<li>\n<p>retrieval time<\/p>\n<\/li>\n<li>\n<p>retrieved chars<\/p>\n<\/li>\n<li>\n<p>assembled prompt size<\/p>\n<\/li>\n<li>\n<p>input tokens actual<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p>answer correctness<\/p>\n<\/li>\n<li>\n<p>groundedness<\/p>\n<\/li>\n<li>\n<p>completeness<\/p>\n<\/li>\n<li>\n<p>context noise<\/p>\n<\/li>\n<li>\n<p>\u043b\u0443\u0447\u0448\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0438\u0441\u043a\u0430 (retrieval mode) \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c: RAG \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, <strong>\u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 RAG \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u044f\u0436\u0435\u043b\u0435\u0435<\/strong>.<\/p>\n<hr\/>\n<h3>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 RAG: \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430<\/h3>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 RAG \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435: RAG \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 &#8212; \u043d\u043e \u0432\u0430\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c: \u0441\u0430\u043c \u043f\u043e\u0438\u0441\u043a \u0447\u0435\u0440\u0435\u0437 Chroma \u0431\u044b\u043b \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0443\u0437\u043a\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 embedding \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/p>\n<\/li>\n<li>\n<p>\u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 assembled prompt<\/p>\n<\/li>\n<li>\n<p>\u0440\u043e\u0441\u0442 input tokens actual<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 prompt \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 LLM<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, RAG \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0440\u043e\u0433\u0438\u043c \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 prompt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e72\/995\/f35\/e72995f354a1cc8c4c57579c53048a42.png\" width=\"2048\" height=\"683\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/e72\/995\/f35\/e72995f354a1cc8c4c57579c53048a42.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e72\/995\/f35\/e72995f354a1cc8c4c57579c53048a42.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<div class=\"floating-image\">\n<figure class=\"float full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/953\/681\/abb\/953681abbfb65d1d401986d3942022ed.png\" width=\"908\" height=\"686\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/953\/681\/abb\/953681abbfb65d1d401986d3942022ed.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/953\/681\/abb\/953681abbfb65d1d401986d3942022ed.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u0435\u043d \u043d\u0435 \u0441\u0430\u043c \u0444\u0430\u043a\u0442, \u0447\u0442\u043e RAG \u0441\u0442\u0430\u043b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. \u0412\u0430\u0436\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u043e\u0435: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c vector DB \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0435\u0441\u044c RAG pipeline \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0448\u0435\u0432\u044b\u043c. \u0414\u0430\u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u043e\u0441\u0442\u0443 TTFT, prompt eval duration \u0438 \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<\/div>\n<hr\/>\n<h3>Retrieval vs no-RAG: \u043a\u043e\u0433\u0434\u0430 RAG \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439: \u0435\u0441\u043b\u0438 RAG \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f?<\/p>\n<p>\u042f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b \u043e\u0442\u0432\u0435\u0442\u044b no-RAG \u0438 RAG \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b, \u0441\u0442\u0430\u043b \u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u0434\u0430\u043b \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443: \u0433\u0434\u0435-\u0442\u043e RAG \u043f\u043e\u043c\u043e\u0433\u0430\u043b, \u0433\u0434\u0435-\u0442\u043e \u0431\u044b\u043b \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u0435\u043d, \u0430 \u0433\u0434\u0435-\u0442\u043e \u0434\u0430\u0436\u0435 \u0443\u0445\u0443\u0434\u0448\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0437\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u044b\u043b\u0430 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0430 \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0440\u043f\u0443\u0441\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c, \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043b\u0443\u0447\u0448\u0435: RAG \u0447\u0430\u0449\u0435 \u0434\u0430\u0432\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b, \u0430 no-RAG \u0447\u0430\u0449\u0435 \u043e\u0448\u0438\u0431\u0430\u043b\u0441\u044f \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0438 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043e\u0440\u043f\u0443\u0441\u0430.<\/p>\n<p>\u041d\u043e \u0432\u044b\u0432\u043e\u0434 \u043f\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0435 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 (overhead) \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0437\u0434\u0435\u0441\u044c \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0435:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e latency \u0438 overhead \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u043f\u0443\u0441\u0430, \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u0437\u0438\u0441 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e &#171;RAG \u043f\u043b\u043e\u0445\u043e\u0439&#187; \u0438\u043b\u0438 &#171;RAG \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u0435\u043d&#187;.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<p><strong>Retrieval \u043d\u0443\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u044b \u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0431\u0430\u0437\u044b \u0437\u043d\u0430\u043d\u0438\u0439 (groundedness) &#8212; \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 retrieval \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0442\u0430\u043a \u0437\u043d\u0430\u0435\u0442, \u0438\u043b\u0438 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u0448\u0443\u043c, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u044f\u0436\u0435\u043b\u0435\u0435 \u0431\u0435\u0437 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h3>top-k: \u043d\u0435 &#171;\u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435&#187;<\/h3>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0432\u043b\u0438\u044f\u043d\u0438\u0435 top-k.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430: \u0432\u0437\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 chunks \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u041d\u043e top-k \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430:<\/p>\n<ul>\n<li>\n<p>retrieved payload<\/p>\n<\/li>\n<li>\n<p>assembled prompt size<\/p>\n<\/li>\n<li>\n<p>input tokens actual<\/p>\n<\/li>\n<li>\n<p>TTFT<\/p>\n<\/li>\n<li>\n<p>prompt eval duration<\/p>\n<\/li>\n<li>\n<p>context noise<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043c\u043e\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u043e\u0441\u0442 top-k \u043f\u043e\u0447\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b \u043e\u0431\u044a\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 input tokens actual.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 top-k \u0441 1 \u0434\u043e 10 input tokens actual \u0432\u044b\u0440\u043e\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441 522 \u0434\u043e 3881.<\/p>\n<p>\u0421\u0430\u043c \u043f\u043e\u0438\u0441\u043a \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u043d\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 prompt \u0440\u043e\u0441\u043b\u0430.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/549\/408\/9c7\/5494089c7bb7ef9a14d631aa4906f763.png\" width=\"1240\" height=\"882\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/549\/408\/9c7\/5494089c7bb7ef9a14d631aa4906f763.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/549\/408\/9c7\/5494089c7bb7ef9a14d631aa4906f763.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong><\/p>\n<p>\u0414\u043e top-k=7 \u0440\u043e\u0441\u0442 \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439, \u043d\u0430 top-k=10 \u0432\u0438\u0434\u043d\u043e \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u0435 overhead. \u0414\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0435\u0440\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u0442\u0440\u0435\u043d\u0434, \u0430 \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f top-k.<\/p>\n<p>\u041f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u043e. <br \/>\u0411\u043e\u043b\u044c\u0448\u0435 chunks \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u0443\u0447\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u043b\u0438\u0436\u0435 \u043a top-k = 3\u20135, \u0441 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u043e\u043c 7.<\/p>\n<p>top-k = 1 \u0438\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0437\u043a\u0438\u043c, \u0430 top-k = 10 \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u0442\u044f\u0436\u0435\u043b\u0430\u044f \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430: \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435, \u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0435\u0442.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<p><strong>top-k &#8212; \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 retrieval, \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0435\u0448\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/strong><\/p>\n<p>\u0415\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0432\u0435\u0442\u0430, \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438 \u043b\u0438\u0448\u043d\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<hr\/>\n<h3>chunk size: \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0<\/h3>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0441 chunk size.<\/p>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u044d\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 chunk size \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 &#8212; \u043a\u0430\u043a\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0432\u0438\u0434\u0438\u0442 retrieval \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 prompt.<\/p>\n<p>\u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>500 chars<\/p>\n<\/li>\n<li>\n<p>1000 chars<\/p>\n<\/li>\n<li>\n<p>1500 chars<\/p>\n<\/li>\n<li>\n<p>2500 chars<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043c\u043e\u0435\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>500-1000 chars \u0434\u0430\u043b\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (context noise);\u00a0<\/p>\n<\/li>\n<li>\n<p>1500 chars \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043d\u043e \u0443\u0436\u0435 \u0434\u0430\u0432\u0430\u043b \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>2500 chars \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u0442\u044f\u0436\u0435\u043b\u0430\u044f \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0442\u043e\u0447\u043a\u0430: \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (payload), \u0432\u044b\u0448\u0435 TTFT, \u0432\u044b\u0448\u0435 prompt eval duration, \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0443\u043c\u0430 \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0430\u0436\u043d\u043e: \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u043e\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u043d\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u043e\u0441\u043b\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c chunk.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 chunk \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u043e \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043b\u0438\u0448\u043d\u044e\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c prompt, \u0443\u0445\u0443\u0434\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0438 \u043d\u0435 \u0434\u0430\u0442\u044c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/725\/f7c\/f21\/725f7cf21c288273b5b21db801a72869.png\" width=\"1144\" height=\"830\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/725\/f7c\/f21\/725f7cf21c288273b5b21db801a72869.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/725\/f7c\/f21\/725f7cf21c288273b5b21db801a72869.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/p>\n<p><strong>chunk size &#8212; \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/strong><\/p>\n<p>\u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d 500-1000 chars \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d, \u044d\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0440\u043f\u0443\u0441\u0430, \u044d\u0442\u043e\u0439 embedding model, \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u044d\u0442\u043e\u0433\u043e prompt contract \u0438 \u044d\u0442\u043e\u0439 LLM.<\/p>\n<hr\/>\n<h3>Chunked retrieval vs document-level retrieval<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u042f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f \u043a retrieval:<\/p>\n<ul>\n<li>\n<p>chunked 500<\/p>\n<\/li>\n<li>\n<p>chunked 1000<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0444\u0430\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e chunked vector retrieval &#8212; \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 chunks \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0438, \u043e\u043d\u0438 \u0434\u0430\u0432\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c prompt.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u0430\u043a \u0446\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. Chunked retrieval \u043c\u043e\u0433 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438, \u043d\u043e \u043d\u0435 \u0432\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c.<\/p>\n<p>\u0414\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u043e\u0440 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439, \u0432\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0438\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443: \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u043e\u0438\u0441\u043a chunks \u0438\u0434\u0435\u0442 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b07\/9ad\/fed\/b079adfed840d21a12be29f5cf178004.png\" width=\"1240\" height=\"722\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b07\/9ad\/fed\/b079adfed840d21a12be29f5cf178004.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b07\/9ad\/fed\/b079adfed840d21a12be29f5cf178004.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0439 \u0441\u0435\u0440\u0438\u0438:<\/p>\n<p><strong>\u0435\u0434\u0438\u043d\u0438\u0446\u0430 retrieval \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.<\/strong><\/p>\n<p>\u0418\u043d\u0430\u0447\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 chunks, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e: \u044d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. \u041e\u043d \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0446\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. \u0414\u043b\u044f \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0430\u043a\u0442\u0430 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0436\u0438\u043c \u0447\u0430\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u0435\u043d, \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 prompt \u0438 \u043c\u043e\u0436\u0435\u0442 \u0443\u0445\u0443\u0434\u0448\u0430\u0442\u044c latency \u0431\u0435\u0437 \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0443\u044e: \u0431\u043e\u043b\u044c\u0448\u0438\u0439 prompt. \u0414\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u043c, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u043c \u0432\u044b\u0431\u043e\u0440\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435.\u00a0<\/p>\n<hr\/>\n<h3>\u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043b\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b RAG<\/h3>\n<p>RAG \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0434\u0438\u043d \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 pipeline:<\/p>\n<p>\u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430 chunks -&gt; \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c embeddings -&gt; \u0441\u0434\u0435\u043b\u0430\u0442\u044c top-k \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a -&gt; \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 LLM<\/p>\n<p>\u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f retrieval \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442:<\/p>\n<ul>\n<li>\n<p>\u0442\u0438\u043f\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u043f\u043e\u043b\u043d\u043e\u0442\u0435 \u043e\u0442\u0432\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0433\u043e latency budget<\/p>\n<\/li>\n<li>\n<p>cost per request<\/p>\n<\/li>\n<li>\n<p>\u0440\u0438\u0441\u043a\u0430 context noise<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 groundedness<\/p>\n<\/li>\n<li>\n<p>\u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u044b\u0445: \u0442\u0435\u043a\u0441\u0442, \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, API-\u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0444\u0430\u043a\u0442\u0430 &#8212; chunked retrieval \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 &#8212; chunked retrieval \u0447\u0430\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 &#8212; \u043d\u0443\u0436\u0435\u043d \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, retrieval \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439\u00a0retrieval<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 &#8212; \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 \u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u0440\u043c\u0438\u043d\u044b, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u043f\u0443\u0441\u0430 &#8212; RAG \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 retrieval \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fc6\/dae\/d97\/fc6daed9760e069488e55b77ae9f9181.png\" width=\"1364\" height=\"1020\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/fc6\/dae\/d97\/fc6daed9760e069488e55b77ae9f9181.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fc6\/dae\/d97\/fc6daed9760e069488e55b77ae9f9181.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<hr\/>\n<h3>\u0427\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c<\/h3>\n<p>\u0415\u0441\u043b\u0438 RAG \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u043c \/ \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435, \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 E2E latency.<\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0434\u043b\u044f RAG:<\/p>\n<ul>\n<li>\n<p>query class<\/p>\n<\/li>\n<li>\n<p>retrieval mode<\/p>\n<\/li>\n<li>\n<p>top-k<\/p>\n<\/li>\n<li>\n<p>chunk size<\/p>\n<\/li>\n<li>\n<p>retrieved chars<\/p>\n<\/li>\n<li>\n<p>assembled prompt chars<\/p>\n<\/li>\n<li>\n<p>input tokens actual<\/p>\n<\/li>\n<li>\n<p>TTFT<\/p>\n<\/li>\n<li>\n<p>prompt eval duration<\/p>\n<\/li>\n<li>\n<p>E2E latency<\/p>\n<\/li>\n<li>\n<p>answer correctness<\/p>\n<\/li>\n<li>\n<p>groundedness<\/p>\n<\/li>\n<li>\n<p>completeness<\/p>\n<\/li>\n<li>\n<p>context noise<\/p>\n<\/li>\n<li>\n<p>cost per request<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e: retrieval \u0432\u0435\u0440\u043d\u0443\u043b \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435?<\/p>\n<p>\u0410 \u0441\u043a\u043e\u0440\u0435\u0435: retrieval \u0432\u0435\u0440\u043d\u0443\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430?<\/p>\n<hr\/>\n<h3>\u041d\u0430\u043f\u043e\u043c\u043d\u044e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h3>\n<ul>\n<li>\n<p>\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043d\u0434<\/p>\n<\/li>\n<li>\n<p>\u043e\u0434\u043d\u0430 LLM<\/p>\n<\/li>\n<li>\n<p>\u043e\u0434\u043d\u0430 embedding model<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u0440\u043f\u0443\u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 (\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0431\u043e\u0435\u0432)<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 reranking<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u0435<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0448\u043a\u0430\u043b\u0435, \u0431\u0435\u0437 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438 \u043e\u0446\u0435\u043d\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0433\u043e\u043d \u0432 \u0440\u044f\u0434\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>Mistral 7B \u043c\u043e\u0433 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e reasoning, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u0446\u0438\u0444\u0440\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0435\u043a\u0438.<\/p>\n<p>\u041d\u043e \u0446\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u0434\u0440\u0443\u0433\u043e\u0439: \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0438 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b  \u043f\u043e\u043b\u0435\u0437\u043d\u044b.<\/p>\n<hr\/>\n<h3>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434<\/h3>\n<p>RAG &#8212; \u044d\u0442\u043e \u043d\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430:<\/p>\n<ul>\n<li>\n<p>latency<\/p>\n<\/li>\n<li>\n<p>input tokens<\/p>\n<\/li>\n<li>\n<p>prompt processing<\/p>\n<\/li>\n<li>\n<p>context budget<\/p>\n<\/li>\n<li>\n<p>cost per request<\/p>\n<\/li>\n<li>\n<p>SLA<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u0448\u0443\u043c \u043e\u0442\u0432\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>top-k, chunk size \u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f retrieval &#8212; \u044d\u0442\u043e \u043d\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u043b\u043e\u0447\u0438, \u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0442\u0430\u043a\u043e\u0439:<\/p>\n<p><strong>RAG \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043e\u0442 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0430 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/strong><\/p>\n<ul>\n<li>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 chunked vector retrieval &#8212; \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u0435\u043d retrieval \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u0435\u043d \u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u0410 \u0438\u043d\u043e\u0433\u0434\u0430 retrieval \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0427\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0433\u043e \/ \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c RAG \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c RAG \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a\u043e\u0439 latency budget \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0437\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0443\u0436\u043d\u0430: chunk, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0443\u0436\u043d\u044b \u0434\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 retrieval \u043d\u0443\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c, \u0430 \u043a\u043e\u0433\u0434\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043b\u0443\u0447\u0448\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441 &#171;\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043b\u0438 RAG?&#187; \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u0435\u043d, \u0447\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441:<\/p>\n<p><strong>&#171;\u043a\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f retrieval \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?&#187;<\/strong><\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1040938\/\">https:\/\/habr.com\/ru\/articles\/1040938\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435: RAG\u00a0\u2014 \u044d\u0442\u043e \u043d\u0435\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u043f\u043e\u0438\u0441\u043a + LLM\u00bb. \u0412\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u00a0\u0432\u00a0vector\u00a0DB, \u0430\u00a0\u0432\u00a0embedding \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0440\u043e\u0441\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 prompt \u0438\u00a0\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. Top-k, chunk size \u0438\u00a0retrieval mode \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u00a0\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0430\u00a0\u043d\u0435\u00a0\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u00ab\u043f\u043e\u00a0\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434: \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e retrieval \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e\u0434 \u0442\u0438\u043f \u0432\u043e\u043f\u0440\u043e\u0441\u0430, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, latency budget \u0438\u00a0\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443.\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u041a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043f\u0440\u043e RAG, \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c LLM-\u0441\u0438\u0441\u0442\u0435\u043c\u0443: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u0434\u0435\u0438 \u0438 \u0442\u0435\u043e\u0440\u0438\u0438 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u043e.\u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 RAG &#8212; \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u043e\u0433\u0430\u0442\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443, \u0440\u0430\u0437\u043c\u0435\u0440 prompt, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e input tokens, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u0430, SLA \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.\u042f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u044d\u0442\u043e \u043d\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043e\u0431\u0449\u0438\u0445 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439, \u0430 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435: \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u043a\u0430\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 (latency), \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 (retrieval) \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u0438\u043f\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445.\u042d\u0442\u043e \u043d\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043d\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0445 \u0411\u0414, \u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u0432 \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 RAG.\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0447\u0430\u0441\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0442.\u043a. \u043e\u043d\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435. \u0427\u0430\u0441\u0442\u044c \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435 \u0434\u0430\u043d\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 &#8212; \u0438\u043b\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0438\u043b\u0438 \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0435 \u0438 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 (\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 &#8212; LLM).\u0421\u0442\u0435\u043d\u0434 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e:LLM: mistral:7bembedding \u043c\u043e\u0434\u0435\u043b\u044c: qwen3-embedding:0.6b\u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435: Chromaruntime: Ollama + local ChromaGPU: RTX 3090 Ti 24 GB\u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438\u0431\u0435\u0437 reranking\u0431\u0435\u0437 tools \/ agents\u0431\u0435\u0437 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u043e\u0440\u043a\u0435\u0441\u0442\u0440\u0430\u0446\u0438\u0438\u041a\u043e\u0440\u043f\u0443\u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (corpus) \u0431\u044b\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c: \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u043e retrieval, embeddings, latency, \u0432\u044b\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0437 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Chroma, Ollama, API \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a, \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a\u0438.\u0412\u0430\u0436\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435: \u0447\u0430\u0441\u0442\u044c \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u043b\u0430\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0433\u043b\u0430 \u0437\u043d\u0430\u0442\u044c \u0441\u0430\u043c\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u0443\u044e \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0433\u043e \/ \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e (production \/ enterprise) RAG, \u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 RAG \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043a\u043e\u0440\u043f\u0443\u0441\u0430 \u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0442\u0441\u044f.\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u044f \u0443\u0442\u043e\u0447\u043d\u0438\u043b \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e \u043a\u043e\u0440\u043f\u0443\u0441\u0430 \u0438 \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0432\u0430\u0436\u043d\u044b\u043c: \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e latency \u0438 overhead \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c, \u0430 \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0430 \u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0443.\u042f \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u043d\u043e \u0438 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438:\u0412 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 (latency):TTFTE2E latencyprompt eval durationdecode time\u0412 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 (retrieval):query embedding timeretrieval timeretrieved charsassembled prompt sizeinput tokens actual\u0412 \u0447\u0430\u0441\u0442\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430:answer correctnessgroundednesscompletenesscontext noise\u043b\u0443\u0447\u0448\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0438\u0441\u043a\u0430 (retrieval mode) \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c: RAG \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438\u043b\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 RAG \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0442\u044f\u0436\u0435\u043b\u0435\u0435.\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 RAG: \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439: \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 RAG \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435: RAG \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 &#8212; \u043d\u043e \u0432\u0430\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f.\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c: \u0441\u0430\u043c \u043f\u043e\u0438\u0441\u043a \u0447\u0435\u0440\u0435\u0437 Chroma \u0431\u044b\u043b \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0443\u0437\u043a\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c.\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435:\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 embedding \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 assembled prompt\u0440\u043e\u0441\u0442 input tokens actual\u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 prompt \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 LLM\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, RAG \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0440\u043e\u0433\u0438\u043c \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 prompt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c.\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u0435\u043d \u043d\u0435 \u0441\u0430\u043c \u0444\u0430\u043a\u0442, \u0447\u0442\u043e RAG \u0441\u0442\u0430\u043b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. \u0412\u0430\u0436\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u043e\u0435: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c vector DB \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0435\u0441\u044c RAG pipeline \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0448\u0435\u0432\u044b\u043c. \u0414\u0430\u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u043e\u0441\u0442\u0443 TTFT, prompt eval duration \u0438 \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.Retrieval vs no-RAG: \u043a\u043e\u0433\u0434\u0430 RAG \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439: \u0435\u0441\u043b\u0438 RAG \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f?\u042f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b \u043e\u0442\u0432\u0435\u0442\u044b no-RAG \u0438 RAG \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u043b, \u0441\u0442\u0430\u043b \u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0435\u0435.\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u0434\u0430\u043b \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443: \u0433\u0434\u0435-\u0442\u043e RAG \u043f\u043e\u043c\u043e\u0433\u0430\u043b, \u0433\u0434\u0435-\u0442\u043e \u0431\u044b\u043b \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u0435\u043d, \u0430 \u0433\u0434\u0435-\u0442\u043e \u0434\u0430\u0436\u0435 \u0443\u0445\u0443\u0434\u0448\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430.\u041f\u043e\u0437\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u044b\u043b\u0430 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0430 \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0440\u043f\u0443\u0441\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c, \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043b\u0443\u0447\u0448\u0435: RAG \u0447\u0430\u0449\u0435 \u0434\u0430\u0432\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b, \u0430 no-RAG \u0447\u0430\u0449\u0435 \u043e\u0448\u0438\u0431\u0430\u043b\u0441\u044f \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0438 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043e\u0440\u043f\u0443\u0441\u0430.\u041d\u043e \u0432\u044b\u0432\u043e\u0434 \u043f\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0435 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 (overhead) \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f.\u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0437\u0434\u0435\u0441\u044c \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0435:\u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e latency \u0438 overhead \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u043c\u0438;\u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u043f\u0443\u0441\u0430, \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0443.\u0422\u043e \u0435\u0441\u0442\u044c \u0442\u0435\u0437\u0438\u0441 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e &#171;RAG \u043f\u043b\u043e\u0445\u043e\u0439&#187; \u0438\u043b\u0438 &#171;RAG \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u0435\u043d&#187;.\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:Retrieval \u043d\u0443\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0443:\u0415\u0441\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u043a\u0442\u044b \u0438\u043b\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0431\u0430\u0437\u044b \u0437\u043d\u0430\u043d\u0438\u0439 (groundedness) &#8212; \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0430.\u0415\u0441\u043b\u0438 retrieval \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0442\u0430\u043a \u0437\u043d\u0430\u0435\u0442, \u0438\u043b\u0438 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u0448\u0443\u043c, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u044f\u0436\u0435\u043b\u0435\u0435 \u0431\u0435\u0437 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b.top-k: \u043d\u0435 &#171;\u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435&#187;\u0414\u0430\u043b\u044c\u0448\u0435 \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0432\u043b\u0438\u044f\u043d\u0438\u0435 top-k.\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u0430\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430: \u0432\u0437\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 chunks \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.\u041d\u043e top-k \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430:retrieved payloadassembled prompt sizeinput tokens actualTTFTprompt eval durationcontext noise\u0412 \u043c\u043e\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u043e\u0441\u0442 top-k \u043f\u043e\u0447\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b \u043e\u0431\u044a\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 input tokens actual.\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 top-k \u0441 1 \u0434\u043e 10 input tokens actual \u0432\u044b\u0440\u043e\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441 522 \u0434\u043e 3881.\u0421\u0430\u043c \u043f\u043e\u0438\u0441\u043a \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u044b\u043c, \u043d\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 prompt \u0440\u043e\u0441\u043b\u0430.\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:\u0414\u043e top-k=7 \u0440\u043e\u0441\u0442 \u0443\u043c\u0435\u0440\u0435\u043d\u043d\u044b\u0439, \u043d\u0430 top-k=10 \u0432\u0438\u0434\u043d\u043e \u0443\u0441\u0438\u043b\u0435\u043d\u0438\u0435 overhead. \u0414\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u0435\u0440\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u0442\u0440\u0435\u043d\u0434, \u0430 \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f top-k.\u041f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 chunks \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u0443\u0447\u0448\u0438\u0439 \u043e\u0442\u0432\u0435\u0442.\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u043b\u0438\u0436\u0435 \u043a top-k = 3\u20135, \u0441 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u043e\u043c 7.top-k = 1 \u0438\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0437\u043a\u0438\u043c, \u0430 top-k = 10 \u0443\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u0442\u044f\u0436\u0435\u043b\u0430\u044f \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430: \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435, \u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0435\u0442.\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:top-k &#8212; \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 retrieval, \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0435\u0448\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.\u0415\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0432\u0435\u0442\u0430, \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438 \u043b\u0438\u0448\u043d\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c.chunk size: \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0441 chunk size.\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u044d\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 chunk size \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 &#8212; \u043a\u0430\u043a\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0437\u043d\u0430\u043d\u0438\u044f \u0443\u0432\u0438\u0434\u0438\u0442 retrieval \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 prompt.\u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432:500 chars1000 chars1500 chars2500 chars\u0412 \u043c\u043e\u0435\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:500-1000 chars \u0434\u0430\u043b\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (context noise);\u00a01500 chars \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043d\u043e \u0443\u0436\u0435 \u0434\u0430\u0432\u0430\u043b \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c;2500 chars \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a \u0442\u044f\u0436\u0435\u043b\u0430\u044f \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0442\u043e\u0447\u043a\u0430: \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (payload), \u0432\u044b\u0448\u0435 TTFT, \u0432\u044b\u0448\u0435 prompt eval duration, \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0443\u043c\u0430 \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0438.\u0412\u0430\u0436\u043d\u043e: \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u043e\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u043d\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u0440\u043e\u0441\u043b\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c chunk.\u0411\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0439 chunk \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u043e \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043b\u0438\u0448\u043d\u044e\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c prompt, \u0443\u0445\u0443\u0434\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u0438 \u043d\u0435 \u0434\u0430\u0442\u044c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430.\u041f\u043e\u044d\u0442\u043e\u043c\u0443:chunk size &#8212; \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.\u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d 500-1000 chars \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d, \u044d\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0440\u043f\u0443\u0441\u0430, \u044d\u0442\u043e\u0439 embedding model, \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u044d\u0442\u043e\u0433\u043e prompt contract \u0438 \u044d\u0442\u043e\u0439 LLM.Chunked retrieval vs document-level retrieval\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e.\u042f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f \u043a retrieval:chunked 500chunked 1000\u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a\u0418 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432:\u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0444\u0430\u043a\u0442\u0430\u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432\u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u0430\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e chunked vector retrieval &#8212; \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.\u0414\u043b\u044f \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 chunks \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0438, \u043e\u043d\u0438 \u0434\u0430\u0432\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c prompt.\u041d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u0430\u043a \u0446\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. Chunked retrieval \u043c\u043e\u0433 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438, \u043d\u043e \u043d\u0435 \u0432\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c.\u0414\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u043e\u0440 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439, \u0432\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0438\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443: \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u043e\u0438\u0441\u043a chunks \u0438\u0434\u0435\u0442 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430.\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0439 \u0441\u0435\u0440\u0438\u0438:\u0435\u0434\u0438\u043d\u0438\u0446\u0430 retrieval \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430.\u0418\u043d\u0430\u0447\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 chunks, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0434\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.\u0412\u0430\u0436\u043d\u043e: \u044d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. \u041e\u043d \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0446\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u043b\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. \u0414\u043b\u044f \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0444\u0430\u043a\u0442\u0430&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-481493","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/481493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=481493"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/481493\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=481493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=481493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=481493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}