{"id":363407,"date":"2024-05-21T01:55:17","date_gmt":"2024-05-21T01:55:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=363407"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T01:55:17","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=363407","title":{"rendered":"<span>&#8216;Attention is all you need&#8217; \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c<\/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<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043f\u043e\u0432\u0435\u0441\u0438\u043b <a href=\"https:\/\/habr.com\/ru\/articles\/778048\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u043e\u0431\u0437\u043e\u0440\u043e\u043c \u0442\u0435\u0445\u043d\u0438\u043a \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/a>, \u0438 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0432 \u043a\u0430\u043a\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 NLP \u0448\u0430\u0433\u043d\u0443\u043b\u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <strong>attention<\/strong>. \u041c\u044b \u0441 <a href=\"mailto:zdrelyuk@bk.ru\" rel=\"noopener noreferrer nofollow\">\u0414\u0430\u0440\u044c\u0435\u0439, \u043c\u043e\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443<\/a>, \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0432\u0438\u0434\u0435\u043e\u0440\u043e\u043b\u0438\u043a &#171;<a href=\"https:\/\/www.youtube.com\/watch?v=sznZ78HquPc\" rel=\"noopener noreferrer nofollow\">Attention is all you need explained<\/a>&#187; \u0432 \u0441\u0442\u0430\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e.  \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0437\u0430 \u0441\u0432\u0435\u0442\u043e\u0444\u043e\u0440 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445: \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0447\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u043d \u0438\u0437 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432 \u0443\u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c :).<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 2017 \u0433\u043e\u0434\u0443, \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <em>Attention is all you need<\/em>, \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0437 Google \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 Transformer. \u041d\u043e\u0432\u0438\u0437\u043d\u0430 Transformer \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 self-attention <em>(\u0434\u043e\u0441\u043b. \u0441 \u0430\u043d\u0433\u043b. \u2014 \u0441\u0430\u043c\u043e\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435)<\/em> \u2014 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0440\u0430\u0437\u0443, \u0430 \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0445 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/2v\/hx\/gx\/2vhxgxld0o-dlxiblqgz3_p5bmu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/2v\/hx\/gx\/2vhxgxld0o-dlxiblqgz3_p5bmu.png\"\/><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h3>1. \u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d attention<\/h3>\n<h4>1.1. \u041f\u0440\u043e \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 (RNNs)<\/h4>\n<p>\u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f <em>Transformer<\/em> \u0437\u0430\u0434\u0430\u0447\u0438 NLP \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 (RNN) \u2014 \u043e\u043d\u0438 \u0443\u043c\u0435\u044e\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/b9\/tq\/zr\/b9tqzrqcvx7syi-1jhbkxo40o1o.png\" data-src=\"https:\/\/habrastorage.org\/webt\/b9\/tq\/zr\/b9tqzrqcvx7syi-1jhbkxo40o1o.png\"\/><\/figure>\n<p>\u0423 RNN \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0432 \u043d\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043d\u0438\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0442\u0443\u0445\u0430\u044e\u0449\u0438\u0445 \u0438 \u0440\u0430\u0437\u043b\u0435\u0442\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ol>\n<h4>1.2. Transformers. \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c &#8216;Self-attention&#8217;<\/h4>\n<p><em>Transformer<\/em> \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u044d\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <em>self-attention. Self-attention<\/em> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0435\u0441\u0430 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0447\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043e\u0431\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b RNN.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ok\/y3\/4g\/oky34ggnd2fyyc40kwe8zm3n0lk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ok\/y3\/4g\/oky34ggnd2fyyc40kwe8zm3n0lk.png\"\/><\/figure>\n<h4>1.3. \u041b\u0438\u043d\u0433\u0432\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u043f\u043e\u0445\u043e\u0436\u0438 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <em>she<\/em> \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 <em>Alice<\/em>, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <em>Barbara.<\/em><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/k5\/o9\/8o\/k5o98oaldmgmaowme0a7j7evjpw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/k5\/o9\/8o\/k5o98oaldmgmaowme0a7j7evjpw.png\"\/><\/figure>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c <em><u>younger<\/u><\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>attention<\/em> \u043e\u0442\u043d\u043e\u0441\u0438\u0442 <em><u>she<\/u><\/em> \u043a <em><u>Alice<\/u><\/em>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/a0\/rg\/nj\/a0rgnjdds-t_vikggozkcmryzym.png\" data-src=\"https:\/\/habrastorage.org\/webt\/a0\/rg\/nj\/a0rgnjdds-t_vikggozkcmryzym.png\"\/><\/figure>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c <em><u>older<\/u><\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>attention<\/em> \u043e\u0442\u043d\u043e\u0441\u0438\u0442 <em><u>she<\/u><\/em> \u043a <em><u>Barbara<\/u><\/em>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/mg\/p6\/fc\/mgp6fc3aahhtbaww3jj23jwft_a.png\" data-src=\"https:\/\/habrastorage.org\/webt\/mg\/p6\/fc\/mgp6fc3aahhtbaww3jj23jwft_a.png\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>attention<\/em> \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e <em><u>more experienced<\/u><\/em> \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 <em><u>even though<\/u><\/em>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/pe\/zk\/qv\/pezkqvx0qcpsnprzxuh8mrefo84.png\" data-src=\"https:\/\/habrastorage.org\/webt\/pe\/zk\/qv\/pezkqvx0qcpsnprzxuh8mrefo84.png\"\/><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043c\u044b\u0441\u043b\u0430\u043c\u0438. \u0421\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0441\u043b\u043e\u0432\u0435 <em><u>it<\/u><\/em>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ek\/5y\/ba\/ek5yban5zaqomp4msw5znxem4u4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ek\/5y\/ba\/ek5yban5zaqomp4msw5znxem4u4.png\"\/><\/figure>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <em>it<\/em> \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441\u043e <em>swap<\/em>, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 \u0441 <em>AI<\/em>. \u041b\u044e\u0434\u044f\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/pk\/bf\/3b\/pkbf3bsnnelm-lqidzjtvfuzcli.png\" data-src=\"https:\/\/habrastorage.org\/webt\/pk\/bf\/3b\/pkbf3bsnnelm-lqidzjtvfuzcli.png\"\/><\/figure>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u0442\u0438 \u043d\u044e\u0430\u043d\u0441\u044b \u2014 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 \u0441\u043b\u043e\u0432, \u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u043c\u0435\u0442\u044c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0447\u043b\u0435\u043d\u0430\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/iw\/zf\/io\/iwzfiog5zfqag2lxdxaagi-fdrs.png\" data-src=\"https:\/\/habrastorage.org\/webt\/iw\/zf\/io\/iwzfiog5zfqag2lxdxaagi-fdrs.png\"\/><\/figure>\n<h4>1.4. \u041c\u0430\u0448\u0438\u043d\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u0418\u0418 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u043a\u0430\u043b\u044f\u0440\u0430\u043c\u0438, \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c\u0438 \u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u0430\u043c\u0438 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u044b \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435).<\/p>\n<h3>2. \u0421\u0443\u0442\u044c \u0438\u0434\u0435\u0438 attention<\/h3>\n<h4>2.1. \u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 attention<\/h4>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0438\u043b\u0430\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u0435\u0445 \u043c\u0430\u0442\u0440\u0438\u0446. \u041e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430\u043c\u0438 \u0441\u043b\u043e\u0432, \u0433\u0434\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u044b\u043b\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043e \u043f\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/bz\/l6\/qf\/bzl6qfu-fk8um43i4i1g7cqugko.png\" data-src=\"https:\/\/habrastorage.org\/webt\/bz\/l6\/qf\/bzl6qfu-fk8um43i4i1g7cqugko.png\"\/><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rn\/hz\/ey\/rnhzeyxhya67lhwctvrfybylwxu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rn\/hz\/ey\/rnhzeyxhya67lhwctvrfybylwxu.png\"\/><\/figure>\n<p>\u0412 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f  \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u044b \u0438 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u044b.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/8z\/n2\/jc\/8zn2jc_vt_tlfm7tve8ehxysdtm.png\" data-src=\"https:\/\/habrastorage.org\/webt\/8z\/n2\/jc\/8zn2jc_vt_tlfm7tve8ehxysdtm.png\"\/><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/7t\/fp\/bs\/7tfpbscknydov4qmhg79bpzl220.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/7t\/fp\/bs\/7tfpbscknydov4qmhg79bpzl220.jpeg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0422\u0440\u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432\u044b\u0448\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u2014 \u044d\u0442\u043e:<\/p>\n<ul>\n<li>\n<p><strong>Q<\/strong> \u2014 <strong>q<\/strong>uery\/<em>\u0437\u0430\u043f\u0440\u043e\u0441<\/em>;<\/p>\n<\/li>\n<li>\n<p><strong>K<\/strong> \u2014 <strong>k<\/strong>ey\/<em>\u043a\u043b\u044e\u0447<\/em>;<\/p>\n<\/li>\n<li>\n<p><strong>V<\/strong> \u2014 <strong>v<\/strong>alue\/<em>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u0438 \u0441 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439 \u0432 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430\u0445, \u0432\u0435\u0441\u0430 \u0432 \u044d\u0442\u0438\u0445 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u0445 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438. \u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u0435\u0442\u044c \u0442\u0438\u043f\u0430 GPT-3 \u0438\u043b\u0438 ChatGPT \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0442\u0435\u043a\u0441\u0442\u0430. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, ChatGPT \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0435\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0442\u0440\u0438\u043b\u043b\u0438\u043e\u043d\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043e\u0431\u0449\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432 45 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442. \u041f\u043e\u0432\u0435\u0440\u0438\u043c \u0435\u0439 \u043d\u0430 \u0441\u043b\u043e\u0432\u043e \ud83d\ude42<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/pp\/o5\/au\/ppo5auerwc6ximgtssybdv7be1y.png\" data-src=\"https:\/\/habrastorage.org\/webt\/pp\/o5\/au\/ppo5auerwc6ximgtssybdv7be1y.png\"\/><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ax\/p_\/h1\/axp_h1wmnsjrgd3lqywmckrmtv4.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ax\/p_\/h1\/axp_h1wmnsjrgd3lqywmckrmtv4.png\"\/><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/8g\/pe\/uw\/8gpeuw7mujoylzwgvzsdciecl-y.png\" data-src=\"https:\/\/habrastorage.org\/webt\/8g\/pe\/uw\/8gpeuw7mujoylzwgvzsdciecl-y.png\"\/><\/figure>\n<h4>2.2. \u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h4>\n<p>GPT-3 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 (<em>backpropagation<\/em>). \u042d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0432\u0435\u0441\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0441 \u0446\u0435\u043b\u044c\u044e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c (<em>loss function<\/em>).<\/p>\n<h3>2.2.1. \u041a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h3>\n<p>\u0430. \u0421\u0435\u0442\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0430\u043a\u0435\u0442\u0443 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/p7\/jh\/xh\/p7jhxhh2d7it7buhfrdiimsvjby.png\" data-src=\"https:\/\/habrastorage.org\/webt\/p7\/jh\/xh\/p7jhxhh2d7it7buhfrdiimsvjby.png\"\/><\/figure>\n<p>\u0431. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0442\u0435\u0440\u044c \u043c\u0435\u0436\u0434\u0443 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xn\/zu\/fz\/xnzufzwwozvybdq0gvjjntw-z7c.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xn\/zu\/fz\/xnzufzwwozvybdq0gvjjntw-z7c.png\"\/><\/figure>\n<p>\u0433. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (<em>chain rule<\/em>).<\/p>\n<p>\u0434. \u0414\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0435\u0441\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u0438\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/3e\/ou\/sr\/3eousribes4oic7crvey2-wqn2o.png\" data-src=\"https:\/\/habrastorage.org\/webt\/3e\/ou\/sr\/3eousribes4oic7crvey2-wqn2o.png\"\/><\/figure>\n<p>\u0435. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0441\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (<em>convergence<\/em>), \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 <em>Transformer<\/em> \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0435\u0441\u0430, \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043d\u0438\u0436\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u0438 \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f\u0445.<\/p>\n<h4>2.3. \u041c\u0430\u0442\u0440\u0438\u0446\u044b Query, Key \u0438 Value<\/h4>\n<p>\u0412\u0435\u0441\u0430 \u043c\u0430\u0442\u0440\u0438\u0446 Query, Key \u0438 Value \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438. \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0441\u043b\u043e\u0432 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ix\/6i\/2x\/ix6i2xqg4dnfmdjsk3vi7ohquey.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ix\/6i\/2x\/ix6i2xqg4dnfmdjsk3vi7ohquey.png\"\/><\/figure>\n<ul>\n<li>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 [<strong>Q]uery<\/strong> \u2014 \u0441\u043b\u043e\u0432\u043e, <strong>\u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e<\/strong> \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>attention<\/em>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 [<strong>K]ey<\/strong> \u2014 \u0441\u043b\u043e\u0432\u043e, <strong>\u043a\u043e\u0442\u043e\u0440\u043e\u0435<\/strong> \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <em>attention<\/em>. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b (<em>eigenvalues<\/em> \u0438 <em>eigenvectors<\/em>) \u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0445\u043e\u0436\u0438, \u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention<\/em>. \u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u044b, \u0430 \u043d\u0438\u0437\u043a\u0430\u044f  \u2014 \u0447\u0442\u043e \u0441\u043b\u0430\u0431\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 [<strong>V]alue<\/strong> \u0437\u0430\u0442\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention<\/em> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b \u0441\u043b\u043e\u0432 \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0442\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h4>2.4. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u044f<\/h4>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c <em>Transformer<\/em> \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0435\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443.<\/p>\n<p>\u0426\u0435\u043b\u044c \u2014 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u044e \u0441\u043b\u043e\u0432 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <em>attention<\/em>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0435\u043b\u043e. \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0443\u043b\u0438\u043a, \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a, \u043d\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0430\u0436\u043d\u043e\u043c, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u2014 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 <em>attention<\/em> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 <em>Transformer<\/em>.<\/p>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 Q<\/strong> \u043f\u043e\u0434\u043e\u0431\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u0432 \u0443\u043c\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0435\u043b\u043e  \u2014 \u043e\u043d\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u00ab\u043f\u043e\u043d\u044f\u0442\u044c\u00bb \u0442\u0435\u043a\u0441\u0442.<\/p>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 K<\/strong> \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043d\u0430\u0431\u043e\u0440 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u043b\u0438\u043a. \u0414\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0445 \u0432\u0441\u0435, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u0443\u043b\u0438\u043a\u0430\u0445 \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention<\/em> \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 Q \u0438 K.<\/p>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 V<\/strong> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0443\u043b\u0438\u043a\u0438 \u0434\u043b\u044f \u0434\u0435\u043b\u0430. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0446\u0435\u043d\u043a\u0435 <em>attention<\/em> \u043d\u0435\u043a\u0438\u0435 \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u044b, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u0438\u043c\u0435\u043d\u0438\u0435 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u2014 \u0438 \u044d\u0442\u043e \u043d\u0430\u043c \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>Query<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>Key<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>Value<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0414\u0435\u0442\u0435\u043a\u0442\u0438\u0432<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0430<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0412\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u0434\u043b\u044f \u0434\u0435\u043b\u0430 \u0443\u043b\u0438\u043a<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/em> <em>\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u043b\u0438\u043a \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0430<\/em><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Transformer<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0437\u044e\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0412\u044b\u0431\u043e\u0440 \u0441\u043b\u043e\u0432, \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0420\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u0440\u044b \u0441\u043b\u043e\u0432 \u043a \u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044e<\/em><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041f\u043e\u0438\u0441\u043a \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0442\u0435\u043c\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0420\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043d\u0438\u0433 \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/em><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>2.5. \u0424\u043e\u0440\u043c\u0443\u043b\u0430 Query, Key \u0438 Value<\/h4>\n<p>\u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b Q \u0438 K \u0443\u043c\u043d\u043e\u0436\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <em>(\u0434\u0435\u043a\u043e\u0434\u0435\u0440)<\/em>, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f <em>(softmax)<\/em> \u0438 \u0443\u043c\u043d\u043e\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 V.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/gs\/fy\/li\/gsfyliac9wre_pczv3f5p6solgs.png\" data-src=\"https:\/\/habrastorage.org\/webt\/gs\/fy\/li\/gsfyliac9wre_pczv3f5p6solgs.png\"\/><\/figure>\n<p>\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ht\/mb\/kp\/htmbkpvu8gjhmoe3gnq0jmymbvg.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ht\/mb\/kp\/htmbkpvu8gjhmoe3gnq0jmymbvg.png\"\/><\/figure>\n<p>\u0430. \u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 Q \u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443  K. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043d\u0435\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention.<\/em><\/p>\n<p>\u0431. \u041e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 <em>attention<\/em>, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0435\u0451 \u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b K. \u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u044d\u0442\u043e \u2014 64, \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0435\u043b\u0438\u043c \u043d\u0430 8).<\/p>\n<p>\u0432. \u0417\u0430\u0442\u0435\u043c \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 softmax, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0441\u0430 \u0432 \u0441\u0443\u043c\u043c\u0435 \u0434\u0430\u0432\u0430\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/p>\n<p>\u0433. \u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u044d\u0442\u0438 \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 <em>attention<\/em> \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 V.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043c\u043e\u0434\u0435\u043b\u0438 <em>Transformer<\/em>, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a ChatGPT \u0438 GPT-3, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044f\u0437\u044b\u043a\u0430, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443. \u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <em>Transformer<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <em>attention<\/em> \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u0437\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 . \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p><em>Attention<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <em>attention<\/em> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0441\u043b\u043e\u0432\u0430 <em>Transformer<\/em> \u0443\u043c\u0435\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c, \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u0435\u0439 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430.<\/p>\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\/781770\/\"> https:\/\/habr.com\/ru\/articles\/781770\/<\/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<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u043f\u043e\u0432\u0435\u0441\u0438\u043b <a href=\"https:\/\/habr.com\/ru\/articles\/778048\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e \u0441 \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u043e\u0431\u0437\u043e\u0440\u043e\u043c \u0442\u0435\u0445\u043d\u0438\u043a \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/a>, \u0438 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0432 \u043a\u0430\u043a\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 NLP \u0448\u0430\u0433\u043d\u0443\u043b\u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u2014 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <strong>attention<\/strong>. \u041c\u044b \u0441 <a href=\"mailto:zdrelyuk@bk.ru\" rel=\"noopener noreferrer nofollow\">\u0414\u0430\u0440\u044c\u0435\u0439, \u043c\u043e\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u043e\u0439 \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443<\/a>, \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0432\u0438\u0434\u0435\u043e\u0440\u043e\u043b\u0438\u043a &#171;<a href=\"https:\/\/www.youtube.com\/watch?v=sznZ78HquPc\" rel=\"noopener noreferrer nofollow\">Attention is all you need explained<\/a>&#187; \u0432 \u0441\u0442\u0430\u0442\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e.  \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0437\u0430 \u0441\u0432\u0435\u0442\u043e\u0444\u043e\u0440 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445: \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0447\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u043d \u0438\u0437 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u043e\u0432 \u0443\u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c :).<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 2017 \u0433\u043e\u0434\u0443, \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <em>Attention is all you need<\/em>, \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0437 Google \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 Transformer. \u041d\u043e\u0432\u0438\u0437\u043d\u0430 Transformer \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 self-attention <em>(\u0434\u043e\u0441\u043b. \u0441 \u0430\u043d\u0433\u043b. \u2014 \u0441\u0430\u043c\u043e\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435)<\/em> \u2014 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0440\u0430\u0437\u0443, \u0430 \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0445 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h3>1. \u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d attention<\/h3>\n<h4>1.1. \u041f\u0440\u043e \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 (RNNs)<\/h4>\n<p>\u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f <em>Transformer<\/em> \u0437\u0430\u0434\u0430\u0447\u0438 NLP \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 (RNN) \u2014 \u043e\u043d\u0438 \u0443\u043c\u0435\u044e\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0423 RNN \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0432 \u043d\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043d\u0438\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0442\u0443\u0445\u0430\u044e\u0449\u0438\u0445 \u0438 \u0440\u0430\u0437\u043b\u0435\u0442\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ol>\n<h4>1.2. Transformers. \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c &#8216;Self-attention&#8217;<\/h4>\n<p><em>Transformer<\/em> \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u044d\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u043a\u0443\u0440\u0440\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <em>self-attention. Self-attention<\/em> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0435\u0441\u0430 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0447\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043e\u0431\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b RNN.<\/p>\n<figure class=\"\"><\/figure>\n<h4>1.3. \u041b\u0438\u043d\u0433\u0432\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u043f\u043e\u0445\u043e\u0436\u0438 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <em>she<\/em> \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 <em>Alice<\/em>, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <em>Barbara.<\/em><\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c <em><u>younger<\/u><\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>attention<\/em> \u043e\u0442\u043d\u043e\u0441\u0438\u0442 <em><u>she<\/u><\/em> \u043a <em><u>Alice<\/u><\/em>.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c <em><u>older<\/u><\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>attention<\/em> \u043e\u0442\u043d\u043e\u0441\u0438\u0442 <em><u>she<\/u><\/em> \u043a <em><u>Barbara<\/u><\/em>.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <em>attention<\/em> \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e <em><u>more experienced<\/u><\/em> \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 <em><u>even though<\/u><\/em>.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438, \u043d\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043c\u044b\u0441\u043b\u0430\u043c\u0438. \u0421\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0441\u043b\u043e\u0432\u0435 <em><u>it<\/u><\/em>.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <em>it<\/em> \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441\u043e <em>swap<\/em>, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 \u0441 <em>AI<\/em>. \u041b\u044e\u0434\u044f\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u044f\u0437\u044b\u043a\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u0442\u0438 \u043d\u044e\u0430\u043d\u0441\u044b \u2014 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 \u0441\u043b\u043e\u0432, \u0438\u0445 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u043c\u0435\u0442\u044c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0447\u043b\u0435\u043d\u0430\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0438\u0447\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<h4>1.4. \u041c\u0430\u0448\u0438\u043d\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u0418\u0418 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u043a\u0430\u043b\u044f\u0440\u0430\u043c\u0438, \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u043c\u0438 \u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u0430\u043c\u0438 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u044b \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435).<\/p>\n<h3>2. \u0421\u0443\u0442\u044c \u0438\u0434\u0435\u0438 attention<\/h3>\n<h4>2.1. \u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 attention<\/h4>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0438\u043b\u0430\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0442\u0440\u0435\u0445 \u043c\u0430\u0442\u0440\u0438\u0446. \u041e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430\u043c\u0438 \u0441\u043b\u043e\u0432, \u0433\u0434\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u0421\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u044b\u043b\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043e \u043f\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<figure class=\"\"><\/figure>\n<p>\u0412 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f  \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u044b \u0438 \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u044b.<\/p>\n<figure class=\"\"><\/figure>\n<figure class=\"\"><\/figure>\n<p>\u0422\u0440\u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0432\u044b\u0448\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u2014 \u044d\u0442\u043e:<\/p>\n<ul>\n<li>\n<p><strong>Q<\/strong> \u2014 <strong>q<\/strong>uery\/<em>\u0437\u0430\u043f\u0440\u043e\u0441<\/em>;<\/p>\n<\/li>\n<li>\n<p><strong>K<\/strong> \u2014 <strong>k<\/strong>ey\/<em>\u043a\u043b\u044e\u0447<\/em>;<\/p>\n<\/li>\n<li>\n<p><strong>V<\/strong> \u2014 <strong>v<\/strong>alue\/<em>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u0438 \u0441 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439 \u0432 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0430\u0445, \u0432\u0435\u0441\u0430 \u0432 \u044d\u0442\u0438\u0445 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u0445 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438. \u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u0435\u0442\u044c \u0442\u0438\u043f\u0430 GPT-3 \u0438\u043b\u0438 ChatGPT \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0442\u0435\u043a\u0441\u0442\u0430. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, ChatGPT \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0435\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u043b\u0430\u0441\u044c \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0442\u0440\u0438\u043b\u043b\u0438\u043e\u043d\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043e\u0431\u0449\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432 45 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442. \u041f\u043e\u0432\u0435\u0440\u0438\u043c \u0435\u0439 \u043d\u0430 \u0441\u043b\u043e\u0432\u043e \ud83d\ude42<\/p>\n<figure class=\"\"><\/figure>\n<figure class=\"\"><\/figure>\n<figure class=\"\"><\/figure>\n<h4>2.2. \u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h4>\n<p>GPT-3 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 (<em>backpropagation<\/em>). \u042d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0432\u0435\u0441\u0430 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0441 \u0446\u0435\u043b\u044c\u044e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u0435\u0440\u044c (<em>loss function<\/em>).<\/p>\n<h3>2.2.1. \u041a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h3>\n<p>\u0430. \u0421\u0435\u0442\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0430\u043a\u0435\u0442\u0443 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0431. \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0442\u0435\u0440\u044c \u043c\u0435\u0436\u0434\u0443 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0433. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u044b \u043f\u043e\u0442\u0435\u0440\u044c \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (<em>chain rule<\/em>).<\/p>\n<p>\u0434. \u0414\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0435\u0441\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0442\u0438\u0432 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0435. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0441\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (<em>convergence<\/em>), \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0442\u0435\u0440\u044c \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 <em>Transformer<\/em> \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0435\u0441\u0430, \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043d\u0438\u0436\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u0438 \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f\u0445.<\/p>\n<h4>2.3. \u041c\u0430\u0442\u0440\u0438\u0446\u044b Query, Key \u0438 Value<\/h4>\n<p>\u0412\u0435\u0441\u0430 \u043c\u0430\u0442\u0440\u0438\u0446 Query, Key \u0438 Value \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438. \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0441\u043b\u043e\u0432 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<ul>\n<li>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 [<strong>Q]uery<\/strong> \u2014 \u0441\u043b\u043e\u0432\u043e, <strong>\u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e<\/strong> \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>attention<\/em>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 [<strong>K]ey<\/strong> \u2014 \u0441\u043b\u043e\u0432\u043e, <strong>\u043a\u043e\u0442\u043e\u0440\u043e\u0435<\/strong> \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <em>attention<\/em>. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b (<em>eigenvalues<\/em> \u0438 <em>eigenvectors<\/em>) \u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0445\u043e\u0436\u0438, \u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention<\/em>. \u0412\u044b\u0441\u043e\u043a\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u044b, \u0430 \u043d\u0438\u0437\u043a\u0430\u044f  \u2014 \u0447\u0442\u043e \u0441\u043b\u0430\u0431\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 [<strong>V]alue<\/strong> \u0437\u0430\u0442\u0435\u043c \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention<\/em> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b \u0441\u043b\u043e\u0432 \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u043e\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430, \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0442\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h4>2.4. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u044f<\/h4>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c <em>Transformer<\/em> \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0435\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443.<\/p>\n<p>\u0426\u0435\u043b\u044c \u2014 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u044e \u0441\u043b\u043e\u0432 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <em>attention<\/em>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u0435\u043b\u043e. \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0443\u043b\u0438\u043a, \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a, \u043d\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0430\u0436\u043d\u043e\u043c, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u2014 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 <em>attention<\/em> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 <em>Transformer<\/em>.<\/p>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 Q<\/strong> \u043f\u043e\u0434\u043e\u0431\u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u0432 \u0443\u043c\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0435\u043b\u043e  \u2014 \u043e\u043d\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u00ab\u043f\u043e\u043d\u044f\u0442\u044c\u00bb \u0442\u0435\u043a\u0441\u0442.<\/p>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 K<\/strong> \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043d\u0430\u0431\u043e\u0440 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u043b\u0438\u043a. \u0414\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0445 \u0432\u0441\u0435, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u0443\u043b\u0438\u043a\u0430\u0445 \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention<\/em> \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 Q \u0438 K.<\/p>\n<p><strong>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 V<\/strong> \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0443\u043b\u0438\u043a\u0438 \u0434\u043b\u044f \u0434\u0435\u043b\u0430. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0446\u0435\u043d\u043a\u0435 <em>attention<\/em> \u043d\u0435\u043a\u0438\u0435 \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u044b, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u0438\u043c\u0435\u043d\u0438\u0435 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u2014 \u0438 \u044d\u0442\u043e \u043d\u0430\u043c \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>Query<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>Key<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>Value<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0414\u0435\u0442\u0435\u043a\u0442\u0438\u0432<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0430<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0412\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0445 \u0434\u043b\u044f \u0434\u0435\u043b\u0430 \u0443\u043b\u0438\u043a<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/em> <em>\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0443\u043b\u0438\u043a \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0435\u043b\u0430<\/em><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Transformer<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0437\u044e\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0412\u044b\u0431\u043e\u0440 \u0441\u043b\u043e\u0432, \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0441\u043b\u043e\u0432\u043e\u043c<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0420\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u0440\u044b \u0441\u043b\u043e\u0432 \u043a \u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044e<\/em><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041f\u043e\u0438\u0441\u043a \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u0442\u0435\u043c\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>\u0420\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043a\u043d\u0438\u0433 \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f<\/em><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>2.5. \u0424\u043e\u0440\u043c\u0443\u043b\u0430 Query, Key \u0438 Value<\/h4>\n<p>\u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b Q \u0438 K \u0443\u043c\u043d\u043e\u0436\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <em>(\u0434\u0435\u043a\u043e\u0434\u0435\u0440)<\/em>, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f <em>(softmax)<\/em> \u0438 \u0443\u043c\u043d\u043e\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 V.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0430. \u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 Q \u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443  K. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043d\u0435\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 <em>attention.<\/em><\/p>\n<p>\u0431. \u041e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 <em>attention<\/em>, \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u0435\u0451 \u043d\u0430 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b K. \u0420\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u044d\u0442\u043e \u2014 64, \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0435\u043b\u0438\u043c \u043d\u0430 8).<\/p>\n<p>\u0432. \u0417\u0430\u0442\u0435\u043c \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 softmax, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0441\u0430 \u0432 \u0441\u0443\u043c\u043c\u0435 \u0434\u0430\u0432\u0430\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.<\/p>\n<p>\u0433. \u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u044d\u0442\u0438 \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 <em>attention<\/em> \u043d\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 V.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043c\u043e\u0434\u0435\u043b\u0438 <em>Transformer<\/em>, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a ChatGPT \u0438 GPT-3, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044f\u0437\u044b\u043a\u0430, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443. \u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <em>Transformer<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <em>attention<\/em> \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u0437\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 . \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p><em>Attention<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <em>attention<\/em> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0441\u043b\u043e\u0432\u0430 <em>Transformer<\/em> \u0443\u043c\u0435\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c, \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u0438\u0435\u0439 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430.<\/p>\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\/781770\/\"> https:\/\/habr.com\/ru\/articles\/781770\/<\/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-363407","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363407","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=363407"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363407\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}