{"id":28779,"date":"2025-03-17T14:16:14","date_gmt":"2025-03-17T06:16:14","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=28779"},"modified":"2025-03-17T14:16:14","modified_gmt":"2025-03-17T06:16:14","slug":"zhuanzaiqwq-32b-dea","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/de\/zhuanzaiqwq-32b-dea\/","title":{"rendered":"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528"},"content":{"rendered":"<h3>\u80cc\u666f<\/h3>\n<p>\u8fd1\u671f\uff0c\u4e00\u7bc7\u540d\u4e3a\u00a0<em><a href=\"https:\/\/www.kdjingpai.com\/de\/search-r1\/\">Search-R1<\/a>: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learning<\/em>\u00a0\u7684\u8bba\u6587 (<a href=\"https:\/\/arxiv.org\/pdf\/2503.09516\">arxiv.org\/pdf\/2503.09516<\/a>) \u5f15\u53d1\u4e86\u5e7f\u6cdb\u5173\u6ce8\u3002\u8be5\u8bba\u6587\u63d0\u51fa\u4e86\u4e00\u79cd\u5229\u7528\u5f3a\u5316\u5b66\u4e60\u8bad\u7ec3\u5927\u8bed\u8a00\u6a21\u578b (LLM) \u8fdb\u884c\u63a8\u7406\u548c\u5229\u7528\u641c\u7d22\u5f15\u64ce\u7684\u65b0\u65b9\u6cd5\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u8bba\u6587\u4e2d\u7684\u4e00\u4e9b\u601d\u8def\u4e0e Qwen \u56e2\u961f\u5728 <a href=\"https:\/\/www.kdjingpai.com\/de\/xiaomoxingdanengba\/\">QwQ-32B<\/a> \u6a21\u578b\u4e0a\u7684\u63a2\u7d22\u4e0d\u8c0b\u800c\u5408\u3002<\/p>\n<p>\u963f\u91cc\u5df4\u5df4\u8fd1\u671f\u53d1\u5e03\u7684 QwQ-32B (qwenlm.github.io\/zh\/blog\/qwq-32b\/) \u5728\u63a8\u7406\u6a21\u578b\u4e2d\u96c6\u6210\u4e86\u4e0e Agent \u76f8\u5173\u7684\u80fd\u529b\u3002\u8fd9\u4e9b\u80fd\u529b\u4f7f\u5f97\u6a21\u578b\u53ef\u4ee5\u5728\u4f7f\u7528\u5de5\u5177\u7684\u540c\u65f6\u8fdb\u884c\u6279\u5224\u6027\u601d\u8003\uff0c\u5e76\u6839\u636e\u73af\u5883\u53cd\u9988\u8c03\u6574\u63a8\u7406\u8fc7\u7a0b\u3002\u5728 QwQ-32B \u6a21\u578b\u6587\u4ef6\u5939\u4e2d\u7684\u00a0<code>added_tokens.json<\/code>\u00a0\u6587\u4ef6\u91cc\uff0c\u53ef\u4ee5\u770b\u5230\u65b0\u589e\u7684\u5de5\u5177\u8c03\u7528\u548c\u5de5\u5177\u54cd\u5e94\u7684\u7279\u6b8a token\uff1a<\/p>\n<pre><code>{\r\n\"&lt;\/think&gt;\": 151668,\r\n\"&lt;\/tool_call&gt;\": 151658,\r\n\"&lt;\/tool_response&gt;\": 151666,\r\n\"&lt;think&gt;\": 151667,\r\n\"&lt;tool_call&gt;\": 151657,\r\n\"&lt;tool_response&gt;\": 151665\r\n}\r\n<\/code><\/pre>\n<p>\u672c\u6587\u5c06\u4ee5 Agentic <a href=\"https:\/\/www.kdjingpai.com\/de\/rag\/\">RAG<\/a> \u4e3a\u4f8b\uff0c\u5c55\u793a QwQ-32B \u6a21\u578b\u5728\u5de5\u5177\u8c03\u7528\u65b9\u9762\u7684\u80fd\u529b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Agentic RAG vs. \u4f20\u7edf RAG<\/h3>\n<p>\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3 Agentic RAG \u7684\u4f18\u52bf\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u533a\u5206 Agentic RAG \u548c\u5f53\u524d\u666e\u904d\u7684 RAG \u5b9e\u8df5\u8303\u5f0f\uff1a<\/p>\n<ul>\n<li><strong>\u4f20\u7edf RAG<\/strong>\uff1a\u76ee\u524d\u7edd\u5927\u591a\u6570 RAG \u9879\u76ee\u672c\u8d28\u4e0a\u662f\u5de5\u4f5c\u6d41\uff0c\u5373\u901a\u8fc7\u9884\u5b9a\u4e49\u7684\u4ee3\u7801\u8def\u5f84\u7f16\u6392 LLM \u548c\u5de5\u5177\u7684\u7cfb\u7edf\u3002\u8fd9\u79cd\u4eba\u4e3a\u9884\u5148\u5b9a\u4e49\u7684\u201c\u5199\u6b7b\u201d\u7684\u5de5\u4f5c\u6d41\u7531\u8bb8\u591a\u76f8\u4e92\u5173\u8054\u4f46\u8106\u5f31\u7684\u90e8\u5206\u7ec4\u6210\uff0c\u5982\u8def\u7531\u3001\u5206\u5757\u3001\u91cd\u6392\u5e8f\u3001\u67e5\u8be2\u89e3\u91ca\u3001\u67e5\u8be2\u6269\u5c55\u3001\u6e90\u4e0a\u4e0b\u6587\u5316\u548c\u641c\u7d22\u5de5\u7a0b\u7b49\u3002\n<ul>\n<li><strong>\u7f3a\u70b9<\/strong>\uff1a\u4eba\u4e3a\u7f16\u6392\u7684\u5de5\u4f5c\u6d41\u96be\u4ee5\u8986\u76d6\u6240\u6709\u60c5\u51b5 (corner case)\u3002\u7279\u522b\u662f\u5728\u9700\u8981\u591a\u8f6e\u68c0\u7d22\u7b49\u590d\u6742\u573a\u666f\u4e0b\uff0c\u6548\u679c\u66f4\u53d7\u9650\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>Agentic RAG<\/strong>\uff1a\u91c7\u7528\u7aef\u5230\u7aef\u7684\u65b9\u5f0f\uff0c\u7b80\u5316\u6d41\u7a0b\u3002\u53ea\u9700\u4e3a\u6a21\u578b\u914d\u5907\u4e00\u4e2a\u8054\u7f51\u68c0\u7d22\u7684 API \u5de5\u5177\uff08\u672c\u6587\u6848\u4f8b\u4e2d\u4f7f\u7528\u4e86\u00a0<a href=\"https:\/\/www.kdjingpai.com\/de\/tavily\/\">Tavily<\/a> API\uff0c\u6709\u4e00\u5b9a\u7684\u514d\u8d39\u989d\u5ea6\uff09\uff0c\u5176\u4f59\u5de5\u4f5c\u5168\u90e8\u7531\u6a21\u578b\u81ea\u4e3b\u5b8c\u6210\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\uff1a\n<ul>\n<li>\u610f\u56fe\u7406\u89e3\uff08\u5224\u65ad\u662f\u5426\u9700\u8981\u8054\u7f51\uff09<\/li>\n<li>\u95ee\u9898\u6539\u5199\u6216\u62c6\u5206<\/li>\n<li>\u63a5\u53e3\u8c03\u7528<\/li>\n<li>\u6d41\u7a0b\u7f16\u6392\uff08\u5305\u62ec\u662f\u5426\u8fdb\u884c\u591a\u6b65\u68c0\u7d22\uff0c\u4ee5\u53ca\u5982\u4f55\u8fdb\u884c\u591a\u6b65\u68c0\u7d22\uff09<\/li>\n<li>\u5f15\u7528\u6eaf\u6e90<\/li>\n<li>&#8230;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u7b80\u5355\u6765\u8bf4\uff0cAgentic RAG \u7684\u6838\u5fc3\u7406\u5ff5\u662f\uff1a<strong>\u7ed3\u6784\u66f4\u5c11\uff0c\u667a\u80fd\u66f4\u591a\uff0c\u5c11\u5373\u662f\u591a (Less structure, more intelligence, Less is More)<\/strong>\u3002<\/p>\n<p>\u6b63\u5982 <a href=\"https:\/\/www.kdjingpai.com\/de\/claudeanquanfubai\/\">Anthropic<\/a> \u5bf9 Agent \u6a21\u578b\u7684\u5b9a\u4e49\uff1a\u7c7b\u4f3c\u4e8e Deep Search\uff0cAgent \u5fc5\u987b\u5728\u5185\u90e8\u6267\u884c\u76ee\u6807\u4efb\u52a1\uff0c\u5b83\u4eec\u201c\u52a8\u6001\u6307\u5bfc\u81ea\u5df1\u7684\u8fc7\u7a0b\u548c\u5de5\u5177\u4f7f\u7528\uff0c\u63a7\u5236\u5b8c\u6210\u4efb\u52a1\u7684\u65b9\u5f0f\u201d\u3002<\/p>\n<h3>\u6574\u4f53\u6d41\u7a0b<\/h3>\n<p>\u4e0b\u56fe\u5c55\u793a\u4e86 Agentic RAG \u7684\u6574\u4f53\u6d41\u7a0b\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28781\" title=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/b04be76812d1a15.jpg\" alt=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-1\" width=\"1074\" height=\"788\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/b04be76812d1a15.jpg 1074w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/b04be76812d1a15-768x563.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/b04be76812d1a15-16x12.jpg 16w\" sizes=\"auto, (max-width: 1074px) 100vw, 1074px\" \/><\/p>\n<ol>\n<li>\u5c06\u7528\u6237\u95ee\u9898\u9002\u914d\u5230\u63d0\u793a\u8bcd\u6a21\u677f\u3002<\/li>\n<li>\u8c03\u7528\u6a21\u578b\u751f\u6210\u65b0\u7684 token\u3002\u5982\u679c\u751f\u6210\u8fc7\u7a0b\u4e2d\u672a\u51fa\u73b0\u00a0<code>&lt;tool_call&gt; ... &lt;\/tool_call&gt;<\/code>\uff0c\u5219\u76f4\u63a5\u8f93\u51fa\u8fd4\u56de\u7ed3\u679c\u3002<\/li>\n<li>\u5982\u679c\u51fa\u73b0\u00a0<code>&lt;tool_call&gt; ... &lt;\/tool_call&gt;<\/code>\uff0c\u5219\u8868\u660e\u6a21\u578b\u5728\u63a8\u7406\u8fc7\u7a0b\u4e2d\u53d1\u8d77\u4e86\u4e00\u4e2a\u5de5\u5177\u8c03\u7528\u7533\u8bf7\u3002\u89e3\u6790\u8be5\u7533\u8bf7\uff0c\u6267\u884c\u00a0<code>web_search<\/code>\uff0c\u5e76\u5c06\u63a5\u53e3\u8c03\u7528\u7ed3\u679c\u5305\u88c5\u6210\u00a0<code>&lt;tool_response&gt; ... &lt;\/tool_response&gt;<\/code>\u00a0\u7684\u683c\u5f0f\uff0c\u62fc\u63a5\u5230\u5927\u6a21\u578b\u7684\u4e0a\u4e0b\u6587\u4e2d\uff0c\u518d\u6b21\u8bf7\u6c42\u5927\u6a21\u578b\u751f\u6210\u3002<\/li>\n<li>\u91cd\u590d\u6267\u884c\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u76f4\u5230\u6ca1\u6709\u66f4\u591a\u7684\u00a0<code>&lt;tool_call&gt;<\/code>\uff08\u6216\u8fbe\u5230\u8bf7\u6c42\u4e0a\u9650\uff09\u6216\u51fa\u73b0\u00a0<code>&lt;|im_end|&gt;<\/code>\u3002<\/li>\n<\/ol>\n<p>\u8be5\u6d41\u7a0b\u4e0e Search-R1 \u8bba\u6587\u4e2d\u63cf\u8ff0\u7684\u6d41\u7a0b\u57fa\u672c\u4e00\u81f4\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28780\" title=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-2\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/32ec214ace69432.jpg\" alt=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-2\" width=\"959\" height=\"672\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/32ec214ace69432.jpg 959w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/32ec214ace69432-768x538.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/32ec214ace69432-18x12.jpg 18w\" sizes=\"auto, (max-width: 959px) 100vw, 959px\" \/><\/p>\n<h3>\u5173\u952e\u6280\u672f\u70b9<\/h3>\n<ul>\n<li><strong>\u63d0\u793a\u8bcd\u6a21\u677f<\/strong>\uff1a<\/li>\n<\/ul>\n<pre><code>user_question = input('\u8bf7\u8f93\u5165\u4f60\u7684\u95ee\u9898\uff1a')\r\nmax_search_times = 5\r\nprompt = f\"\"\"You are Qwen QwQ, a curious AI built for retrival augmented generation.\r\nYou are at 2025 and current date is {date.today()}.\r\nYou have access to the web_search tool to retrival relevant information to help answer user questions.\r\nYou can use web_search tool up to {max_search_times} times to answer a user's question, but try to be efficient and use as few as possible.\r\nBelow are some guidelines:\r\n- Use web_search for general internet queries, like finding current events or factual information.\r\n- Always provide a final answer in a clear and concise manner, with citations for any information obtained from the internet.\r\n- If you think you need to use a tool, format your response as a tool call with the `action` and `action_input` within &lt;tool_call&gt;...&lt;\/tool_call&gt;, like this:\\n&lt;tool_call&gt;\\n{{ \"action\": \"web_search\", \"action_input\": {{ \"query\": \"current stock price of Tesla\" }} }}\\n&lt;\/tool_call&gt;.\r\n- After using a tool, <a href=\"https:\/\/www.kdjingpai.com\/de\/continue\/\">continue<\/a> your reasoning based on the web_search result in &lt;tool_response&gt;...&lt;\/tool_response&gt;.\r\n- Remember that if you need multi-turn web_search to find relevant information, make sure you conduct all search tasks before you provide a final answer.\r\n---\r\nUser Question:{user_question}\"\"\"\r\n<\/code><\/pre>\n<ul>\n<li><strong>\u81ea\u5b9a\u4e49\u505c\u6b62\u7b26<\/strong>\uff1a\n<p>\u5f53\u68c0\u6d4b\u5230\u6a21\u578b\u5728\u81ea\u56de\u5f52\u751f\u6210\u8fc7\u7a0b\u4e2d\u89e6\u53d1\u4e86\u00a0<code>&lt;tool_call&gt;(.*?)&lt;\/tool_call&gt;\\s*$<\/code>\u00a0\u683c\u5f0f\uff08\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\uff09\u540e\uff0c\u505c\u6b62\u751f\u6210\uff1a<\/li>\n<\/ul>\n<pre><code>from transformers import (\r\nAutoModelForCausalLM,\r\nAutoTokenizer,\r\nStoppingCriteria,\r\nStoppingCriteriaList\r\n)\r\nimport torch\r\nimport re\r\ntool_call_regex = r\"&lt;tool_call&gt;(.*?)&lt;\/tool_call&gt;\\s*$\"\r\nend_regex = r\"&lt;\\|im_end\\|\\&gt;\\s*$\"\r\n# \u540c\u65f6\u76d1\u6d4b: &lt;tool_call&gt; \u6216 &lt;|im_end|&gt;\r\nclass RegexStoppingCriteria(StoppingCriteria):\r\ndef __init__(self, tokenizer, patterns):\r\nself.patterns = patterns\r\nself.tokenizer = tokenizer\r\ndef __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -&gt; bool:\r\ndecoded_text = self.tokenizer.decode(input_ids[0])\r\nfor pattern in self.patterns:\r\nif re.search(pattern, decoded_text, re.DOTALL):\r\nreturn True\r\nreturn False\r\nstopping_criteria = StoppingCriteriaList([\r\nRegexStoppingCriteria(\r\ntokenizer,\r\npatterns=[tool_call_regex, end_regex]\r\n)\r\n])\r\n#model.generate(..., stopping_criteria=stopping_criteria) # \u52a0\u4e0a\u505c\u6b62\u7b26\r\n<\/code><\/pre>\n<ul>\n<li><strong>\u7f51\u7edc\u641c\u7d22 API<\/strong>\uff1a\n<p>\u672c\u5b9e\u8df5\u4e2d\u4f7f\u7528\u7684\u641c\u7d22 API \u4e3a Tavily API\uff0c\u8be5 API \u63d0\u4f9b\u4e00\u5b9a\u7684\u514d\u8d39\u989d\u5ea6\uff0c\u65b9\u4fbf\u5b9e\u9a8c\u548c\u590d\u73b0\u3002Tavily API \u5141\u8bb8\u5f00\u53d1\u8005\u901a\u8fc7\u7b80\u5355\u7684 API \u8c03\u7528\uff0c\u5c06\u7f51\u7edc\u641c\u7d22\u529f\u80fd\u96c6\u6210\u5230\u81ea\u5df1\u7684\u5e94\u7528\u4e2d\u3002<\/li>\n<\/ul>\n<h3>\u5b9e\u8df5\u4ee3\u7801<\/h3>\n<p>\u8be6\u7ec6\u7684\u5b9e\u8df5\u4ee3\u7801\uff0c\u8bf7\u53c2\u8003\u4ee5\u4e0b\u94fe\u63a5\uff1a<\/p>\n<p><a href=\"https:\/\/github.com\/Paul33333\/experimental-notebook\/blob\/main\/DeepSearch%25E5%25A4%258D%25E7%258E%25B0%25E7%25AF%2587%25EF%25BC%259AQwQ_32B_ToolCall%25E5%258A%259F%25E8%2583%25BD%25E5%2588%259D%25E6%258E%25A2%25EF%25BC%258C%25E4%25BB%25A5Agentic_RAG%25E4%25B8%25BA%25E4%25BE%258B.ipynb\">DeepSearch\u590d\u73b0\u7bc7\uff1aQwQ-32B ToolCall\u529f\u80fd\u521d\u63a2\uff0c\u4ee5Agentic RAG\u4e3a\u4f8b.ipynb<\/a><\/p>\n<h3>\u6d4b\u8bd5\u6848\u4f8b<\/h3>\n<p><strong>\u6d4b\u8bd5\u95ee\u9898<\/strong>\uff1a\u8bf7\u7ed9\u6211\u8be6\u7ec6\u4ecb\u7ecd\u4e0b\u963f\u91cc\u6700\u8fd1\u5f00\u6e90\u53d1\u5e03\u7684 QwQ-32B \u6a21\u578b\u7684\u76f8\u5173\u4fe1\u606f\u3002<\/p>\n<p><strong>\u751f\u6210\u7ed3\u679c<\/strong>\uff1a\uff08\u5b8c\u6574\u751f\u6210\u7ed3\u679c\u8be6\u89c1 notebook\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28784\" title=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-3\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/7a838e98b513191.jpg\" alt=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-3\" width=\"1440\" height=\"739\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/7a838e98b513191.jpg 1440w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/7a838e98b513191-768x394.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/7a838e98b513191-18x9.jpg 18w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28782\" title=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-4\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/0a043ad18e517ec.jpg\" alt=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-4\" width=\"1440\" height=\"749\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/0a043ad18e517ec.jpg 1440w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/0a043ad18e517ec-768x399.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/0a043ad18e517ec-18x9.jpg 18w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28783\" title=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-5\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/ffccf8080820002.jpg\" alt=\"[\u8f6c\u8f7d]QwQ-32B \u7684\u5de5\u5177\u8c03\u7528\u80fd\u529b\u53ca Agentic RAG \u5e94\u7528-5\" width=\"1440\" height=\"749\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/ffccf8080820002.jpg 1440w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/ffccf8080820002-768x399.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/ffccf8080820002-18x9.jpg 18w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><\/p>\n<p>\u4ece\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0c\u63a8\u7406\u6a21\u578b\u81ea\u4e3b\u5b8c\u6210\u4e86\u610f\u56fe\u7406\u89e3\uff08\u5224\u65ad\u662f\u5426\u9700\u8981\u8054\u7f51\u641c\u7d22\uff09\u548c\u641c\u7d22\u5173\u952e\u8bcd\u751f\u6210\uff08\u95ee\u9898\u6539\u5199\u6216\u62c6\u5206\uff09\u3002\u6a21\u578b\u8fd8\u8003\u8651\u5230\u4e86\u6f5c\u5728\u7684\u591a\u8f6e\u641c\u7d22\u573a\u666f\u3002\u5728\u89e6\u53d1\u4e86\u4e00\u6b21\u00a0<code>web search<\/code>\u00a0\u540e\uff0c\u6a21\u578b\u6839\u636e\u641c\u7d22\u7ed3\u679c\u751f\u6210\u4e86\u6700\u7ec8\u62a5\u544a\u3002<\/p>\n<p>\u672c\u6848\u4f8b\u4e2d\uff0c\u6a21\u578b\u4ec5\u5b8c\u6210\u4e86\u4e00\u6b21\u641c\u7d22\u63a5\u53e3\u8c03\u7528\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u6848\u4f8b\u95ee\u9898\u8f83\u4e3a\u7b80\u5355\uff0c\u4e5f\u53ef\u80fd\u662f\u57fa\u5ea7\u6a21\u578b\u7684\u80fd\u529b\u5c1a\u4e0d\u8db3\u4ee5\u89e6\u53d1\u590d\u6742\u7684\u591a\u8f6e\u641c\u7d22\u3002\u8fd9\u4e5f\u8bf4\u660e\u8981\u5145\u5206\u53d1\u6325\u6a21\u578b\u4f5c\u4e3a\u667a\u80fd\u4f53\u7684\u6f5c\u529b\uff0c\u8fd8\u662f\u6709\u5fc5\u8981\u53c2\u8003 Search-R1 \u8fdb\u884c\u540e\u8bad\u7ec3(Post Training)\uff0c\u9488\u5bf9\u6027\u5730\u8fdb\u884c\u5fae\u8c03\u3002<\/p>\n<p>\u4e0d\u8fc7\uff0c\u4ece QwQ-32B \u6a21\u578b\u5df2\u7ecf\u5c55\u73b0\u7684\u80fd\u529b\u6765\u770b\uff0c\u7ed3\u5408\u7cbe\u5fc3\u8bbe\u8ba1\u7684\u5408\u6210\uff08\u6216\u4eba\u5de5\u6574\u7406\uff09\u7684\u518d\u8bad\u7ec3\u6570\u636e\uff0c\u4ee5\u53ca\u7ec6\u5206\u573a\u666f\u4e0b\u7684\u518d\u6b21\u5f3a\u5316\u8bad\u7ec3\u6216 SFT\uff0c\u5e76\u63a9\u7801\u6389\u5de5\u5177\u63a5\u53e3\u54cd\u5e94\u8fd4\u56de\u7684\u8f93\u51fa <a href=\"https:\/\/www.kdjingpai.com\/de\/tokenization\/\">token<\/a> \u5bf9\u5e94\u7684\u635f\u5931 (loss)\uff0c\u8fd9\u79cd\u518d\u8bad\u7ec3\u8def\u7ebf\u6709\u671b\u6210\u4e3a\u672a\u6765\u667a\u80fd\u4f53\u5f00\u53d1\u548c\u90e8\u7f72\u7684\u4e3b\u6d41\u3002\u901a\u8fc7\u518d\u8bad\u7ec3\uff0c\u53ef\u4ee5\u9884\u5148\u8003\u8651\u5404\u79cd\u884c\u52a8\u548c\u8fb9\u754c\u60c5\u51b5\uff0c\u4f7f\u5f97\u90e8\u7f72\u66f4\u52a0\u7b80\u5355\uff0c\u4e0d\u518d\u9700\u8981\u4eba\u4e3a\u7f16\u6392\u8bbe\u8ba1\u5de5\u4f5c\u6d41\u3002Search-R1 \u8bba\u6587\u4e2d 3.1 \u8282\u8be6\u7ec6\u4ecb\u7ecd\u4e86&#8221;Loss Masking for Retrieved Tokens&#8221; \u6280\u672f\u3002\u901a\u8fc7\u5728 PPO \u548c <a href=\"https:\/\/www.kdjingpai.com\/de\/grpo-ruhezaishi\/\">GRPO<\/a> \u4e2d\uff0c\u5bf9\u68c0\u7d22\u5230\u7684 <a href=\"https:\/\/www.kdjingpai.com\/de\/tokenization\/\">Tokens<\/a> \u8fdb\u884c\u635f\u5931\u5c4f\u853d\uff0cSearch-R1 \u4f18\u5316\u4e86 LLM \u751f\u6210 Tokens\uff0c\u589e\u5f3a\u6a21\u578b\u4e0e\u641c\u7d22\u5f15\u64ce\u4ea4\u4e92\u548c\u6267\u884c\u63a8\u7406\u7684\u80fd\u529b\u3002<\/p>\n<p>\u6b64\u5916\uff0cSearch-R1 \u8fd8\u652f\u6301\u591a\u8f6e\u68c0\u7d22\u548c\u63a8\u7406\uff08\u8bba\u6587\u4e2d 3.2 \u8282 &#8220;Text Generation with Interleaved Multi-turn Search Engine Call&#8221;\uff09\uff0c\u901a\u8fc7\u00a0<code>&lt;search&gt;<\/code>\u00a0\u548c\u00a0<code>&lt;\/search&gt;<\/code>\u00a0\u89e6\u53d1\uff0c\u5e76\u5c06\u68c0\u7d22\u5230\u7684\u5185\u5bb9\u653e\u5230\u00a0<code>&lt;information&gt;<\/code>\u00a0\u548c\u00a0<code>&lt;\/information&gt;<\/code>\u00a0\u4e4b\u95f4\u3002\u800c\u6700\u7ec8\u7b54\u6848\u7684\u8f93\u51fa\uff0c\u5219\u4f7f\u7528\u00a0<code>&lt;answer&gt;<\/code>\u00a0\u548c\u00a0<code>&lt;\/answer&gt;<\/code>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u8fd1\u671f\uff0c\u4e00\u7bc7\u540d\u4e3a\u00a0Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learning\u00a0\u7684\u8bba\u6587 (arxiv.org\/pdf&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-28779","post","type-post","status-publish","format-standard","hentry","category-knowledge"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/28779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/comments?post=28779"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/28779\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media?parent=28779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/categories?post=28779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/tags?post=28779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}