<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>面经 on 多辣加香菜</title>
    <link>http://xilyfeAAAA.github.io/series/%E9%9D%A2%E7%BB%8F/</link>
    <description>Recent content in 面经 on 多辣加香菜</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Mon, 27 Apr 2026 11:13:51 +0800</lastBuildDate>
    <atom:link href="http://xilyfeAAAA.github.io/series/%E9%9D%A2%E7%BB%8F/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>RL训推不一致的原因 &amp; 解决方案</title>
      <link>http://xilyfeAAAA.github.io/posts/rl-inconsistent/</link>
      <pubDate>Sun, 26 Apr 2026 15:31:35 +0800</pubDate>
      <guid>http://xilyfeAAAA.github.io/posts/rl-inconsistent/</guid>
      <description>&lt;h2 id=&#34;1-问题&#34; class=&#34;headerLink&#34;&gt;&#xA;    &lt;a href=&#34;#1-%e9%97%ae%e9%a2%98&#34; class=&#34;header-mark&#34;&gt;&lt;/a&gt;1. 问题&lt;/h2&gt;&lt;p&gt;随着现在强化学习训练的规模越来越大，大部分的公司都把强化学习的 inference 和 training 分为两个部分。在 inference 或者说 rollout 阶段，我们用推理引擎（vllm/sglang）。它带来了 paged attention、kv cache 和其它优化过的 kernal 以及特定的浮点精度设置（例如 BF16、FP8 等），我们追求快速生成与高 throughput。然后在梯度更新阶段采用训练引擎（fsdp/megatron）等等，它采用的分布式框架可以提高训练规模，我们关注数值稳定性与精确梯度计算，并可能采用不同的浮点精度和算子实现。但是由于两部分用不同框架进行训练，推理引擎和训练引擎对同一个 prompt 计算得到的 logprobs 不一致，就导致了 on-policy 变成了 off-policy，我们用于训练的数据不是真的有模型自己生成了。这种微小差异在监督学习里可能不会显著，但在 RL 中会被放大，因为强化学习依赖概率比率来估计梯度。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
