{"id":444192,"date":"2025-01-08T03:01:16","date_gmt":"2025-01-08T03:01:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444192"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-08T03:01:16","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444192","title":{"rendered":"<span>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 LLM<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e LLM \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0440\u043e\u0441\u043b\u043e, \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u043b\u0438 \u043b\u0443\u0447\u0448\u0435, \u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b \u043c\u043e\u0449\u043d\u0435\u0435. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0432\u0435\u0441\u043e\u0432 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. <br \/>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0430 &#8212; \u0442\u043e\u043a\u0435\u043d \u0437\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<p>\u041d\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u043c\u044b \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043c\u044b\u0441\u043b\u0438\u043c \u0438\u0434\u0435\u044f\u043c\u0438, \u0430 \u0441\u043b\u043e\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u043c \u201c\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0435\u201d. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f.<\/p>\n<h3>Prefill vs decode<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/347\/864\/29a\/34786429ac7e37c2a850c7f9f6d99532.jpg\" alt=\"prefill (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 + \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 KVCache) vs decode (\u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432)\" title=\"prefill (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 + \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 KVCache) vs decode (\u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432)\" width=\"1280\" height=\"905\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/347\/864\/29a\/34786429ac7e37c2a850c7f9f6d99532.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>prefill (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 + \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 KVCache) <br \/>vs <br \/>decode (\u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432)<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 llm \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u0441\u0442\u0430\u0434\u0438\u0438:<\/p>\n<ol>\n<li>\n<p><strong>Prefill<\/strong> &#8212; \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 KVCache<br \/><strong>Compute-bound<\/strong> \u0437\u0430\u0434\u0430\u0447\u0430 (\u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0442\u0440\u0438\u0446) <\/p>\n<\/li>\n<li>\n<p><strong>Decode<\/strong> &#8212; \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e: \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043a\u0435\u043d, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u043c\u043f\u0442\u0443, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e <br \/><strong>Memory-bound<\/strong> \u0437\u0430\u0434\u0430\u0447\u0430 (\u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0430\u0441\u043a\u0430\u0435\u043c KVCache \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c)<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0443\u0442 \u0435\u0441\u0442\u044c 2 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 kv-cache \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439. <br \/>\u041e\u0442 \u0447\u0435\u0433\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u0436\u0430\u0442\u0438\u044f \u0438 \u043e\u0444\u043b\u043e\u0430\u0434\u0438\u043d\u0433\u0430 \u043a\u0435\u0448\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0441\u043d\u0438\u0436\u0430\u044e\u0449\u0430\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u0412 \u044d\u0442\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a vllm \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e PagedAttention. <br \/>\u042f \u043f\u0438\u0441\u0430\u043b \u043e\u0431 \u044d\u0442\u043e\u043c <a href=\"https:\/\/t.me\/deploy_ml\/71\" rel=\"noopener noreferrer nofollow\">\u0432 \u0441\u0432\u043e\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0430\u043c \u043a\u0430\u043d\u0430\u043b\u0435<\/a> (\u0438 \u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u0430\u0441\u0430\u0435\u043c\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439).<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e forward \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d, \u0447\u0442\u043e \u043d\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u0418 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0438\u0434\u0435\u0435 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0418\u0434\u0435\u044f \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>\u0418\u043c\u0435\u0435\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 forward \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0432 decode. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u044b \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043d\u0435\u0441\u0442\u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432? <br \/>\u0412\u0435\u0434\u044c \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c &#171;\u0443\u0433\u0430\u0434\u0430\u043d\u043d\u0430\u044f&#187; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0446\u0435\u043b\u0438\u043a\u043e\u043c (\u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0449\u0435\u0433\u043e forward), \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e forward \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 decode \u0441\u0442\u0430\u0434\u0438\u0438.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0438\u0434\u0435\u0439\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043a\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0440\u044b \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u0442\u0430\u043a \u0438 \u043f\u043e \u201c\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0442\u0432\u0435\u0442\u0430\u201d (\u0447\u0442\u043e \u0431\u044b \u0432\u044b \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b\u0438) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<h3>\u0421\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/429\/dac\/9b9\/429dac9b91726a0830a4742020db25c4.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430\" width=\"1280\" height=\"773\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/429\/dac\/9b9\/429dac9b91726a0830a4742020db25c4.png\"\/><\/p>\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u043f\u0435\u0440\u0435\u0434 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e \u0442\u043e\u043a\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430 \u043e\u0434\u0438\u043d forward \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u043c\u0435\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 q(x) \u0434\u043b\u044f \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 p(x) \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0436\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u043c\u0435\u0441\u0442\u043e  \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f x \u223c p(x):<\/p>\n<ol>\n<li>\n<p>\u0421\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u043c x \u223c q(x)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 q(x) \u2264 p(x) \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 q(x) &gt; p(x), \u0442\u043e \u0440\u0435\u0434\u0436\u0435\u043a\u0442\u0438\u043c \u0435\u0433\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e 1 \u2212 p(x)\/q(x)<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0434\u0436\u0435\u043a\u0442\u0430 \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u043c x \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f norm(max(0, p(x) \u2212 q(x)))<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c x \u223c p(x).<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2211.17192\" rel=\"noopener noreferrer nofollow\"><strong><u>Fast Inference from Transformers via Speculative Decoding<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/feifeibear\/LLMSpeculativeSampling\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/feifeibear\/LLMSpeculativeSampling<\/a><\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2302.01318\" rel=\"noopener noreferrer nofollow\"><strong><u>Accelerating Large Language Model Decoding with Speculative Sampling<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/shreyansh26\/Speculative-Sampling?tab=readme-ov-file\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/shreyansh26\/Speculative-Sampling<\/a><\/p>\n<h3>Lookahead decoding<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/596\/7e0\/aec\/5967e0aecdf238046ad6de5ae33c9e70.jpg\" alt=\"\u0421\u0445\u0435\u043c\u0430 lookahead \u0441 \u0445\u0435\u0448\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 N-gram \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438\" title=\"\u0421\u0445\u0435\u043c\u0430 lookahead \u0441 \u0445\u0435\u0448\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 N-gram \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438\" width=\"1280\" height=\"959\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/596\/7e0\/aec\/5967e0aecdf238046ad6de5ae33c9e70.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 lookahead \u0441 \u0445\u0435\u0448\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 N-gram \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u044c (\u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043d\u0438\u0436\u0435 &#8212; \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439). \u0410 \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 &#8212; \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0432 \u0445\u0435\u0448 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 \u0432\u044b\u0445\u043e\u0434 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u043f\u0435\u0440\u0435\u0434, \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043d\u0430 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0421\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u042f\u043a\u043e\u0431\u0438.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2402.02057\" rel=\"noopener noreferrer nofollow\"><strong><u>Break the Sequential Dependency of LLM Inference Using LOOKAHEAD DECODING<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/hao-ai-lab\/LookaheadDecoding\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/hao-ai-lab\/LookaheadDecoding<\/a><\/p>\n<p>\u0415\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 TensorRT-LLM:<br \/><a href=\"https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/blob\/main\/examples\/lookahead\/README.md\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/blob\/main\/examples\/lookahead\/README.md<\/a><\/p>\n<p>\u041e \u0441\u0430\u043c\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u042f\u043a\u043e\u0431\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442:<\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2305.10427\" rel=\"noopener noreferrer nofollow\"><strong><u>Accelerating Transformer Inference for Translation via Parallel Decoding<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/teelinsan\/parallel-decoding\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/teelinsan\/parallel-decoding<\/a><\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044b (early exit \u0438 skip decode)<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d2a\/149\/fc4\/d2a149fc4b0cb896f3d08f85fd2213eb.png\" alt=\"Early exit \u0438 layer skip\" title=\"Early exit \u0438 layer skip\" width=\"1280\" height=\"752\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d2a\/149\/fc4\/d2a149fc4b0cb896f3d08f85fd2213eb.png\"\/><\/p>\n<div><figcaption>Early exit \u0438 layer skip<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c early-exit \u0441\u043b\u043e\u0435\u0432 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0432\u0435\u0441\u0430\u0445. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u0438 \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2307.02628\" rel=\"noopener noreferrer nofollow\"><strong><u>SkipDecode: Autoregressive Skip Decoding with Batching and Caching for Efficient LLM Inference<\/u><\/strong><\/a><br \/><strong>code:<\/strong> \u0437\u0430\u043a\u0440\u044b\u0442 \ud83d\ude14<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2312.04916\" rel=\"noopener noreferrer nofollow\"><strong><u>EE-LLM: Large-Scale Training and Inference of Early-Exit Large Language Models with 3D Parallelism<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/pan-x-c\/EE-LLM\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pan-x-c\/EE-LLM<\/a><\/p>\n<h3>Multitoken prediction<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c84\/9f8\/019\/c849f801982bf11466e288fd31913a54.png\" alt=\"multitoken prediction\" title=\"multitoken prediction\" width=\"1030\" height=\"824\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c84\/9f8\/019\/c849f801982bf11466e288fd31913a54.png\"\/><\/p>\n<div><figcaption>multitoken prediction<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432? \u0410 \u043c\u044b \u0443\u0436\u0435 \u0440\u0435\u0448\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2404.19737\" rel=\"noopener noreferrer nofollow\"><strong><u>Better &amp; Faster Large Language Models via Multi-token Prediction<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> \u043d\u0435\u0442 \ud83d\ude14<\/p>\n<p>\u041d\u043e \u0438\u0434\u0435\u044e \u043e\u0431\u043e\u0431\u0449\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0441\u043e\u0432.<\/p>\n<h3>Medusa<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5b7\/a95\/813\/5b7a958134bbc051fb0784f7975bce34.png\" alt=\"\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0443\u0442\u0430 \u0438 \u0438\u0434\u0435\u0439\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\" title=\"\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0443\u0442\u0430 \u0438 \u0438\u0434\u0435\u0439\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\" width=\"982\" height=\"778\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b7\/a95\/813\/5b7a958134bbc051fb0784f7975bce34.png\"\/><\/p>\n<div><figcaption>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0443\u0442\u0430 \u0438 \u0438\u0434\u0435\u0439\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u0432\u0438\u0432\u0430\u044f \u0438\u0434\u0435\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a LMHead (\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u0435) \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043e\u043b\u043e\u0432, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0443\u044e\u0449\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430\u043f\u0435\u0440\u0435\u0434. <br \/>\u0418 \u0434\u043e\u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445, \u0447\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0438 \u043b\u044e\u0431\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2401.10774\" rel=\"noopener noreferrer nofollow\"><strong><u>Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads<\/u><\/strong><\/a><u><br \/><\/u><strong>code:<\/strong> <a href=\"https:\/\/github.com\/FasterDecoding\/Medusa\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/FasterDecoding\/Medusa<\/a><\/p>\n<h3>Eagle<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8d3\/36f\/cc6\/8d336fcc68c1fa9074fa6aad5faccff3.png\" alt=\"Eagle. \u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0438\u0434\u0435\u0435, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e\u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0440\u0430\u0437\u0443\" title=\"Eagle. \u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0438\u0434\u0435\u0435, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e\u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0440\u0430\u0437\u0443\" width=\"1250\" height=\"1008\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8d3\/36f\/cc6\/8d336fcc68c1fa9074fa6aad5faccff3.png\"\/><\/p>\n<div><figcaption>Eagle. \u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0438\u0434\u0435\u0435, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e<br \/>\u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0440\u0430\u0437\u0443<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u0434\u0435\u0438 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430 \u0441 draft \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0441 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0433\u043e\u043b\u043e\u0432 \u0438 \u0438\u0434\u0435\u0439 \u0438\u0437 lookahead.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433, \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0435\u0449\u0435 \u0438 feature-\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u044d\u0442\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434 LMHead).<br \/>Draft \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 LMHead \u0438 \u0441\u043b\u043e\u0439 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0431\u0443\u0447\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u201c\u0442\u0443\u0448\u043a\u0443\u201d \u043d\u0430 \u0441\u043c\u0435\u0441\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0441\u0441\u0430 \u0438 l1 (\u043c\u0435\u0436\u0434\u0443 feature \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0435\u0439). \u041c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0442\u0443\u0448\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u0410 \u0441\u0430\u043c \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u043c\u043f\u043b\u0438\u043d\u0433 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tree-search (\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u043e 2 \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438).<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2401.15077\" rel=\"noopener noreferrer nofollow\"><strong><u>EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/SafeAILab\/EAGLE\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/SafeAILab\/EAGLE<\/a><\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 &#8212; TensorRT-LLM (<a href=\"https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/tree\/main\/examples\/eagle\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/tree\/main\/examples\/eagle<\/a>), vLLM (<a href=\"https:\/\/github.com\/vllm-project\/vllm\/pull\/6830\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/vllm-project\/vllm\/pull\/6830<\/a>)<\/p>\n<h3>\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>\u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u043e\u0434 \u0432\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0445 \u0432\u0435\u0440\u044b \u0432 \u043d\u0438\u0445. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0430 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 &#8212; \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043d\u0435\u043c.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0440\u0438 \u043f\u0443\u0442\u0438:<\/p>\n<ol>\n<li>\n<p>Lookahead &#8212; \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043d\u0438 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f,<\/p>\n<\/li>\n<li>\n<p>\u0421\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433 &#8212; \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c draft \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0435\u0435 \u0432\u0435\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439 \u0435\u0441\u0442\u044c \u0432\u0435\u0441\u0430 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0441\u0442 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 70b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 1b\/3b\/7b,<\/p>\n<\/li>\n<li>\n<p>\u0412\u0430\u0440\u0438\u0430\u0446\u0438\u0438 Eagle\/Medusa \u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0433\u043e\u043b\u043e\u0432\u044b &#8212; \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0430 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0435\u0441\u0430 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u0440\u0430\u0442\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0443\u0442\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/871704\/\"> https:\/\/habr.com\/ru\/articles\/871704\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e LLM \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0440\u043e\u0441\u043b\u043e, \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u043b\u0438 \u043b\u0443\u0447\u0448\u0435, \u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b \u043c\u043e\u0449\u043d\u0435\u0435. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0432\u0435\u0441\u043e\u0432 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. <br \/>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0430 &#8212; \u0442\u043e\u043a\u0435\u043d \u0437\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.<\/p>\n<p>\u041d\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u043c\u044b \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043c\u044b\u0441\u043b\u0438\u043c \u0438\u0434\u0435\u044f\u043c\u0438, \u0430 \u0441\u043b\u043e\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u043c \u201c\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0435\u201d. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f.<\/p>\n<h3>Prefill vs decode<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>prefill (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 + \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 KVCache) <br \/>vs <br \/>decode (\u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432)<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 llm \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435 \u0441\u0442\u0430\u0434\u0438\u0438:<\/p>\n<ol>\n<li>\n<p><strong>Prefill<\/strong> &#8212; \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 KVCache<br \/><strong>Compute-bound<\/strong> \u0437\u0430\u0434\u0430\u0447\u0430 (\u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0442\u0440\u0438\u0446) <\/p>\n<\/li>\n<li>\n<p><strong>Decode<\/strong> &#8212; \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e: \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043a\u0435\u043d, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u043c\u043f\u0442\u0443, \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e <br \/><strong>Memory-bound<\/strong> \u0437\u0430\u0434\u0430\u0447\u0430 (\u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0430\u0441\u043a\u0430\u0435\u043c KVCache \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c)<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0443\u0442 \u0435\u0441\u0442\u044c 2 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 kv-cache \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439. <br \/>\u041e\u0442 \u0447\u0435\u0433\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u0436\u0430\u0442\u0438\u044f \u0438 \u043e\u0444\u043b\u043e\u0430\u0434\u0438\u043d\u0433\u0430 \u043a\u0435\u0448\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0441\u043d\u0438\u0436\u0430\u044e\u0449\u0430\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e. \u0412 \u044d\u0442\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a vllm \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e PagedAttention. <br \/>\u042f \u043f\u0438\u0441\u0430\u043b \u043e\u0431 \u044d\u0442\u043e\u043c <a href=\"https:\/\/t.me\/deploy_ml\/71\" rel=\"noopener noreferrer nofollow\">\u0432 \u0441\u0432\u043e\u0435\u043c \u0442\u0435\u043b\u0435\u0433\u0430\u043c \u043a\u0430\u043d\u0430\u043b\u0435<\/a> (\u0438 \u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u0430\u0441\u0430\u0435\u043c\u043e \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439).<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e forward \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d, \u0447\u0442\u043e \u043d\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u0418 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0438\u0434\u0435\u0435 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0418\u0434\u0435\u044f \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>\u0418\u043c\u0435\u0435\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 forward \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0432 decode. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u044b \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043d\u0435\u0441\u0442\u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432? <br \/>\u0412\u0435\u0434\u044c \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c &#171;\u0443\u0433\u0430\u0434\u0430\u043d\u043d\u0430\u044f&#187; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0446\u0435\u043b\u0438\u043a\u043e\u043c (\u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0449\u0435\u0433\u043e forward), \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e forward \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 decode \u0441\u0442\u0430\u0434\u0438\u0438.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0438\u0434\u0435\u0439\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u043a\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0440\u044b \u043d\u0430 \u0432\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u0442\u0430\u043a \u0438 \u043f\u043e \u201c\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u043e\u0442\u0432\u0435\u0442\u0430\u201d (\u0447\u0442\u043e \u0431\u044b \u0432\u044b \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b\u0438) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<h3>\u0421\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u043f\u0435\u0440\u0435\u0434 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e \u0442\u043e\u043a\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430 \u043e\u0434\u0438\u043d forward \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u043c\u0435\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 q(x) \u0434\u043b\u044f \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 p(x) \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0436\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432\u043c\u0435\u0441\u0442\u043e  \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f x \u223c p(x):<\/p>\n<ol>\n<li>\n<p>\u0421\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u043c x \u223c q(x)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 q(x) \u2264 p(x) \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 q(x) &gt; p(x), \u0442\u043e \u0440\u0435\u0434\u0436\u0435\u043a\u0442\u0438\u043c \u0435\u0433\u043e \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e 1 \u2212 p(x)\/q(x)<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0434\u0436\u0435\u043a\u0442\u0430 \u0441\u0435\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u043c x \u0438\u0437 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f norm(max(0, p(x) \u2212 q(x)))<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c x \u223c p(x).<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2211.17192\" rel=\"noopener noreferrer nofollow\"><strong><u>Fast Inference from Transformers via Speculative Decoding<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/feifeibear\/LLMSpeculativeSampling\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/feifeibear\/LLMSpeculativeSampling<\/a><\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2302.01318\" rel=\"noopener noreferrer nofollow\"><strong><u>Accelerating Large Language Model Decoding with Speculative Sampling<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/shreyansh26\/Speculative-Sampling?tab=readme-ov-file\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/shreyansh26\/Speculative-Sampling<\/a><\/p>\n<h3>Lookahead decoding<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0445\u0435\u043c\u0430 lookahead \u0441 \u0445\u0435\u0448\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 N-gram \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u044c (\u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043d\u0438\u0436\u0435 &#8212; \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439). \u0410 \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 &#8212; \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0432 \u0445\u0435\u0448 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 \u0432\u044b\u0445\u043e\u0434 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u043f\u0435\u0440\u0435\u0434, \u0435\u0441\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0439 \u043d\u0430 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0421\u043f\u0435\u043a\u0443\u043b\u044f\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u042f\u043a\u043e\u0431\u0438.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2402.02057\" rel=\"noopener noreferrer nofollow\"><strong><u>Break the Sequential Dependency of LLM Inference Using LOOKAHEAD DECODING<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/hao-ai-lab\/LookaheadDecoding\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/hao-ai-lab\/LookaheadDecoding<\/a><\/p>\n<p>\u0415\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 TensorRT-LLM:<br \/><a href=\"https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/blob\/main\/examples\/lookahead\/README.md\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/blob\/main\/examples\/lookahead\/README.md<\/a><\/p>\n<p>\u041e \u0441\u0430\u043c\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u042f\u043a\u043e\u0431\u0438 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442:<\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2305.10427\" rel=\"noopener noreferrer nofollow\"><strong><u>Accelerating Transformer Inference for Translation via Parallel Decoding<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/teelinsan\/parallel-decoding\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/teelinsan\/parallel-decoding<\/a><\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044b (early exit \u0438 skip decode)<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>Early exit \u0438 layer skip<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c early-exit \u0441\u043b\u043e\u0435\u0432 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0432\u0435\u0441\u0430\u0445. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u0438 \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2307.02628\" rel=\"noopener noreferrer nofollow\"><strong><u>SkipDecode: Autoregressive Skip Decoding with Batching and Caching for Efficient LLM Inference<\/u><\/strong><\/a><br \/><strong>code:<\/strong> \u0437\u0430\u043a\u0440\u044b\u0442 \ud83d\ude14<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2312.04916\" rel=\"noopener noreferrer nofollow\"><strong><u>EE-LLM: Large-Scale Training and Inference of Early-Exit Large Language Models with 3D Parallelism<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/pan-x-c\/EE-LLM\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/pan-x-c\/EE-LLM<\/a><\/p>\n<h3>Multitoken prediction<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>multitoken prediction<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432? \u0410 \u043c\u044b \u0443\u0436\u0435 \u0440\u0435\u0448\u0438\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/pdf\/2404.19737\" rel=\"noopener noreferrer nofollow\"><strong><u>Better &amp; Faster Large Language Models via Multi-token Prediction<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> \u043d\u0435\u0442 \ud83d\ude14<\/p>\n<p>\u041d\u043e \u0438\u0434\u0435\u044e \u043e\u0431\u043e\u0431\u0449\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0441\u043e\u0432.<\/p>\n<h3>Medusa<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0443\u0442\u0430 \u0438 \u0438\u0434\u0435\u0439\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u0432\u0438\u0432\u0430\u044f \u0438\u0434\u0435\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a LMHead (\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u0435) \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u043e\u043b\u043e\u0432, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0443\u044e\u0449\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0430\u043f\u0435\u0440\u0435\u0434. <br \/>\u0418 \u0434\u043e\u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445, \u0447\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0438 \u043b\u044e\u0431\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u0430.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2401.10774\" rel=\"noopener noreferrer nofollow\"><strong><u>Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads<\/u><\/strong><\/a><u><br \/><\/u><strong>code:<\/strong> <a href=\"https:\/\/github.com\/FasterDecoding\/Medusa\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/FasterDecoding\/Medusa<\/a><\/p>\n<h3>Eagle<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>Eagle. \u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0438\u0434\u0435\u0435, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e<br \/>\u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0442\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0440\u0430\u0437\u0443<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u0434\u0435\u0438 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430 \u0441 draft \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0441 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0433\u043e\u043b\u043e\u0432 \u0438 \u0438\u0434\u0435\u0439 \u0438\u0437 lookahead.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433, \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0435\u0449\u0435 \u0438 feature-\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u044d\u0442\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434 LMHead).<br \/>Draft \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 LMHead \u0438 \u0441\u043b\u043e\u0439 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u0431\u0443\u0447\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u201c\u0442\u0443\u0448\u043a\u0443\u201d \u043d\u0430 \u0441\u043c\u0435\u0441\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043b\u043e\u0441\u0441\u0430 \u0438 l1 (\u043c\u0435\u0436\u0434\u0443 feature \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0435\u0439). \u041c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0442\u0443\u0448\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u0410 \u0441\u0430\u043c \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u043c\u043f\u043b\u0438\u043d\u0433 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tree-search (\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u043e 2 \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438).<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2401.15077\" rel=\"noopener noreferrer nofollow\"><strong><u>EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty<\/u><\/strong><\/a><strong><u><br \/><\/u>code:<\/strong> <a href=\"https:\/\/github.com\/SafeAILab\/EAGLE\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/SafeAILab\/EAGLE<\/a><\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 &#8212; TensorRT-LLM (<a href=\"https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/tree\/main\/examples\/eagle\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/NVIDIA\/TensorRT-LLM\/tree\/main\/examples\/eagle<\/a>), vLLM (<a href=\"https:\/\/github.com\/vllm-project\/vllm\/pull\/6830\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/vllm-project\/vllm\/pull\/6830<\/a>)<\/p>\n<h3>\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>\u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u043e\u0434 \u0432\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0445 \u0432\u0435\u0440\u044b \u0432 \u043d\u0438\u0445. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u043c\u0435\u043d\u0430 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 &#8212; \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043d\u0435\u043c.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0440\u0438 \u043f\u0443\u0442\u0438:<\/p>\n<ol>\n<li>\n<p>Lookahead &#8212; \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043d\u0438 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f,<\/p>\n<\/li>\n<li>\n<p>\u0421\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433 &#8212; \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c draft \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0435\u0435 \u0432\u0435\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439 \u0435\u0441\u0442\u044c \u0432\u0435\u0441\u0430 \u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0441\u0442 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 70b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 1b\/3b\/7b,<\/p>\n<\/li>\n<li>\n<p>\u0412\u0430\u0440\u0438\u0430\u0446\u0438\u0438 Eagle\/Medusa \u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0433\u043e\u043b\u043e\u0432\u044b &#8212; \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0430 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043f\u0435\u043a\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u043d\u0433\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0435\u0441\u0430 \u0434\u0440\u0430\u0444\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u0440\u0430\u0442\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0443\u0442\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/871704\/\"> https:\/\/habr.com\/ru\/articles\/871704\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-444192","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444192","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=444192"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444192\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}