{"id":362743,"date":"2024-05-21T01:41:17","date_gmt":"2024-05-21T01:41:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=362743"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=362743","title":{"rendered":"<span>\u041e \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Transformer<\/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<h4>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/h4>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b Transformer. \u041e\u0442 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0431\u0449\u0438\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b Transformer \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 self-attention. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0440\u0432\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043e\u0442 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u00a0<a href=\"https:\/\/habr.com\/ru\/companies\/just_ai\/articles\/733110\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442 \u043e\u0431\u0437\u043e\u0440<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u00a0<a href=\"http:\/\/jalammar.github.io\/illustrated-transformer\" rel=\"noopener noreferrer nofollow\">\u043e\u0441\u043d\u043e\u0432<\/a>.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Transformer \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445. \u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/773312\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043e\u0431\u0437\u043e\u0440\u0435<\/a> \u0443\u043f\u043e\u0440 \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 self-attention, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0427\u0430\u0441\u0442\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/direct.mit.edu\/coli\/article\/48\/3\/733\/111478\/Position-Information-in-Transformers-An-Overview\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u043f\u043b\u043e\u0445\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435<\/a>.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Transformer, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, RNN, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u00ab\u043c\u0435\u0448\u043e\u043a \u0441\u043b\u043e\u0432\u00bb. \u041f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0431\u0435\u0437 \u043d\u0438\u0445, \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0441 \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0412\u0430\u0436\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0440\u0430\u043c\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0442 \u0434\u043b\u0438\u043d\u044b \u0432\u0445\u043e\u0434\u0430, \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 LLM. \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0431\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u043b\u0438\u0431\u043e \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0442\u0443\u0434\u0430 \u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0434\u0442\u0438 \u0437\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0432\u0437\u044f\u0442\u044b \u043b\u0438\u0431\u043e \u0438\u0437 \u0441\u0430\u043c\u0438\u0445 \u0440\u0430\u0431\u043e\u0442, \u043b\u0438\u0431\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b<\/h2>\n<ul>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x = (x_1, \\dots, x_n)\" alt=\"x = (x_1, \\dots, x_n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c46\/8df\/9d5\/c468df9d511907b9d72e58b0b479d183.svg\" width=\"138\" height=\"22\"\/> \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0442\u043e\u043a\u0435\u043d\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<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z = (z_1, \\dots, z_n)\" alt=\"z = (z_1, \\dots, z_n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/48f\/494\/84e\/48f49484e98eeaf4b727a2aa1bba4a53.svg\" width=\"131\" height=\"22\"\/> \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0433\u043e\u043b\u043e\u0432\u044b self-attention<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d_x\" alt=\"d_x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57a\/b48\/109\/57ab4810969172141c2292246f2d3bec.svg\" width=\"20\" height=\"20\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d_z\" alt=\"d_z\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5cd\/44a\/a56\/5cd44aa56114dd8c58a795559576894f.svg\" width=\"19\" height=\"20\"\/> \u2014 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x\" alt=\"x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/44e\/528\/f7b\/44e528f7bb8b0d357579f67800062ea9.svg\" width=\"11\" height=\"12\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"z\" alt=\"z\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1b7\/df9\/621\/1b7df9621d394e4e36aed38607631315.svg\" width=\"9\" height=\"12\"\/> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f65\/3e6\/b7c\/f653e6b7cb780677345a1f74876717c1.svg\" width=\"15\" height=\"20\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/863\/b39\/af6\/863b39af619c859495433e8702f767f9.svg\" width=\"17\" height=\"17\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"V\" alt=\"V\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4bc\/75a\/b58\/4bc75ab5869fb67e1a203752b248f133.svg\" width=\"15\" height=\"17\"\/> \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u043b\u043e\u044f-\u0433\u043e\u043b\u043e\u0432\u044b<\/p>\n<\/li>\n<li>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"W^Q\" alt=\"W^Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ce9\/780\/8df\/ce97808df855759cd563f3b64c1ba78a.svg\" width=\"34\" height=\"21\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"W^K\" alt=\"W^K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/672\/132\/90a\/67213290ab97001be38f601536b095f8.svg\" width=\"35\" height=\"21\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"W^V\" alt=\"W^V\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/31c\/014\/c67\/31c014c676e79cbd7cf0f02d20c6e2dd.svg\" width=\"34\" height=\"21\"\/> \u2014 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u043b\u043e\u044f-\u0433\u043e\u043b\u043e\u0432\u044b<\/p>\n<\/li>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 self-attention:<\/p>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\qquad e_{ij} = \\cfrac{\\big(x_i W^Q\\big)\\big(x_j W^K\\big)^T}{\\sqrt{d_z}}\" alt=\"\\qquad e_{ij} = \\cfrac{\\big(x_i W^Q\\big)\\big(x_j W^K\\big)^T}{\\sqrt{d_z}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/36f\/11e\/e27\/36f11ee27e9dd0989ce740afd54cad17.svg\" width=\"248\" height=\"62\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\qquad \\alpha_{ij} = \\mathrm{softmax}(e)_{ij} = \\cfrac{\\exp(e_{ij})}{\\sum_{k=1}^n \\exp(e_{ik})}\" alt=\"\\qquad \\alpha_{ij} = \\mathrm{softmax}(e)_{ij} = \\cfrac{\\exp(e_{ij})}{\\sum_{k=1}^n \\exp(e_{ik})}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/812\/925\/7cb\/8129257cb2c695f790e8e5dcdc7dcd3a.svg\" width=\"348\" height=\"57\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"z_{i} = \\sum_{j=1}^n \\alpha_{ij}\\big(x_{ij}W^V\\big)\" alt=\"z_{i} = \\sum_{j=1}^n \\alpha_{ij}\\big(x_{ij}W^V\\big)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a8\/13d\/04e\/8a813d04ecf973c42a0db4364aae7d7d.svg\" width=\"174\" height=\"60\"\/><\/p>\n<h2>\u041e\u0431\u0437\u043e\u0440 \u0440\u0430\u0431\u043e\u0442<\/h2>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1706.03762\" rel=\"noopener noreferrer nofollow\"><strong>Sinusoidal \u0438 Trainable Absolute, 2017<\/strong><\/a><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u0430\u043c\u043e\u0433\u043e Transformer. \u041f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u0412\u0435\u043a\u0442\u043e\u0440 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u043c\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0443 \u0442\u043e\u043a\u0435\u043d\u0430 (\u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0443) \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438.<\/p>\n<p>\u0421\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\hat p_t \\in \\mathbb{R}^d_x\" alt=\"\\hat p_t \\in \\mathbb{R}^d_x\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d36\/a2a\/866\/d36a2a866ec3da6da98f035c4ca5dd58.svg\" width=\"67\" height=\"25\"\/>\u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"t\" alt=\"t\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/90f\/265\/035\/90f2650353bb8f19d7c4d8cf76436f2e.svg\" width=\"7\" height=\"16\"\/>\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u0441\u0435\u0442\u0438. \u042d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u0434\u043b\u0438\u043d\u043e\u0439, \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0435\u0451 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0445 (\u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445) \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\hat p^i_t\" alt=\"\\hat p^i_t\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/238\/432\/fd8\/238432fd820ca6c5e82b82e5ea22ceb5.svg\" width=\"19\" height=\"25\"\/> \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"            \\hat p^i_t =             \\begin{cases}               \\sin(w_k t), \\quad i = 2k \\\\               \\cos(w_k t), \\quad i = 2k + 1 \\\\             \\end{cases}\\hspace{-10pt}, \\qquad w_k = \\cfrac{1}{10000^{2k \/ d_x}}\" alt=\"            \\hat p^i_t =             \\begin{cases}               \\sin(w_k t), \\quad i = 2k \\\\               \\cos(w_k t), \\quad i = 2k + 1 \\\\             \\end{cases}\\hspace{-10pt}, \\qquad w_k = \\cfrac{1}{10000^{2k \/ d_x}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/649\/2c5\/a56\/6492c5a569a95a3a042cfb2b533cc009.svg\" width=\"427\" height=\"58\"\/><\/p>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1803.02155\" rel=\"noopener noreferrer nofollow\"><strong>Relative, 2018<\/strong><\/a><\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c\u0438 \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0442.\u0435. \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u0430 \u043f\u0430\u0440\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430. \u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u043f\u0443\u0442\u0451\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435, \u0430 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<p>\u042d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u044b\u043b\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0432 \u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i - j\" alt=\"i - j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/981\/c9c\/cbb\/981c9ccbb5f574e11a4bc2fd88e5b083.svg\" width=\"39\" height=\"20\"\/> \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"a_{ij}^K, a_{ij}^V \\in \\mathbb{R}^{d_z}\" alt=\"a_{ij}^K, a_{ij}^V \\in \\mathbb{R}^{d_z}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/905\/a5f\/79a\/905a5f79a62bdafd39c297d18f4032e3.svg\" width=\"109\" height=\"29\"\/>\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u0445 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 self-attention:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"e_{ij} = \\cfrac{\\big(x_i W^Q\\big)\\big(x_j W^K \\color{blue}{\\,+\\,a_{ij}^K}\\big)^T}{\\sqrt{d_z}}, \\qquad             z_{i} = \\sum_{j=1}^n \\alpha_{ij}\\big(x_{ij}W^V\\color{blue}{\\,+\\,a_{ij}^V} \\big)\" alt=\"e_{ij} = \\cfrac{\\big(x_i W^Q\\big)\\big(x_j W^K \\color{blue}{\\,+\\,a_{ij}^K}\\big)^T}{\\sqrt{d_z}}, \\qquad             z_{i} = \\sum_{j=1}^n \\alpha_{ij}\\big(x_{ij}W^V\\color{blue}{\\,+\\,a_{ij}^V} \\big)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e3\/457\/aaf\/5e3457aafc0e2856599532be4e10c831.svg\" width=\"538\" height=\"68\"\/><\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c, \u0440\u0430\u0441\u043a\u0440\u044b\u0432 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u043e\u043c, \u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0433\u043e\u043b\u043e\u0432 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0441\u043b\u043e\u0451\u0432.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1901.02860\" rel=\"noopener noreferrer nofollow\"><strong>Transformer-XL, 2019<\/strong><\/a><\/p>\n<p>\u0412\u0445\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/15d\/f08\/926\/15df08926bc2fdc28c4635fc5695c8ad.svg\" width=\"7\" height=\"16\"\/>-\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"i+1\" alt=\"i+1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/94a\/fcc\/12d\/94afcc12da9d67a13bf270c5952a15c0.svg\" width=\"40\" height=\"18\"\/>-\u0433\u043e. \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442: \u0443 \u043e\u0431\u043e\u0438\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430, \u043a\u0430\u043a \u0438 \u0432 Relative, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 self-attention. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x_i\" alt=\"x_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/67a\/138\/074\/67a1380740727b3af87ff9b2cb1f8ee0.svg\" width=\"18\" height=\"15\"\/>\u0432 \u0432\u0438\u0434\u0435 \u0441\u0443\u043c\u043c\u044b \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x_i = x_i^{\\textbf{e}mb} + x_i^{\\mathbf{p}os}\" alt=\"x_i = x_i^{\\textbf{e}mb} + x_i^{\\mathbf{p}os}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ef\/e95\/b9a\/2efe95b9a6a9baff58b3326a153524e9.svg\" width=\"142\" height=\"26\"\/> \u0438 \u0440\u0430\u0441\u043f\u0438\u0448\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"e_{ij}\" alt=\"e_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ea\/44c\/c74\/5ea44cc744933f23b3f3d2e7f6b854ff.svg\" width=\"22\" height=\"17\"\/>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"e_{ij} \\propto \\big((x^e_i \\,+\\, x^p_i) W^Q\\big)\\big((x^e_j \\,+\\, x^p_j) W^K \\big)^T = \\\\ \\qquad\\qquad\\qquad = x^e_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T \\,+\\, x^e_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T \\,+ \\\\ \\qquad\\qquad\\qquad +\\, x^p_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T \\,+\\, x^p_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T\" alt=\"e_{ij} \\propto \\big((x^e_i \\,+\\, x^p_i) W^Q\\big)\\big((x^e_j \\,+\\, x^p_j) W^K \\big)^T = \\\\ \\qquad\\qquad\\qquad = x^e_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T \\,+\\, x^e_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T \\,+ \\\\ \\qquad\\qquad\\qquad +\\, x^p_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T \\,+\\, x^p_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/84f\/8b8\/c3d\/84f8b8c3d2de2962a621e9870c0263eb.svg\" width=\"697\" height=\"108\"\/><\/p>\n<p>\u0420\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0437\u0431\u0430\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u043e\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"x^p_i\" alt=\"x^p_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/174\/a43\/42d\/174a4342d9d3e4c33e7aad685ca32d68.svg\" width=\"20\" height=\"25\"\/>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"e_{ij} \\propto \\underset{(1)}{\\underbrace{x^e_i W^Q \\big(\\color{blue}{W^{K, E}}\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,                 \\underset{(2)}{\\underbrace{x^e_i W^Q \\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T}} \\,+ \\\\ +\\, \\underset{(3)}{\\underbrace{{\\color{purple}u} \\big(\\color{blue}{W^{K, E}}\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,               \\underset{(4)}{\\underbrace{{\\color{purple}v} \\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T}}\" alt=\"e_{ij} \\propto \\underset{(1)}{\\underbrace{x^e_i W^Q \\big(\\color{blue}{W^{K, E}}\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,                 \\underset{(2)}{\\underbrace{x^e_i W^Q \\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T}} \\,+ \\\\ +\\, \\underset{(3)}{\\underbrace{{\\color{purple}u} \\big(\\color{blue}{W^{K, E}}\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,               \\underset{(4)}{\\underbrace{{\\color{purple}v} \\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ab\/f50\/907\/6abf509075828b52d50f66742a29bb52.svg\" width=\"697\" height=\"137\"\/><\/p>\n<p>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{\\color{blue}R}\" alt=\"{\\color{blue}R}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c38\/4b3\/97a\/c384b397a4616bd21e394d961af40ddf.svg\" width=\"15\" height=\"17\"\/>. \u0412\u0435\u043a\u0442\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{\\color{purple}u}\" alt=\"{\\color{purple}u}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/716\/2bc\/79d\/7162bc79d64f8f3d94605a2a440e2fab.svg\" width=\"11\" height=\"12\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"{\\color{purple}v}\" alt=\"{\\color{purple}v}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c4d\/95f\/e19\/c4d95fe195572a885fdacee4dd340c77.svg\" width=\"9\" height=\"12\"\/>. \u0412\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a\u043b\u044e\u0447\u0435\u0439 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u044f \u0441\u0432\u044f\u0437\u044c<\/p>\n<\/li>\n<li>\n<p>\u0441\u0432\u044f\u0437\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u0441\u0434\u0432\u0438\u0433<\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u0434\u0432\u0438\u0433<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 Relative \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e (1) \u0438 (2), \u0441\u0434\u0432\u0438\u0433\u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 Relative \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T\" alt=\"\\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a1\/d61\/079\/9a1d61079b0143c0e6316c2fb5404197.svg\" width=\"147\" height=\"30\"\/>\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1910.10683\" rel=\"noopener noreferrer nofollow\"><strong>T5, 2020<\/strong><\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u043b\u044f\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"e_{ij}\" alt=\"e_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a1\/264\/cd2\/7a1264cd279b963622ffed361b26817d.svg\" width=\"22\" height=\"17\"\/> \u043f\u0435\u0440\u0435\u0434 softmax. \u0421\u043a\u0430\u043b\u044f\u0440\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c-\u043e\u0442\u0441\u0442\u0443\u043f\u0430\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(i-j)\" alt=\"(i-j)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2db\/9be\/e14\/2db9bee14ce401fd610253035b6ddfe3.svg\" width=\"54\" height=\"22\"\/>. \u0412\u0441\u0435\u0433\u043e \u0441\u043a\u0430\u043b\u044f\u0440\u043e\u0432 32, \u043e\u043d\u0438 \u0432 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0448\u043a\u0430\u043b\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 128 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432, \u0442.\u0435. \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u043a 0 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043a\u0430\u043b\u044f\u0440\u0430\u043c\u0438, \u0430 \u0434\u0430\u043b\u0451\u043a\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6c8\/386\/5da\/6c83865dacb5293f852c2b2c4e9c2f9d.png\" alt=\"\u0421\u043d\u0438\u0437\u0443 \u043d\u043e\u043c\u0435\u0440 \u0441\u043a\u0430\u043b\u044f\u0440\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0435\u043c\u0443 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438.\" title=\"\u0421\u043d\u0438\u0437\u0443 \u043d\u043e\u043c\u0435\u0440 \u0441\u043a\u0430\u043b\u044f\u0440\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0435\u043c\u0443 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438.\" width=\"2288\" height=\"312\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6c8\/386\/5da\/6c83865dacb5293f852c2b2c4e9c2f9d.png\"\/><\/p>\n<div><figcaption>\u0421\u043d\u0438\u0437\u0443 \u043d\u043e\u043c\u0435\u0440 \u0441\u043a\u0430\u043b\u044f\u0440\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0435\u043c\u0443 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c, \u0431\u043e\u043b\u044c\u0448\u0438\u043c 128, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u043a\u0430\u043b\u044f\u0440, \u043e\u043d \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u041f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u044b \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u043e\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043e\u043a\u043d\u043e \u0443\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0438\u0434\u0435\u0439\u043d\u043e \u0441\u0445\u043e\u0436\u0435 \u0441 CNN \u0438\u043b\u0438 \u043e\u043a\u043d\u043e\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432 Longformer). \u041e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u044b \u0441\u0432\u043e\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b self-attention, \u043d\u043e \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0451\u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2006.03654\" rel=\"noopener noreferrer nofollow\"><strong>DeBERTa, 2021<\/strong><\/a><\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 Transformer-XL, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u0432 self-attention \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 3 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"e_{ij} \\propto                \\underset{(1)}{\\underbrace{x^e_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,               \\underset{(2)}{\\underbrace{x^e_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T}} \\,+ \\\\ +\\, \\underset{(3)}{\\underbrace{x^p_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,               \\underset{(4)}{\\underbrace{\\color{red}{{x^p_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T}}}}\" alt=\"e_{ij} \\propto                \\underset{(1)}{\\underbrace{x^e_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,               \\underset{(2)}{\\underbrace{x^e_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T}} \\,+ \\\\ +\\, \\underset{(3)}{\\underbrace{x^p_i W^Q \\big(W^K\\big)^T \\big(x^e_j\\big)^T}} \\,+\\,               \\underset{(4)}{\\underbrace{\\color{red}{{x^p_i W^Q \\big(W^K\\big)^T \\big(x^p_j\\big)^T}}}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dca\/a59\/3de\/dcaa593deff2b7f49b11dd46eede43ff.svg\" width=\"697\" height=\"137\"\/><\/p>\n<p>\u041f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 (3) \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u0434\u0432\u0438\u0433\u0435, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a (4) \u2014 position-to-position term \u2014 \u0434\u043b\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0441\u0451\u0442 \u043c\u0430\u043b\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0430\u044f \u0440\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 Transformer-XL:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"e_{ij} \\propto                \\underset{(1)}{\\underbrace{               x^e_i W^Q               \\big(W^K\\big)^T \\big(x^e_j\\big)^T               }} \\,+\\,               \\underset{(2)}{\\underbrace{               x^e_i W^Q               \\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T               }} \\,+ \\,               \\underset{(3)}{\\underbrace{               \\color{blue}{R_{i-j}} \\color{blue}{W^{Q, R}}               \\big(W^K\\big)^T \\big(x^e_j\\big)^T               }}\" alt=\"e_{ij} \\propto                \\underset{(1)}{\\underbrace{               x^e_i W^Q               \\big(W^K\\big)^T \\big(x^e_j\\big)^T               }} \\,+\\,               \\underset{(2)}{\\underbrace{               x^e_i W^Q               \\big(\\color{blue}{W^{K, R}}\\big)^T \\big(\\color{blue}{ R_{i-j}}\\big)^T               }} \\,+ \\,               \\underset{(3)}{\\underbrace{               \\color{blue}{R_{i-j}} \\color{blue}{W^{Q, R}}               \\big(W^K\\big)^T \\big(x^e_j\\big)^T               }}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d17\/9e0\/2bc\/d179e02bcf93456697718905ca2209d7.svg\" width=\"678\" height=\"66\"\/><\/p>\n<p>\u041d\u043e\u0432\u044b\u0435 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u0432\u043e\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b \u0433\u043e\u043b\u043e\u0432\u0430-\u0441\u043b\u043e\u0439, \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0439 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R_{i-j}\" alt=\"R_{i-j}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a9\/365\/7a9\/9a93657a9f48af357d9b0f7afdf43690.svg\" width=\"38\" height=\"22\"\/> \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u0430\u044f, \u043e\u0431\u0449\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0451\u0432 \u0438 \u0441\u0432\u043e\u044f \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432, \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"R_{i-j}\" alt=\"R_{i-j}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/51b\/416\/869\/51b4168694d948ecfc5e7dccca5be5db.svg\" width=\"38\" height=\"22\"\/>, \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0446\u0430 \u043e\u0442\u0441\u0442\u0443\u043f\u0430.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0430\u043a\u0442: \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0435\u043c \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2104.09864\" rel=\"noopener noreferrer nofollow\"><strong>RoPE, 2021<\/strong><\/a><\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 (LLaMA, Qwen, Mistral), \u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043e \u0447\u0435\u043c \u0440\u0435\u0447\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c. \u0415\u0441\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438, \u0442\u043e \u0432 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"e_{ij} \\propto \\langle f_q(x_i, i), f_k(x_j, j) \\rangle,\" alt=\"e_{ij} \\propto \\langle f_q(x_i, i), f_k(x_j, j) \\rangle,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f03\/8e0\/164\/f038e01647537ec1e5bccc19da47637c.svg\" width=\"213\" height=\"23\"\/><\/p>\n<p>\u0442.\u0435. \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0442 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"g, f_q, f_k\" alt=\"g, f_q, f_k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/31d\/271\/839\/31d271839fd8261cad5b23f717aae757.svg\" width=\"64\" height=\"22\"\/>, \u0442\u0430\u043a\u0438\u0435, \u0447\u0442\u043e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\langle f_q(x_i, i), f_k(x_j, j)\\rangle = g(x_i, x_j, i - j)\" alt=\"\\langle f_q(x_i, i), f_k(x_j, j)\\rangle = g(x_i, x_j, i - j)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/008\/f41\/c28\/008f41c28d2dcbf2e2bd2adb68233c77.svg\" width=\"304\" height=\"23\"\/><\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d_z=2\" alt=\"d_z=2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/46d\/2a0\/285\/46d2a0285a8872fe8aeba9705d57b60c.svg\" width=\"55\" height=\"20\"\/> \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"    f_q(x_i, i) =     \\begin{pmatrix}         \\cos i\\theta &amp; -\\sin i\\theta \\\\         \\sin i\\theta &amp; \\cos i\\theta     \\end{pmatrix}     \\begin{pmatrix}         W^Q_{11} &amp; W^Q_{12} \\\\         W^Q_{21} &amp; W^Q_{22}     \\end{pmatrix}     \\begin{pmatrix}         x_i^1 \\\\         x_i^2     \\end{pmatrix},\" alt=\"    f_q(x_i, i) =     \\begin{pmatrix}         \\cos i\\theta &amp; -\\sin i\\theta \\\\         \\sin i\\theta &amp; \\cos i\\theta     \\end{pmatrix}     \\begin{pmatrix}         W^Q_{11} &amp; W^Q_{12} \\\\         W^Q_{21} &amp; W^Q_{22}     \\end{pmatrix}     \\begin{pmatrix}         x_i^1 \\\\         x_i^2     \\end{pmatrix},\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/063\/fb5\/077\/063fb5077388378f42295f9ebe765ba9.svg\" width=\"450\" height=\"62\"\/><\/p>\n<p>\u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\theta \\in \\mathbb{R}, \\theta \\ne 0\" alt=\"\\theta \\in \\mathbb{R}, \\theta \\ne 0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/758\/2ca\/d42\/7582cad42aabee7066e8cbf59fdb5dd2.svg\" width=\"101\" height=\"22\"\/> \u2014 \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430. \u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f_k\" alt=\"f_k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa7\/ee4\/f53\/fa7ee4f5367b858dc71436543a6d3ff7.svg\" width=\"19\" height=\"21\"\/> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430. \u041f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"g\" alt=\"g\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/918\/934\/c56\/918934c560627a778ad73eb954d639fd.svg\" width=\"9\" height=\"16\"\/> \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"g(x_i, x_j, i - j) = \\mathrm{Re}[\\big( W^Q x_i \\big)\\big( W^K x_j \\big)^* e^{\\textbf{i}(i - j)\\theta}],\" alt=\"g(x_i, x_j, i - j) = \\mathrm{Re}[\\big( W^Q x_i \\big)\\big( W^K x_j \\big)^* e^{\\textbf{i}(i - j)\\theta}],\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/06e\/611\/08a\/06e61108ae78c11b1c1c6c644fd7d6b1.svg\" width=\"388\" height=\"28\"\/><\/p>\n<p>\u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\mathrm{Re[X]}\" alt=\"\\mathrm{Re[X]}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc2\/1a3\/560\/fc21a35603a2175b317eed81befa628a.svg\" width=\"49\" height=\"22\"\/> \u2014 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"X \\in \\mathbb{C}\" alt=\"X \\in \\mathbb{C}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/03d\/5ef\/497\/03d5ef497d46ba7c8c902f7aaf6745a6.svg\" width=\"55\" height=\"17\"\/>, <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A^*\" alt=\"A^*\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/063\/daa\/caa\/063daacaaba6947ca7ee2658827d6427.svg\" width=\"24\" height=\"18\"\/> \u2014 \u0441\u043e\u043f\u0440\u044f\u0436\u0451\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f2\/a20\/617\/5f2a206178de55e14e158555e29e7436.svg\" width=\"15\" height=\"18\"\/>, \u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\textbf{i}\" alt=\"\\textbf{i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1da\/273\/7ed\/1da2737ed4f1f0477cd290a4b78335da.svg\" width=\"6\" height=\"17\"\/> \u2014 \u043c\u043d\u0438\u043c\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 RoPE \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\/\u043a\u043b\u044e\u0447\u0430 \u043d\u0430 \u0443\u0433\u043e\u043b, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0439 \u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0435\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0433\u043e\u043b, \u0442.\u0435. \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0447\u0451\u0442\u043d\u0443\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d_z\" alt=\"d_z\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/00c\/14f\/efb\/00c14fefb25408e9b22bf99f71509909.svg\" width=\"19\" height=\"20\"\/>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d_z\" alt=\"d_z\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/294\/3ef\/506\/2943ef506d847380530b1919ce53566e.svg\" width=\"19\" height=\"20\"\/> \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d_z \/ 2\" alt=\"d_z \/ 2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/88c\/cfc\/762\/88ccfc762cf98dace82bbb1ad9d1d4c9.svg\" width=\"38\" height=\"22\"\/> \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432, \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430. \u0418\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f_q\" alt=\"f_q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/587\/935\/75c\/58793575c0e4cdebacd55a590679b339.svg\" width=\"18\" height=\"22\"\/> (<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"f_k\" alt=\"f_k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a6\/4ee\/d9c\/4a64eed9c20a95c27241387fa0d51f52.svg\" width=\"19\" height=\"21\"\/> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"f_q(x_i, i) = R^{d_z}_{\\Theta, i} \\, W^Q \\, x_i,\" alt=\"f_q(x_i, i) = R^{d_z}_{\\Theta, i} \\, W^Q \\, x_i,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f9\/c13\/07c\/4f9c1307c127bdaf1e401260ea760e67.svg\" width=\"193\" height=\"31\"\/><\/p>\n<p>\u0433\u0434\u0435<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"R^{d_x}_{\\Theta, i} =     \\begin{pmatrix}         \\cos i\\theta_1 &amp; -\\sin i\\theta_1 &amp; 0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 \\\\         \\sin i\\theta_1 &amp; \\cos i\\theta_1 &amp; 0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 \\\\          0 &amp; 0 &amp; \\cos i\\theta_2 &amp; -\\sin i\\theta_2 &amp; \\cdots &amp; 0 &amp; 0 \\\\         0 &amp; 0 &amp; \\sin i\\theta_2 &amp; \\cos i\\theta_2 &amp; \\cdots &amp; 0 &amp; 0 \\\\          \\vdots &amp; \\vdots &amp; \\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\          0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 &amp; \\cos i\\theta_{d_z \/ 2} &amp; -\\sin i\\theta_{d_z \/ 2}\\\\         0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 &amp; \\sin i\\theta_{d_z \/ 2} &amp; \\cos i\\theta_{d_z \/ 2}\\\\     \\end{pmatrix},\" alt=\"R^{d_x}_{\\Theta, i} =     \\begin{pmatrix}         \\cos i\\theta_1 &amp; -\\sin i\\theta_1 &amp; 0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 \\\\         \\sin i\\theta_1 &amp; \\cos i\\theta_1 &amp; 0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 \\\\          0 &amp; 0 &amp; \\cos i\\theta_2 &amp; -\\sin i\\theta_2 &amp; \\cdots &amp; 0 &amp; 0 \\\\         0 &amp; 0 &amp; \\sin i\\theta_2 &amp; \\cos i\\theta_2 &amp; \\cdots &amp; 0 &amp; 0 \\\\          \\vdots &amp; \\vdots &amp; \\vdots &amp; \\vdots &amp; \\ddots &amp; \\vdots &amp; \\vdots \\\\          0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 &amp; \\cos i\\theta_{d_z \/ 2} &amp; -\\sin i\\theta_{d_z \/ 2}\\\\         0 &amp; 0 &amp; \\cdots &amp; 0 &amp; 0 &amp; \\sin i\\theta_{d_z \/ 2} &amp; \\cos i\\theta_{d_z \/ 2}\\\\     \\end{pmatrix},\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f58\/40d\/b93\/f5840db937dfcc373014331f8e06a50d.svg\" width=\"669\" height=\"208\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\Theta = \\{\\theta_k = 10000^{-2(k-1)\/d_z}, k \\in [1, \\dots, d_z \/ 2] \\}\" alt=\"\\Theta = \\{\\theta_k = 10000^{-2(k-1)\/d_z}, k \\in [1, \\dots, d_z \/ 2] \\}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ba\/003\/712\/5ba0037124b31dddd22ef3e06ff87b2b.svg\" width=\"375\" height=\"26\"\/><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ec5\/69f\/f07\/ec569ff074ecdff98a3cc6107146ed30.png\" alt=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f RoPE.\" title=\"\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f RoPE.\" width=\"1966\" height=\"1116\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec5\/69f\/f07\/ec569ff074ecdff98a3cc6107146ed30.png\"\/><\/p>\n<div><figcaption>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f RoPE.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Absolute \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c, \u0430 \u043a \u043f\u0430\u0440\u0430\u043c, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sin\/\\cos\" alt=\"\\sin\/\\cos\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1cd\/128\/1c8\/1cd1281c834e823caff04c8e0aa36bd0.svg\" width=\"67\" height=\"22\"\/> \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0443\u043c\u043c\u044b (\u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u0434\u0434\u0438\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438). \u0412 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 RoPE \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c Absolute \u0438 Relative:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/07f\/ddd\/204\/07fddd20432c034e836eadea8b0837b5.png\" alt=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 Absolute \u0438 RoPE \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 MLM \u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\" title=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 Absolute \u0438 RoPE \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 MLM \u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\" width=\"1754\" height=\"568\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07f\/ddd\/204\/07fddd20432c034e836eadea8b0837b5.png\"\/><\/p>\n<div><figcaption>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 Absolute \u0438 RoPE \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 MLM \u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 RoPE \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0447\u0435\u043c \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438, \u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2108.12409\" rel=\"noopener noreferrer nofollow\"><strong>ALiBi, 2022<\/strong><\/a><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u0441\u0445\u043e\u0436\u0438\u0439 \u0441 T5: \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0438\u043b\u0438 \u0440\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"e_{ij}\" alt=\"e_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/207\/6e3\/9de\/2076e39de7ba65ee036ce59df10c3066.svg\" width=\"22\" height=\"17\"\/> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u043b\u044f\u0440. \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 T5 \u0441\u043a\u0430\u043b\u044f\u0440\u044b \u043d\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m(i - j)\" alt=\"m(i - j)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/70c\/edc\/fae\/70cedcfae9b32bdd9630448e1c8b84a2.svg\" width=\"71\" height=\"22\"\/>, \u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"m\" alt=\"m\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/582\/630\/c2b\/582630c2b843464b72f188bb6dfa8c59.svg\" width=\"17\" height=\"12\"\/> \u2014 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0447\u0438\u0441\u043b\u043e, \u0441\u0432\u043e\u0451 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u043e\u0431\u0449\u0435\u0435 \u0434\u043b\u044f \u0441\u043b\u043e\u0451\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f 8 \u0433\u043e\u043b\u043e\u0432 \u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\frac{1}{2^1}, \\frac{1}{2^2}, \\dots, \\frac{1}{2^8}\" alt=\"\\frac{1}{2^1}, \\frac{1}{2^2}, \\dots, \\frac{1}{2^8}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3f\/a6b\/072\/f3fa6b072ae3cac58e93ffb22db4941a.svg\" width=\"129\" height=\"46\"\/>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd5\/fd3\/699\/dd5fd3699cae3c898d040a2623f6373f.png\" width=\"822\" height=\"350\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd5\/fd3\/699\/dd5fd3699cae3c898d040a2623f6373f.png\"\/><\/figure>\n<p>\u0412 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 Absolute vs. RoPE vs T5 \u0442\u043e\u043b\u044c\u043a\u043e T5 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043a \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445 \u0441 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0434\u043b\u0438\u043d\u043e\u0439, \u0447\u0435\u043c \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 (\u0434\u043e 600 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0432\u0435\u0440\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 512), \u043d\u043e \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438, \u043f\u0440\u043e\u0449\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 Absolute \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c. AliBi \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441 \u0442.\u0437. \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/638\/3de\/105\/6383de1052b0363776d4c014142856c7.png\" width=\"1722\" height=\"346\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/638\/3de\/105\/6383de1052b0363776d4c014142856c7.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0432 \u0440\u0430\u0437\u044b \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u043c, \u0447\u0435\u043c \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441 \u0442.\u0437. \u043f\u0435\u0440\u043f\u043b\u0435\u043a\u0441\u0438\u0438):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bf9\/28c\/ebe\/bf928cebea5246416c5b7b2ac75d146c.png\" width=\"1730\" height=\"640\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bf9\/28c\/ebe\/bf928cebea5246416c5b7b2ac75d146c.png\"\/><\/figure>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2212.10554\" rel=\"noopener noreferrer nofollow\"><strong>xPos, 2023<\/strong><\/a><\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438 RoPE \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a \u0434\u043b\u0438\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443. \u0412\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u00ab\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f\u00bb \u0434\u043b\u044f \u043f\u0430\u0440\u044b \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c RoPE \u043f\u0440\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0440\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u044d\u0442\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043e\u0441\u0446\u0438\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u044d\u0442\u043e \u043f\u043e\u0440\u0442\u0438\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e3f\/db1\/5d2\/e3fdb15d2784bf4799f723cafc088a8a.png\" width=\"1656\" height=\"694\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e3f\/db1\/5d2\/e3fdb15d2784bf4799f723cafc088a8a.png\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u0443\u0433\u043b\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0431\u043e\u043b\u044c\u0448\u0435\u043c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\pi\" alt=\"\\pi\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/334\/ef0\/037\/334ef0037a933805d137ef7732180d62.svg\" width=\"11\" height=\"12\"\/>. \u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"Q\" alt=\"Q\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e5\/8b6\/c48\/6e58b6c480eac5cad32a9d3c14b42870.svg\" width=\"15\" height=\"20\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/966\/eda\/79b\/966eda79b9ca0982f9649ff44199b6d4.svg\" width=\"17\" height=\"17\"\/>(<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"T\" alt=\"T\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d9f\/067\/324\/d9f067324e7ae143fce5b1fa4d643f5f.svg\" width=\"14\" height=\"17\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"T^{-1}\" alt=\"T^{-1}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86a\/8a0\/930\/86a8a093068081c6ae065bbf2f71291f.svg\" width=\"34\" height=\"21\"\/>\u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/63c\/d0f\/270\/63cd0f270fb4135c413697b87fbe126c.png\" alt=\"\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 RoPE \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u043b\u044e\u0447\u0435\u0439. M \u2014 \u043c\u0430\u0441\u043a\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.\" title=\"\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 RoPE \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u043b\u044e\u0447\u0435\u0439. M \u2014 \u043c\u0430\u0441\u043a\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.\" width=\"1656\" height=\"826\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/63c\/d0f\/270\/63cd0f270fb4135c413697b87fbe126c.png\"\/><\/p>\n<div><figcaption>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 RoPE \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u043b\u044e\u0447\u0435\u0439. M \u2014 \u043c\u0430\u0441\u043a\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u044e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0443\u043b\u0443\u0447\u0448\u0430\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2305.19466\" rel=\"noopener noreferrer nofollow\"><strong>NoPE, 2023<\/strong><\/a><\/p>\n<p>\u0412 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 Transformer \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u00ab\u043c\u0435\u0448\u043a\u0430 \u0441\u043b\u043e\u0432\u00bb, \u043d\u043e \u044d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0432\u0435\u0440\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430. \u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0449\u0438\u043a, \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e, \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0440\u0435\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438.<\/p>\n<p>\u0412 \u0440\u0430\u0431\u043e\u0442\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0442\u0435\u043e\u0440\u0435\u043c\u044b. \u041f\u0435\u0440\u0432\u0430\u044f \u0433\u043b\u0430\u0441\u0438\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u043e\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0412\u0442\u043e\u0440\u0430\u044f \u2014 \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u043b\u043e\u044f\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"100M\" alt=\"100M\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/345\/924\/224\/34592422485e42e2d1ee8ed62f87bc13.svg\" width=\"50\" height=\"17\"\/>, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 20 \u0438 \u043d\u0430 \u0442\u0435\u0441\u0442\u0435 \u0434\u043e 40. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430 10 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 3 \u0433\u0440\u0443\u043f\u043f\u044b (\u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0438\u0434\u0430 \u00ab\u0441\u043b\u043e\u0436\u0438\u0442\u044c 2 \u0447\u0438\u0441\u043b\u0430\u00bb \u0438\u043b\u0438 \u00ab\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u00bb), \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e NoPE \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u043d\u0435\u043f\u043b\u043e\u0445\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b1c\/08e\/cb4\/b1c08ecb46d3c498263a24066fd2f752.png\" width=\"1562\" height=\"360\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b1c\/08e\/cb4\/b1c08ecb46d3c498263a24066fd2f752.png\"\/><\/figure>\n<p>\u0410\u0432\u0442\u043e\u0440\u044b \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0441\u043b\u043e\u0451\u0432 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432. \u0411\u043b\u0438\u0437\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"A\" alt=\"A\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/698\/9b2\/883\/6989b28830165df195622827d64e0faa.svg\" width=\"15\" height=\"18\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ea4\/68b\/9a6\/ea468b9a63d91ed44229725da7251765.svg\" width=\"15\" height=\"17\"\/> \u043d\u0430 \u0441\u043b\u043e\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\ell\" alt=\"\\ell\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f10\/022\/522\/f10022522286c88588e8db798c28386a.svg\" width=\"8\" height=\"17\"\/> \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"D^\\ell(A, B) = \\underset{(P, Q) \\in A_\\ell \\times B_\\ell}{\\min} D(P,Q), \\quad D(P,Q) = \\cfrac{1}{n}\\sum_{i=1}^nD_{JSD}(P_i \\Vert Q_i),\" alt=\"D^\\ell(A, B) = \\underset{(P, Q) \\in A_\\ell \\times B_\\ell}{\\min} D(P,Q), \\quad D(P,Q) = \\cfrac{1}{n}\\sum_{i=1}^nD_{JSD}(P_i \\Vert Q_i),\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10d\/68b\/6f8\/10d68b6f8764669136a510438fd4a96c.svg\" width=\"562\" height=\"58\"\/><\/p>\n<p>\u0433\u0434\u0435<img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"D_{JSD}\" alt=\"D_{JSD}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f04\/419\/43a\/f0441943add65b10571b898c755fba7a.svg\" width=\"47\" height=\"20\"\/> \u2014 \u0434\u0438\u0432\u0435\u0440\u0433\u0435\u043d\u0446\u0438\u044f \u0419\u0435\u043d\u0441\u0435\u043d\u0430-\u0428\u0435\u043d\u043d\u043e\u043d\u0430 \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0430\u043c \u0434\u0432\u0443\u0445 \u0433\u043e\u043b\u043e\u0432. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c, \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u0430\u044f \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0431\u043e\u043b\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c T5:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/34f\/bd1\/1f8\/34fbd11f8a109841a42cccf704fb9cfd.png\" width=\"1582\" height=\"656\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/34f\/bd1\/1f8\/34fbd11f8a109841a42cccf704fb9cfd.png\"\/><\/figure>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u043b\u0438\u0436\u0435 \u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438: \u043c\u043e\u0434\u0435\u043b\u044c <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"1.3B\" alt=\"1.3B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a0\/7d2\/b48\/5a07d2b48ede76838ba513f4c0492dc9.svg\" width=\"40\" height=\"17\"\/>, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 1024 (\u043d\u0430 \u0442\u0435\u0441\u0442\u0435 \u0434\u043e 2560), \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 StarCoder. \u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u0435\u0440\u043f\u043b\u0435\u043a\u0441\u0438\u044f \u043d\u0430 200 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u0430\u0445:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a0b\/54a\/51f\/a0b54a51f0cc152a04fd41357cf0a3a7.png\" alt=\"\u0421\u0432\u0435\u0440\u0445\u0443 \u2014 \u0434\u043b\u0438\u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432.\" title=\"\u0421\u0432\u0435\u0440\u0445\u0443 \u2014 \u0434\u043b\u0438\u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432.\" width=\"1556\" height=\"946\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a0b\/54a\/51f\/a0b54a51f0cc152a04fd41357cf0a3a7.png\"\/><\/p>\n<div><figcaption>\u0421\u0432\u0435\u0440\u0445\u0443 \u2014 \u0434\u043b\u0438\u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432.<\/figcaption><\/div>\n<\/figure>\n<p>NoPE \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0434\u043b\u0438\u043d\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0445\u043e\u0442\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c RoPE.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2306.15595\" rel=\"noopener noreferrer nofollow\"><strong>Positional Interpolation RoPE, 2023<\/strong><\/a><\/p>\n<p>\u042d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u044b\u043b\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 <a href=\"https:\/\/kaiokendev.github.io\/til#extending-context-to-8k\" rel=\"noopener noreferrer nofollow\">SuperHOT RoPE<\/a>, \u0432 \u043e\u0431\u0435\u0438\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0445\u043e\u0436\u0438\u0435 \u0438\u0434\u0435\u0438, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435 \u0438\u0434\u0435\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u044e: \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435, \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e: \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 RoPE \u0438 \u0432\u043b\u043e\u0436\u0438\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 \u0442\u043e\u0442 \u0436\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/67e\/cf2\/39f\/67ecf239f12aa3a4bbdff872b4a359a0.png\" alt=\"\u0412\u043c\u0435\u0441\u0442\u043e \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0436\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d.\" title=\"\u0412\u043c\u0435\u0441\u0442\u043e \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0436\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d.\" width=\"1814\" height=\"930\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/67e\/cf2\/39f\/67ecf239f12aa3a4bbdff872b4a359a0.png\"\/><\/p>\n<div><figcaption>\u0412\u043c\u0435\u0441\u0442\u043e \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0436\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"g\" alt=\"g\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d3\/594\/4eb\/3d35944eb0c49505453d3378e6153e9d.svg\" width=\"9\" height=\"16\"\/> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"e_{ij}\" alt=\"e_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c21\/65c\/b77\/c2165cb77282f9d38b353f49f34c3e0e.svg\" width=\"22\" height=\"17\"\/> \u0438\u0437 RoPE \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0451 \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"g'\" alt=\"g'\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d7e\/438\/a3d\/d7e438a3d5a6f20503a3b2da985d522f.svg\" width=\"15\" height=\"23\"\/>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"g'(x_i, x_j, i - j) = g\\bigg(x_i, x_j, \\frac{(i - j)\\color{blue}{L}}{\\color{blue}{L'}}\\bigg),\" alt=\"g'(x_i, x_j, i - j) = g\\bigg(x_i, x_j, \\frac{(i - j)\\color{blue}{L}}{\\color{blue}{L'}}\\bigg),\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d43\/f21\/25f\/d43f2125f2efbeb3867768994825a0e5.svg\" width=\"322\" height=\"50\"\/><\/p>\n<p>\u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"L\" alt=\"L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/015\/aa9\/292\/015aa929244db613cdf3bac748b9d81a.svg\" width=\"13\" height=\"17\"\/> \u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"L'\" alt=\"L'\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/342\/d11\/666\/342d11666b9013b0f3db1228b0685e16.svg\" width=\"19\" height=\"19\"\/> \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u0438\u043d\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0422.\u0435. \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0443\u0447\u0438\u043b\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 1, 2, 3 \u0438 \u0442.\u0434., \u0441\u0436\u0430\u0442\u0438\u0435 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0443 \u043d\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 0.5, 1, 1.5, 2 \u0438 \u0442.\u0434.<\/p>\n<p>\u041f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\sim 10^4-10^5\" alt=\"\\sim 10^4-10^5\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/700\/cd7\/b3e\/700cd7b3e154dd850f01f5683834559d.svg\" width=\"102\" height=\"22\"\/> \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445, \u0430 \u0437\u0430\u043c\u0435\u0440\u044b \u043f\u0435\u0440\u043f\u043b\u0435\u043a\u0441\u0438\u0438 \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 LLaMA \u0438 \u0441\u0443\u043c\u043c\u0430\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e 1\u041a \u0448\u0430\u0433\u043e\u0432 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 PI \u043d\u0430\u0434 10\u041a \u0448\u0430\u0433\u0430\u043c\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (FT).<\/p>\n<p><a href=\"https:\/\/www.reddit.com\/r\/LocalLLaMA\/comments\/14lz7j5\/ntkaware_scaled_rope_allows_llama_models_to_have\" rel=\"noopener noreferrer nofollow\"><strong>NTK-Aware Scaled RoPE, 2023<\/strong><\/a><\/p>\n<p>\u0412 PI RoPE \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0441\u0443\u0442\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043e\u0431\u0437\u043e\u0440\u043d\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0438\u0437 \u0440\u0430\u0431\u043e\u0442\u044b <a href=\"https:\/\/arxiv.org\/abs\/2309.00071\" rel=\"noopener noreferrer nofollow\">YaRN<\/a> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 <a href=\"https:\/\/arxiv.org\/abs\/2006.10739\" rel=\"noopener noreferrer nofollow\">Neural Tangent Kernel (NTK)<\/a>, \u0434\u043b\u044f DL-\u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u0443\u0447\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0439 \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0439. RoPE \u0438\u043c\u0435\u0435\u0442 \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0432\u0438\u0434\u043e\u043c Fourier Features \u0438\u0437 NTK, \u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u0442\u044f\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 RoPE (\u043a\u0430\u043a \u0432 PI) \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u0438 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u0422.\u0435. \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442, \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 PI RoPE \u043d\u0430 \u043d\u0435-\u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0441\u044d\u043c\u043f\u043b\u0430\u0445 \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f (\u0447\u0435\u0433\u043e \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e).<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043c\u0435\u043d\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"b\" alt=\"b\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/573\/8c4\/9fe\/5738c49fe0b5f94483748f578f685797.svg\" width=\"8\" height=\"17\"\/>(\u043a\u043e\u0442\u043e\u0440\u043e\u0435 10000), \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u00ab\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f\u00bb \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"b_{new} = b\\, \\cdot\\color{blue}{ \\bigg(\\frac{L'}{L}\\bigg)^{\\frac{d_z}{d_z - 2}}}\" alt=\"b_{new} = b\\, \\cdot\\color{blue}{ \\bigg(\\frac{L'}{L}\\bigg)^{\\frac{d_z}{d_z - 2}}}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a9\/f82\/3c7\/9a9f823c72adce60c71a6e878ce5d32f.svg\" width=\"174\" height=\"59\"\/><\/p>\n<p>\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0438 \u0441\u0442\u0430\u0440\u043e\u0439 \u0434\u043b\u0438\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u043d \u0443\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438. \u042d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0438\u0441\u043b\u0430, \u0442.\u0435. \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u044f.<\/p>\n<p>\u0421\u0445\u043e\u0436\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 <a href=\"https:\/\/arxiv.org\/abs\/2309.16039\" rel=\"noopener noreferrer nofollow\">LLaMA Long<\/a>.<\/p>\n<p><a href=\"https:\/\/github.%20com\/jquesnelle\/scaled-rope\/pull\/1\" rel=\"noopener noreferrer nofollow\"><strong>NTK-by-parts RoPE, 2023<\/strong><\/a><\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u043c\u0435\u0442\u043e\u0434, \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0434\u0432\u0443\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435. \u0412\u0432\u0435\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u0438\u043d\u044b \u0432\u043e\u043b\u043d\u044b \u2014 \u0447\u0438\u0441\u043b\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0430 RoPE \u043a\u0440\u0443\u0433\u0430 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"2\\pi\" alt=\"2\\pi\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/903\/9ba\/f43\/9039baf4366fab9c95158a59ddaf0cfc.svg\" width=\"21\" height=\"17\"\/> \u0432 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"d\" alt=\"d\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0cd\/f8d\/114\/0cdf8d114159c5305d6120c99765c348.svg\" width=\"10\" height=\"17\"\/>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\lambda_d = \\cfrac{2\\pi}{\\theta_d}\" alt=\"\\lambda_d = \\cfrac{2\\pi}{\\theta_d}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/149\/008\/49c\/14900849cc803474b845c0416e55d61d.svg\" width=\"75\" height=\"57\"\/><\/p>\n<p>PI RoPE \u0438 NTK-Aware RoPE \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0434\u043b\u0438\u043d\u0443 \u0432\u043e\u043b\u043d\u044b \u0438 \u0441\u0447\u0438\u0442\u0430\u044e\u0442 \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f RoPE \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0443 \u0447\u0430\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 <img class=\"formula inline\" source=\"\\lambda_d > L&#187; alt=&#187;\\lambda_d > L&#187; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/534\/00a\/1ca\/53400a1ca4359d5b5089e0af3829c93c.svg&#187; width=&#187;60&#8243; height=&#187;20&#8243;\/>, \u0443 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0438 \u0434\u0438\u0441\u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u044b\u043c. \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u044b \u0432\u043e\u043b\u043d\u044b. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 NTK-by-parts RoPE \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\lambda_d \\ll L\" alt=\"\\lambda_d \\ll L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/148\/57a\/8ce\/14857a8ce4996243d0f0d36cf7f9ce83.svg\" width=\"64\" height=\"20\"\/> \u2014 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\lambda_d \\ge L\" alt=\"\\lambda_d \\ge L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6b7\/7d3\/847\/6b77d38477d68c39e2f8c16176a744a4.svg\" width=\"60\" height=\"20\"\/> \u2014 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0438 (\u043a\u0430\u043a \u0432 PI RoPE)<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u043f\u0440\u043e\u0447\u0438\u0445 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u0443\u044e NTK-Aware \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 PI RoPE \u0438 NTK-Aware \u0438 \u0441 \u0434\u043e\u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c, \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p><a href=\"https:\/\/www.reddit.com\/r\/LocalLLaMA\/comments\/14mrgpr\/dynamically_scaled_rope_further_increases\" rel=\"noopener noreferrer nofollow\"><strong>Dynamic Scaled RoPE, 2023<\/strong><\/a><\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u0438\u0434\u0435\u044f \u0432 \u043a\u043e\u043f\u0438\u043b\u043a\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0441\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u043a\u0442\u043e\u0440 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430, \u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u043b\u0438\u043d\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\ell\" alt=\"\\ell\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6b\/7ce\/840\/f6b7ce8406f4d0f714234d57a208ef5d.svg\" width=\"8\" height=\"17\"\/>\u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0422.\u0435. \u0432\u043c\u0435\u0441\u0442\u043e <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"L' \/ L\" alt=\"L' \/ L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe7\/a64\/be7\/fe7a64be74c3ee6edf1430a73a4f8065.svg\" width=\"42\" height=\"23\"\/> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f  <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"\\ell' \/ L, \\quad\\ell'=\\max(1, \\ell \/ L)\" alt=\"\\ell' \/ L, \\quad\\ell'=\\max(1, \\ell \/ L)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa6\/a2d\/b77\/aa6a2db77c7aa88561d73fce5e9c1438.svg\" width=\"207\" height=\"23\"\/>. \u041f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0434\u043b\u0438\u043d\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2309.00071\" rel=\"noopener noreferrer nofollow\"><strong>YaRN, 2023<\/strong><\/a><\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u0437\u043e\u0440\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435), \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e NTK-by-parts RoPE. \u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"t\" alt=\"t\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/683\/850\/960\/6838509603a3119d066827246ad371bf.svg\" width=\"7\" height=\"16\"\/> \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u0434\u043b\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"e_{ij}\" alt=\"e_{ij}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d08\/aeb\/23a\/d08aeb23af70ec023e63068a33139006.svg\" width=\"22\" height=\"17\"\/> \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u0435\u0440\u043f\u043b\u0435\u043a\u0441\u0438\u044e \u043f\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 YaRN = NTK-by-parts RoPE + \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0435 \u043b\u043e\u0433\u0438\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u043d\u0430\u0431\u043e\u0440\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b (\u043a\u0430\u043a \u043f\u043e \u043f\u0435\u0440\u043f\u043b\u0435\u043a\u0441\u0438\u0438, \u0442\u0430\u043a \u0438 \u043d\u0430 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u0445), \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u043d (\u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b) \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 Flash Attention.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0435\u043c\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0442\u0440\u0435\u043d\u0434\u0435, \u0440\u0430\u0431\u043e\u0442 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e, \u0438 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u0441\u044f\u043a\u0430\u0442\u044c. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0435\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445 \u0435\u0449\u0451 \u0434\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043b\u0430\u0441\u0441 <code>LlamaDynamicNTKScalingRotaryEmbedding<\/code> \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 transformers).<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0435\u0449\u0451 \u043d\u0435\u0442, \u0445\u043e\u0442\u044f \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0447\u0430\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u043e\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 RoPE \u0438 \u0438\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u0437\u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0445 LLaMA. \u0418\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b RoPE \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u044f\u0449\u043d\u043e \u0438 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0438\u0445 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c. \u041d\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043d\u0443\u043b\u044f \u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c 2-3 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u0443\u0441\u043f\u0435\u0445\u043e\u0432!<\/p>\n<\/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\/780116\/\"> https:\/\/habr.com\/ru\/articles\/780116\/<\/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<h4>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440<\/h4>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b Transformer. \u041e\u0442 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0431\u0449\u0438\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b Transformer \u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 self-attention. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0440\u0432\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043e\u0442 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u00a0<a href=\"https:\/\/habr.com\/ru\/companies\/just_ai\/articles\/733110\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442 \u043e\u0431\u0437\u043e\u0440<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0451, \u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u00a0<a href=\"http:\/\/jalammar.github.io\/illustrated-transformer\" rel=\"noopener noreferrer nofollow\">\u043e\u0441\u043d\u043e\u0432<\/a>.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Transformer \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445. \u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/773312\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043e\u0431\u0437\u043e\u0440\u0435<\/a> \u0443\u043f\u043e\u0440 \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 self-attention, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0427\u0430\u0441\u0442\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/direct.mit.edu\/coli\/article\/48\/3\/733\/111478\/Position-Information-in-Transformers-An-Overview\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u043f\u043b\u043e\u0445\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0435<\/a>.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Transformer, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, RNN, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u00ab\u043c\u0435\u0448\u043e\u043a \u0441\u043b\u043e\u0432\u00bb. \u041f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0431\u0435\u0437 \u043d\u0438\u0445, \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0441 \u044d\u043a\u0441\u0442\u0440\u0430\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0412\u0430\u0436\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0440\u0430\u043c\u0438 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0442 \u0434\u043b\u0438\u043d\u044b \u0432\u0445\u043e\u0434\u0430, \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0443\u0447\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 LLM. \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0431\u043e \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438, \u043b\u0438\u0431\u043e \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0442\u0443\u0434\u0430 \u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0434\u0442\u0438 \u0437\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0432\u0437\u044f\u0442\u044b \u043b\u0438\u0431\u043e \u0438\u0437 \u0441\u0430\u043c\u0438\u0445 \u0440\u0430\u0431\u043e\u0442, \u043b\u0438\u0431\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u044b<\/h2>\n<ul>\n<li>\n<p> \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0442\u043e\u043a\u0435\u043d\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<\/p>\n<\/li>\n<li>\n<p> \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0433\u043e\u043b\u043e\u0432\u044b self-attention<\/p>\n<\/li>\n<li>\n<p>,  \u2014 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432  \u0438  \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>, ,  \u2014 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u043b\u043e\u044f-\u0433\u043e\u043b\u043e\u0432\u044b<\/p>\n<\/li>\n<li>\n<p>, ,  \u2014 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u043b\u043e\u044f-\u0433\u043e\u043b\u043e\u0432\u044b<\/p>\n<\/li>\n<li>\n<p>\u0424\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 self-attention:<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0431\u0437\u043e\u0440 \u0440\u0430\u0431\u043e\u0442<\/h2>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1706.03762\" rel=\"noopener noreferrer nofollow\"><strong>Sinusoidal \u0438 Trainable Absolute, 2017<\/strong><\/a><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438 \u0441\u0430\u043c\u043e\u0433\u043e Transformer. \u041f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435. \u0412\u0435\u043a\u0442\u043e\u0440 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u043c\u0443 \u0432\u0435\u043a\u0442\u043e\u0440\u0443 \u0442\u043e\u043a\u0435\u043d\u0430 (\u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0443) \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438.<\/p>\n<p>\u0421\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0443\u0447\u0438\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u0441\u0435\u0442\u0438. \u042d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u044a\u0451\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u0434\u043b\u0438\u043d\u043e\u0439, \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0435\u0451 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043f\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0445 (\u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445) \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b  \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439:<\/p>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u043f\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1803.02155\" rel=\"noopener noreferrer nofollow\"><strong>Relative, 2018<\/strong><\/a><\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c\u0438 \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435, \u0442.\u0435. \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u0430 \u043f\u0430\u0440\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430. \u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435 \u043f\u0443\u0442\u0451\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435, \u0430 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<p>\u042d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u044b\u043b\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0432 \u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f  \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u0445 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 self-attention:<\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c, \u0440\u0430\u0441\u043a\u0440\u044b\u0432 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u043e\u043c, \u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0433\u043e\u043b\u043e\u0432 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0441\u043b\u043e\u0451\u0432.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1901.02860\" rel=\"noopener noreferrer nofollow\"><strong>Transformer-XL, 2019<\/strong><\/a><\/p>\n<p>\u0412\u0445\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 -\u0433\u043e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u043b\u044f -\u0433\u043e. \u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442: \u0443 \u043e\u0431\u043e\u0438\u0445 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430, \u043a\u0430\u043a \u0438 \u0432 Relative, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 self-attention. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0432\u0438\u0434\u0435 \u0441\u0443\u043c\u043c\u044b \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439  \u0438 \u0440\u0430\u0441\u043f\u0438\u0448\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 :<\/p>\n<p>\u0420\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u0437\u0431\u0430\u0432\u0438\u0432\u0448\u0438\u0441\u044c \u043e\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b :<\/p>\n<p>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 . \u0412\u0435\u043a\u0442\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u043c\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438  \u0438 . \u0412\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043a\u043b\u044e\u0447\u0435\u0439 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u044f \u0441\u0432\u044f\u0437\u044c<\/p>\n<\/li>\n<li>\n<p>\u0441\u0432\u044f\u0437\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u0441\u0434\u0432\u0438\u0433<\/p>\n<\/li>\n<li>\n<p>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u0434\u0432\u0438\u0433<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 Relative \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e (1) \u0438 (2), \u0441\u0434\u0432\u0438\u0433\u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 Relative \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 \u0441\u0438\u043d\u0443\u0441\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1910.10683\" rel=\"noopener noreferrer nofollow\"><strong>T5, 2020<\/strong><\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u043b\u044f\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a  \u043f\u0435\u0440\u0435\u0434 softmax. \u0421\u043a\u0430\u043b\u044f\u0440\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c-\u043e\u0442\u0441\u0442\u0443\u043f\u0430\u043c . \u0412\u0441\u0435\u0433\u043e \u0441\u043a\u0430\u043b\u044f\u0440\u043e\u0432 32, \u043e\u043d\u0438 \u0432 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0448\u043a\u0430\u043b\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 128 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432, \u0442.\u0435. \u0431\u043b\u0438\u0437\u043a\u0438\u0435 \u043a 0 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u043a\u043e\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043a\u0430\u043b\u044f\u0440\u0430\u043c\u0438, \u0430 \u0434\u0430\u043b\u0451\u043a\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u0438\u043c:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043d\u0438\u0437\u0443 \u043d\u043e\u043c\u0435\u0440 \u0441\u043a\u0430\u043b\u044f\u0440\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0435\u043c\u0443 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c, \u0431\u043e\u043b\u044c\u0448\u0438\u043c 128, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u043a\u0430\u043b\u044f\u0440, \u043e\u043d \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442. \u041f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u044b \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u043e\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043e\u043a\u043d\u043e \u0443\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0438\u0434\u0435\u0439\u043d\u043e \u0441\u0445\u043e\u0436\u0435 \u0441 CNN \u0438\u043b\u0438 \u043e\u043a\u043d\u043e\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0432 Longformer). \u041e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u044b \u0441\u0432\u043e\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b self-attention, \u043d\u043e \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0451\u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2006.03654\" rel=\"noopener noreferrer nofollow\"><strong>DeBERTa, 2021<\/strong><\/a><\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 Transformer-XL, \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u0432 self-attention \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 3 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445:<\/p>\n<p>\u041f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 (3) \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u0434\u0432\u0438\u0433\u0435, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a (4) \u2014 position-to-position term \u2014 \u0434\u043b\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0441\u0451\u0442 \u043c\u0430\u043b\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0430\u044f \u0440\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 Transformer-XL:<\/p>\n<p>\u041d\u043e\u0432\u044b\u0435 \u0432\u0435\u0441\u043e\u0432\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u0432\u043e\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b \u0433\u043e\u043b\u043e\u0432\u0430-\u0441\u043b\u043e\u0439, \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0439  \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u0430\u044f, \u043e\u0431\u0449\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0451\u0432 \u0438 \u0441\u0432\u043e\u044f \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432, \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0432 \u0440\u0430\u0437\u043c\u0435\u0440 , \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0446\u0430 \u043e\u0442\u0441\u0442\u0443\u043f\u0430.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0430\u043a\u0442: \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0435\u043c \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2104.09864\" rel=\"noopener noreferrer nofollow\"><strong>RoPE, 2021<\/strong><\/a><\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 (LLaMA, Qwen, Mistral), \u043d\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043e \u0447\u0435\u043c \u0440\u0435\u0447\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c. \u0415\u0441\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438, \u0442\u043e \u0432 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0442\u043e\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<p>\u0442.\u0435. \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0442 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 , \u0442\u0430\u043a\u0438\u0435, \u0447\u0442\u043e<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f  \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<p>\u0433\u0434\u0435  \u2014 \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430. \u0424\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043b\u044f  \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430. \u041f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f  \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<p>\u0433\u0434\u0435  \u2014 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c ,  \u2014 \u0441\u043e\u043f\u0440\u044f\u0436\u0451\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043a , \u0430  \u2014 \u043c\u043d\u0438\u043c\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 RoPE \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\/\u043a\u043b\u044e\u0447\u0430 \u043d\u0430 \u0443\u0433\u043e\u043b, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0439 \u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0435\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0433\u043e\u043b, \u0442.\u0435. \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0447\u0451\u0442\u043d\u0443\u044e . \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e  \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430  \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0445 \u043f\u043e\u0434\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432, \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430. \u0418\u0442\u043e\u0433\u043e\u0432\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f  ( \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e):<\/p>\n<p>\u0433\u0434\u0435<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f RoPE.<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Absolute \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c, \u0430 \u043a \u043f\u0430\u0440\u0430\u043c, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430  \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0443\u043c\u043c\u044b (\u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u0434\u0434\u0438\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438). \u0412 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 RoPE \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c Absolute \u0438 Relative:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 Absolute \u0438 RoPE \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 MLM \u0438 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 RoPE \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0447\u0435\u043c \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438, \u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2108.12409\" rel=\"noopener noreferrer nofollow\"><strong>ALiBi, 2022<\/strong><\/a><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u0441\u0445\u043e\u0436\u0438\u0439 \u0441 T5: \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u043e\u0432 \u0438\u043b\u0438 \u0440\u0435\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a  \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u043b\u044f\u0440. \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 T5 \u0441\u043a\u0430\u043b\u044f\u0440\u044b \u043d\u0435 \u043e\u0431\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 , \u0433\u0434\u0435  \u2014 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435 \u0447\u0438\u0441\u043b\u043e, \u0441\u0432\u043e\u0451 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u043e\u0431\u0449\u0435\u0435 \u0434\u043b\u044f \u0441\u043b\u043e\u0451\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f 8 \u0433\u043e\u043b\u043e\u0432 \u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c .<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 Absolute vs. RoPE vs T5 \u0442\u043e\u043b\u044c\u043a\u043e T5 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043a \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445 \u0441 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0434\u043b\u0438\u043d\u043e\u0439, \u0447\u0435\u043c \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 (\u0434\u043e 600 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0441\u0432\u0435\u0440\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 512), \u043d\u043e \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438, \u043f\u0440\u043e\u0449\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441 Absolute \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c. AliBi \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441 \u0442.\u0437. \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0432 \u0440\u0430\u0437\u044b \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u043c, \u0447\u0435\u043c \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0441 \u0442.\u0437. \u043f\u0435\u0440\u043f\u043b\u0435\u043a\u0441\u0438\u0438):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2212.10554\" rel=\"noopener noreferrer nofollow\"><strong>xPos, 2023<\/strong><\/a><\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438 RoPE \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a \u0434\u043b\u0438\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443. \u0412\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u00ab\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f\u00bb \u0434\u043b\u044f \u043f\u0430\u0440\u044b \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438. \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c RoPE \u043f\u0440\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0440\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u044d\u0442\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043e\u0441\u0446\u0438\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u044d\u0442\u043e \u043f\u043e\u0440\u0442\u0438\u0442 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u0443\u0433\u043b\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0431\u043e\u043b\u044c\u0448\u0435\u043c . \u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0430\u043f\u0440\u0438\u043e\u0440\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432  \u0438 ( \u0438 \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438):<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0438\u044f <\/figcaption><\/div>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-362743","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362743","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=362743"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/362743\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}