{"id":62303,"date":"2026-01-19T18:18:05","date_gmt":"2026-01-19T10:18:05","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/62303.html"},"modified":"2026-01-19T18:18:05","modified_gmt":"2026-01-19T10:18:05","slug":"bert%ef%bc%88bidirectional-encoder-representations-from-transformers%ef%bc%89%e6%9e%b6%e6%9e%84%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/62303.html","title":{"rendered":"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E6%A0%B8%E5%BF%83%E6%80%9D%E6%83%B3-toc\" style=\"margin-left:80px\">\u4e00\u3001\u6838\u5fc3\u601d\u60f3<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E6%9E%B6%E6%9E%84%E7%BB%84%E6%88%90-toc\" style=\"margin-left:80px\">\u4e8c\u3001\u67b6\u6784\u7ec4\u6210<\/p>\n<p id=\"1.%E5%9F%BA%E7%A1%80%E6%9E%B6%E6%9E%84%EF%BC%9ATransformer%E7%BC%96%E7%A0%81%E5%99%A8-toc\" style=\"margin-left:120px\">1.\u57fa\u7840\u67b6\u6784&#xff1a;Transformer\u7f16\u7801\u5668<\/p>\n<p id=\"2.%E8%BE%93%E5%85%A5%E8%A1%A8%E7%A4%BA-toc\" style=\"margin-left:120px\">2.\u8f93\u5165\u8868\u793a<\/p>\n<p id=\"3.%E8%BE%93%E5%87%BA%E8%A1%A8%E7%A4%BA-toc\" style=\"margin-left:120px\">3.\u8f93\u51fa\u8868\u793a<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E9%A2%84%E8%AE%AD%E7%BB%83%E4%BB%BB%E5%8A%A1%EF%BC%88Pre-Training%EF%BC%89-toc\" style=\"margin-left:80px\">\u4e09\u3001\u9884\u8bad\u7ec3\u4efb\u52a1&#xff08;Pre-Training&#xff09;<\/p>\n<p id=\"1.%E6%8E%A9%E7%A0%81%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9E%8B%EF%BC%88MLM%EF%BC%8CMasked%20Language%20Model%EF%BC%89-toc\" style=\"margin-left:120px\">1.\u63a9\u7801\u8bed\u8a00\u6a21\u578b&#xff08;MLM&#xff0c;Masked Language Model&#xff09;<\/p>\n<p id=\"2.%E4%B8%8B%E4%B8%80%E5%8F%A5%E9%A2%84%E6%B5%8B%EF%BC%88NSP%EF%BC%8CNext%20Sentence%20Prediction%EF%BC%89-toc\" style=\"margin-left:120px\">2.\u4e0b\u4e00\u53e5\u9884\u6d4b&#xff08;NSP&#xff0c;Next Sentence Prediction&#xff09;<\/p>\n<p id=\"3.%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:120px\">3.\u603b\u7ed3<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E7%BD%91%E7%BB%9C%E7%BB%86%E8%8A%82-toc\" style=\"margin-left:80px\">\u56db\u3001\u7f51\u7edc\u7ec6\u8282<\/p>\n<p id=\"1.%E8%87%AA%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6-toc\" style=\"margin-left:120px\">1.\u81ea\u6ce8\u610f\u529b\u673a\u5236<\/p>\n<p id=\"2.%E5%B1%82%E5%BD%92%E4%B8%80%E5%8C%96%E4%B8%8E%E6%AE%8B%E5%B7%AE%E8%BF%9E%E6%8E%A5-toc\" style=\"margin-left:120px\">2.\u5c42\u5f52\u4e00\u5316\u4e0e\u6b8b\u5dee\u8fde\u63a5<\/p>\n<p id=\"3.%E5%89%8D%E9%A6%88%E7%BD%91%E7%BB%9C-toc\" style=\"margin-left:120px\">3.\u524d\u9988\u7f51\u7edc<\/p>\n<p id=\"%E4%BA%94%E3%80%81%E5%BE%AE%E8%B0%83%EF%BC%88Fine-tuning%EF%BC%89-toc\" style=\"margin-left:80px\">\u4e94\u3001\u5fae\u8c03&#xff08;Fine-tuning&#xff09;<\/p>\n<p id=\"1.%20%E5%BE%AE%E8%B0%83%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%80%9D%E6%83%B3-toc\" style=\"margin-left:120px\">1. \u5fae\u8c03\u7684\u57fa\u672c\u601d\u60f3<\/p>\n<p id=\"2.%20%E5%B8%B8%E8%A7%81%E4%BB%BB%E5%8A%A1%E7%9A%84%E5%BE%AE%E8%B0%83-toc\" style=\"margin-left:120px\">2. \u5e38\u89c1\u4efb\u52a1\u7684\u5fae\u8c03<\/p>\n<p id=\"2.1%20%E5%8F%A5%E5%AD%90%E5%AF%B9%E5%88%86%E7%B1%BB%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82MNLI%EF%BC%8CQQP%E7%AD%89%EF%BC%89-toc\" style=\"margin-left:160px\">2.1 \u53e5\u5b50\u5bf9\u5206\u7c7b\u4efb\u52a1&#xff08;\u5982MNLI&#xff0c;QQP\u7b49&#xff09;<\/p>\n<p id=\"2.2%20%E5%8D%95%E5%8F%A5%E5%AD%90%E5%88%86%E7%B1%BB%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82SST-2%EF%BC%8C%E6%83%85%E6%84%9F%E5%88%86%E7%B1%BB%EF%BC%89-toc\" style=\"margin-left:160px\">2.2 \u5355\u53e5\u5b50\u5206\u7c7b\u4efb\u52a1&#xff08;\u5982SST-2&#xff0c;\u60c5\u611f\u5206\u7c7b&#xff09;<\/p>\n<p id=\"2.3%20%E9%97%AE%E7%AD%94%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82SQuAD%EF%BC%89-toc\" style=\"margin-left:160px\">2.3 \u95ee\u7b54\u4efb\u52a1&#xff08;\u5982SQuAD&#xff09;<\/p>\n<p id=\"2.4%20%E5%BA%8F%E5%88%97%E6%A0%87%E6%B3%A8%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82NER%EF%BC%89-toc\" style=\"margin-left:160px\">2.4 \u5e8f\u5217\u6807\u6ce8\u4efb\u52a1&#xff08;\u5982NER&#xff09;<\/p>\n<p id=\"3.%20%E5%BE%AE%E8%B0%83%E6%AD%A5%E9%AA%A4-toc\" style=\"margin-left:120px\">3. \u5fae\u8c03\u6b65\u9aa4<\/p>\n<p id=\"4.%20%E5%BE%AE%E8%B0%83%E6%8A%80%E5%B7%A7-toc\" style=\"margin-left:120px\">4. \u5fae\u8c03\u6280\u5de7<\/p>\n<p id=\"%E5%85%AD%E3%80%81%E4%B8%BB%E8%A6%81%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:80px\">\u516d\u3001\u4e3b\u8981\u5e94\u7528\u573a\u666f<\/p>\n<p id=\"%E4%B8%83%E3%80%81%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:80px\">\u4e03\u3001\u603b\u7ed3<\/p>\n<hr id=\"hr-toc\" \/>\n<p>\u8bba\u6587\u94fe\u63a5&#xff1a;https:\/\/arxiv.org\/pdf\/1810.04805<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"610\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101802-696e04dac0603.png\" width=\"1440\" \/><\/p>\n<p>BERT\u662fGoogle\u57282018\u5e74\u63d0\u51fa\u7684\u9769\u547d\u6027\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6a21\u578b&#xff0c;\u5b83\u5f7b\u5e95\u6539\u53d8\u4e86NLP\u9886\u57df\u7684\u9884\u8bad\u7ec3\u8303\u5f0f\u3002<\/p>\n<h4 id=\"%E4%B8%80%E3%80%81%E6%A0%B8%E5%BF%83%E6%80%9D%E6%83%B3\">\u4e00\u3001\u6838\u5fc3\u601d\u60f3<\/h4>\n<p>\u53cc\u5411\u4e0a\u4e0b\u6587\u7406\u89e3&#xff1a;\u4e0e\u4f20\u7edf\u8bed\u8a00\u6a21\u578b&#xff08;\u5982GPT&#xff09;\u7684\u5355\u5411\u9884\u6d4b\u4e0d\u540c&#xff0c;BERT\u901a\u8fc7\u63a9\u7801\u8bed\u8a00\u6a21\u578b&#xff08;MLM&#xff09;\u5b9e\u73b0\u53cc\u5411\u4e0a\u4e0b\u6587\u7f16\u7801&#xff0c;\u80fd\u591f\u540c\u65f6\u8003\u8651\u5355\u8bcd\u5de6\u53f3\u4e24\u4fa7\u7684\u4e0a\u4e0b\u6587\u4fe1\u606f\u3002<\/p>\n<h4 id=\"%E4%BA%8C%E3%80%81%E6%9E%B6%E6%9E%84%E7%BB%84%E6%88%90\">\u4e8c\u3001\u67b6\u6784\u7ec4\u6210<\/h4>\n<h5 id=\"1.%E5%9F%BA%E7%A1%80%E6%9E%B6%E6%9E%84%EF%BC%9ATransformer%E7%BC%96%E7%A0%81%E5%99%A8\">1.\u57fa\u7840\u67b6\u6784&#xff1a;Transformer\u7f16\u7801\u5668<\/h5>\n<ul>\n<li>BERT\u5b8c\u5168\u57fa\u4e8eTransformer\u7684\u7f16\u7801\u5668&#xff08;Encoder&#xff09;\u90e8\u5206<\/li>\n<li>\u91c7\u7528\u591a\u5934\u81ea\u6ce8\u610f\u529b\u673a\u5236\u548c\u524d\u9988\u795e\u7ecf\u7f51\u7edc<\/li>\n<li>\u4e3b\u8981\u7248\u672c&#xff1a;\n<ul>\n<li>BERT-Base&#xff1a;12\u5c42&#xff0c;768\u9690\u85cf\u5355\u5143&#xff0c;12\u4e2a\u6ce8\u610f\u529b\u5934&#xff08;110M\u53c2\u6570&#xff09;<\/li>\n<li>BERT-Large&#xff1a;24\u5c42&#xff0c;1024\u9690\u85cf\u5355\u5143&#xff0c;16\u4e2a\u6ce8\u610f\u529b\u5934&#xff08;340M\u53c2\u6570&#xff09;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5 id=\"2.%E8%BE%93%E5%85%A5%E8%A1%A8%E7%A4%BA\">2.\u8f93\u5165\u8868\u793a<\/h5>\n<p>\u7279\u6b8a\u6807\u8bb0&#xff1a;<\/p>\n<ul>\n<li>[CLS]&#xff1a;\u5206\u7c7b\u4efb\u52a1\u7684\u805a\u5408\u8868\u793a<\/li>\n<li>[SEP]&#xff1a;\u53e5\u5b50\u5206\u9694\u7b26<\/li>\n<li>[MASK]&#xff1a;\u63a9\u7801\u6807\u8bb0<\/li>\n<\/ul>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"206\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101803-696e04db2d8e5.png\" width=\"417\" \/><\/p>\n<p>BERT\u7684\u8f93\u5165\u4e3a\u6bcf\u4e00\u4e2atoken\u5bf9\u5e94\u7684\u8868\u5f81&#xff08;\u56fe\u4e2d\u7684\u7c89\u7ea2\u8272\u5757\u5c31\u662ftoken&#xff0c;\u9ec4\u8272\u5757\u5c31\u662ftoken\u5bf9\u5e94\u7684embedding\u8868\u5f81&#xff09;&#xff0c;\u5e76\u4e14\u5355\u8bcd\u5b57\u5178\u662f\u91c7\u7528WordPiece\u7b97\u6cd5\u6765\u8fdb\u884c\u6784\u5efa\u7684\u3002\u4e3a\u4e86\u5b8c\u6210\u5177\u4f53\u7684\u5206\u7c7b\u4efb\u52a1&#xff0c;\u9664\u4e86\u5355\u8bcd\u7684token\u4e4b\u5916&#xff0c;\u8fd8\u5728\u8f93\u5165\u7684\u6bcf\u4e00\u4e2a\u5e8f\u5217\u5f00\u5934\u90fd\u63d2\u5165\u7279\u5b9a\u7684\u5206\u7c7btoken&#xff08;[CLS]&#xff09;&#xff0c;\u8be5\u5206\u7c7btoken\u5bf9\u5e94\u7684\u6700\u540e\u4e00\u4e2aTransformer\u5c42\u8f93\u51fa\u88ab\u7528\u6765\u8d77\u5230\u805a\u96c6\u6574\u4e2a\u5e8f\u5217\u8868\u5f81\u4fe1\u606f\u7684\u4f5c\u7528\u3002<\/p>\n<p>\u7531\u4e8eBERT\u662f\u4e00\u4e2a\u9884\u8bad\u7ec3\u6a21\u578b&#xff0c;\u5176\u5fc5\u987b\u8981\u9002\u5e94\u5404\u79cd\u5404\u6837\u7684\u81ea\u7136\u8bed\u8a00\u4efb\u52a1&#xff0c;\u56e0\u6b64\u6a21\u578b\u6240\u8f93\u5165\u7684\u5e8f\u5217\u5fc5\u987b\u6709\u80fd\u529b\u5305\u542b\u4e00\u53e5\u8bdd&#xff08;\u6587\u672c\u60c5\u611f\u5206\u7c7b&#xff0c;\u5e8f\u5217\u6807\u6ce8\u4efb\u52a1&#xff09;\u6216\u8005\u4e24\u53e5\u8bdd\u4ee5\u4e0a&#xff08;\u6587\u672c\u6458\u8981&#xff0c;\u81ea\u7136\u8bed\u8a00\u63a8\u65ad&#xff0c;\u95ee\u7b54\u4efb\u52a1&#xff09;\u3002\u90a3\u4e48\u5982\u4f55\u4ee4\u6a21\u578b\u6709\u80fd\u529b\u53bb\u5206\u8fa8\u54ea\u4e2a\u8303\u56f4\u662f\u5c5e\u4e8e\u53e5\u5b50A&#xff0c;\u54ea\u4e2a\u8303\u56f4\u662f\u5c5e\u4e8e\u53e5\u5b50B\u5462&#xff1f;BERT\u91c7\u7528\u4e86\u4e24\u79cd\u65b9\u6cd5\u53bb\u89e3\u51b3&#xff1a;<\/p>\n<li>\u5728\u5e8f\u5217tokens\u4e2d\u628a\u5206\u5272token&#xff08;[SEP]&#xff09;\u63d2\u5165\u5230\u6bcf\u4e2a\u53e5\u5b50\u540e&#xff0c;\u4ee5\u5206\u5f00\u4e0d\u540c\u7684\u53e5\u5b50tokens\u3002<\/li>\n<li>\u4e3a\u6bcf\u4e00\u4e2atoken\u8868\u5f81\u90fd\u6dfb\u52a0\u4e00\u4e2a\u53ef\u5b66\u4e60\u7684\u5206\u5272embedding\u6765\u6307\u793a\u5176\u5c5e\u4e8e\u53e5\u5b50A\u8fd8\u662f\u53e5\u5b50B\u3002<\/li>\n<p>\u56e0\u6b64\u6700\u540e\u6a21\u578b\u7684\u8f93\u5165\u5e8f\u5217tokens\u4e3a\u4e0b\u56fe&#xff08;\u5982\u679c\u8f93\u5165\u5e8f\u5217\u53ea\u5305\u542b\u4e00\u4e2a\u53e5\u5b50\u7684\u8bdd&#xff0c;\u5219\u6ca1\u6709[SEP]\u53ca\u4e4b\u540e\u7684token&#xff09;&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"220\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101803-696e04db685d3.png\" width=\"986\" \/><\/p>\n<p>\u8f93\u5165\u5e8f\u5217 &#061; \u4e09\u90e8\u5206\u5d4c\u5165\u7684\u52a0\u548c&#xff1a;<\/p>\n<ul>\n<li>\u8bcd\u5d4c\u5165&#xff08;Token Embeddings&#xff09;&#xff1a;WordPiece\u5206\u8bcd<\/li>\n<li>\u6bb5\u5d4c\u5165&#xff08;Segment Embeddings&#xff09;&#xff1a;\u533a\u5206\u53e5\u5b50A\u548c\u53e5\u5b50B&#xff08;[SEP]\u5206\u9694&#xff09;<\/li>\n<li>\u4f4d\u7f6e\u5d4c\u5165&#xff08;Position Embeddings&#xff09;&#xff1a;\u5b66\u4e60\u5230\u7684\u4f4d\u7f6e\u7f16\u7801<\/li>\n<\/ul>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"602\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101803-696e04db85525.png\" width=\"1868\" \/><\/p>\n<h5 id=\"3.%E8%BE%93%E5%87%BA%E8%A1%A8%E7%A4%BA\">3.\u8f93\u51fa\u8868\u793a<\/h5>\n<p>\u4ecb\u7ecd\u5b8cBERT\u7684\u8f93\u5165&#xff0c;\u5b9e\u9645\u4e0aBERT\u7684\u8f93\u51fa\u4e5f\u5c31\u547c\u4e4b\u6b32\u51fa\u4e86&#xff0c;\u56e0\u4e3aTransformer\u7684\u7279\u70b9\u5c31\u662f\u6709\u591a\u5c11\u4e2a\u8f93\u5165\u5c31\u6709\u591a\u5c11\u4e2a\u5bf9\u5e94\u7ef4\u5ea6\u7684\u8f93\u51fa&#xff0c;\u5982\u4e0b\u56fe&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"160\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101803-696e04dbe8dec.png\" width=\"971\" \/><\/p>\n<p>\u56fe\u4e2dC\u4e3a\u5206\u7c7btoken&#xff08;[CLS]&#xff09;\u5bf9\u5e94\u6700\u540e\u4e00\u4e2aTransformer\u7684\u8f93\u51fa&#xff0c;<img decoding=\"async\" alt=\"T_i\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc0af8f.png\" \/>\u5219\u4ee3\u8868\u5176\u4ed6token\u5bf9\u5e94\u6700\u540e\u4e00\u4e2aTransformer\u7684\u8f93\u51fa\u3002<\/p>\n<ul>\n<li>\n<p>token\u7ea7\u522b\u4efb\u52a1&#xff1a;\u9700\u8981\u6bcf\u4e2atoken\u7684\u8868\u793a&#xff0c;\u56e0\u6b64\u4f7f\u7528\u6bcf\u4e2atoken\u5bf9\u5e94\u7684\u8f93\u51fa\u5411\u91cf<img decoding=\"async\" alt=\"T_i\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc0af8f.png\" \/>\u3002<\/p>\n<\/li>\n<li>\n<p>\u53e5\u5b50\u7ea7\u522b\u4efb\u52a1&#xff1a;\u9700\u8981\u6574\u4e2a\u53e5\u5b50\u7684\u8868\u793a&#xff0c;\u56e0\u6b64\u4f7f\u7528[CLS]\u7684\u8f93\u51faC\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4e3a\u4ec0\u4e48[CLS]\u53ef\u4ee5\u4ee3\u8868\u6574\u4e2a\u53e5\u5b50\u7684\u4fe1\u606f&#xff1f; \u5728\u9884\u8bad\u7ec3\u9636\u6bb5&#xff0c;[CLS]\u88ab\u7528\u4e8e\u4e0b\u4e00\u53e5\u9884\u6d4b&#xff08;NSP&#xff09;\u4efb\u52a1&#xff0c;\u8fd9\u4f7f\u5f97[CLS]\u7684\u5411\u91cf\u80fd\u591f\u6355\u6349\u4e24\u4e2a\u53e5\u5b50\u4e4b\u95f4\u7684\u5173\u7cfb\u4fe1\u606f&#xff0c;\u4ece\u800c\u5b66\u4e60\u5230\u6574\u4e2a\u8f93\u5165\u5e8f\u5217\u7684\u8bed\u4e49\u8868\u793a\u3002\u56e0\u6b64&#xff0c;\u5728\u5fae\u8c03\u65f6&#xff0c;\u5bf9\u4e8e\u53e5\u5b50\u7ea7\u522b\u7684\u4efb\u52a1&#xff0c;\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5229\u7528[CLS]\u7684\u5411\u91cf\u4f5c\u4e3a\u6574\u4e2a\u5e8f\u5217\u7684\u8868\u793a&#xff0c;\u7136\u540e\u52a0\u4e0a\u4e00\u4e2a\u7b80\u5355\u7684\u5206\u7c7b\u5c42&#xff08;\u5982\u5168\u8fde\u63a5\u5c42&#xff09;\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<p>BERT\u7684\u8f93\u51fa\u5728\u5177\u4f53\u4efb\u52a1\u5e94\u7528\u7684\u793a\u4f8b&#xff1a;<\/p>\n<p>&#xff08;1&#xff09;\u5e8f\u5217\u6807\u6ce8&#xff08;\u5982\u547d\u540d\u5b9e\u4f53\u8bc6\u522b&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6bcf\u4e2atoken\u90fd\u9700\u8981\u9884\u6d4b\u4e00\u4e2a\u6807\u7b7e&#xff08;\u5982B-PER, I-PER, O\u7b49&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06\u6bcf\u4e2atoken\u5bf9\u5e94\u7684\u8f93\u51fa\u5411\u91cf<img decoding=\"async\" alt=\"T_i\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc0af8f.png\" \/>\u8f93\u5165\u5230\u4e00\u4e2a\u5206\u7c7b\u5c42&#xff08;\u901a\u5e38\u662f\u4e00\u4e2a\u5168\u8fde\u63a5\u5c42&#xff0c;\u7136\u540e\u63a5Softmax&#xff09;\u6765\u9884\u6d4b\u6bcf\u4e2atoken\u7684\u6807\u7b7e\u3002<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;2&#xff09;\u95ee\u7b54\u4efb\u52a1&#xff08;\u5982SQuAD&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u9700\u8981\u9884\u6d4b\u7b54\u6848\u5728\u539f\u6587\u4e2d\u7684\u8d77\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06\u6bcf\u4e2atoken\u7684\u8f93\u51fa\u5411\u91cf<img decoding=\"async\" alt=\"T_i\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc0af8f.png\" \/>\u5206\u522b\u8f93\u5165\u5230\u4e24\u4e2a\u5206\u7c7b\u5c42&#xff08;\u4e00\u4e2a\u7528\u4e8e\u9884\u6d4b\u8d77\u59cb\u4f4d\u7f6e&#xff0c;\u4e00\u4e2a\u7528\u4e8e\u9884\u6d4b\u7ed3\u675f\u4f4d\u7f6e&#xff09;&#xff0c;\u6bcf\u4e2a\u5206\u7c7b\u5c42\u8f93\u51fa\u4e00\u4e2a\u6982\u7387\u5206\u5e03&#xff0c;\u8868\u793a\u6bcf\u4e2atoken\u4f5c\u4e3a\u8d77\u59cb\/\u7ed3\u675f\u4f4d\u7f6e\u7684\u6982\u7387\u3002<\/p>\n<\/li>\n<\/ul>\n<p>&#xff08;3&#xff09;\u53e5\u5b50\u5206\u7c7b&#xff08;\u5982\u60c5\u611f\u5206\u6790&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5c06[CLS]\u7684\u8f93\u51fa\u5411\u91cfC\u8f93\u5165\u5230\u4e00\u4e2a\u5206\u7c7b\u5c42&#xff0c;\u7136\u540e\u901a\u8fc7Softmax\u5f97\u5230\u4e0d\u540c\u7c7b\u522b\u7684\u6982\u7387\u3002<\/p>\n<\/li>\n<\/ul>\n<h4 id=\"%E4%B8%89%E3%80%81%E9%A2%84%E8%AE%AD%E7%BB%83%E4%BB%BB%E5%8A%A1%EF%BC%88Pre-Training%EF%BC%89\">\u4e09\u3001\u9884\u8bad\u7ec3\u4efb\u52a1&#xff08;Pre-Training&#xff09;<\/h4>\n<p>BERT\u7684\u9884\u8bad\u7ec3\u91c7\u7528\u65e0\u76d1\u7763\u5b66\u4e60&#xff0c;\u5728\u5927\u89c4\u6a21\u6587\u672c\u8bed\u6599\u4e0a\u8bad\u7ec3&#xff0c;\u4f7f\u6a21\u578b\u5b66\u4e60\u5230\u6df1\u5c42\u7684\u8bed\u8a00\u8868\u793a\u3002\u8bad\u7ec3\u5305\u542b\u4e24\u4e2a\u6838\u5fc3\u4efb\u52a1&#xff0c;\u8bbe\u8ba1\u7406\u5ff5\u662f\u8ba9\u6a21\u578b\u7406\u89e3\u5355\u8bcd\u7ea7\u548c\u53e5\u5b50\u7ea7\u7684\u8bed\u8a00\u4fe1\u606f\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u8f93\u5165\u5e8f\u5217token\u5316&#xff1a;<\/p>\n<p>\u539f\u59cb\u6587\u672c&#xff1a; &#034;The quick brown fox jumps over the lazy dog.&#034;<br \/>\n\u5206\u8bcd\u540e&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;fox&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;] <\/p>\n<h5 id=\"1.%E6%8E%A9%E7%A0%81%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9E%8B%EF%BC%88MLM%EF%BC%8CMasked%20Language%20Model%EF%BC%89\">1.\u63a9\u7801\u8bed\u8a00\u6a21\u578b&#xff08;MLM&#xff0c;Masked Language Model&#xff09;<\/h5>\n<ul>\n<li>\u968f\u673a\u63a9\u76d615%\u7684\u8f93\u5165token<\/li>\n<li>\u63a9\u76d6\u7b56\u7565&#xff1a;\n<ul>\n<li>80%\u66ff\u6362\u4e3a[MASK]<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u8f93\u5165&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;[MASK]&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;]<br \/>\n\u6807\u7b7e&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;fox&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;] <\/p>\n<ul>\n<li>10%\u66ff\u6362\u4e3a\u968f\u673a\u8bcd<\/li>\n<\/ul>\n<p>\u8f93\u5165&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;car&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;]<br \/>\n\u6807\u7b7e&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;fox&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;] <\/p>\n<ul>\n<li>10%\u4fdd\u6301\u539f\u8bcd\u4e0d\u53d8<\/li>\n<\/ul>\n<p>\u8f93\u5165&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;fox&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;]<br \/>\n\u6807\u7b7e&#xff1a; [&#034;the&#034;, &#034;quick&#034;, &#034;brown&#034;, &#034;fox&#034;, &#034;jumps&#034;, &#034;over&#034;, &#034;the&#034;, &#034;lazy&#034;, &#034;dog&#034;, &#034;.&#034;] <\/p>\n<p>\u8bbe\u8ba1\u539f\u56e0&#xff1a;\u4e3a\u4e86\u7f13\u89e3\u9884\u8bad\u7ec3&#xff08;\u6709[MASK]&#xff09;\u548c\u5fae\u8c03&#xff08;\u6ca1\u6709[MASK]&#xff09;\u4e4b\u95f4\u7684\u4e0d\u5339\u914d\u3002\u5982\u679c\u603b\u662f\u7528[MASK]\u66ff\u6362&#xff0c;\u6a21\u578b\u5728\u5fae\u8c03\u65f6\u4ece\u672a\u89c1\u8fc7\u771f\u5b9e\u5355\u8bcd&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002<\/p>\n<p>\u6a21\u578b\u9884\u6d4b&#xff1a;\u5c06\u906e\u76d6\u540e\u7684\u5e8f\u5217\u8f93\u5165BERT\u6a21\u578b&#xff0c;\u6a21\u578b\u4f1a\u5bf9\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e00\u4e2a\u4f4d\u7f6e\u90fd\u8f93\u51fa\u4e00\u4e2a\u5411\u91cf\u8868\u793a\u3002<\/p>\n<p>\u8ba1\u7b97\u635f\u5931&#xff1a;\u53ea\u8ba1\u7b97\u88ab\u906e\u76d6\u4f4d\u7f6e&#xff08;\u5373\u90a315%\u7684token&#xff09;\u7684\u9884\u6d4b\u635f\u5931\u3002\u5177\u4f53\u6765\u8bf4&#xff0c;\u5c06\u88ab\u906e\u76d6\u4f4d\u7f6e\u5bf9\u5e94\u7684\u8f93\u51fa\u5411\u91cf\u9001\u5165\u4e00\u4e2aSoftmax\u5206\u7c7b\u5668&#xff08;\u8bcd\u6c47\u8868\u5927\u5c0f\u7684\u5168\u8fde\u63a5\u5c42&#xff09;&#xff0c;\u9884\u6d4b\u8be5\u4f4d\u7f6e\u7684\u539f\u59cbtoken\u662f\u4ec0\u4e48\u3002<\/p>\n<p>\u635f\u5931\u51fd\u6570&#xff1a;\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u4ea4\u53c9\u71b5\u635f\u5931\u3002<\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u906e\u76d6\u4e86\u00a0k\u00a0\u4e2a token&#xff0c;\u8bcd\u6c47\u8868\u5927\u5c0f\u4e3a\u00a0V\u3002<\/p>\n<ul>\n<li>\n<p>\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"L_{\\\\text{MLM}} &#061; -\\\\frac{1}{k} \\\\sum_{i&#061;1}^{k} \\\\log P(w_i \\\\mid \\\\text{context})\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc119e7.png\" \/><\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" alt=\"w_i\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc1b85a.png\" \/>\u00a0\u662f\u7b2c\u00a0i\u00a0\u4e2a\u88ab\u906e\u76d6\u4f4d\u7f6e\u7684\u771f\u5b9etoken\u3002<\/p>\n<\/li>\n<li>\n<p><img decoding=\"async\" alt=\"P(w_i \\\\mid \\\\text{context})\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc21e85.png\" \/>\u00a0\u662f\u6a21\u578b\u9884\u6d4b\u8be5\u4f4d\u7f6e\u4e3a\u771f\u5b9etoken\u00a0w_i\u00a0\u7684\u6982\u7387\u3002<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u6240\u6709\u88ab\u906e\u76d6\u7684\u4f4d\u7f6e\u7684\u8d1f\u5bf9\u6570\u4f3c\u7136\u6c42\u5e73\u5747\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u76f4\u89c2\u7406\u89e3&#xff1a;\u5c31\u662f\u8ba9\u6a21\u578b\u9884\u6d4b\u88ab\u906e\u76d6\u8bcd\u7684\u6982\u7387\u5c3d\u53ef\u80fd\u5927\u3002\u4f8b\u5982&#xff0c;\u5bf9\u4e8e\u00a0&#034;The quick [MASK] fox jumps&#034;&#xff0c;\u6a21\u578b\u5e94\u8be5\u7ed9\u00a0&#034;brown&#034;\u00a0\u8fd9\u4e2a\u8bcd\u5206\u914d\u5f88\u9ad8\u7684\u6982\u7387\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"2.%E4%B8%8B%E4%B8%80%E5%8F%A5%E9%A2%84%E6%B5%8B%EF%BC%88NSP%EF%BC%8CNext%20Sentence%20Prediction%EF%BC%89\">2.\u4e0b\u4e00\u53e5\u9884\u6d4b&#xff08;NSP&#xff0c;Next Sentence Prediction&#xff09;<\/h5>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u53e5\u5b50A &#043; \u53e5\u5b50B<\/li>\n<li>\u9884\u6d4b&#xff1a;B\u662f\u5426\u662fA\u7684\u4e0b\u4e00\u53e5<\/li>\n<li>\u6b63\u4f8b&#xff1a;\u8fde\u7eed\u53e5\u5b50<\/li>\n<\/ul>\n<p>\u53e5\u5b50A: &#034;The capital of France is Paris.&#034;<br \/>\n\u53e5\u5b50B: &#034;It is the largest city in France.&#034;<\/p>\n<p>\u6807\u7b7e&#xff1a;IsNext (1) <\/p>\n<ul>\n<li>\u8d1f\u4f8b&#xff1a;\u968f\u673a\u9009\u62e9\u7684\u53e5\u5b50<\/li>\n<\/ul>\n<p>\u53e5\u5b50A: &#034;The capital of France is Paris.&#034;<br \/>\n\u53e5\u5b50B: &#034;The sky is blue today.&#034;  \/\/ \u65e0\u5173\u53e5\u5b50<\/p>\n<p>\u6807\u7b7e&#xff1a;NotNext (0) <\/p>\n<p>\u6a21\u578b\u8f93\u5165&#xff1a;\u53e5\u5b50\u5bf9\u548c[CLS]\u3001[SEP]\u4e00\u8d77\u6784\u6210\u5b8c\u6574\u8f93\u5165&#xff1a;[CLS] \u53e5\u5b50A [SEP] \u53e5\u5b50B [SEP]\u3002<\/p>\n<p>[CLS] The capital of France is Paris. [SEP] It is the largest city in France. [SEP]<br \/>\n        |&#8212;&#8212;&#8212;- \u53e5\u5b50A &#8212;&#8212;&#8212;|     |&#8212;&#8212;&#8212;&#8212;&#8211; \u53e5\u5b50B &#8212;&#8212;&#8212;&#8212;&#8211;| <\/p>\n<p>\u6a21\u578b\u9884\u6d4b&#xff1a;BERT\u6a21\u578b\u8f93\u51fa[CLS]\u00a0token\u7684\u5411\u91cf\u8868\u793a\u3002\u8fd9\u4e2a\u5411\u91cf\u88ab\u8ba4\u4e3a\u805a\u5408\u4e86\u6574\u4e2a\u8f93\u5165\u5e8f\u5217\u7684\u8bed\u4e49\u4fe1\u606f\u3002<\/p>\n<p>\u8ba1\u7b97\u635f\u5931&#xff1a;\u5c06[CLS]\u5411\u91cf\u9001\u5165\u4e00\u4e2a\u4e8c\u5206\u7c7b\u5668&#xff08;\u5168\u8fde\u63a5\u5c42&#043;Softmax&#xff09;&#xff0c;\u9884\u6d4b\u00a0IsNext\u00a0\u6216\u00a0NotNext\u3002<\/p>\n<p>NSP\u635f\u5931\u51fd\u6570&#xff1a;\u4e5f\u662f\u4e00\u4e2a\u6807\u51c6\u7684\u4e8c\u5206\u7c7b\u4ea4\u53c9\u71b5\u635f\u5931\u3002<\/p>\n<ul>\n<li>\n<p>\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"L_{\\\\text{NSP}} &#061; - \\\\left[ y \\\\log(p) &#043; (1 - y) \\\\log(1 - p) \\\\right]\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc2816e.png\" \/><\/p>\n<ul>\n<li>\n<p>y\u00a0\u662f\u771f\u5b9e\u6807\u7b7e&#xff08;1\u8868\u793a\u00a0IsNext&#xff0c;0\u8868\u793a\u00a0NotNext&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>p\u00a0\u662f\u6a21\u578b\u9884\u6d4b\u4e3a\u00a0IsNext\u00a0\u7684\u6982\u7387\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5 id=\"3.%E6%80%BB%E7%BB%93\">3.\u603b\u7ed3<\/h5>\n<p>\u5728BERT\u7684\u9884\u8bad\u7ec3\u4e2d&#xff0c;\u4e24\u4e2a\u4efb\u52a1\u662f\u8054\u5408\u8bad\u7ec3\u7684\u3002\u6a21\u578b\u540c\u65f6\u8fdb\u884cMLM\u548cNSP&#xff0c;\u5176\u603b\u635f\u5931\u662f\u8fd9\u4e24\u4e2a\u635f\u5931\u7684\u7b80\u5355\u52a0\u548c&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"L &#061; L_{\\\\text{MLM}} &#043; L_{\\\\text{NSP}}\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc3176e.png\" \/><\/p>\n<table>\n<tr>\u7279\u6027MLM (\u63a9\u7801\u8bed\u8a00\u6a21\u578b)NSP (\u4e0b\u4e00\u53e5\u9884\u6d4b)<\/tr>\n<tbody>\n<tr>\n<td>\u76ee\u6807<\/td>\n<td>\u5b66\u4e60\u8bcd\u7ea7\u53cc\u5411\u4e0a\u4e0b\u6587\u8868\u793a<\/td>\n<td>\u5b66\u4e60\u53e5\u95f4\u5173\u7cfb\u8868\u793a<\/td>\n<\/tr>\n<tr>\n<td>\u8f93\u5165<\/td>\n<td>\u53ef\u80fd\u88ab\u906e\u76d6\u7684\u5355\u4e2a\u53e5\u5b50\/\u53e5\u5b50\u5bf9<\/td>\n<td>\u5fc5\u987b\u662f\u53e5\u5b50\u5bf9 (A, B)<\/td>\n<\/tr>\n<tr>\n<td>\u8f93\u51fa<\/td>\n<td>\u9884\u6d4b\u88ab\u906e\u76d6\u7684\u8bcd (\u8bcd\u6c47\u8868\u5927\u5c0f)<\/td>\n<td>\u4e8c\u5206\u7c7b (\u662f\/\u5426\u4e0b\u4e00\u53e5)<\/td>\n<\/tr>\n<tr>\n<td>\u635f\u5931\u51fd\u6570<\/td>\n<td>\u4ea4\u53c9\u71b5\u635f\u5931 (\u5bf9\u88ab\u906e\u76d6\u4f4d\u7f6e)<\/td>\n<td>\u4e8c\u5206\u7c7b\u4ea4\u53c9\u71b5\u635f\u5931<\/td>\n<\/tr>\n<tr>\n<td>\u5173\u952e\u4f5c\u7528<\/td>\n<td>\u5b9e\u73b0\u6df1\u5ea6\u53cc\u5411\u7f16\u7801&#xff0c;\u662fBERT\u7684\u6838\u5fc3<\/td>\n<td>\u589e\u5f3a\u5bf9\u53e5\u5b50\u5bf9\u4efb\u52a1\u7684\u7406\u89e3\u80fd\u529b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>BERT\u7684\u9884\u8bad\u7ec3\u901a\u8fc7\u5de7\u5999\u7684MLM\u548cNSP\u4efb\u52a1\u8bbe\u8ba1&#xff1a;<\/p>\n<ul>\n<li>MLM\u5b9e\u73b0\u4e86\u771f\u6b63\u7684\u53cc\u5411\u8bed\u8a00\u5efa\u6a21<\/li>\n<li>NSP\u5b66\u4e60\u4e86\u53e5\u5b50\u95f4\u5173\u7cfb<\/li>\n<li>\u8054\u5408\u8bad\u7ec3\u8ba9\u6a21\u578b\u540c\u65f6\u638c\u63e1\u8bcd\u6c47\u548c\u7bc7\u7ae0\u77e5\u8bc6<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u9884\u8bad\u7ec3\u65b9\u5f0f\u4f7f\u5f97BERT\u80fd\u591f\u5b66\u4e60\u5230\u6df1\u5c42\u6b21\u3001\u53ef\u8fc1\u79fb\u7684\u8bed\u8a00\u8868\u793a&#xff0c;\u4e3a\u5176\u5728\u5404\u79cd\u4e0b\u6e38\u4efb\u52a1\u4e0a\u7684\u4f18\u5f02\u8868\u73b0\u5960\u5b9a\u4e86\u57fa\u7840\u3002\u9884\u8bad\u7ec3\u7684\u8d28\u91cf\u76f4\u63a5\u51b3\u5b9a\u4e86\u5fae\u8c03\u6548\u679c&#xff0c;\u662fBERT\u6210\u529f\u7684\u5173\u952e\u6240\u5728\u3002<\/p>\n<h4 id=\"%E5%9B%9B%E3%80%81%E7%BD%91%E7%BB%9C%E7%BB%86%E8%8A%82\">\u56db\u3001\u7f51\u7edc\u7ec6\u8282<\/h4>\n<h5 id=\"1.%E8%87%AA%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6\">1.\u81ea\u6ce8\u610f\u529b\u673a\u5236<\/h5>\n<ul>\n<li>\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"\\\\text{Attention}(Q, K, V) &#061; \\\\text{softmax}\\\\left( \\\\frac{QK^T}{\\\\sqrt{d_k}} \\\\right) V\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc38b8f.png\" \/><\/li>\n<li>\u591a\u5934\u6ce8\u610f\u529b&#xff1a;\u5e76\u884c\u591a\u4e2a\u6ce8\u610f\u529b\u5934&#xff0c;\u6355\u83b7\u4e0d\u540c\u5b50\u7a7a\u95f4\u7684\u8bed\u4e49\u4fe1\u606f<\/li>\n<\/ul>\n<h5 id=\"2.%E5%B1%82%E5%BD%92%E4%B8%80%E5%8C%96%E4%B8%8E%E6%AE%8B%E5%B7%AE%E8%BF%9E%E6%8E%A5\">2.\u5c42\u5f52\u4e00\u5316\u4e0e\u6b8b\u5dee\u8fde\u63a5<\/h5>\n<ul>\n<li>\u6bcf\u4e2a\u5b50\u5c42\u540e\u90fd\u6709\u6b8b\u5dee\u8fde\u63a5\u548c\u5c42\u5f52\u4e00\u5316<\/li>\n<li>\u89e3\u51b3\u6df1\u5ea6\u7f51\u7edc\u8bad\u7ec3\u4e2d\u7684\u68af\u5ea6\u95ee\u9898<\/li>\n<\/ul>\n<h5 id=\"3.%E5%89%8D%E9%A6%88%E7%BD%91%E7%BB%9C\">3.\u524d\u9988\u7f51\u7edc<\/h5>\n<ul>\n<li>\u4e24\u5c42\u5168\u8fde\u63a5\u5c42 &#043; ReLU\u6fc0\u6d3b\u51fd\u6570<\/li>\n<li>\u516c\u5f0f&#xff1a;<img decoding=\"async\" alt=\"\\\\text{FFN}(x) &#061; \\\\max(0, xW_1 &#043; b_1)W_2 &#043; b_2\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101804-696e04dc42ac8.png\" \/><\/li>\n<\/ul>\n<h4 id=\"%E4%BA%94%E3%80%81%E5%BE%AE%E8%B0%83%EF%BC%88Fine-tuning%EF%BC%89\">\u4e94\u3001\u5fae\u8c03&#xff08;Fine-tuning&#xff09;<\/h4>\n<h5 id=\"1.%20%E5%BE%AE%E8%B0%83%E7%9A%84%E5%9F%BA%E6%9C%AC%E6%80%9D%E6%83%B3\">1. \u5fae\u8c03\u7684\u57fa\u672c\u601d\u60f3<\/h5>\n<p>BERT\u7684\u5fae\u8c03\u662f\u6307\u5728\u9884\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u53c2\u6570\u57fa\u7840\u4e0a&#xff0c;\u4f7f\u7528\u4e0b\u6e38\u4efb\u52a1\u7684\u6709\u6807\u6ce8\u6570\u636e\u5bf9\u6574\u4e2a\u6a21\u578b\u6216\u90e8\u5206\u6a21\u578b\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u8bad\u7ec3&#xff0c;\u4f7f\u6a21\u578b\u9002\u5e94\u7279\u5b9a\u4efb\u52a1\u3002\u7531\u4e8e\u9884\u8bad\u7ec3\u6a21\u578b\u5df2\u7ecf\u5b66\u4e60\u4e86\u4e30\u5bcc\u7684\u8bed\u8a00\u8868\u793a&#xff0c;\u5fae\u8c03\u901a\u5e38\u53ea\u9700\u8981\u76f8\u5bf9\u8f83\u5c11\u7684\u6709\u6807\u6ce8\u6570\u636e\u5c31\u80fd\u53d6\u5f97\u5f88\u597d\u7684\u6548\u679c\u3002<\/p>\n<h5 id=\"2.%20%E5%B8%B8%E8%A7%81%E4%BB%BB%E5%8A%A1%E7%9A%84%E5%BE%AE%E8%B0%83\">2. \u5e38\u89c1\u4efb\u52a1\u7684\u5fae\u8c03<\/h5>\n<h6 id=\"2.1%20%E5%8F%A5%E5%AD%90%E5%AF%B9%E5%88%86%E7%B1%BB%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82MNLI%EF%BC%8CQQP%E7%AD%89%EF%BC%89\">2.1 \u53e5\u5b50\u5bf9\u5206\u7c7b\u4efb\u52a1&#xff08;\u5982MNLI&#xff0c;QQP\u7b49&#xff09;<\/h6>\n<p>\u4efb\u52a1\u63cf\u8ff0&#xff1a;\u5224\u65ad\u4e24\u4e2a\u53e5\u5b50\u4e4b\u95f4\u7684\u5173\u7cfb&#xff0c;\u5982\u662f\u5426\u76f8\u4f3c\u3001\u662f\u5426\u8574\u542b\u7b49\u3002<\/p>\n<p>\u6570\u636e\u683c\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u4e24\u4e2a\u53e5\u5b50&#xff0c;\u4e2d\u95f4\u7528[SEP]\u5206\u9694\u3002<\/li>\n<li>\u4f8b\u5982&#xff1a;[CLS] \u53e5\u5b501 [SEP] \u53e5\u5b502 [SEP]<\/li>\n<li>\u6807\u7b7e&#xff1a;\u7c7b\u522b\u6807\u7b7e&#xff08;\u59820,1,2\u7b49&#xff09;<\/li>\n<\/ul>\n<p>\u6a21\u578b\u8c03\u6574&#xff1a;<\/p>\n<ul>\n<li>\u5728BERT\u7684\u8f93\u51fa\u4e2d&#xff0c;\u53d6[CLS]\u5bf9\u5e94\u7684\u5411\u91cf&#xff08;\u5373\u6574\u4e2a\u5e8f\u5217\u7684\u8868\u793a&#xff09;\u4f5c\u4e3a\u53e5\u5b50\u5bf9\u7684\u8868\u793a\u3002<\/li>\n<li>\u7136\u540e\u63a5\u4e00\u4e2a\u5168\u8fde\u63a5\u5c42&#xff08;\u5206\u7c7b\u5668&#xff09;&#xff0c;\u5c06768\u7ef4&#xff08;BERT-base&#xff09;\u7684\u5411\u91cf\u6620\u5c04\u5230\u7c7b\u522b\u6570\u91cf\u7684\u7ef4\u5ea6&#xff0c;\u7136\u540e\u901a\u8fc7softmax\u5f97\u5230\u5206\u7c7b\u6982\u7387\u3002<\/li>\n<\/ul>\n<p>\u635f\u5931\u51fd\u6570&#xff1a;\u4ea4\u53c9\u71b5\u635f\u5931\u51fd\u6570\u3002<\/p>\n<h6 id=\"2.2%20%E5%8D%95%E5%8F%A5%E5%AD%90%E5%88%86%E7%B1%BB%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82SST-2%EF%BC%8C%E6%83%85%E6%84%9F%E5%88%86%E7%B1%BB%EF%BC%89\">2.2 \u5355\u53e5\u5b50\u5206\u7c7b\u4efb\u52a1&#xff08;\u5982SST-2&#xff0c;\u60c5\u611f\u5206\u7c7b&#xff09;<\/h6>\n<p>\u4efb\u52a1\u63cf\u8ff0&#xff1a;\u5bf9\u5355\u4e2a\u53e5\u5b50\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<p>\u6570\u636e\u683c\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u5355\u4e2a\u53e5\u5b50&#xff0c;\u683c\u5f0f\u4e3a[CLS] \u53e5\u5b50 [SEP]<\/li>\n<li>\u6807\u7b7e&#xff1a;\u7c7b\u522b\u6807\u7b7e<\/li>\n<\/ul>\n<p>\u6a21\u578b\u8c03\u6574&#xff1a;\u540c\u6837\u4f7f\u7528[CLS]\u5bf9\u5e94\u7684\u5411\u91cf\u4f5c\u4e3a\u53e5\u5b50\u8868\u793a&#xff0c;\u7136\u540e\u63a5\u5206\u7c7b\u5668\u3002<\/p>\n<h6 id=\"2.3%20%E9%97%AE%E7%AD%94%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82SQuAD%EF%BC%89\">2.3 \u95ee\u7b54\u4efb\u52a1&#xff08;\u5982SQuAD&#xff09;<\/h6>\n<p>\u4efb\u52a1\u63cf\u8ff0&#xff1a;\u7ed9\u5b9a\u4e00\u4e2a\u95ee\u9898\u548c\u4e00\u6bb5\u4e0a\u4e0b\u6587&#xff0c;\u4ece\u4e0a\u4e0b\u6587\u4e2d\u627e\u51fa\u7b54\u6848\u7684\u8d77\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002<\/p>\n<p>\u6570\u636e\u683c\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u95ee\u9898\u4e0e\u4e0a\u4e0b\u6587\u7ec4\u5408&#xff0c;\u683c\u5f0f\u4e3a[CLS] \u95ee\u9898 [SEP] \u4e0a\u4e0b\u6587 [SEP]<\/li>\n<li>\u6807\u7b7e&#xff1a;\u7b54\u6848\u5728\u4e0a\u4e0b\u6587\u4e2d\u7684\u8d77\u59cb\u4f4d\u7f6e\u548c\u7ed3\u675f\u4f4d\u7f6e&#xff08;\u7d22\u5f15&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u6a21\u578b\u8c03\u6574&#xff1a;<\/p>\n<ul>\n<li>\u5728BERT\u7684\u8f93\u51fa\u4e2d&#xff0c;\u5bf9\u4e0a\u4e0b\u6587\u90e8\u5206\u7684\u6bcf\u4e2atoken\u5206\u522b\u9884\u6d4b\u4e24\u4e2a\u6982\u7387&#xff1a;\u4f5c\u4e3a\u7b54\u6848\u8d77\u59cb\u4f4d\u7f6e\u7684\u6982\u7387\u548c\u4f5c\u4e3a\u7b54\u6848\u7ed3\u675f\u4f4d\u7f6e\u7684\u6982\u7387\u3002<\/li>\n<li>\u5177\u4f53\u6765\u8bf4&#xff0c;\u6211\u4eec\u5f15\u5165\u4e24\u4e2a\u53ef\u8bad\u7ec3\u7684\u5411\u91cfS\u548cE&#xff08;\u7ef4\u5ea6\u4e0e\u9690\u85cf\u5c42\u76f8\u540c&#xff09;&#xff0c;\u5206\u522b\u4e0e\u4e0a\u4e0b\u6587\u90e8\u5206\u6bcf\u4e2atoken\u7684\u8f93\u51fa\u5411\u91cf\u70b9\u79ef&#xff0c;\u7136\u540e\u901a\u8fc7softmax\u5f97\u5230\u6bcf\u4e2a\u4f4d\u7f6e\u4f5c\u4e3a\u8d77\u59cb\u548c\u7ed3\u675f\u7684\u6982\u7387\u3002<\/li>\n<li>\u8bad\u7ec3\u65f6&#xff0c;\u6700\u5927\u5316\u6b63\u786e\u7b54\u6848\u8d77\u59cb\u4f4d\u7f6e\u548c\u7ed3\u675f\u4f4d\u7f6e\u7684\u6982\u7387\u3002<\/li>\n<\/ul>\n<p>\u635f\u5931\u51fd\u6570&#xff1a;\u8d77\u59cb\u4f4d\u7f6e\u548c\u7ed3\u675f\u4f4d\u7f6e\u7684\u4ea4\u53c9\u71b5\u635f\u5931\u4e4b\u548c\u3002<\/p>\n<h6 id=\"2.4%20%E5%BA%8F%E5%88%97%E6%A0%87%E6%B3%A8%E4%BB%BB%E5%8A%A1%EF%BC%88%E5%A6%82NER%EF%BC%89\">2.4 \u5e8f\u5217\u6807\u6ce8\u4efb\u52a1&#xff08;\u5982NER&#xff09;<\/h6>\n<p>\u4efb\u52a1\u63cf\u8ff0&#xff1a;\u5bf9\u53e5\u5b50\u4e2d\u7684\u6bcf\u4e2atoken\u8fdb\u884c\u5206\u7c7b&#xff0c;\u5982\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3002<\/p>\n<p>\u6570\u636e\u683c\u5f0f&#xff1a;<\/p>\n<ul>\n<li>\u8f93\u5165&#xff1a;\u5355\u4e2a\u53e5\u5b50&#xff0c;\u683c\u5f0f\u4e3a[CLS] \u5355\u8bcd1 \u5355\u8bcd2 &#8230; [SEP]<\/li>\n<li>\u6807\u7b7e&#xff1a;\u6bcf\u4e2atoken\u5bf9\u5e94\u7684\u6807\u7b7e&#xff08;\u4f7f\u7528BIO\u7b49\u6807\u6ce8\u4f53\u7cfb&#xff09;&#xff0c;\u6ce8\u610f\u6807\u7b7e\u4e0etoken\u4e00\u4e00\u5bf9\u5e94\u3002<\/li>\n<\/ul>\n<p>\u6a21\u578b\u8c03\u6574&#xff1a;<\/p>\n<ul>\n<li>\u53d6\u6bcf\u4e2atoken\u5bf9\u5e94\u7684\u8f93\u51fa\u5411\u91cf&#xff08;\u5373BERT\u6700\u540e\u4e00\u5c42\u7684\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5411\u91cf&#xff09;&#xff0c;\u7136\u540e\u63a5\u4e00\u4e2a\u5168\u8fde\u63a5\u5c42&#xff0c;\u5c06768\u7ef4\u6620\u5c04\u5230\u6807\u7b7e\u6570\u91cf\u7684\u7ef4\u5ea6&#xff0c;\u7136\u540e\u901a\u8fc7softmax\u5f97\u5230\u6bcf\u4e2atoken\u7684\u6807\u7b7e\u6982\u7387\u3002<\/li>\n<li>\u6ce8\u610f&#xff1a;\u7531\u4e8eBERT\u4f7f\u7528WordPiece\u5206\u8bcd&#xff0c;\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e2a\u5355\u8bcd\u88ab\u5206\u6210\u591a\u4e2a\u5b50\u8bcd\u7684\u60c5\u51b5\u3002\u901a\u5e38\u7684\u5904\u7406\u65b9\u6cd5\u662f\u53d6\u7b2c\u4e00\u4e2a\u5b50\u8bcd\u7684\u8f93\u51fa\u4f5c\u4e3a\u8be5\u5355\u8bcd\u7684\u8868\u793a&#xff0c;\u6216\u8005\u53d6\u6240\u6709\u5b50\u8bcd\u8f93\u51fa\u7684\u5e73\u5747\u3002<\/li>\n<\/ul>\n<p>\u635f\u5931\u51fd\u6570&#xff1a;\u6bcf\u4e2atoken\u7684\u4ea4\u53c9\u71b5\u635f\u5931\u4e4b\u548c&#xff08;\u6216\u5e73\u5747&#xff09;\u3002<\/p>\n<h5 id=\"3.%20%E5%BE%AE%E8%B0%83%E6%AD%A5%E9%AA%A4\">3. \u5fae\u8c03\u6b65\u9aa4<\/h5>\n<li>\u51c6\u5907\u6570\u636e&#xff1a;\u5c06\u4efb\u52a1\u6570\u636e\u8f6c\u6362\u6210BERT\u8f93\u5165\u7684\u683c\u5f0f&#xff0c;\u5e76\u6784\u5efaDataLoader\u3002<\/li>\n<li>\u9009\u62e9\u9884\u8bad\u7ec3\u6a21\u578b&#xff1a;\u5982bert-base-uncased\u7b49\u3002<\/li>\n<li>\u6dfb\u52a0\u4efb\u52a1\u7279\u5b9a\u5c42&#xff1a;\u6839\u636e\u4efb\u52a1\u5728BERT\u6a21\u578b\u57fa\u7840\u4e0a\u6dfb\u52a0\u989d\u5916\u7684\u5c42&#xff08;\u5982\u5206\u7c7b\u5668&#xff09;\u3002<\/li>\n<li>\u8bbe\u7f6e\u4f18\u5316\u5668&#xff1a;\u901a\u5e38\u4f7f\u7528AdamW\u4f18\u5316\u5668&#xff0c;\u5e76\u8bbe\u7f6e\u8f83\u5c0f\u7684\u5b66\u4e60\u7387&#xff08;\u59822e-5, 3e-5, 5e-5&#xff09;&#xff0c;\u56e0\u4e3a\u9884\u8bad\u7ec3\u6a21\u578b\u5df2\u7ecf\u6bd4\u8f83\u6210\u719f&#xff0c;\u5fae\u8c03\u65f6\u53ea\u9700\u8981\u5c0f\u5e45\u8c03\u6574\u3002<\/li>\n<li>\u8bad\u7ec3&#xff1a;\u4f7f\u7528\u6709\u6807\u6ce8\u6570\u636e\u8bad\u7ec3\u6574\u4e2a\u6a21\u578b&#xff08;\u5305\u62ecBERT\u548c\u6dfb\u52a0\u7684\u5c42&#xff09;\u3002\u901a\u5e38\u8bad\u7ec3\u51e0\u4e2aepoch&#xff08;3,4,5&#xff09;\u5373\u53ef\u3002<\/li>\n<li>\u8bc4\u4f30&#xff1a;\u5728\u9a8c\u8bc1\u96c6\u4e0a\u8bc4\u4f30\u6a21\u578b\u6027\u80fd\u3002<\/li>\n<h5 id=\"4.%20%E5%BE%AE%E8%B0%83%E6%8A%80%E5%B7%A7\">4. \u5fae\u8c03\u6280\u5de7<\/h5>\n<ul>\n<li>\u5b66\u4e60\u7387&#xff1a;\u5fae\u8c03\u65f6\u5b66\u4e60\u7387\u901a\u5e38\u8f83\u5c0f&#xff0c;\u907f\u514d\u7834\u574f\u9884\u8bad\u7ec3\u6a21\u578b\u5df2\u7ecf\u5b66\u5230\u7684\u77e5\u8bc6\u3002<\/li>\n<li>\u6279\u6b21\u5927\u5c0f&#xff1a;\u7531\u4e8eBERT\u6a21\u578b\u8f83\u5927&#xff0c;\u6279\u6b21\u5927\u5c0f\u53ef\u80fd\u53d7\u663e\u5b58\u9650\u5236&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u68af\u5ea6\u7d2f\u79ef\u6765\u6a21\u62df\u66f4\u5927\u7684\u6279\u6b21\u3002<\/li>\n<li>\u8bad\u7ec3\u8f6e\u6570&#xff1a;\u901a\u5e383-5\u4e2aepoch\u5373\u53ef&#xff0c;\u8fc7\u591a\u53ef\u80fd\u5bfc\u81f4\u8fc7\u62df\u5408\u3002<\/li>\n<li>\u5206\u5c42\u5b66\u4e60\u7387&#xff1a;\u6709\u65f6\u4f1a\u5bf9BERT\u5c42\u548c\u9876\u5c42\u5206\u7c7b\u5668\u4f7f\u7528\u4e0d\u540c\u7684\u5b66\u4e60\u7387&#xff0c;BERT\u5c42\u7684\u5b66\u4e60\u7387\u66f4\u5c0f\u3002<\/li>\n<li>\u4f7f\u7528\u9a8c\u8bc1\u96c6&#xff1a;\u65e9\u505c&#xff08;early stopping&#xff09;\u7b56\u7565\u53ef\u4ee5\u9632\u6b62\u8fc7\u62df\u5408\u3002<\/li>\n<\/ul>\n<h4 id=\"%E5%85%AD%E3%80%81%E4%B8%BB%E8%A6%81%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF\">\u516d\u3001\u4e3b\u8981\u5e94\u7528\u573a\u666f<\/h4>\n<p>1.\u5355\u53e5\u5206\u7c7b\u4efb\u52a1&#xff1a;\u60c5\u611f\u5206\u6790\u3001\u6587\u672c\u5206\u7c7b&#xff0c;\u4f7f\u7528[CLS]\u4f4d\u7f6e\u7684\u8f93\u51fa\u4f5c\u4e3a\u53e5\u5b50\u8868\u793a<\/p>\n<p>2.\u53e5\u5b50\u5bf9\u4efb\u52a1&#xff1a;\u81ea\u7136\u8bed\u8a00\u63a8\u7406\u3001\u8bed\u4e49\u76f8\u4f3c\u5ea6&#xff0c;\u8f93\u5165\u683c\u5f0f&#xff1a;[CLS]\u53e5\u5b50A[SEP]\u53e5\u5b50B[SEP]<\/p>\n<p>3.\u95ee\u7b54\u4efb\u52a1&#xff1a;SQuAD\u6570\u636e\u96c6&#xff0c;\u9884\u6d4b\u7b54\u6848\u5728\u539f\u6587\u4e2d\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e<\/p>\n<p>4.\u5e8f\u5217\u6807\u6ce8&#xff1a;\u547d\u540d\u5b9e\u4f53\u8bc6\u522b\u3001\u8bcd\u6027\u6807\u6ce8&#xff0c;\u4f7f\u7528\u6bcf\u4e2atoken\u5bf9\u5e94\u7684\u8f93\u51fa<\/p>\n<h4 id=\"%E4%B8%83%E3%80%81%E6%80%BB%E7%BB%93\">\u4e03\u3001\u603b\u7ed3<\/h4>\n<p>BERT\u7684\u6210\u529f\u6e90\u4e8e&#xff1a;<\/p>\n<li>\u6df1\u5ea6\u53cc\u5411\u67b6\u6784&#xff1a;\u5168\u9762\u6355\u83b7\u4e0a\u4e0b\u6587\u4fe1\u606f<\/li>\n<li>\u5927\u89c4\u6a21\u9884\u8bad\u7ec3&#xff1a;\u6d77\u91cf\u6570\u636e\u5b66\u4e60\u8bed\u8a00\u6a21\u5f0f<\/li>\n<li>\u901a\u7528\u6027\u5f3a&#xff1a;\u4e00\u5957\u6a21\u578b\u9002\u5e94\u591a\u79cd\u4efb\u52a1<\/li>\n<li>\u5f00\u6e90\u751f\u6001&#xff1a;\u4fc3\u8fdb\u793e\u533a\u53d1\u5c55\u548c\u5e94\u7528\u521b\u65b0<\/li>\n<p>BERT\u5960\u5b9a\u4e86\u73b0\u4ee3\u9884\u8bad\u7ec3\u8bed\u8a00\u6a21\u578b\u7684\u57fa\u7840&#xff0c;\u5176\u601d\u60f3\u548c\u67b6\u6784\u6df1\u523b\u5f71\u54cd\u4e86\u540e\u7eed\u7684NLP\u6a21\u578b\u53d1\u5c55&#xff0c;\u5982GPT\u7cfb\u5217\u3001T5\u7b49\u3002\u867d\u7136\u5df2\u6709\u66f4\u5148\u8fdb\u7684\u6a21\u578b\u51fa\u73b0&#xff0c;\u4f46BERT\u7684\u8bbe\u8ba1\u7406\u5ff5\u81f3\u4eca\u4ecd\u6709\u91cd\u8981\u4ef7\u503c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n\u4e00\u3001\u6838\u5fc3\u601d\u60f3<br \/>\n\u4e8c\u3001\u67b6\u6784\u7ec4\u6210<br \/>\n1.\u57fa\u7840\u67b6\u6784&#xff1a;Transformer\u7f16\u7801\u5668<br \/>\n2.\u8f93\u5165\u8868\u793a<br \/>\n3.\u8f93\u51fa\u8868\u793a<br \/>\n\u4e09\u3001\u9884\u8bad\u7ec3\u4efb\u52a1&#xff08;Pre-Training&#xff09;<br \/>\n1.\u63a9\u7801\u8bed\u8a00\u6a21\u578b&#xff08;MLM&#xff0c;Masked Language Model&#xff09;<br \/>\n2.\u4e0b\u4e00\u53e5\u9884\u6d4b&#xff08;NSP&#xff0c;Next Sentence Prediction&#xff09;<br \/>\n3.\u603b\u7ed3<br \/>\n\u56db\u3001\u7f51\u7edc\u7ec6\u8282<br \/>\n1.\u81ea\u6ce8\u610f<\/p>\n","protected":false},"author":2,"featured_media":62290,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2554,50,86],"topic":[],"class_list":["post-62303","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-bert","tag-50","tag-86"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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:\/\/www.wsisp.com\/helps\/62303.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u4e00\u3001\u6838\u5fc3\u601d\u60f3 \u4e8c\u3001\u67b6\u6784\u7ec4\u6210 1.\u57fa\u7840\u67b6\u6784&#xff1a;Transformer\u7f16\u7801\u5668 2.\u8f93\u5165\u8868\u793a 3.\u8f93\u51fa\u8868\u793a \u4e09\u3001\u9884\u8bad\u7ec3\u4efb\u52a1&#xff08;Pre-Training&#xff09; 1.\u63a9\u7801\u8bed\u8a00\u6a21\u578b&#xff08;MLM&#xff0c;Masked Language Model&#xff09; 2.\u4e0b\u4e00\u53e5\u9884\u6d4b&#xff08;NSP&#xff0c;Next Sentence Prediction&#xff09; 3.\u603b\u7ed3 \u56db\u3001\u7f51\u7edc\u7ec6\u8282 1.\u81ea\u6ce8\u610f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/62303.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-19T10:18:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101802-696e04dac0603.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/62303.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/62303.html\",\"name\":\"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-19T10:18:05+00:00\",\"dateModified\":\"2026-01-19T10:18:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/62303.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/62303.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/62303.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/62303.html","og_locale":"zh_CN","og_type":"article","og_title":"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u4e00\u3001\u6838\u5fc3\u601d\u60f3 \u4e8c\u3001\u67b6\u6784\u7ec4\u6210 1.\u57fa\u7840\u67b6\u6784&#xff1a;Transformer\u7f16\u7801\u5668 2.\u8f93\u5165\u8868\u793a 3.\u8f93\u51fa\u8868\u793a \u4e09\u3001\u9884\u8bad\u7ec3\u4efb\u52a1&#xff08;Pre-Training&#xff09; 1.\u63a9\u7801\u8bed\u8a00\u6a21\u578b&#xff08;MLM&#xff0c;Masked Language Model&#xff09; 2.\u4e0b\u4e00\u53e5\u9884\u6d4b&#xff08;NSP&#xff0c;Next Sentence Prediction&#xff09; 3.\u603b\u7ed3 \u56db\u3001\u7f51\u7edc\u7ec6\u8282 1.\u81ea\u6ce8\u610f","og_url":"https:\/\/www.wsisp.com\/helps\/62303.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-19T10:18:05+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260119101802-696e04dac0603.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/62303.html","url":"https:\/\/www.wsisp.com\/helps\/62303.html","name":"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-19T10:18:05+00:00","dateModified":"2026-01-19T10:18:05+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/62303.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/62303.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/62303.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"BERT\uff08Bidirectional Encoder Representations from Transformers\uff09\u67b6\u6784\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/62303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=62303"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/62303\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/62290"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=62303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=62303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=62303"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=62303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}