{"id":1308,"date":"2025-11-16T08:40:26","date_gmt":"2025-11-16T00:40:26","guid":{"rendered":"https:\/\/lingbo.online\/?p=1308"},"modified":"2026-04-18T18:19:48","modified_gmt":"2026-04-18T10:19:48","slug":"%e3%80%90%e5%bc%ba%e5%8c%96%e5%ad%a6%e4%b9%a0%e4%b8%93%e9%a2%98%e3%80%91ppo%e3%80%81dpo%e3%80%81grpo%e3%80%81gspo","status":"publish","type":"post","link":"https:\/\/lingbo.online\/index.php\/uncategorized\/%e3%80%90%e5%bc%ba%e5%8c%96%e5%ad%a6%e4%b9%a0%e4%b8%93%e9%a2%98%e3%80%91ppo%e3%80%81dpo%e3%80%81grpo%e3%80%81gspo\/","title":{"rendered":"\u3010\u5f3a\u5316\u5b66\u4e60\u4e13\u9898\u3011PPO\u3001DPO\u3001GRPO\u3001GSPO"},"content":{"rendered":"<h3>\u8fd1\u7aef\u7b56\u7565\u4f18\u5316\u7b97\u6cd5PPO\uff08Proximal Policy Optimization\uff09<\/h3>\n<p>PPO\u7b97\u6cd5\u5728openai\u7684\u8bba\u6587\u300aTraining language models to follow instructions with human feedback\u300b\u63d0\u51fa\u7684RLHF\u8303\u5f0f\u4e2d\u4f7f\u7528\uff0c\u7528\u4e8e\u5bf9\u5176\u4eba\u7c7b\u504f\u597d\u3002<\/p>\n<h4>PPO\u7b97\u6cd5\u6a21\u578b\u6784\u6210<\/h4>\n<p>\u5176\u4e2d\uff0c\u9488\u5bf9RLHF\u573a\u666f\u4e2d\u7684PPO\u7b97\u6cd5\u4e00\u5171\u5b58\u5728\u56db\u4e2a\u6a21\u578b\uff1a<strong>\u7b56\u7565\u6a21\u578b\uff08policy model\uff09\u3001\u5956\u52b1\u6a21\u578b\uff08value model\uff09\u3001\u53c2\u8003\u6a21\u578b\uff08reference model\uff09\u4ee5\u53cacritic\u6a21\u578b<\/strong>\u3002<\/p>\n<ul>\n<li>\u7b56\u7565\u6a21\u578b\uff1a\u53c8\u79f0Actor\uff0c\u5f53\u524d\u9700\u8981\u8bad\u7ec3\u7684\u201c\u5b66\u751f\u201d\u6a21\u578b\uff0c\u5373\u76ee\u6807\u7684\u8bed\u8a00\u6a21\u578b\u3002\u63a5\u6536\u7528\u6237\u8f93\u5165\u7684\u6307\u4ee4\uff08prompt\uff09\uff0c\u751f\u6210\u5bf9\u5e94\u7684\u54cd\u5e94\u3002\u901a\u8fc7\u4e0e\u73af\u5883\uff08\u5373\u5956\u52b1\u6a21\u578b\uff09\u4ea4\u4e92\uff0c\u5b66\u4e60\u4f18\u5316\u751f\u6210\u7b56\u7565\uff0c\u4ee5\u6700\u5927\u5316\u5956\u52b1\u4fe1\u53f7\u3002<\/li>\n<li>\u5956\u52b1\u6a21\u578b\uff1a\u201c\u88c1\u5224\u201d\u6a21\u578b\uff0c\u8bc4\u4f30\u751f\u6210\u5185\u5bb9\u7684\u8d28\u91cf\uff0c\u5bf9\u201c\u6307\u4ee4-\u54cd\u5e94\u201d\u8fdb\u884c\u8bc4\u5206\uff0c\u8f93\u51fa\u6807\u91cf\u5956\u52b1\u6307\uff08\u5982\u56de\u7b54\u7684\u6709\u7528\u6027\u3001\u65e0\u5bb3\u6027\uff09\u3002\u8bc4\u5206\u57fa\u4e8e\u4eba\u7c7b\u504f\u597d\u6570\u636e\u5de1\u6797\u554a\uff0c\u4f8b\u5982\u4eba\u5de5\u6807\u6ce8\u7684\u4f18\u8d28\u56de\u7b54\u6392\u5e8f\u3002\u53c2\u6570\u51bb\u7ed3\uff0c\u4e0d\u53c2\u4e0e\u8bad\u7ec3\u66f4\u65b0\u3002\u63d0\u4f9b\u4f18\u5316\u65b9\u5411\uff0c\u5c06\u6a21\u7cca\u7684\u201c\u4eba\u7c7b\u504f\u597d\u201d\u91cf\u5316\u4e3a\u53ef\u8ba1\u7b97\u7684\u5956\u52b1<\/li>\n<li>\u53c2\u8003\u6a21\u578b\uff1a\u5373SFT\u8bad\u7ec3\u540e\u5f97\u5230\u7684\u6a21\u578b\uff0c\u5c06\u5176\u4f5c\u4e3a\u201c\u4e0d\u53d8\u201d\u7684\u57fa\u51c6\uff0c\u9632\u6b62\u7b56\u7565\u504f\u79bb\u521d\u59cb\u80fd\u529b\u3002\u7ea6\u675f\u516c\u5f0f\u4e3a\uff1a\u6700\u7ec8\u5956\u52b1=\u5956\u52b1\u6a21\u578b\u5206-\u03b1\u00d7KL\u6563\u5ea6\uff08\u03b1\u4e3a\u60e9\u7f5a\u7cfb\u6570\uff09<\/li>\n<li>\u6279\u8bc4\u5bb6\u6a21\u578b\uff1a\u52a8\u6001\u7684\u201c\u8bc4\u8bba\u5bb6\u201d\uff0c<strong>\u9884\u6d4b\u672a\u6765\u7d2f\u79ef\u5956\u52b1<\/strong>\u3002\u8f93\u5165\u6307\u4ee4\uff08\u72b6\u6001\uff09\uff0c\u9884\u6d4b\u5f53\u524d\u7b56\u7565\u4e0b\u672a\u6765\u80fd\u83b7\u5f97\u7684\u603b\u5956\u52b1\u671f\u671b\u503c\u3002\u7528\u4e8e\u8ba1\u7b97\u4f18\u52bf\u51fd\u6570\uff08Advantage\uff09\uff0c\u8861\u91cf\u5f53\u524d\u52a8\u4f5c\u6bd4\u5e73\u5747\u8868\u73b0\u597d\u591a\u5c11\u3002\u4e0e\u7b56\u7565\u6a21\u578b\u540c\u6b65\u66f4\u65b0\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u9884\u6d4b\u503c\u4e0e\u5b9e\u9645\u56de\u62a5\u7684\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u4f18\u5316\u3002\u51cf\u5c11\u5956\u52b1\u4fe1\u53f7\u7684\u65b9\u5dee\uff0c\u63d0\u5347\u8bad\u7ec3\u7a33\u5b9a\u6027\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/youpaiyun.lingbo.online\/2025\/08\/20250820075059890.jpg\" alt=\"\" \/><\/li>\n<\/ul>\n<h3>\u76f4\u63a5\u7b56\u7565\u4f18\u5316\u7b97\u6cd5DPO\uff08Directly Policy Optimization\uff09<\/h3>\n<p>\u73b0\u6709\u7684\u5927\u6a21\u578b\u7684\u5bf9\u9f50\u65b9\u6cd5\uff0c\u4f8b\u5982PPO\uff0c\u5f80\u5f80\u7a0b\u5e8f\u590d\u6742\u4e14\u7a33\u5b9a\u6027\u4e0d\u8db3\uff0c\u901a\u5e38\u9700\u8981\u5148\u4f60\u548c\u4e00\u4e2a\u80fd\u591f\u53cd\u6620\u4eba\u7c7b\u504f\u597d\u7684\u5956\u52b1\u6a21\u578b\uff0c\u7136\u540e\u901a\u8fc7\u5f3a\u5316\u5b66\u4e60\u6765\u5fae\u8c03\u5927\u6a21\u578b\uff0c\u540c\u65f6\u8981\u786e\u4fdd\u6a21\u578b\u884c\u4e3a\u4e0d\u4f1a\u8fc7\u5206\u504f\u79bb\u5176\u539f\u59cb\u72b6\u6001\u3002<br \/>\n\u76f8\u6bd4\u4e4b\u4e0b\uff0cDPO\u7b97\u6cd5\u7b80\u5316\u8be5\u6d41\u7a0b\uff0c\u65e0\u9700\u8bad\u7ec3\u4e13\u95e8\u7684\u5956\u52b1\u6a21\u578b\uff0c\u800c\u662f\u5229\u7528\u7b80\u5355\u7684\u5206\u7c7b\u635f\u5931\u6765\u89e3\u51b3\u6807\u51c6\u7684PLHF\uff08\u57fa\u4e8e\u4eba\u7c7b\u53cd\u9988\u7684\u5f3a\u5316\u5b66\u4e60\uff09\u95ee\u9898\u3002DPO\u4e0d\u4ec5\u7b97\u6cd5\u7a33\u5b9a\u3001\u6027\u80fd\u4f18\u826f\uff0c\u800c\u4e14\u8ba1\u7b97\u91cf\u8f83\u5c0f\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/youpaiyun.lingbo.online\/2025\/08\/20250820083634552.jpg\" alt=\"\" \/><br \/>\nDPO\u7b97\u6cd5\u4ec5\u5305\u542bRLHF\u4e2d\u7684\u4e24\u4e2a\u6a21\u578b\uff0c\u5373\u6f14\u5458\u6a21\u578b\uff08Actor model\uff09\u548c\u53c2\u8003\u6a21\u578b\uff08Reference model\uff09\uff0c\u4e14\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4e0d\u9700\u8981\u8fdb\u884c\u6570\u636e\u91c7\u6837\u3002<\/p>\n<h3>\u7ec4\u95f4\u76f8\u5bf9\u7b56\u7565\u4f18\u5316\u7b97\u6cd5GRPO\uff08Group Relative Policy Optimization\uff09<\/h3>\n<p>GRPO\u6452\u5f03\u4e86\u4ef7\u503c\u51fd\u6570\u6a21\u578b\u7684\u8bad\u7ec3\uff0c\u4e8c\u662f\u901a\u8fc7\u7ec4\u5185\u5956\u52b1\u5206\u6570\u6765\u8bc4\u4f30\u57fa\u51c6\u7ebf\uff08advantage\uff09\uff0c\u5927\u5e45\u964d\u4f4e\u4e86\u8bad\u7ec3\u8d44\u6e90\u7684\u9700\u6c42\u3002GRPO\u9996\u5148\u6839\u636e\u95ee\u9898q\uff0c\u751f\u6210\u4e00\u7ec4\u56de\u7b54\uff08o1,...,oG\uff09\uff0c\u7136\u540e\u95ee\u9898+\u56de\u7b54\u8f93\u5165Reference\u6a21\u578b\uff0c\u5e76\u4e0ePolicy\u6a21\u578b\u8ba1\u7b97KL\u6563\u5ea6\uff0c\u7ea6\u675fPolicy\u6a21\u578b\u7684\u66f4\u65b0\u5e45\u5ea6\u3002\u6b64\u5916\uff0c\u95ee\u9898+\u56de\u7b54\u8f93\u5165Reward\u6a21\u578b\u4e2d\u8f93\u51fa\u4e00\u7ec4\u5956\u52b1\u5206\u6570\uff08r1,...,rG\uff09\uff0c\u4e0ePPO\u663e\u8457\u4e0d\u540c\u7684\u662f\uff0cGRPO\u4f7f\u7528\u8fd9\u4e00\u7ec4\u5956\u52b1\u5206\u6570\u6765\u4f30\u7b97A\uff0c\u5177\u4f53\u516c\u5f0f\u4e3a\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/youpaiyun.lingbo.online\/2025\/08\/20250820081002428.jpg\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/youpaiyun.lingbo.online\/2025\/08\/20250820080316298.jpg\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd1\u7aef\u7b56\u7565\u4f18\u5316\u7b97\u6cd5PPO\uff08Proximal Policy Optimization\uff09 PPO\u7b97\u6cd5\u5728openai\u7684\u8bba\u6587\u300aTrainin &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/posts\/1308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/comments?post=1308"}],"version-history":[{"count":5,"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/posts\/1308\/revisions"}],"predecessor-version":[{"id":1540,"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/posts\/1308\/revisions\/1540"}],"wp:attachment":[{"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/media?parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/categories?post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lingbo.online\/index.php\/wp-json\/wp\/v2\/tags?post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}