{"id":36868,"date":"2025-01-20T05:00:21","date_gmt":"2025-01-19T21:00:21","guid":{"rendered":"https:\/\/17aitech.com\/?p=36868"},"modified":"2025-01-20T05:00:21","modified_gmt":"2025-01-19T21:00:21","slug":"huggingface%e5%b7%a5%e7%a8%8b%e5%b8%88%e4%ba%b2%e6%8e%88%ef%bc%9a%e5%a6%82%e4%bd%95%e5%9c%a8transformer%e4%b8%ad%e5%ae%9e%e7%8e%b0%e6%9c%80%e5%a5%bd%e7%9a%84%e4%bd%8d%e7%bd%ae%e7%bc%96%e7%a0%81","status":"publish","type":"post","link":"https:\/\/17aitech.com\/?p=36868","title":{"rendered":"HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801"},"content":{"rendered":"<p>\u6587\u7ae0\u6765\u6e90\u4e8e\u4e92\u8054\u7f51:<a href=\"https:\/\/www.jiqizhixin.com\/articles\/2024-11-27-3\" target=\"_blank\">HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801<\/a><\/p>\n<blockquote data-author-name=\"\" data-content-utf8-length=\"37\" data-source-title=\"\" data-type=\"2\" data-url=\"\">\n<section>\n<section>\n<section>\u4e00\u4e2a\u6709\u6548\u7684\u590d\u6742\u7cfb\u7edf\u603b\u662f\u4ece\u4e00\u4e2a\u6709\u6548\u7684\u7b80\u5355\u7cfb\u7edf\u6f14\u5316\u800c\u6765\u7684\u3002\u2014\u2014John Gall<\/section>\n<\/section>\n<\/section>\n<\/blockquote>\n<section><\/section>\n<section>\u5728 Transformer \u6a21\u578b\u4e2d\uff0c\u4f4d\u7f6e\u7f16\u7801\uff08Positional Encoding\uff09 \u88ab\u7528\u6765\u8868\u793a\u8f93\u5165\u5e8f\u5217\u4e2d\u7684\u5355\u8bcd\u4f4d\u7f6e\u3002\u4e0e\u9690\u5f0f\u5305\u542b\u987a\u5e8f\u4fe1\u606f\u7684 RNN \u548c CNN \u4e0d\u540c\uff0cTransformer \u7684\u67b6\u6784\u4e2d\u6ca1\u6709\u5185\u7f6e\u5904\u7406\u5e8f\u5217\u987a\u5e8f\u7684\u673a\u5236\uff0c\u9700\u8981\u901a\u8fc7\u4f4d\u7f6e\u7f16\u7801\u663e\u5f0f\u5730\u4e3a\u6a21\u578b\u63d0\u4f9b\u5e8f\u5217\u4e2d\u5355\u8bcd\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u4ee5\u66f4\u597d\u5730\u5b66\u4e60\u5e8f\u5217\u5173\u7cfb\u3002<\/section>\n<section><\/section>\n<section>\u4f4d\u7f6e\u7f16\u7801\u901a\u5e38\u901a\u8fc7\u6570\u5b66\u51fd\u6570\u751f\u6210\uff0c\u76ee\u7684\u662f\u4e3a\u6bcf\u4e2a\u4f4d\u7f6e\u751f\u6210\u4e00\u4e2a\u72ec\u7279\u7684\u5411\u91cf\u3002\u8fd9\u4e9b\u5411\u91cf\u5728\u5d4c\u5165\u7a7a\u95f4\u4e2d\u5177\u6709\u7279\u5b9a\u7684\u6027\u8d28\uff0c\u6bd4\u5982\u5468\u671f\u6027\u548c\u8fde\u7eed\u6027\u3002<\/section>\n<section><\/section>\n<section>\u5728\u6700\u8fd1\u7684\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0cHuggingFace \u673a\u5668\u5b66\u4e60\u5de5\u7a0b\u5e08 Christopher Fleetwood \u4ecb\u7ecd\u4e86\u9010\u6b65\u53d1\u73b0 Transformer \u6a21\u578b\u4e2d\u6700\u5148\u8fdb\u4f4d\u7f6e\u7f16\u7801\u7684\u65b9\u6cd5\u3002\u4e3a\u6b64\uff0c\u4f5c\u8005\u4f1a\u8bb2\u8ff0\u5982\u4f55\u4e0d\u65ad\u6539\u8fdb\u4f4d\u7f6e\u7f16\u7801\u65b9\u6cd5\uff0c\u6700\u7ec8\u5f62\u6210\u65cb\u8f6c\u4f4d\u7f6e\u7f16\u7801 (RoPE)\uff0c\u5e76\u5728\u6700\u65b0\u7684 LLama 3.2 \u7248\u672c\u548c\u5927\u591a\u6570\u73b0\u4ee3 Transformer \u4e2d\u4f7f\u7528\u3002\u5728\u8bfb\u8fd9\u7bc7\u6587\u7ae0\u524d\uff0c\u4f60\u9700\u8981\u638c\u63e1\u4e00\u4e9b\u57fa\u672c\u7684\u7ebf\u6027\u4ee3\u6570\u3001\u4e09\u89d2\u5b66\u548c\u81ea\u6ce8\u610f\u529b\u7684\u77e5\u8bc6\u3002<\/section>\n<section><\/section>\n<section><strong>\u95ee\u9898\u9648\u8ff0<\/strong><\/section>\n<section><\/section>\n<section>\u4e0e\u6240\u6709\u95ee\u9898\u4e00\u6837\uff0c\u6700\u597d\u9996\u5148\u4e86\u89e3\u6211\u4eec\u60f3\u8981\u5b9e\u73b0\u7684\u76ee\u6807\u3002Transformer \u4e2d\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236\u7528\u4e8e\u7406\u89e3\u5e8f\u5217\u4e2d token \u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u81ea\u6ce8\u610f\u529b\u662f\u4e00\u79cd\u96c6\u5408\u8fd0\u7b97\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u662f\u7f6e\u6362\u7b49\u53d8\u7684\u3002\u5982\u679c\u6211\u4eec\u4e0d\u5229\u7528\u4f4d\u7f6e\u4fe1\u606f\u6765\u4e30\u5bcc\u81ea\u6ce8\u610f\u529b\uff0c\u5c31\u65e0\u6cd5\u786e\u5b9a\u8bb8\u591a\u91cd\u8981\u7684\u5173\u7cfb\u3002<\/section>\n<section><\/section>\n<section>\u4e3e\u4f8b\u8bf4\u660e\u6700\u80fd\u8bf4\u660e\u8fd9\u4e00\u70b9\u3002<\/section>\n<section><\/section>\n<section>\u8003\u8651\u4e00\u4e0b\u8fd9\u4e2a\u53e5\u5b50\uff0c\u5176\u4e2d\u540c\u4e00\u4e2a\u5355\u8bcd\u51fa\u73b0\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\uff1a<\/section>\n<section><\/section>\n<section>\u300c\u8fd9\u53ea\u72d7\u8ffd\u8d76\u53e6\u4e00\u53ea\u72d7\u300d<\/section>\n<section><\/section>\n<section>\u76f4\u89c2\u5730\u770b\uff0c\u300c\u72d7\u300d\u6307\u7684\u662f\u4e24\u4e2a\u4e0d\u540c\u7684\u5b9e\u4f53\u3002\u5982\u679c\u6211\u4eec\u9996\u5148\u5bf9\u5b83\u4eec\u8fdb\u884c token \u5316\uff0c\u6620\u5c04\u5230 Llama 3.2 1B \u7684\u771f\u5b9e token \u5d4c\u5165\uff0c\u5e76\u5c06\u5b83\u4eec\u4f20\u9012\u7ed9 torch.nn.MultiheadAttention \uff0c\u4f1a\u53d1\u751f\u4ec0\u4e48\u3002<\/section>\n<section>\n<pre data-lang=\"makefile\"><code>import torchimport torch.nn as nnfrom transformers import AutoTokenizer, AutoModelmodel_id = \"meta-llama\/Llama-3.2-1B\"tok = AutoTokenizer.from_pretrained(model_id)model = AutoModel.from_pretrained(model_id)text = \"The dog chased another dog\"tokens = tok(text, return_tensors=\"pt\")[\"input_ids\"]embeddings = model.embed_tokens(tokens)hdim = embeddings.shape[-1]W_q = nn.Linear(hdim, hdim, bias=False)W_k = nn.Linear(hdim, hdim, bias=False)W_v = nn.Linear(hdim, hdim, bias=False)mha = nn.MultiheadAttention(embed_dim=hdim, num_heads=4, batch_first=True)with torch.no_grad(): \u00a0 \u00a0for param in mha.parameters(): \u00a0 \u00a0 \u00a0 \u00a0nn.init.normal_(param, std=0.1) # Initialize weights to be non-negligibleoutput, _ = mha(W_q(embeddings), W_k(embeddings), W_v(embeddings))dog1_out = output[0, 2]dog2_out = output[0, 5]print(f\"Dog output identical?: {torch.allclose(dog1_out, dog2_out, atol=1e-6)}\") #True<\/code><\/pre>\n<\/section>\n<section>\u53ef\u4ee5\u770b\u5230\uff0c\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u4f4d\u7f6e\u4fe1\u606f\uff0c\u90a3\u4e48\uff08\u591a\u5934\uff09\u81ea\u6ce8\u610f\u529b\u8fd0\u7b97\u7684\u8f93\u51fa\u5bf9\u4e8e\u4e0d\u540c\u4f4d\u7f6e\u7684\u76f8\u540c token \u662f\u76f8\u540c\u7684\uff0c\u5c3d\u7ba1\u8fd9\u4e9b token \u663e\u7136\u4ee3\u8868\u4e0d\u540c\u7684\u5b9e\u4f53\u3002<\/section>\n<section><\/section>\n<section>\u8ba9\u6211\u4eec\u5f00\u59cb\u8bbe\u8ba1\u4e00\u79cd\u5229\u7528\u4f4d\u7f6e\u4fe1\u606f\u589e\u5f3a\u81ea\u6ce8\u610f\u529b\u7684\u65b9\u6cd5\uff0c\u4ee5\u4fbf\u5b83\u53ef\u4ee5\u786e\u5b9a\u6309\u4f4d\u7f6e\u7f16\u7801\u7684\u5355\u8bcd\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/section>\n<section><\/section>\n<section>\u4e3a\u4e86\u7406\u89e3\u548c\u8bbe\u8ba1\u6700\u4f73\u7f16\u7801\u65b9\u6848\uff0c\u8ba9\u6211\u4eec\u63a2\u8ba8\u4e00\u4e0b\u8fd9\u79cd\u65b9\u6848\u5e94\u5177\u5907\u7684\u4e00\u4e9b\u7406\u60f3\u7279\u6027\u3002<\/section>\n<section><\/section>\n<section><strong>\u7406\u60f3\u7279\u6027<\/strong><\/section>\n<section><\/section>\n<section><strong>\u5c5e\u6027 1 \uff1a\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u552f\u4e00\u7f16\u7801\uff08\u8de8\u5e8f\u5217\uff09<\/strong><\/section>\n<section><\/section>\n<section>\u6bcf\u4e2a\u4f4d\u7f6e\u90fd\u9700\u8981\u4e00\u4e2a\u65e0\u8bba\u5e8f\u5217\u957f\u5ea6\u5982\u4f55\u90fd\u4fdd\u6301\u4e00\u81f4\u7684\u552f\u4e00\u7f16\u7801 &#8211; \u65e0\u8bba\u5f53\u524d\u5e8f\u5217\u7684\u957f\u5ea6\u662f 10 \u8fd8\u662f 10,000\uff0c\u4f4d\u7f6e 5 \u5904\u7684\u6807\u8bb0\u90fd\u5e94\u8be5\u5177\u6709\u76f8\u540c\u7684\u7f16\u7801\u3002<\/section>\n<section><\/section>\n<section><strong>\u5c5e\u6027 2 \uff1a\u4e24\u4e2a\u7f16\u7801\u4f4d\u7f6e\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb<\/strong><\/section>\n<section><\/section>\n<section>\u4f4d\u7f6e\u4e4b\u95f4\u7684\u5173\u7cfb\u5728\u6570\u5b66\u4e0a\u5e94\u8be5\u662f\u7b80\u5355\u7684\u3002\u5982\u679c\u77e5\u9053\u4f4d\u7f6e p \u7684\u7f16\u7801\uff0c\u90a3\u4e48\u8ba1\u7b97\u4f4d\u7f6e p+k \u7684\u7f16\u7801\u5c31\u5e94\u8be5\u5f88\u7b80\u5355\uff0c\u8fd9\u6837\u6a21\u578b\u5c31\u80fd\u66f4\u5bb9\u6613\u5730\u5b66\u4e60\u4f4d\u7f6e\u6a21\u5f0f\u3002<\/section>\n<section><\/section>\n<section>\u5982\u679c\u4f60\u60f3\u4e00\u60f3\u5982\u4f55\u5728\u6570\u7ebf\u4e0a\u8868\u793a\u6570\u5b57\uff0c\u5c31\u4e0d\u96be\u7406\u89e3 5 \u8ddd\u79bb 3 \u662f 2 \u6b65\uff0c\u6216\u8005 10 \u8ddd\u79bb 15 \u662f 5 \u6b65\u3002\u540c\u6837\u7684\u76f4\u89c2\u5173\u7cfb\u4e5f\u5e94\u8be5\u5b58\u5728\u4e8e\u7f16\u7801\u4e2d\u3002<\/section>\n<section><\/section>\n<section><strong>\u5c5e\u6027 3\uff1a\u53ef\u6cdb\u5316\u5230\u6bd4\u8bad\u7ec3\u4e2d\u9047\u5230\u7684\u5e8f\u5217\u66f4\u957f\u7684\u5e8f\u5217\u4e0a<\/strong><\/section>\n<section><\/section>\n<section>\u4e3a\u4e86\u63d0\u9ad8\u6a21\u578b\u5728\u73b0\u5b9e\u4e16\u754c\u4e2d\u7684\u5b9e\u7528\u6027\uff0c\u5b83\u4eec\u5e94\u8be5\u5728\u8bad\u7ec3\u5206\u5e03\u4e4b\u5916\u6cdb\u5316\u3002\u56e0\u6b64\uff0c\u7f16\u7801\u65b9\u6848\u9700\u8981\u6709\u8db3\u591f\u7684\u9002\u5e94\u6027\uff0c\u4ee5\u5904\u7406\u610f\u60f3\u4e0d\u5230\u7684\u8f93\u5165\u957f\u5ea6\uff0c\u540c\u65f6\u53c8\u4e0d\u8fdd\u53cd\u4efb\u4f55\u5176\u4ed6\u7406\u60f3\u7279\u6027\u3002<\/section>\n<section><\/section>\n<section><strong>\u5c5e\u6027 4\uff1a\u7531\u6a21\u578b\u53ef\u4ee5\u5b66\u4e60\u786e\u5b9a\u6027\u8fc7\u7a0b\u751f\u6210<\/strong><\/section>\n<section><\/section>\n<section>\u5982\u679c\u4f4d\u7f6e\u7f16\u7801\u80fd\u4ece\u4e00\u4e2a\u786e\u5b9a\u7684\u8fc7\u7a0b\u4e2d\u4ea7\u751f\uff0c\u90a3\u5c06\u662f\u6700\u7406\u60f3\u7684\u3002\u8fd9\u6837\uff0c\u6a21\u578b\u5c31\u80fd\u6709\u6548\u5730\u5b66\u4e60\u7f16\u7801\u65b9\u6848\u80cc\u540e\u7684\u673a\u5236\u3002<\/section>\n<section><\/section>\n<section><strong>\u5c5e\u6027 5\uff1a\u53ef\u6269\u5c55\u81f3\u591a\u4e2a\u7ef4\u5ea6<\/strong><\/section>\n<section><\/section>\n<section>\u968f\u7740\u591a\u6a21\u6001\u6a21\u578b\u6210\u4e3a\u5e38\u6001\uff0c\u4f4d\u7f6e\u7f16\u7801\u65b9\u6848\u5fc5\u987b\u80fd\u591f\u81ea\u7136\u5730\u4ece 1D \u6269\u5c55\u5230 nD\u3002\u8fd9\u5c06\u4f7f\u6a21\u578b\u80fd\u591f\u4f7f\u7528\u50cf\u56fe\u50cf\u6216\u8111\u90e8\u626b\u63cf\u8fd9\u6837\u7684\u6570\u636e\uff0c\u5b83\u4eec\u5206\u522b\u662f 2D \u548c 4D \u7684\u3002<\/section>\n<section><\/section>\n<section>\u73b0\u5728\u6211\u4eec\u77e5\u9053\u4e86\u7406\u60f3\u7684\u5c5e\u6027\uff08\u4ee5\u4e0b\u7b80\u79f0\u4e3a<a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png\"><\/a>\uff09\uff0c\u8ba9\u6211\u4eec\u5f00\u59cb\u8bbe\u8ba1\u548c\u8fed\u4ee3\u7f16\u7801\u65b9\u6848\u5427\u3002<\/section>\n<section><\/section>\n<section><strong>\u6574\u6570\u4f4d\u7f6e\u7f16\u7801<br \/><\/strong><\/section>\n<section><\/section>\n<section>\u6211\u4eec\u9996\u5148\u60f3\u5230\u7684\u65b9\u6cd5\u662f\u5c06 token \u4f4d\u7f6e\u7684\u6574\u6570\u503c\u6dfb\u52a0\u5230 token \u5d4c\u5165\u7684\u6bcf\u4e2a\u5206\u91cf\u4e2d\uff0c\u53d6\u503c\u8303\u56f4\u4e3a 0\u2192L\uff0c\u5176\u4e2d L \u662f\u5f53\u524d\u5e8f\u5217\u7684\u957f\u5ea6\u3002<\/section>\n<section><em><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-a5823ea644acb168db52bcd29904dcc2.gif\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-a5823ea644acb168db52bcd29904dcc2.gif\"><\/a><sup>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IntegerEncoding<\/sup><\/em><\/section>\n<section><\/section>\n<section>\u5728\u4e0a\u9762\u7684\u52a8\u753b\u4e2d\uff0c\u6211\u4eec\u4e3a\u7d22\u5f15\u4e2d\u7684 token \u521b\u5efa\u4e86\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230 token \u5d4c\u5165\u4e2d\u3002\u8fd9\u91cc\u7684\u5d4c\u5165\u503c\u662f Llama 3.2 1B \u4e2d\u771f\u5b9e\u503c\u7684\u5b50\u96c6\u3002\u53ef\u4ee5\u89c2\u5bdf\u5230\uff0c\u8fd9\u4e9b\u503c\u90fd\u96c6\u4e2d\u5728 0 \u9644\u8fd1\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u68af\u5ea6\u6d88\u5931\u6216\u7206\u70b8\u7684\u60c5\u51b5\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u5e0c\u671b\u5728\u6574\u4e2a\u6a21\u578b\u4e2d\u90fd\u80fd\u4fdd\u6301\u8fd9\u79cd\u60c5\u51b5\u3002<\/section>\n<section><\/section>\n<section>\u5f88\u660e\u663e\uff0c\u76ee\u524d\u7684\u65b9\u6cd5\u4f1a\u5e26\u6765\u95ee\u9898\uff0c\u4f4d\u7f6e\u503c\u7684\u5927\u5c0f\u8fdc\u8fdc\u8d85\u8fc7\u4e86\u8f93\u5165\u7684\u5b9e\u9645\u503c\u3002\u8fd9\u610f\u5473\u7740\u4fe1\u566a\u6bd4\u975e\u5e38\u4f4e\uff0c\u6a21\u578b\u5f88\u96be\u4ece\u4f4d\u7f6e\u4fe1\u606f\u4e2d\u5206\u79bb\u51fa\u8bed\u4e49\u4fe1\u606f\u3002<\/section>\n<section><\/section>\n<section>\u6709\u4e86\u8fd9\u4e00\u65b0\u77e5\u8bc6\uff0c\u4e00\u4e2a\u81ea\u7136\u7684\u540e\u7eed\u65b9\u6cd5\u53ef\u80fd\u662f\u5c06\u4f4d\u7f6e\u503c\u5f52\u4e00\u5316\u4e3a 1\/N\u3002\u8fd9\u5c31\u5c06\u6570\u503c\u9650\u5236\u5728 0 \u548c 1 \u4e4b\u95f4\uff0c\u4f46\u4e5f\u5e26\u6765\u4e86\u53e6\u4e00\u4e2a\u95ee\u9898\u3002\u5982\u679c\u6211\u4eec\u9009\u62e9 N \u4e3a\u5f53\u524d\u5e8f\u5217\u7684\u957f\u5ea6\uff0c\u90a3\u4e48\u6bcf\u4e2a\u957f\u5ea6\u4e0d\u540c\u7684\u5e8f\u5217\u7684\u4f4d\u7f6e\u503c\u5c31\u4f1a\u5b8c\u5168\u4e0d\u540c\uff0c\u8fd9\u5c31\u8fdd\u53cd\u4e86<a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-d80a2bdebfce97ae71b526db20b52da4.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-d80a2bdebfce97ae71b526db20b52da4.png\"><\/a>\u3002<\/section>\n<section><\/section>\n<section>\u6709\u6ca1\u6709\u66f4\u597d\u7684\u65b9\u6cd5\u6765\u786e\u4fdd\u6211\u4eec\u7684\u6570\u5b57\u4ecb\u4e8e 0 \u548c 1 \u4e4b\u95f4\u5462\uff1f\u5982\u679c\u6211\u4eec\u8ba4\u771f\u601d\u8003\u4e00\u6bb5\u65f6\u95f4\uff0c\u4e5f\u8bb8\u4f1a\u60f3\u5230\u5c06\u5341\u8fdb\u5236\u6570\u8f6c\u6362\u4e3a\u4e8c\u8fdb\u5236\u6570\u3002<\/section>\n<section><\/section>\n<section><strong>\u4e8c\u8fdb\u5236\u4f4d\u7f6e\u7f16\u7801<\/strong><\/section>\n<section><\/section>\n<section>\u6211\u4eec\u53ef\u4ee5\u5c06\u5176\u8f6c\u6362\u4e3a\u4e8c\u8fdb\u5236\u8868\u793a\u6cd5\uff0c\u5e76\u5c06\u6211\u4eec\u7684\u503c\uff08\u53ef\u80fd\u5df2\u5f52\u4e00\u5316\uff09\u4e0e\u5d4c\u5165\u7ef4\u5ea6\u76f8\u5339\u914d\uff0c\u800c\u4e0d\u662f\u5c06\u6211\u4eec\u7684\uff08\u53ef\u80fd\u5df2\u5f52\u4e00\u5316\u7684\uff09\u6574\u6570\u4f4d\u7f6e\u6dfb\u52a0\u5230\u5d4c\u5165\u7684\u6bcf\u4e2a\u5206\u91cf\u4e2d\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/section>\n<section><em><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-80252475af0110f6d4fe84dba057c7b0.gif\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-80252475af0110f6d4fe84dba057c7b0.gif\"><\/a><sup>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 BinaryEncoding<\/sup><\/em><\/section>\n<section><\/section>\n<section>\u6211\u4eec\u5c06\u611f\u5174\u8da3\u7684\u4f4d\u7f6e\uff08252\uff09\u8f6c\u6362\u4e3a\u4e8c\u8fdb\u5236\u8868\u793a\uff0811111100\uff09\uff0c\u5e76\u5c06\u6bcf\u4e00\u4f4d\u6dfb\u52a0\u5230 token \u5d4c\u5165\u7684\u76f8\u5e94\u7ec4\u4ef6\u4e2d\u3002\u6700\u5c0f\u6709\u6548\u4f4d\uff08LSB\uff09\u5c06\u5728\u6bcf\u4e2a\u540e\u7eed\u6807\u8bb0\u7684 0 \u548c 1 \u4e4b\u95f4\u5faa\u73af\uff0c\u800c\u6700\u5927\u6709\u6548\u4f4d\uff08MSB\uff09\u5c06\u6bcf 2^(n-1) \u4e2a token \u5faa\u73af\u4e00\u6b21\uff0c\u5176\u4e2d n \u662f\u4f4d\u6570\u3002\u4f60\u53ef\u4ee5\u5728\u4e0b\u9762\u7684\u52a8\u753b\u4e2d\u770b\u5230\u4e0d\u540c\u7d22\u5f15\u7684\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u3002<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-492a3317553ca2a86e137d4ce7326594.gif\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-492a3317553ca2a86e137d4ce7326594.gif\"><\/a><\/section>\n<section>\u6211\u4eec\u5df2\u7ecf\u89e3\u51b3\u4e86\u6570\u503c\u8303\u56f4\u7684\u95ee\u9898\uff0c\u73b0\u5728\u6211\u4eec\u6709\u4e86\u5728\u4e0d\u540c\u5e8f\u5217\u957f\u5ea6\u4e0a\u4fdd\u6301\u4e00\u81f4\u7684\u552f\u4e00\u7f16\u7801\u3002\u5982\u679c\u6211\u4eec\u7ed8\u5236 token \u5d4c\u5165\u7684\u4f4e\u7ef4\u7248\u672c\uff0c\u5e76\u53ef\u89c6\u5316\u4e0d\u540c\u503c\u7684\u4e8c\u8fdb\u5236\u4f4d\u7f6e\u5411\u91cf\u7684\u52a0\u6cd5\uff0c\u4f1a\u53d1\u751f\u4ec0\u4e48\u60c5\u51b5\u5462\uff1f<\/section>\n<section><\/section>\n<section>\u53ef\u4ee5\u770b\u5230\uff0c\u7ed3\u679c\u975e\u5e38\u300c\u8df3\u8dc3\u300d\uff08\u6b63\u5982\u6211\u4eec\u5bf9\u4e8c\u8fdb\u5236\u79bb\u6563\u6027\u7684\u9884\u671f\uff09\u3002\u4f18\u5316\u8fc7\u7a0b\u559c\u6b22\u5e73\u6ed1\u3001\u8fde\u7eed\u548c\u53ef\u9884\u6d4b\u7684\u53d8\u5316\u3002\u90a3\u4e48\u6709\u54ea\u4e9b\u5177\u6709\u7c7b\u4f3c\u53d6\u503c\u8303\u56f4\u7684\u51fd\u6570\u662f\u5e73\u6ed1\u8fde\u7eed\u7684\u5417\uff1f<\/section>\n<section><\/section>\n<section>\u5982\u679c\u6211\u4eec\u7a0d\u52a0\u7559\u610f\uff0c\u5c31\u4f1a\u53d1\u73b0 sin \u548c cos \u90fd\u7b26\u5408\u8981\u6c42\uff01<\/section>\n<section><\/section>\n<section><strong>\u6b63\u5f26\u4f4d\u7f6e\u7f16\u7801<\/strong><\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-c4032947fd687e5db5f8ec8e0625d151.gif\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-c4032947fd687e5db5f8ec8e0625d151.gif\"><\/a><\/section>\n<section>\u4e0a\u9762\u7684\u52a8\u753b\u5f62\u8c61\u5730\u5c55\u793a\u4e86\u6211\u4eec\u7684\u4f4d\u7f6e\u5d4c\u5165\uff0c\u5982\u679c\u6bcf\u4e2a\u5206\u91cf\u90fd\u662f\u7531\u6ce2\u957f\u9010\u6e10\u589e\u52a0\u7684 sin \u548c cos \u4ea4\u66ff\u7ed8\u5236\u800c\u6210\u3002\u5982\u679c\u5c06\u5176\u4e0e\u4e4b\u524d\u7684\u52a8\u753b\u8fdb\u884c\u6bd4\u8f83\uff0c\u4f60\u4f1a\u53d1\u73b0\u4e24\u8005\u6709\u60ca\u4eba\u7684\u76f8\u4f3c\u4e4b\u5904\u3002<\/section>\n<section><\/section>\n<section>\u73b0\u5728\uff0c\u6211\u4eec\u5df2\u7ecf\u638c\u63e1\u4e86\u6b63\u5f26\u6ce2\u5d4c\u5165\u7684\u65b9\u6cd5\uff0c\u8fd9\u6700\u521d\u662f\u5728\u300aAttention is all you need\u300b\u8bba\u6587\u4e2d\u5b9a\u4e49\u7684\u3002\u8ba9\u6211\u4eec\u6765\u770b\u770b\u65b9\u7a0b\u5f0f\uff1a<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-d7e0b350d6eab68f57b9441d36d25b9f.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-d7e0b350d6eab68f57b9441d36d25b9f.png\"><\/a><\/section>\n<section>\u5176\u4e2d\uff0cpos \u662f\u8bcd\u5757\u4f4d\u7f6e\u7d22\u5f15\uff0ci \u662f\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u4e2d\u7684\u5206\u91cf\u7d22\u5f15\uff0cd \u662f\u6a21\u578b\u7ef4\u5ea6\u300210,000 \u662f\u57fa\u672c\u6ce2\u957f\uff08\u4e0b\u6587\u7b80\u79f0\u4e3a \u03b8\uff09\uff0c\u6211\u4eec\u6839\u636e\u5206\u91cf\u7d22\u5f15\u7684\u51fd\u6570\u5bf9\u5176\u8fdb\u884c\u62c9\u4f38\u6216\u538b\u7f29\u3002\u6211\u9f13\u52b1\u5927\u5bb6\u8f93\u5165\u4e00\u4e9b\u5b9e\u9645\u503c\u6765\u611f\u53d7\u8fd9\u79cd\u51e0\u4f55\u7ea7\u6570\u3002<\/section>\n<section><\/section>\n<section>\u8fd9\u4e2a\u7b49\u5f0f\u6709\u51e0\u4e2a\u90e8\u5206\u4e4d\u770b\u4e4b\u4e0b\u4ee4\u4eba\u56f0\u60d1\u3002\u4f5c\u8005\u662f\u5982\u4f55\u9009\u62e9 10,00 \u7684\uff1f\u4e3a\u4ec0\u4e48\u5076\u6570\u548c\u5947\u6570\u4f4d\u7f6e\u5206\u522b\u4f7f\u7528 sin \u548c cos\uff1f<\/section>\n<section><\/section>\n<section>\u770b\u6765\uff0c\u4f7f\u7528 10000 \u4f5c\u4e3a\u57fa\u672c\u6ce2\u957f\u662f\u901a\u8fc7\u5b9e\u9a8c\u786e\u5b9a\u7684\u3002\u7834\u89e3 sin \u548c cos \u7684\u7528\u6cd5\u6d89\u53ca\u7684\u95ee\u9898\u8f83\u591a\uff0c\u4f46\u5bf9\u6211\u4eec\u7684\u8fed\u4ee3\u7406\u89e3\u65b9\u6cd5\u81f3\u5173\u91cd\u8981\u3002\u8fd9\u91cc\u7684\u5173\u952e\u662f\u6211\u4eec\u5e0c\u671b\u4e24\u4e2a\u7f16\u7801\u4f4d\u7f6e\u4e4b\u95f4\u5b58\u5728\u7ebf\u6027\u5173\u7cfb (<a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-b38d2aec5f6564a0c214452b6d949072.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-b38d2aec5f6564a0c214452b6d949072.png\"><\/a>\uff09\u3002\u8981\u7406\u89e3\u6b63\u5f26\u548c\u4f59\u5f26\u5982\u4f55\u914d\u5408\u4f7f\u7528\u624d\u80fd\u4ea7\u751f\u8fd9\u79cd\u7ebf\u6027\u5173\u7cfb\uff0c\u6211\u4eec\u5fc5\u987b\u6df1\u5165\u5b66\u4e60\u4e00\u4e9b\u4e09\u89d2\u5b66\u77e5\u8bc6\u3002<\/section>\n<section><\/section>\n<section>\u8003\u8651\u4e00\u4e32\u6b63\u5f26\u548c\u4f59\u5f26\u5bf9\uff0c\u6bcf\u5bf9\u90fd\u4e0e\u9891\u7387 \u03c9_i \u76f8\u5173\u8054\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f\u627e\u5230\u4e00\u4e2a\u7ebf\u6027\u53d8\u6362\u77e9\u9635 M\uff0c\u5b83\u80fd\u5c06\u8fd9\u4e9b\u6b63\u5f26\u51fd\u6570\u79fb\u52a8\u4e00\u4e2a\u56fa\u5b9a\u7684\u504f\u79fb\u91cf k:<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-fe953b21845a2906c1c95ecc0ffc5418.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-fe953b21845a2906c1c95ecc0ffc5418.png\"><\/a><\/section>\n<section>\u9891\u7387 \u03c9_i \u968f\u7ef4\u5ea6\u6307\u6570 i \u9012\u51cf\uff0c\u5176\u51e0\u4f55\u7ea7\u6570\u4e3a\uff1a<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-f69cf963276e088b8ad54f614242e3f0.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-f69cf963276e088b8ad54f614242e3f0.png\"><\/a><\/section>\n<section>\u8981\u627e\u5230\u8fd9\u4e2a\u53d8\u6362\u77e9\u9635\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u5176\u8868\u793a\u4e3a\u4e00\u4e2a\u5305\u542b\u672a\u77e5\u7cfb\u6570 u_1\u3001v_1\u3001u_2 \u548c v_2 \u7684\u4e00\u822c 2\u00d72 \u77e9\u9635\uff1a<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-8b56a92d16c6b28620741943bcc3c12f.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-8b56a92d16c6b28620741943bcc3c12f.png\"><\/a><\/section>\n<section>\u6839\u636e\u4e09\u89d2\u52a0\u6cd5\u5b9a\u7406\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u53f3\u8fb9\u7684\u516c\u5f0f\u6269\u5c55\u4e3a:<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-a4157342bbf1adf65fa324927c7defcd.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-a4157342bbf1adf65fa324927c7defcd.png\"><\/a><\/section>\n<section>\u901a\u8fc7\u5339\u914d\u7cfb\u6570\uff0c\u6b64\u5c55\u5f00\u5f0f\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e24\u4e2a\u65b9\u7a0b\u7684\u7cfb\u7edf\uff1a<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-23ac4305855e7cd0ed206e637c85cfd8.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-23ac4305855e7cd0ed206e637c85cfd8.png\"><\/a><\/section>\n<section>\u901a\u8fc7\u6bd4\u8f83\u4e24\u8fb9\u7684 sin (\u03c9_ip) \u548c cos (\u03c9_ip) \u9879\uff0c\u6211\u4eec\u53ef\u4ee5\u89e3\u51fa\u672a\u77e5\u7cfb\u6570\uff1a<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-27c55eba59d86dd9688a857e504e73c7.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-27c55eba59d86dd9688a857e504e73c7.png\"><\/a><\/section>\n<section>\u8fd9\u4e9b\u89e3\u51b3\u65b9\u6848\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u6700\u7ec8\u7684\u53d8\u6362\u77e9\u9635 M_k\uff1a<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-dc335f2f8dbadce6c0f6a6ac3c47bdac.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-dc335f2f8dbadce6c0f6a6ac3c47bdac.png\"><\/a><\/section>\n<section>\u5982\u679c\u4f60\u4ee5\u524d\u505a\u8fc7\u6e38\u620f\u7f16\u7a0b\uff0c\u4f60\u53ef\u80fd\u4f1a\u53d1\u73b0\u6211\u4eec\u7684\u63a8\u5bfc\u7ed3\u679c\u975e\u5e38\u719f\u6089\u3002\u6ca1\u9519\uff0c\u8fd9\u5c31\u662f\u65cb\u8f6c\u77e9\u9635\u3002<\/section>\n<section><\/section>\n<section>\u56e0\u6b64\uff0c\u65e9\u5728 2017 \u5e74\uff0cNoam Shazeer \u5728\u300aAttention is all you need\u300b\u8bba\u6587\u4e2d\u8bbe\u8ba1\u7684\u7f16\u7801\u65b9\u6848\u5c31\u5df2\u7ecf\u5c06\u76f8\u5bf9\u4f4d\u7f6e\u7f16\u7801\u4e3a\u65cb\u8f6c\u3002\u4ece\u6b63\u5f26\u7f16\u7801\u5230 RoPE \u53c8\u82b1\u4e86 4 \u5e74\u65f6\u95f4\uff0c\u5c3d\u7ba1\u65cb\u8f6c\u5df2\u7ecf\u6446\u5728\u684c\u9762\u4e0a&#8230;&#8230;<\/section>\n<section><\/section>\n<section><strong>\u7edd\u5bf9 vs \u76f8\u5bf9\u4f4d\u7f6e\u7f16\u7801<\/strong><\/section>\n<section><\/section>\n<section>\u5728\u4e86\u89e3\u4e86\u65cb\u8f6c\u5728\u8fd9\u91cc\u7684\u91cd\u8981\u6027\u4e4b\u540e\uff0c\u8ba9\u6211\u4eec\u56de\u5230\u6211\u4eec\u7684\u6fc0\u52b1\u6837\u672c\uff0c\u5c1d\u8bd5\u4e3a\u4e0b\u4e00\u6b21\u8fed\u4ee3\u53d1\u73b0\u4e00\u4e9b\u76f4\u89c9\u3002<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-0ff57b2a2f6694951d9ca1e593a33582.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-0ff57b2a2f6694951d9ca1e593a33582.png\"><\/a><\/section>\n<section>\u5728\u4e0a\u9762\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230 token \u7684\u7edd\u5bf9\u4f4d\u7f6e\uff0c\u4ee5\u53ca\u4ece chased \u5230\u5176\u4ed6 token \u7684\u76f8\u5bf9\u4f4d\u7f6e\u3002\u901a\u8fc7\u6b63\u5f26\u7f16\u7801\uff0c\u6211\u4eec\u751f\u6210\u4e86\u4e00\u4e2a\u5355\u72ec\u7684\u5411\u91cf\u6765\u8868\u793a\u7edd\u5bf9\u4f4d\u7f6e\uff0c\u5e76\u4f7f\u7528\u4e00\u4e9b\u4e09\u89d2\u51fd\u6570\u6280\u5de7\u6765\u7f16\u7801\u76f8\u5bf9\u4f4d\u7f6e\u3002<\/section>\n<section><\/section>\n<section>\u5f53\u6211\u4eec\u8bd5\u56fe\u7406\u89e3\u8fd9\u4e9b\u53e5\u5b50\u65f6\uff0c\u8fd9\u4e2a\u5355\u8bcd\u662f\u8fd9\u7bc7\u535a\u6587\u7684\u7b2c 2149 \u4e2a\u5355\u8bcd\u91cd\u8981\u5417\uff1f\u8fd8\u662f\u6211\u4eec\u5173\u5fc3\u5b83\u4e0e\u5468\u56f4\u5355\u8bcd\u7684\u5173\u7cfb\uff1f\u4e00\u4e2a\u5355\u8bcd\u7684\u7edd\u5bf9\u4f4d\u7f6e\u5bf9\u5176\u610f\u4e49\u6765\u8bf4\u5f88\u5c11\u91cd\u8981\uff0c\u91cd\u8981\u7684\u662f\u5355\u8bcd\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/section>\n<section><\/section>\n<section><strong>\u4e0a\u4e0b\u6587\u4e2d\u7684\u4f4d\u7f6e\u7f16\u7801<\/strong><\/section>\n<section><\/section>\n<section>\u4ece\u8fd9\u4e00\u70b9\u51fa\u53d1\uff0c\u5728\u81ea\u6ce8\u610f\u529b\u7684\u80cc\u666f\u4e0b\u8003\u8651\u4f4d\u7f6e\u7f16\u7801\u662f\u5173\u952e\u3002\u91cd\u7533\u4e00\u4e0b\uff0c\u81ea\u6ce8\u610f\u529b\u673a\u5236\u4f7f\u6a21\u578b\u80fd\u591f\u8861\u91cf\u8f93\u5165\u5e8f\u5217\u4e2d\u4e0d\u540c\u5143\u7d20\u7684\u91cd\u8981\u6027\uff0c\u5e76\u52a8\u6001\u8c03\u6574\u5b83\u4eec\u5bf9\u8f93\u51fa\u7684\u5f71\u54cd\u3002<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-7b829b5731dd57298d3fc60e62e44c3f.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-7b829b5731dd57298d3fc60e62e44c3f.png\"><\/a><\/section>\n<section>\u5728\u6211\u4eec\u4ee5\u524d\u7684\u8fed\u4ee3\u4e2d\uff0c\u6211\u4eec\u5df2\u7ecf\u751f\u6210\u4e86\u4e00\u4e2a\u5355\u72ec\u7684\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\uff0c\u5e76\u5728 Q\u3001 K \u548c V \u6295\u5f71\u4e4b\u524d\u5c06\u5176\u6dfb\u52a0\u5230\u6211\u4eec\u7684 token \u5d4c\u5165\u4e2d\u3002\u901a\u8fc7\u5c06\u4f4d\u7f6e\u4fe1\u606f\u76f4\u63a5\u6dfb\u52a0\u5230 token \u5d4c\u5165\u4e2d\uff0c\u6211\u4eec\u6b63\u5728\u7528\u4f4d\u7f6e\u4fe1\u606f\u6c61\u67d3\u8bed\u4e49\u4fe1\u606f\u3002\u6211\u4eec\u5e94\u8be5\u5c1d\u8bd5\u5728\u4e0d\u4fee\u6539\u89c4\u8303\u7684\u60c5\u51b5\u4e0b\u5bf9\u4fe1\u606f\u8fdb\u884c\u7f16\u7801\u3002\u8f6c\u5411\u4e58\u6cd5\u662f\u5173\u952e\u3002<\/section>\n<section><\/section>\n<section>\u4f7f\u7528\u5b57\u5178\u7c7b\u6bd4\uff0c\u5f53\u67e5\u627e\u4e00\u4e2a\u8bcd (\u67e5\u8be2) \u5728\u6211\u4eec\u7684\u5b57\u5178 (\u952e) \uff0c\u9644\u8fd1\u7684\u8bcd\u5e94\u8be5\u6bd4\u9065\u8fdc\u7684\u8bcd\u6709\u66f4\u591a\u7684\u5f71\u54cd\u3002\u4e00\u4e2a token \u5bf9\u53e6\u4e00\u4e2a token \u7684\u5f71\u54cd\u662f\u7531 QK^T \u70b9\u79ef\u51b3\u5b9a\u7684 \u2014\u2014 \u6240\u4ee5\u8fd9\u6b63\u662f\u6211\u4eec\u5e94\u8be5\u5173\u6ce8\u4f4d\u7f6e\u7f16\u7801\u7684\u5730\u65b9\u3002<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-55e4afec544ffc0d8bb9a09897a5a2fd.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-55e4afec544ffc0d8bb9a09897a5a2fd.png\"><\/a><\/section>\n<section>\u4e0a\u9762\u663e\u793a\u7684\u70b9\u4e58\u7684\u51e0\u4f55\u89e3\u91ca\u7ed9\u4e86\u6211\u4eec\u4e00\u4e2a\u6d1e\u5bdf\uff1a\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u589e\u52a0\u6216\u51cf\u5c0f\u4e24\u4e2a\u5411\u91cf\u4e4b\u95f4\u7684\u5939\u89d2\u6765\u8c03\u6574\u6211\u4eec\u7684\u4e24\u4e2a\u5411\u91cf\u7684\u70b9\u79ef\u7684\u7ed3\u679c\u3002\u6b64\u5916\uff0c\u901a\u8fc7\u65cb\u8f6c\u5411\u91cf\uff0c\u6211\u4eec\u5bf9\u5411\u91cf\u7684\u8303\u6570\u5b8c\u5168\u6ca1\u6709\u5f71\u54cd\uff0c\u8fd9\u4e2a\u8303\u6570\u7f16\u7801\u4e86\u6211\u4eec token \u7684\u8bed\u4e49\u4fe1\u606f\u3002<\/section>\n<section><\/section>\n<section>\u56e0\u6b64\uff0c\u73b0\u5728\u6211\u4eec\u77e5\u9053\u6ce8\u610f\u529b\u96c6\u4e2d\u5728\u54ea\u91cc\uff0c\u5e76\u4e14\u4ece\u53e6\u4e00\u4e2a\u89d2\u5ea6\u770b\u5230\u4e86\u4e3a\u4ec0\u4e48\u65cb\u8f6c\u53ef\u80fd\u662f\u4e00\u4e2a\u5408\u7406\u7684\u300c\u901a\u9053\u300d\uff0c\u5728\u5176\u4e2d\u7f16\u7801\u6211\u4eec\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u8ba9\u6211\u4eec\u628a\u5b83\u4eec\u653e\u5728\u4e00\u8d77\u3002<\/section>\n<section><\/section>\n<section><strong>\u65cb\u8f6c\u4f4d\u7f6e\u7f16\u7801<\/strong><\/section>\n<section><\/section>\n<section>RoForm \u7684\u8bba\u6587\u4e2d\u5b9a\u4e49\u4e86\u65cb\u8f6c\u4f4d\u7f6e\u7f16\u7801\u6216 RoPE (\u82cf\u5251\u6797\u5728\u4ed6\u7684\u535a\u5ba2\u4e2d\u72ec\u7acb\u8bbe\u8ba1\u4e86\u5b83)\u3002\u5982\u679c\u4f60\u76f4\u63a5\u8df3\u5230\u6700\u7ec8\u7ed3\u679c\uff0c\u8fd9\u770b\u8d77\u6765\u50cf\u662f\u5deb\u672f\uff0c\u901a\u8fc7\u5728\u81ea\u6ce8\u610f\u529b (\u66f4\u5177\u4f53\u5730\u8bf4\u662f\u70b9\u79ef) \u7684\u80cc\u666f\u4e0b\u601d\u8003\u6b63\u5f26\u7f16\u7801\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u5b83\u662f\u5982\u4f55\u6574\u5408\u5728\u4e00\u8d77\u7684\u3002<\/section>\n<section><\/section>\n<section>\u5c31\u50cf\u5728 Sinusoidal Encoding \u4e00\u6837\uff0c\u6211\u4eec\u628a\u5411\u91cf (q \u6216 k\uff0c\u800c\u4e0d\u662f\u9884\u5148\u6295\u5f71 x) \u5206\u89e3\u6210 2D \u5bf9 \/ \u5757\u3002\u6211\u4eec\u6ca1\u6709\u76f4\u63a5\u7f16\u7801\u7edd\u5bf9\u4f4d\u7f6e\uff0c\u800c\u662f\u52a0\u5165\u4e00\u4e2a\u6211\u4eec\u4ece\u9891\u7387\u7f13\u6162\u9012\u51cf\u7684\u6b63\u5f26\u51fd\u6570\u4e2d\u63d0\u53d6\u7684\u77e2\u91cf\uff0c\u6211\u4eec\u5207\u5165 chase\uff0c\u901a\u8fc7\u5c06\u6bcf\u5bf9\u65cb\u8f6c\u77e9\u9635\u76f8\u4e58\u6765\u7f16\u7801\u76f8\u5bf9\u4f4d\u7f6e\u3002<\/section>\n<section><\/section>\n<section>\u8bbe q \u6216 k \u662f\u4f4d\u7f6e\u4e3a p \u7684\u8f93\u5165\u5411\u91cf\u3002\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u5757\u5bf9\u89d2\u77e9\u9635\uff0c\u5176\u4e2d M_i \u662f\u8be5\u7ec4\u4ef6\u5bf9\u6240\u9700\u65cb\u8f6c\u7684\u5bf9\u5e94\u65cb\u8f6c\u77e9\u9635:<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-58586a253f028c282383ed5f16237166.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-58586a253f028c282383ed5f16237166.png\"><\/a><\/section>\n<section>\u4e0e\u6b63\u5f26\u7f16\u7801\u975e\u5e38\u76f8\u4f3c\uff0cM_i \u662f\u7b80\u5355\u7684:<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-4245f5ee20bfaedb13d0707a3aad14f5.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-4245f5ee20bfaedb13d0707a3aad14f5.png\"><\/a><\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-0518abd7e04e66d1ebe671760dd36939.gif\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-0518abd7e04e66d1ebe671760dd36939.gif\"><\/a><\/section>\n<section>\u5728\u5b9e\u8df5\u4e2d\uff0c\u6211\u4eec\u4e0d\u4f7f\u7528\u77e9\u9635\u4e58\u6cd5\u6765\u8ba1\u7b97 RoPE\uff0c\u56e0\u4e3a\u4f7f\u7528\u8fd9\u6837\u4e00\u4e2a\u7a00\u758f\u7684\u77e9\u9635\u4f1a\u5bfc\u81f4\u8ba1\u7b97\u6548\u7387\u4f4e\u4e0b\u3002\u76f8\u53cd\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u8ba1\u7b97\u4e2d\u7684\u89c4\u5219\u6a21\u5f0f\uff0c\u5c06\u65cb\u8f6c\u76f4\u63a5\u5e94\u7528\u4e8e\u72ec\u7acb\u7684\u5143\u7d20\u5bf9:<\/section>\n<section><a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-2b72217d6db3ced2f9fbe12d0ebf9032.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-2b72217d6db3ced2f9fbe12d0ebf9032.png\"><\/a><\/section>\n<section>\u5c31\u662f\u8fd9\u6837\uff01\u901a\u8fc7\u5de7\u5999\u5730\u5c06\u6211\u4eec\u7684\u65cb\u8f6c\u5e94\u7528\u4e8e\u70b9\u79ef\u4e4b\u524d\u7684 q \u548c k \u7684 2D \u5757\uff0c\u5e76\u4ece\u52a0\u6cd5\u8f6c\u6362\u4e3a\u4e58\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u8bc4\u4f30\u4e2d\u83b7\u5f97\u5f88\u5927\u7684\u6027\u80fd\u63d0\u5347\u3002<\/section>\n<section><\/section>\n<section><strong>\u5c06 RoPE \u6269\u5c55\u5230 n \u7ef4<\/strong><\/section>\n<section><\/section>\n<section>\u6211\u4eec\u5df2\u7ecf\u63a2\u8ba8\u4e86 1D \u60c5\u51b5\u4e0b\u7684 RoPE\uff0c\u8fd9\u4e00\u70b9\uff0c\u6211\u5e0c\u671b\u4f60\u5df2\u7ecf\u83b7\u5f97\u4e86\u4e00\u4e2a\u76f4\u89c2\u7684\u7406\u89e3\uff0c\u516c\u8ba4\u7684\u975e\u76f4\u89c2\u7ec4\u6210\u90e8\u5206\u7684 transformer\u3002\u6700\u540e\uff0c\u8ba9\u6211\u4eec\u63a2\u7d22\u5982\u4f55\u5c06\u5176\u6269\u5c55\u5230\u66f4\u9ad8\u7684\u7ef4\u5ea6\uff0c\u4f8b\u5982\u56fe\u50cf\u3002<\/section>\n<section><\/section>\n<section>\u7b2c\u4e00\u76f4\u89c9\u53ef\u80fd\u662f\u76f4\u63a5\u4f7f\u7528\u56fe\u50cf\u4e2d\u7684<a href=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-131e70e40f67c32ff85c2b7c9937eb53.png\" data-fancybox=\"images\" data-fancybox=\"gallery\"><img decoding=\"async\" src=\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-131e70e40f67c32ff85c2b7c9937eb53.png\"><\/a>\u5750\u6807\u5bf9\u3002\u8fd9\u53ef\u80fd\u770b\u8d77\u6765\u5f88\u76f4\u89c2\uff0c\u6bd5\u7adf\uff0c\u6211\u4eec\u4e4b\u524d\u51e0\u4e4e\u662f\u4efb\u610f\u5730\u5bf9\u7ec4\u4ef6\u8fdb\u884c\u914d\u5bf9\u3002\u7136\u800c\uff0c\u8fd9\u4f1a\u662f\u4e00\u4e2a\u9519\u8bef\uff01<\/section>\n<section><\/section>\n<section>\u5728 1D \u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u901a\u8fc7\u4ece\u8f93\u5165\u5411\u91cf\u65cb\u8f6c\u4e00\u5bf9\u503c\u6765\u7f16\u7801\u76f8\u5bf9\u4f4d\u7f6e m-n\u3002\u5bf9\u4e8e 2D \u6570\u636e\uff0c\u6211\u4eec\u9700\u8981\u7f16\u7801\u6c34\u5e73\u548c\u5782\u76f4\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u6bd4\u5982 m-n \u548c i-j \u662f\u72ec\u7acb\u7684\u3002RoPE \u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u5982\u4f55\u5904\u7406\u591a\u4e2a\u7ef4\u5ea6\u3002\u6211\u4eec\u6ca1\u6709\u5c1d\u8bd5\u5728\u4e00\u4e2a\u65cb\u8f6c\u4e2d\u7f16\u7801\u6240\u6709\u4f4d\u7f6e\u4fe1\u606f\uff0c\u800c\u662f\u5c06\u540c\u4e00\u7ef4\u5ea6\u5185\u7684\u7ec4\u4ef6\u914d\u5bf9\u5e76\u65cb\u8f6c\u5b83\u4eec\uff0c\u5426\u5219\u6211\u4eec\u5c06\u6df7\u5408\u4f7f\u7528 x \u548c y \u504f\u79fb\u91cf\u4fe1\u606f\u3002\u901a\u8fc7\u72ec\u7acb\u5904\u7406\u6bcf\u4e2a\u7ef4\u5ea6\uff0c\u6211\u4eec\u4fdd\u6301\u4e86\u7a7a\u95f4\u7684\u81ea\u7136\u7ed3\u6784\u3002\u8fd9\u53ef\u4ee5\u6839\u636e\u9700\u8981\u63a8\u5e7f\u5230\u4efb\u610f\u591a\u4e2a\u7ef4\u5ea6\uff01<\/section>\n<section><\/section>\n<section><strong>\u4f4d\u7f6e\u7f16\u7801\u7684\u672a\u6765<\/strong><\/section>\n<section><\/section>\n<section>RoPE \u662f\u4f4d\u7f6e\u7f16\u7801\u7684\u6700\u7ec8\u5316\u8eab\u5417\uff1fDeepMind \u6700\u8fd1\u7684\u4e00\u7bc7\u8bba\u6587\uff08https:\/\/arxiv.org\/pdf\/2410.06205\uff09\u6df1\u5165\u5206\u6790\u4e86 RoPE\uff0c\u5e76\u5f3a\u8c03\u4e86\u4e00\u4e9b\u57fa\u672c\u95ee\u9898\u3002<\/section>\n<section><\/section>\n<section>\u6211\u9884\u8ba1\u672a\u6765\u4f1a\u6709\u4e00\u4e9b\u7a81\u7834\uff0c\u4e5f\u8bb8\u4f1a\u4ece\u4fe1\u53f7\u5904\u7406\u4e2d\u83b7\u5f97\u7075\u611f\uff0c\u6bd4\u5982\u5c0f\u6ce2\u6216\u8005\u5206\u5c42\u5b9e\u73b0\u3002\u968f\u7740\u6a21\u578b\u8d8a\u6765\u8d8a\u591a\u5730\u88ab\u91cf\u5316\u7528\u4e8e\u90e8\u7f72\uff0c\u6211\u4e5f\u5e0c\u671b\u5728\u7f16\u7801\u65b9\u6848\u4e2d\u770b\u5230\u4e00\u4e9b\u521b\u65b0\uff0c\u8fd9\u4e9b\u7f16\u7801\u65b9\u6848\u5728\u4f4e\u7cbe\u5ea6\u7b97\u672f\u4e0b\u4ecd\u7136\u5177\u6709\u9c81\u68d2\u6027\u3002<\/section>\n<section><\/section>\n<section><em><sup>\u53c2\u8003\u94fe\u63a5\uff1ahttps:\/\/fleetwood.dev\/posts\/you-could-have-designed-SOTA-positional-encoding<\/sup><\/em><\/section>\n<p>\u6587\u7ae0\u6765\u6e90\u4e8e\u4e92\u8054\u7f51:<a href=\"https:\/\/www.jiqizhixin.com\/articles\/2024-11-27-3\" target=\"_blank\">HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6765\u6e90\u4e8e\u4e92\u8054\u7f51:HuggingFace [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[27],"tags":[73,55],"class_list":["post-36868","post","type-post","status-publish","format-standard","hentry","category-news","tag-73","tag-55"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801 - \u4e00\u8d77AI\u6280\u672f<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/17aitech.com\/?p=36868\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/17aitech.com\/?p=36868\",\"url\":\"https:\/\/17aitech.com\/?p=36868\",\"name\":\"HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801 - \u4e00\u8d77AI\u6280\u672f\",\"isPartOf\":{\"@id\":\"https:\/\/17aitech.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/17aitech.com\/?p=36868#primaryimage\"},\"image\":{\"@id\":\"https:\/\/17aitech.com\/?p=36868#primaryimage\"},\"thumbnailUrl\":\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png\",\"datePublished\":\"2025-01-19T21:00:21+00:00\",\"author\":{\"@id\":\"https:\/\/17aitech.com\/#\/schema\/person\/60225458499e817ae0af73e67e440b9d\"},\"breadcrumb\":{\"@id\":\"https:\/\/17aitech.com\/?p=36868#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/17aitech.com\/?p=36868\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/17aitech.com\/?p=36868#primaryimage\",\"url\":\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png\",\"contentUrl\":\"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/17aitech.com\/?p=36868#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/17aitech.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/17aitech.com\/#website\",\"url\":\"https:\/\/17aitech.com\/\",\"name\":\"\u4e00\u8d77AI\u6280\u672f\",\"description\":\"\u8ba9AI\u77e5\u8bc6\u89e6\u624b\u53ef\u53ca\",\"alternateName\":\"\u4e00\u8d77AI\u6280\u672f\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/17aitech.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/17aitech.com\/#\/schema\/person\/60225458499e817ae0af73e67e440b9d\",\"name\":\"AI\u5c0f\u52a9\u624b\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/17aitech.com\/#\/schema\/person\/image\/\",\"url\":\"\/\/17aitech.com\/wp-content\/uploads\/2024\/04\/robot_3.png\",\"contentUrl\":\"\/\/17aitech.com\/wp-content\/uploads\/2024\/04\/robot_3.png\",\"caption\":\"AI\u5c0f\u52a9\u624b\"},\"description\":\"\u8fd9\u4e2a\u4eba\u5f88\u61d2\uff0c\u4ec0\u4e48\u90fd\u6ca1\u6709\u7559\u4e0b\uff5e\",\"url\":\"https:\/\/17aitech.com\/?page_id=33738&user=3\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801 - \u4e00\u8d77AI\u6280\u672f","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/17aitech.com\/?p=36868","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/17aitech.com\/?p=36868","url":"https:\/\/17aitech.com\/?p=36868","name":"HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801 - \u4e00\u8d77AI\u6280\u672f","isPartOf":{"@id":"https:\/\/17aitech.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/17aitech.com\/?p=36868#primaryimage"},"image":{"@id":"https:\/\/17aitech.com\/?p=36868#primaryimage"},"thumbnailUrl":"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png","datePublished":"2025-01-19T21:00:21+00:00","author":{"@id":"https:\/\/17aitech.com\/#\/schema\/person\/60225458499e817ae0af73e67e440b9d"},"breadcrumb":{"@id":"https:\/\/17aitech.com\/?p=36868#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/17aitech.com\/?p=36868"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/17aitech.com\/?p=36868#primaryimage","url":"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png","contentUrl":"https:\/\/17aitech.com\/wp-content\/uploads\/2024\/11\/frc-36c2b43051526b71ee78089e41ff3ee0.png"},{"@type":"BreadcrumbList","@id":"https:\/\/17aitech.com\/?p=36868#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/17aitech.com\/"},{"@type":"ListItem","position":2,"name":"HuggingFace\u5de5\u7a0b\u5e08\u4eb2\u6388\uff1a\u5982\u4f55\u5728Transformer\u4e2d\u5b9e\u73b0\u6700\u597d\u7684\u4f4d\u7f6e\u7f16\u7801"}]},{"@type":"WebSite","@id":"https:\/\/17aitech.com\/#website","url":"https:\/\/17aitech.com\/","name":"\u4e00\u8d77AI\u6280\u672f","description":"\u8ba9AI\u77e5\u8bc6\u89e6\u624b\u53ef\u53ca","alternateName":"\u4e00\u8d77AI\u6280\u672f","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/17aitech.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/17aitech.com\/#\/schema\/person\/60225458499e817ae0af73e67e440b9d","name":"AI\u5c0f\u52a9\u624b","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/17aitech.com\/#\/schema\/person\/image\/","url":"\/\/17aitech.com\/wp-content\/uploads\/2024\/04\/robot_3.png","contentUrl":"\/\/17aitech.com\/wp-content\/uploads\/2024\/04\/robot_3.png","caption":"AI\u5c0f\u52a9\u624b"},"description":"\u8fd9\u4e2a\u4eba\u5f88\u61d2\uff0c\u4ec0\u4e48\u90fd\u6ca1\u6709\u7559\u4e0b\uff5e","url":"https:\/\/17aitech.com\/?page_id=33738&user=3"}]}},"_links":{"self":[{"href":"https:\/\/17aitech.com\/index.php?rest_route=\/wp\/v2\/posts\/36868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/17aitech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/17aitech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/17aitech.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/17aitech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36868"}],"version-history":[{"count":0,"href":"https:\/\/17aitech.com\/index.php?rest_route=\/wp\/v2\/posts\/36868\/revisions"}],"wp:attachment":[{"href":"https:\/\/17aitech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/17aitech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/17aitech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}