<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mengliu Zhao on Medium]]></title>
        <description><![CDATA[Stories by Mengliu Zhao on Medium]]></description>
        <link>https://medium.com/@mengliuz?source=rss-6db175d93233------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*siAyGzGqa7K3xsa639R_2w.jpeg</url>
            <title>Stories by Mengliu Zhao on Medium</title>
            <link>https://medium.com/@mengliuz?source=rss-6db175d93233------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:15:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mengliuz/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Inside Kimi K3 Technical Report]]></title>
            <link>https://pub.towardsai.net/inside-kimi-k3-technical-report-aa7a9e671de7?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa7a9e671de7</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Thu, 30 Jul 2026 00:01:02 GMT</pubDate>
            <atom:updated>2026-07-30T00:01:02.618Z</atom:updated>
            <content:encoded><![CDATA[<h4>The success of linear attention and the new era of scaling</h4><p>Kimi-series latest model, K3, got scaled up to 2.8 trillion parameters. <em>Impressive.</em></p><p>Moonshot AI’s <a href="https://arxiv.org/pdf/2607.24653">Kimi K3 technical report</a> opens with a model that is, on paper, almost three times the size of Kimi K2–2.8T total parameters, 104B activated, a 1M-token context window, and native vision. The loss comparison shows a 2.5X scaling efficiency over Kimi K2 — just another proof that the scaling law still has its room. However, the scaling law itself is just a piece of evidence on “what works” — but the underlying question, “how things work”, is the actual key in the report.</p><p>In this article, I’ll walk through four architectural ideas that make Kimi K3’s scale tractable:</p><ul><li><strong>Core attention architectures</strong>: Linear attention with <strong>Kimi Delta Attention</strong> (KDA) and <strong>Gated MLA</strong> with NoPE</li><li><strong>Attention residuals</strong> across depth</li><li><strong>Latent MoE</strong> with quantile-based load balancing</li><li>And a <strong>vision tower</strong> trained without any contrastive pre-training</li></ul><p>Then close with the infrastructure co-design that had to happen alongside all of it, continuing a trend that started with <a href="https://arxiv.org/html/2412.19437">DeepSeek V3</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Er4_N87_0z9Ax3Ah" /><figcaption>Image source: <a href="https://tinyurl.com/mu6ezvf3">https://tinyurl.com/mu6ezvf3</a>. Author: Zetong Li</figcaption></figure><h3><strong>Core attention architectures</strong></h3><p>The core attention layer is made of 3 KDA layers + 1 Gated MLA layer, each followed by a stable latentMoE layer (which we’ll talk about laer). First, we’ll explain the KDA layer.</p><h4>Kimi Delta Attention (KDA)</h4><p>Kimi K3 doesn’t use classical multi-head attention as its default sequence mixer. Instead, three out of every four attention layers are <strong>Kimi Delta Attention (KDA)</strong>, a linear attention mechanism first proposed in Kimi Linear (2025) and directly descended from <strong>Gated DeltaNet</strong>.</p><p>The DeltaNet idea is simple: to address the underperforming issue caused by the vanilla linear attention design, a delta rule based on generalized Householder transformation was proposed to update the linear recurrence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qV2hm3RxpsXuH6BkbbPeVg.png" /><figcaption>DeltaNet update rule. Equation source: <a href="https://arxiv.org/pdf/2510.26692">https://arxiv.org/pdf/2510.26692</a></figcaption></figure><p>Then Gated DeltaNet further added a scalar forget gate to further stabilize the learning process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*cf-3ESjW7B5pxOhY1yD9bw.png" /><figcaption>Gated DeltaNet update rule. Equation source: <a href="https://arxiv.org/pdf/2510.26692">https://arxiv.org/pdf/2510.26692</a></figcaption></figure><p>Which <strong>Kimi Delta Attention (KDA)</strong> further added a diagonalized gate to enable fine-grained control of the decay:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*_Y2GyqgI1HhD2koufz7vIw.png" /><figcaption>KDA update rule. Equation source: <a href="https://arxiv.org/pdf/2510.26692">https://arxiv.org/pdf/2510.26692</a></figcaption></figure><p>To improve computational efficiency, KDA could be further rewritten into a <a href="https://arxiv.org/pdf/2510.26692">chunk-wise parallel format</a> (which is a typical format for linear attention computation). To address the precision overflow issue, a negative-softplus mapping is introduced to bound the decay logits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*LfwgRs8IGDmsoTq2RAiWpg.png" /><figcaption>Attention with KDA. Image source: <a href="https://arxiv.org/pdf/2607.24653">https://arxiv.org/pdf/2607.24653</a></figcaption></figure><h4>Gated MLA &amp; No Position Encoding (NoPE)</h4><p>The <strong>Multi-head Latent Attention (MLA) </strong>is a<strong> </strong>mechanism <a href="https://arxiv.org/abs/2405.04434">DeepSeek-V2</a> introduced to shrink the KV cache by compressing keys and values into a shared low-rank latent before reconstructing per-head projections at attention time. While classical MLA applies RoPE to inject positional information, Kimi K3 drops this entirely — its MLA layers use <strong>NoPE (No Position Encoding)</strong>. The reasoning is architectural: the KDA layers already provide position-sensitive, recency-aware mixing through their recurrent decay, so the MLA layers are freed up to do what they’re best at. It also sidesteps a very practical long-context headache: <em>no RoPE frequency base to retune, no YaRN interpolation needed when extending context length</em>, since there’s no rotary embedding to extrapolate in the first place. On top of this, K3 adds a full-rank, input-dependent output gate to MLA (mirroring a similar gate added to KDA), letting each token modulate which channels it reads from global attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*8z6OZ93FSrdqQXFQw6mMmg.png" /><figcaption>Multi-head latent attenion from DeepSeek paper. Image source: <a href="https://arxiv.org/html/2412.19437">https://arxiv.org/html/2412.19437</a></figcaption></figure><h3>Attention Residuals: Treating Depth Like a Sequence</h3><p>This is probably one of the most interesting concepts proposed by the technical report: similar to how transformers addressed sequential dependencies with attention, the <strong>Attention Residual</strong> attempts to formulate the residuals in attention format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*c5SGx5wvgTJe9jaWULlJmw.png" /><figcaption>Duality of depth and residual. Equation source: <a href="https://arxiv.org/pdf/2603.15031">https://arxiv.org/pdf/2603.15031</a></figcaption></figure><p>When moving into Kimi K3 architecture, it means calculating the residual per-pair of layers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*xhLa1FKjTwdaJ08Wr4bmvQ.png" /><figcaption>Full attention residual definition. Equation source: <a href="https://arxiv.org/pdf/2607.24653">https://arxiv.org/pdf/2607.24653</a></figcaption></figure><p>Given the model depth &lt; 100, the full computation cost is O(L²d), which is still affordable, and can be reduced if the residual is computed in a block-wise style.</p><p>So why adding residuals in such a layer-wise style? The reason is simple — Kimi K3 scaled the number of layers up to 93, comparing Kimi K2 which only has 61 layers. The 52% incease of model layers causes a huge bottleneck on gradient backpropagation — which cannot be resolved by classical skip connection, and needs more dense representation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*0WzZyiSmBpFfqq-zISyoqQ.png" /><figcaption>Full Attention residual representation. Image source: <a href="https://arxiv.org/pdf/2603.15031">https://arxiv.org/pdf/2603.15031</a></figcaption></figure><h3>Stable LatentMoE: Scaling to ~1,000 Experts Without Losing Balance</h3><p>Kimi K3 pushes the number of experts in its MoE architecture much further — 896 routed experts with 16 activated per token (versus K2’s 384 routed / 8 active) — and that 133% extra jump in sparsity breaks two things that used to work fine at smaller scale.</p><p>The architectural fix is <strong>LatentMoE</strong>: shared experts still operate on the model’s full hidden width, but routed experts operate in a much narrower latent space, reached via a down-projection before dispatch and an up-projection after aggregation. This decouples the router’s cost from the full model width, which is what makes activating 16 of 896 experts per token affordable at all.</p><p>The stability problems remain, though. Kimi K3 addresses this two approaches: i) with an RMSNorm before the up-projection + a new activation function, <strong>SiTU-GLU</strong> (Sigmoid Tanh Unit GLU), which soft-caps both branches of a SwiGLU-style gate with a scaled tanh — keeping the near-origin behaviour that makes SwiGLU work well, while bounding the output so large-magnitude coordinates can’t blow up in low precision; ii) <strong>Quantile Balancing</strong>: directly sets the expert bias to the score-quantile that would deliver that expert its <em>target</em> load, estimated per training step from a histogram of routing margins (to avoid gathering millions of individual values for an exact quantile).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*rnZJwTyFwaX715Umr05XIQ.png" /><figcaption>Shared and routed MoE design. Image source: <a href="https://arxiv.org/pdf/2607.24653">https://arxiv.org/pdf/2607.24653</a></figcaption></figure><h3>A Vision Tower That Doesn’t Need Contrastive Pre-training</h3><p>One of the more surprising empirical results in the report has nothing to do with attention or MoE. Kimi K2.5’s vision encoder, like most multimodal LLM vision towers, was initialized from a contrastively pre-trained model (SigLIP), on the assumption that contrastive pre-training gives the encoder useful visual priors before it’s ever attached to a language model.</p><p>Kimi K3’s vision encoder, <strong>MoonViT-V2</strong>, is trained <em>entirely from scratch using next-token prediction </em>— no contrastive stage at all. The stated motivation is training stability: when a SigLIP-initialized encoder is jointly optimized with the LLM, gradient norms spike persistently, while the from-scratch encoder trains smoothly throughout. The more interesting finding is the downstream one — MoonViT-V2 <em>matches</em> the SigLIP-initialized baseline across vision benchmarks, which the authors read as evidence that contrastive pre-training isn’t actually a necessary ingredient for a strong multimodal LLM vision encoder, at least at this scale and with enough NTP-style multimodal data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ig3J-n7-2WA-ViLDUJgKAQ.png" /><figcaption>The Model design overall. Image source: <a href="https://arxiv.org/pdf/2607.24653">https://arxiv.org/pdf/2607.24653</a></figcaption></figure><h3>The Real Trend: Infrastructure Is No Longer a Separate Layer</h3><p>Here’s the pattern that ties the whole report together, and it’s the same one DeepSeek V3 first made explicit: at frontier scale, infrastructure isn’t a neutral platform you deploy a model onto — it has to be co-designed with the specific bottlenecks the architecture creates. <a href="https://arxiv.org/html/2412.19437">DeepSeek V3</a>’s DualPipe was built to solve a communication overhead problem created by its own MoE design. Kimi K3 does the same thing in several places at once:</p><ul><li><strong>KDA’s serial recurrence</strong> is only <em>partially</em> parallelizable — the chunkwise form still has a serial cross-chunk dependency that leaves GPU SMs idle during state propagation. Kimi K3 addresses this with a dedicated CUTLASS-based kernel, <strong>FlashKDA</strong>, that overlaps intra-chunk computation with cross-chunk propagation rather than letting the two phases alternate and stall.</li><li><strong>Long-context communication</strong>: rather than exchanging key-value blocks that grow with sequence length (as softmax-attention context parallelism does), <strong>KDA Context Parallelism</strong> exploits the fact that KDA’s state is fixed-size, decomposing each segment’s effect into a locally-computable cumulative transition plus a locally-generated state. The result is that synchronizing state across ranks only ever requires a <strong>fixed-size all-gather</strong>, regardless of sequence length — a much cheaper communication profile than block-based context parallelism scales to.</li><li><strong>Expert-parallel load balance</strong>: the MoE-side counterpart, <strong>MoonEP</strong>, targets <em>perfect</em> load balance across expert-parallel ranks using dynamically planned redundant experts, rather than tolerating the imbalance that conventional EP schemes leave on the table — imbalance that gets more costly, not less, as the routed expert pool grows toward the thousand-expert range.</li><li><strong>Memory management</strong>: block-wise FP8 quantization for most activations, remote offloading of activations across pipeline-parallel ranks (to correct for the uneven activation distribution that interleaved 1F1B scheduling produces), and a companion checkpointing strategy specifically for Block AttnRes so its extra cross-layer reads don’t blow the activation memory budget.</li></ul><h3>Summary</h3><p>Kimi K3 is not only a model that scaled up. The scaling effort itself is a combination of a series of research results together with infra practices, which made the scaling possible. It also proved a few things:</p><ul><li>Scaling law hasn’t hit its upper ceiling yet — however, the technique to scale is more important than parameter scaling itself</li><li>Linear attention has proved its worth — Kimi K3 is the first and largest public model built with pure linear attention, which might indicate we’re into a new era where softmax attention will not dominate the LLM ecosystem</li><li>The infra capability has never been so important in research — however, the problem it resolves doesn’t exist independently without research itself.</li></ul><h3>References</h3><ul><li>Kimi Team, <em>Kimi K3: Open Frontier Intelligence</em>, Technical Report, arXiv:2607.24653, 2026.</li><li>Kimi Team, <em>Kimi Linear: An Expressive, Efficient Attention Architecture</em>, 2025.</li><li>Yang et al., <em>Gated Delta Networks: Improving Mamba2 with Delta Rule</em>, arXiv 2024.</li><li>DeepSeek-AI, <em>DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model</em>, arXiv 2024.</li><li>DeepSeek-AI, <em>DeepSeek-V3 Technical Report</em>, arXiv 2024.</li><li>Dai et al., <em>DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models</em>, arXiv 2024.</li><li>Kimi Team, <em>Kimi K2: Open Agentic Intelligence</em>, Technical Report, 2025.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa7a9e671de7" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/inside-kimi-k3-technical-report-aa7a9e671de7">Inside Kimi K3 Technical Report</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Walkthrough — Geometrically-Constrained Agent for Spatial Reasoning]]></title>
            <link>https://pub.towardsai.net/paper-walkthrough-geometrically-constrained-agent-for-spatial-reasoning-f8d42c61f644?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8d42c61f644</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[multimodal]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 10:02:46 GMT</pubDate>
            <atom:updated>2026-07-12T13:48:59.231Z</atom:updated>
            <content:encoded><![CDATA[<h4>How a formal task constraint bridges the semantic-to-geometric gap in spatial reasoning VLMs</h4><p><em>Can a vision-language model (VLM) imagine sitting on a sofa and see where the coffee is?</em></p><p>Logically, it’s possible — work out the sofa’s orientation, rotate its imagined viewpoint accordingly, and locate the coffee table relative to that viewpoint — but it falls apart in reality. The classical ReAct loop has no built-in mechanism to fix that ambiguity before acting on it.</p><p>This is not a knowledge problem. It’s a <strong>translation</strong> problem.</p><p>A new CVPR 2026 paper, <em>Geometrically-Constrained Agent for Spatial Reasoning</em> (GCA), introduces a <strong>formal task constraint that the VLM must generate and commit to</strong> before any computation begins, splitting the process into a semantic formalization stage and a constrained execution stage. Notably, this is a training-free paradigm — no fine-tuning, no new dataset, no gradient updates to the VLM or the tools it calls. Instead of teaching the model to ground geometry correctly through weight updates, GCA restructures the <em>prompting</em>: the constraint does what fine-tuning would otherwise have to do, forcing an explicit commitment to the reference frame and objective before any tool call occurs. This lets the same off-the-shelf VLM be dropped in as the backbone, with the reasoning discipline coming entirely from the two-stage structure rather than from what the model has learned.</p><p>In this article, we’ll walk through:</p><ul><li><strong>The formal task constraint C_task</strong> — a two-part contract (reference frame + objective) that separates <em>what to solve</em> from <em>how to solve it</em></li><li><strong>Constrained geometric computation</strong> — how the agent turns that contract into tool calls, closed-loop ambiguity resolution, and knowledge-augmented code generation</li><li><strong>Results and takeaways</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D4FSMO45a54-xptc" /><figcaption>Image source: <a href="https://tinyurl.com/36n8jh64">https://tinyurl.com/36n8jh64</a>. Author: <strong>Junel Mujar</strong></figcaption></figure><h3>The formal task constraint C_task</h3><p>GCA’s core idea is to decouple the VLM reasoning into two roles, connected by an explicit, machine-readable contract:</p><pre>C_task ← F_formalize(q, v)<br>r_t = F_compute(C_task, T, r_{t-1})</pre><p><strong>Stage 1 — Task Formalization.</strong> The VLM acts as a <em>semantic analyst</em>. Given the ambiguous natural-language query q and the visual input v, it doesn&#39;t try to answer the question — it defines the question. Take the earlier sofa example: before calling a single tool, the VLM has to explicitly resolve what &quot;relative to you&quot; means geometrically (the sofa&#39;s facing direction, not the camera&#39;s) and what&#39;s actually being measured (the table&#39;s position within that frame). The output isn&#39;t a number — it&#39;s a spec: C_task = (C_R, C_O), a reference frame constraint plus an objective constraint, written down and fixed before any computation begins. Once committed, this contract can&#39;t be silently reinterpreted later — which is exactly what prevents the agent from defaulting to the camera&#39;s viewpoint mid-computation.</p><p><strong>Stage 2 — Constrained Geometric Computation.</strong> The VLM switches to <em>task solver</em>, generating and executing tool calls, but strictly within the deterministic bounds that have C_task just been laid down. Back to the sofa example: by this point, C_R has already fixed the reference frame to the sofa&#39;s facing direction, and C_O has already fixed the target as the table&#39;s position within that frame — neither is up for renegotiation anymore. So this stage isn&#39;t about reasoning over what the question means; it&#39;s a fairly mechanical loop of detecting the sofa, segmenting it, estimating its orientation, doing the same for the table, and running the coordinate transform between them. If the detector returns two tables, the VLM still has to pick the right one — but it&#39;s resolving <em>which object</em> satisfies the objective, not <em>what the objective is</em>. That distinction is what keeps a noisy tool call from quietly drifting the agent off the problem C_task already defined.</p><h4>Reference Frame Constraint (C_R)</h4><p>This is the non-negotiable coordinate system against which everything else is measured: an origin plus three orthogonal basis vectors, following the OpenCV convention (+z forward, +y down, +x right-hand rule). GCA anchors the reference frame to one of three geometric primitives extracted from the scene:</p><ul><li><strong>Object-based frame</strong> — anchored to an object’s own orientation. “When washing hands” implies +z_R = −z_sink, since you face the sink to use it.</li><li><strong>Camera-based frame</strong> — anchored to a specific camera’s viewpoint. “From the viewpoint of Figure 1” gives +z_R = +z_cam1.</li><li><strong>Direction-based frame</strong> — anchored to a vector between two locations. “Owen is north of sink” gives +z_R = normalize(Centroid(owen) − Centroid(sink)).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m74IH4FVkRvpkMO2m-23jA.png" /><figcaption>Reference frames. Image source: <a href="https://arxiv.org/abs/2511.22659">https://arxiv.org/abs/2511.22659</a></figcaption></figure><h4>Objective Constraint (C_O)</h4><p>Once the reference frame is pinned down, C_O defines <em>what</em> needs to be measured inside it. For “Is the chair to the west of the toaster?”, the toaster anchors C_R, and the chair-toaster positional relationship is C_O. Splitting the query this way means the VLM answers two much simpler questions — “what’s my frame?” and “what am I measuring in it?” — instead of one entangled, ambiguous one.</p><p>Because the VLM is only asked to interpret language qualitatively here (not compute anything numerically), this stage plays to its actual strength. The paper reports that the formalization step alone achieves roughly 70% accuracy — the bottleneck isn’t understanding the query; it’s what happens after.</p><h3>Constrained geometric computation</h3><p>With C_task is fixed, the VLM becomes a task solver operating within a ReAct-style loop, but every step is now checked against an immutable contract rather than being free-form.</p><p><strong>Data acquisition.</strong> C_task specifies exactly which geometric ingredients are needed — e.g., instantiating an object-based frame anchored to a sink requires that sink&#39;s orientation. The agent generates tool calls to acquire precisely those variables, nothing more, nothing improvised.</p><p><strong>Ambiguity resolution.</strong> Real scenes are messy. If C_O denotes “the leftmost chair” and the detector returns five chair boxes, the VLM must examine the visualized detections and select the correct index. This closed-loop step keeps noisy perception outputs from silently corrupting the final computation — but crucially, the resolution still has to remain faithful to what C_task originally asked for.</p><p><strong>Knowledge-augmented code generation.</strong> Rather than trusting the VLM to recall complicated 3D transformation formulas from memory — a classic hallucination trap — GCA maintains a fixed, pre-verified library of geometric formulas (e.g., local-to-world transforms). Once all variables are bound, the system retrieves the relevant formula set based on the data types involved and injects it directly into the code generator’s context, functioning as a static retrieval-augmented generation system for math rather than text. The VLM then writes and executes Python against that scaffolding, rather than producing a black-box numeric guess.</p><p>The toolbox behind all this splits into two families: <strong>geometry/perception tools</strong> (3D reconstruction via VGGT, open-vocabulary object detection, segmentation) that parameterize the visual world, and <strong>computation/utility tools</strong> (a Python sandbox, coordinate-projection utilities) that turn those parameters into a final deterministic answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZi1fpOc-s_DVuVjEP6uiA.png" /><figcaption>Overal GCA pipeline. Image source: <a href="https://arxiv.org/abs/2511.22659">https://arxiv.org/abs/2511.22659</a></figcaption></figure><h3>Does it actually work?</h3><p>Tested with Qwen3-VL-Thinking as the backbone VLM across five spatial reasoning benchmarks (MMSI-Bench, MindCube-tiny, OmniSpatial, SPBench, CV-Bench), GCA lands a new state of the art, beating the strongest foundation-model baseline (Gemini-2.5-Pro) by roughly 12% and outperforming training-based specialists like SpatialLadder by around 27% and tool-integrated agents like TIGeR by around 38%.</p><p>The gap is most dramatic on the hardest, multi-step benchmarks. On MMSI-Bench — a 4-choice benchmark where most competing VLMs barely clear the 25% random-guess floor — GCA reaches 47.6%, a 28% relative jump over Gemini-2.5-Pro. The authors attribute this directly to C_task: it prevents the model from defaulting to a flawed semantic shortcut (such as assuming &quot;your perspective&quot; means the camera&#39;s) before any real computation has begun.</p><p>GCA also generalizes well across backbones — GLM-4.5V, GPT-4o, and Gemini-2.5-Pro all improve over their own chain-of-thought baselines, with gains from +19% (GPT-4o) up to +49% (Gemini-2.5-Pro) on MMSI-Bench, roughly tracking each model’s baseline agentic and spatial competence.</p><h4>Takeaways</h4><p>The core lesson here generalizes beyond spatial reasoning: when a model’s failure comes from solving an ill-posed problem correctly rather than solving a well-posed problem incorrectly, more training data or bigger tools won’t fix it. What actually helps is forcing the model to <em>externalize its own problem definition</em> into something verifiable, before it’s allowed to compute anything at all. GCA is training-free, which means this fix is architectural rather than statistical — and the fact that it transfers cleanly across four very different foundation VLMs suggests the semantic-to-geometric gap really is a structural issue with how these models are asked to reason, not a gap any single model’s weights happen to have.</p><h3>References</h3><p>Chen Z. et al., “Geometrically-Constrained Agent for Spatial Reasoning.” CVPR 2026.</p><p>Yang S. et al., “MMSI-Bench: A Benchmark for Multi-Image Spatial Intelligence.” arXiv preprint, 2025.</p><p>Yin B. et al., “Spatial Mental Modeling from Limited Views.” Structural Priors for Vision Workshop at ICCV’25, 2025.</p><p>Jia M. et al., “OmniSpatial: Towards Comprehensive Spatial Reasoning Benchmark for Vision Language Models.” arXiv preprint, 2025.</p><p>Li H. et al., “SpatialLadder: Progressive Training for Spatial Reasoning in Vision-Language Models.” arXiv preprint, 2025.</p><p>Han Y. et al., “TIGeR: Tool-Integrated Geometric Reasoning in Vision-Language Models for Robotics.” arXiv preprint, 2025.</p><p>Yao S. et al., “ReAct: Synergizing Reasoning and Acting in Language Models.” ICLR 2022.</p><p>Wang J. et al., “VGGT: Visual Geometry Grounded Transformer.” CVPR 2025.</p><p>Liu B. et al., “LLM+P: Empowering Large Language Models with Optimal Planning Proficiency.” arXiv preprint, 2023.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8d42c61f644" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/paper-walkthrough-geometrically-constrained-agent-for-spatial-reasoning-f8d42c61f644">Paper Walkthrough — Geometrically-Constrained Agent for Spatial Reasoning</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Walkthrough — MACT: A Multi-Agent Collaboration Framework for Visual Document Understanding]]></title>
            <link>https://pub.towardsai.net/paper-walkthrough-mact-a-multi-agent-collaboration-framework-for-visual-document-understanding-12a907406a1b?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/12a907406a1b</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 05:30:28 GMT</pubDate>
            <atom:updated>2026-07-04T07:06:27.545Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>From one model doing everything to four specialists doing one thing well</em></h4><p>A financial report is not a photograph.</p><p>It is a stack of dense tables, cropped charts, multi-column text, and footnotes — all demanding a different kind of attention at every step. Reading it isn’t a single glance; it’s a <em>procedure</em>: figure out what’s being asked, decide where to look, extract the right numbers, check your own work, and only then answer.</p><p>Most large Vision-Language Models (VLMs) don’t work that way. They take a document and a question, run one forward pass, and hope the answer falls out. <strong>MACT</strong>, a CVPR 2026 paper from NUS, Tencent Youtu Lab, Tsinghua, and collaborators, argues that this “monolithic scaling” — just making the model bigger — is the wrong lever to pull for documents. Instead, MACT splits the job into four cooperating agents, each specialized for one cognitive step, and lets a smaller model beat much larger ones.</p><p>In this walkthrough, we’ll trace the full story: a) why bigger VLMs are hitting diminishing returns on documents, b) how MACT’s four agents divide the labor, c) how test-time compute is allocated differently to each of them, and d) how the reward signal is designed so the agents don’t just game their own local objective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cIRTjNaPr803cDi4" /><figcaption>Image source: <a href="https://tinyurl.com/yyybwe57">https://tinyurl.com/yyybwe57</a>. Author: Rafael Peier.</figcaption></figure><h3>Why Documents Break Monolithic Scaling</h3><p>Scaling up parameter count has been the default strategy for VLMs, and it works well for general vision-language tasks. But for document-based visual question answering (VQA), the paper shows that increasing parameter count yields only marginal gains, while computational cost grows exponentially.</p><p>The paper attributes this to three properties that documents have, and natural images mostly don’t:</p><ul><li><strong>Procedural reasoning.</strong> Answering a question about a document isn’t one action — it’s decomposing the question, forming a strategy, locating the right region, and synthesizing an answer. A single forward pass compresses all of that into one shot.</li><li><strong>Cognitive overload.</strong> Layout parsing, fine-grained text extraction, logical inference, and arithmetic are different skills. Forcing one set of weights to be good at all of them trades off depth for breadth.</li><li><strong>Vulnerability to factual errors.</strong> A single misread table cell or a truncated paragraph can invalidate the whole answer, and a monolithic feed-forward model has no way to catch its own mistake mid-reasoning.</li></ul><p>The proposed fix is a shift from <em>monolithic scaling</em> to what the authors call <strong>procedural scaling</strong>: decompose the workflow into functional roles, and scale each role independently, in a way that the role actually benefits from more compute.</p><h3>Four Agents, One Pipeline</h3><p>MACT decomposes document understanding into four collaborative agents, each handling one stage of the workflow:</p><p><strong>Planning Agent (𝒜_plan).</strong> Given the question and the document, this agent doesn’t just write one plan — it first generates several relevant reference plans for similar hypothetical tasks (inspired by analogical prompting), then uses those as scaffolding to produce the actual execution plan for the real question. The plan stays high-level: it states targets and requirements per step but doesn’t commit to specific tools or execution details, so it doesn’t box in the agent that has to actually do the work.</p><p><strong>Execution Agent (𝒜_exe).</strong> This agent walks through the plan step by step, treating each step as a unit with its own definition, expected output, and access to results from prior steps. It pulls tools from a shared tool library to actually extract information — OCR, cropping, table parsing, and so on — and passes along the full trace of what it did and found.</p><p><strong>Judgment Agent (𝒜_judg).</strong> This is the self-correction layer, and its design choice is the most interesting part of the paper. Rather than having the planning or execution agent grade its own homework, MACT uses a separate, independent judge that only assesses correctness — it never attempts a fix itself. If it finds a mistake, it flags which step failed, describes the mistake, and routes the problem back to whichever agent (planning or execution) is responsible, up to three correction rounds.</p><p><strong>Answer Agent (𝒜_ans).</strong> Once a plan-execution pair has passed judgment, this agent synthesizes the final answer — deliberately keeping both the corrected trace <em>and</em> the earlier incorrect attempts in context, so it can see exactly what changed rather than silently discarding the error-prone parts.</p><p>The reason for a <em>separate</em> judge is worth sitting with. The paper compares three self-correction designs: a) let the same agent correct itself internally, b) use one extra agent that both judges and corrects, and c) MACT’s approach — a judge that only judges. Options a) and b) share a weakness: whatever component is responsible for correction is being trained, via RL, toward “pass verification” as its objective. That creates an incentive to produce vague or incomplete fixes that look right on the surface but aren’t actually right. Separating judgment from correction removes that incentive from the judge, at the cost of needing four coordinated components instead of one or two.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxOf6n3RzYlz7K0Qd5LymA.png" /><figcaption>Independent judge agent design. Image source: <a href="https://arxiv.org/pdf/2508.03404">https://arxiv.org/pdf/2508.03404</a></figcaption></figure><h3>Agent-Wise Adaptive Test-Time Scaling</h3><p>The second pillar of MACT is that test-time compute isn’t spent the same way for every agent — each one gets a scaling strategy suited to its actual job:</p><ul><li>The <strong>planning agent</strong> scales by generating multiple relevant reference plans in parallel, increasing the odds that at least one reasoning path lines up with what the document actually contains.</li><li>The <strong>execution agent</strong> scales at the step level: for each execution step, it produces several candidate outputs, scores them with a pretrained reward model, and keeps only the top-scoring one before moving to the next step — rejecting the rest.</li><li>The <strong>judgment agent</strong> uses <em>budget forcing</em>: a minimum thinking-token budget is enforced, so if the agent tries to wrap up its reasoning too early, it’s pushed to keep reasoning until it hits the floor. Since judgment is the step most sensitive to catching subtle mistakes, more deliberation pays off disproportionately here.</li><li>The <strong>answer agent</strong>, whose job is mostly synthesis rather than search or verification, gets little benefit from extra test-time compute, so the paper doesn’t scale it aggressively.</li></ul><p>This matters because it directly counters a real failure mode of naive test-time scaling: pouring the same extra compute into every component regardless of whether that component actually benefits from it. The paper’s ablations show this agent-specific allocation beats parallel, sequential, hybrid, and internal (budget-forcing-everywhere) scaling strategies applied uniformly across the whole pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sFGu-i0YK3qebeT8mqF8PQ.png" /><figcaption>MACT overview with four different agent streams and test-time scaling. Image source: <a href="https://arxiv.org/pdf/2508.03404">https://arxiv.org/pdf/2508.03404</a></figcaption></figure><h3>Does the Decomposition Actually Help?</h3><p>The paper trains three variants of MACT on different base model families — Qwen2.5-VL, MiMo-VL, and InternVL3 — each kept under 30B total parameters, and evaluates on 15 benchmarks spanning document types (text, webpage, chart, table) plus general and mathematical reasoning, to check that the framework doesn’t just help documents at the expense of everything else.</p><p>The headline result: despite being smaller than 30B parameters, all three MACT variants outperform every open-source and closed-source model under 100B parameters that the paper tested, and beat their own base models by 9.9–11.5% on average across the 15 benchmarks. Compared against much larger monolithic models from the same family — Qwen2.5-VL-72B and InternVL3–78B — the MACT variants still come out ahead by 3.7–6.6% on average, with the widest margins showing up on the longest-context and most reasoning-heavy benchmarks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oeI205haxFVyvplJ4Ds-VA.png" /><figcaption>Three different comparison. Image source: <a href="https://arxiv.org/pdf/2508.03404">https://arxiv.org/pdf/2508.03404</a></figcaption></figure><h3>The Bigger Picture</h3><p>MACT’s core bet is that for a domain like document understanding — where the task is inherently a multi-step procedure rather than a single perceptual judgment — the right place to add capacity isn’t a bigger model, it’s more roles, and more targeted compute per role. That’s a different axis than the “just scale parameters” story that has dominated VLM progress, and the fact that a set of sub-30B-parameter agents can outperform 70–90B monolithic models on this specific class of task is a reasonable existence proof that procedural scaling is worth taking seriously — at least for tasks that are naturally sequential and self-checkable, which document QA clearly is.</p><h3><strong>References</strong></h3><ul><li>Yu X, Xu C, Chen Z, Zhang Y, Lu S, Yang C, Zhang J, Yan S, Hu X. <em>Visual Document Understanding and Reasoning: A Multi-Agent Collaboration Framework with Agent-Wise Adaptive Test-Time Scaling.</em> In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) 2026.</li><li>Xiaomi LL, Xia B, Shen B, Zhu D, Zhang D, Wang G, Zhang H, Liu H, Xiao J, Dong J, Zhao L. MiMo: Unlocking the Reasoning Potential of Language Model — From Pretraining to Posttraining. arXiv preprint arXiv:2505.07608. 2025 May 12.</li><li>Yang A, Li A, Yang B, Zhang B, Hui B, Zheng B, Yu B, Gao C, Huang C, Lv C, Zheng C. Qwen3 technical report. arXiv preprint arXiv:2505.09388. 2025 May 14.</li><li>Zhu J, Wang W, Chen Z, Liu Z, Ye S, Gu L, Tian H, Duan Y, Su W, Shao J, Gao Z. Internvl3: Exploring advanced training and test-time recipes for open-source multimodal models. arXiv preprint arXiv:2504.10479. 2025 Apr 14.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12a907406a1b" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/paper-walkthrough-mact-a-multi-agent-collaboration-framework-for-visual-document-understanding-12a907406a1b">Paper Walkthrough — MACT: A Multi-Agent Collaboration Framework for Visual Document Understanding</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Walkthrough — U-Mind: A Unified Framework for Real-Time Multimodal Interaction with…]]></title>
            <link>https://pub.towardsai.net/paper-walkthrough-u-mind-a-unified-framework-for-real-time-multimodal-interaction-with-c4a0dd2f8300?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4a0dd2f8300</guid>
            <category><![CDATA[reasoning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[multimodal]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 07:31:48 GMT</pubDate>
            <atom:updated>2026-06-30T03:44:44.365Z</atom:updated>
            <content:encoded><![CDATA[<h3>Paper Walkthrough — U-Mind: A Unified Framework for Real-Time Multimodal Interaction with Audiovisual Generation</h3><h4>Can a single model think, talk, gesture, and render video simultaneously, while knowing how to reason?</h4><p>How can an MLLM model think?</p><p>The Multi-modality LLM domain has been advancing rapidly in recent years, converging into two main styles: <a href="https://arxiv.org/pdf/2306.14795">LLM decoder-based style</a> and <a href="https://arxiv.org/pdf/2605.22344">DiT-based style</a>. While most commercial models (e.g., <a href="https://seedancev2.ai/">Seedance</a>) leverage the DiT architecture, it remains an open problem how to inject “reasoning” into the model. On the other hand, the research community actively explores LLM decoder-based models, which make direct reasoning plausible. For example, <a href="https://arxiv.org/pdf/2306.14795">MotionGPT</a> (NeurIPS’ 23) defines 15 core motion tasks to support the instruction-tuning stage for &lt;text, motion&gt; pairs, while <a href="https://arxiv.org/pdf/2412.00174">SOLAMI</a> (CVPR’ 25) uses the instruction-tuning stage to train on multi-turn conversation data to handle speech/motion alignment.</p><p><a href="https://xiang-deng00.github.io/U-Mind.github.io/"><strong>U-Mind</strong></a>, a CVPR 2026 paper from Tsinghua University and Meituan, asks a more demanding question: can a <em>single</em> autoregressive model jointly plan, reason, and generate text, speech, and motion — end to end, in real time — without the high-level reasoning collapsing once you bolt on speech and motion generation?</p><p>This walkthrough traces the technical path from “why is this hard” to how U-Mind’s two-stage training recipe and text-first decoding strategy address it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VVyPQyz_Z5OJeX1Z" /><figcaption>Image source: <a href="https://tinyurl.com/58sdfssn">https://tinyurl.com/58sdfssn</a>. Author: <a href="https://unsplash.com/@timstief">Tim Stief</a></figcaption></figure><h3>Background Literature: Two Roads to “LLM + Motion”</h3><p>Let’s take a detailed look at the MotionGPT and SOLAMI papers.</p><p><strong>MotionGPT</strong> is the paper that established the architectural pattern U-Mind builds on. Its core claim is that human motion has a “semantic coupling” similar to natural language — it’s a form of body language — and so it should be representable the same way text is, rather than treated as a separate continuous signal needing its own model. It uses the SOTA VQ-VAE to discretize 3D motion sequences into discrete tokens, expands an LLM’s vocabulary to include them, and then runs motion-language pre-training so a single autoregressive model can move fluidly between text-to-motion generation, motion captioning, motion prediction, and motion in-between tasks, all driven by natural-language instructions. There’s no dialogue loop and no speech modality — the instruct-tuning stage further trains on &lt;text, motion&gt; pairs on 15 different motion tasks, to enhance the model’s text/motion alignment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zYyDgrzA6x6KVoJyH8b7Vw.png" /><figcaption>MotionGPT pretraining. Image source: <a href="https://arxiv.org/pdf/2306.14795">https://arxiv.org/pdf/2306.14795</a></figcaption></figure><p><strong>SOLAMI</strong> takes that same architectural pattern — motion tokens living inside an LLM’s vocabulary — and wraps it in an actual interactive setting. It focuses on immersive interaction with 3D characters: a user talks and gestures to a character inside a VR interface, and the model generates a synchronized speech-and-motion response, not just a motion clip. Like U-Mind, SOLAMI is built on the <strong>AnyGPT</strong> backbone (itself based on LLaMA2–7B). For the instruction-tuning stage, it trains on multi-turn conversations, which is a step beyond MotionGPT in motion and speech alignment based on character settings and contexts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jivyWf9XGKj67KGb8YMm1A.png" /><figcaption>SOLAMI pretraining and instructing tuning. Image source: <a href="https://arxiv.org/pdf/2412.00174">https://arxiv.org/pdf/2412.00174</a></figcaption></figure><h3>Building Blocks: How U-Mind Represents Everything as Tokens</h3><p>U-Mind’s backbone is <strong>LLaMA2–7B</strong>, extended into a multimodal model in the lineage of <strong>AnyGPT</strong>: rather than bolting on separate encoder/decoder heads per modality, every modality is discretized into tokens living in the same vocabulary as text, so the whole system stays pure next-token prediction. For motion, body pose is represented with the <strong>SMPL-X</strong> parametric model, converted to continuous 6D joint rotations (more stable than quaternions or Euler angles), then compressed into discrete “motion tokens” by a <strong>Residual Vector-Quantized VAE (RVQ-VAE)</strong> — turning a continuous control problem into something an autoregressive LLM can predict one token at a time. Speech receives the same treatment via the RVQ-VAE architecture as <strong>SpeechTokenizer</strong>, which discretizes raw waveforms into tokens that carry both the words said and paralinguistic cues such as prosody and emotion.</p><p>The piece that ties it together is a set of explicit reasoning tokens: &lt;think&gt; / &lt;/think&gt; delimiters wrap text-only internal Chain-of-Thought planning that&#39;s never shown to the user, while speech and motion segments get their own start/end delimiters and a global token wraps the full response (plain text stays undelimited). Stack text vocabulary, motion tokens, speech tokens, and these CoT delimiters into one resized embedding matrix, and you get a single unified token space — no modality-specific decoder heads needed, just autoregressive next-token prediction where &quot;next token&quot; might mean the next word, acoustic frame, or motion frame.</p><h3>The Two-Stage Recipe: Rehearsal-Driven Pretraining + Text-First Instruction Tuning</h3><p>This is where U-Mind actually fights the reasoning-degradation problem described above. The framework is called the <strong>Unified Alignment and Reasoning Framework</strong>, and it’s split into two stages.</p><h3>Stage 1 — Rehearsal-Driven Foundational Pre-training</h3><p>The goal here is narrow: <em>teach the model to speak the language of motion and speech tokens without unlearning how to reason in plain text</em>. The training mixture splits into two halves — modality-grounding tasks (text-to-motion, speech-to-motion, text-to-speech) that teach temporally coherent generation from linguistic or acoustic prompts, and rehearsal tasks interleaved purely to keep the model’s symbolic reasoning circuitry exercised. The intuition is simple: <strong>teach the model to produce temporally and contextually coherent sequences via segment-alignment, while letting the LLM head “rehearse” purely on reasoning tasks</strong> — two objectives running side by side rather than competing for the same gradient updates.</p><p>Cross-modal coordination is handled by a segment-wise alignment strategy: inputs are split along prosodic boundaries (rhythm and pause points in speech), and the model trains on randomized recombinations of these segments rather than on whole, intact utterances — forcing it to learn fine-grained speech-motion correspondence rather than memorizing a fixed global mapping. The ablation confirms this matters: removing segmentation (wo-seg) drives FGD from 11.12 up to 16.89 and angle error from 0.188 up to 0.219, a fairly large hit to raw motion fidelity.</p><h3>Stage 2 — Instruction Tuning with Text-First Decoding</h3><p>Stage 2 takes that stable backbone and aligns it with actual user intent via supervised fine-tuning on a CoT-driven instruction corpus that covers open dialogue and instruction-following.</p><p>The key design choice here is the <strong>text-first decoding strategy</strong>: every response is required to begin with a &lt;think&gt;...&lt;/think&gt; block — a latent, CoT-style plan — <em>before</em> any text, speech, or motion is generated. Symbolic planning happens first; continuous-modality generation is conditioned on that plan, not the other way around.</p><p>Note that the big differentiator between this stage and pretraining is that instruction tuning is specifically about exercising the model’s reasoning capability — by reducing the model’s reliance on raw speech/motion conditioning and instead training it to produce rich, explicit text reasoning <em>before</em> anything continuous gets generated. This is where the unique strength of the decoder-based architecture shows up: reasoning isn’t bolted on through a second model or a complicated training pattern — it’s intrinsically embedded in the architecture itself, simply by virtue of being earlier in the sequence under causal attention. Forcing the &lt;think&gt; block first means everything downstream — text, speech, motion — is mechanically conditioned on that plan, for free, just by token order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvuPprCgZPHYDJEOJznAcw.png" /><figcaption>U-Mind two-stage training/tuning. Image source: <a href="https://arxiv.org/abs/2602.23739">https://arxiv.org/abs/2602.23739</a></figcaption></figure><h3>Results: Does the Recipe Actually Work?</h3><p>Note that the paper directly competes with SOLAMI and another LLM-based algorithm, and exceeds both on generated motion quality, modality types, and open-world reasoning capability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8tuh7v9YnZsLM41pztiRQ.png" /><figcaption>Qualitative Results. Image source: <a href="https://arxiv.org/abs/2602.23739">https://arxiv.org/abs/2602.23739</a></figcaption></figure><p><strong>Final Takeaway</strong>. Multi-modality LLMs have greatly expanded their capabilities in the past few years, but how to properly reason across and align different modalities for real-world problems remains a challenge. The autoregressive decoder-style architecture is still a path worth exploring for its ability to naturally embed reasoning.</p><h3>Reference</h3><p>Deng X, Gao F, Zhang Y, Pang Y, Xu X, Kang Z, Wei X, Liu Y. U-Mind: A Unified Framework for Real-Time Multimodal Interaction with Audiovisual Generation. In <em>Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition</em> 2026, pp. 10874–10886.</p><p>Related work referenced in this walkthrough:</p><ul><li>Jiang J, Xiao W, Lin Z, et al. SOLAMI: Social vision-language-action modeling for immersive interaction with 3D autonomous characters. CVPR 2025.</li><li>Chen C, Zhang J, Lakshmikanth SK, et al. The Language of Motion: Unifying verbal and non-verbal language of 3D human motion (LOM). CVPR 2025.</li><li>Wu Q, Zhao Y, Wang Y, Liu X, Tai YW, Tang CK. Motion-Agent: A conversational framework for human motion generation with LLMs. ICLR 2025.</li><li>Jiang B, Chen X, Liu W, Yu J, Yu G, Chen T. MotionGPT: Human motion as a foreign language. NeurIPS 2023.</li><li>Zhan J, Dai J, Ye J, et al. AnyGPT: Unified multimodal LLM with discrete sequence modeling. ACL 2024.</li><li>Zhang X, Zhang D, Li S, et al. SpeechTokenizer: Unified speech tokenizer for speech language models. ICLR 2023.</li><li>Liu H, Zhu Z, Becherini G, et al. EMAGE: Towards unified holistic co-speech gesture generation via expressive masked audio gesture modeling. CVPR 2024.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4a0dd2f8300" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/paper-walkthrough-u-mind-a-unified-framework-for-real-time-multimodal-interaction-with-c4a0dd2f8300">Paper Walkthrough — U-Mind: A Unified Framework for Real-Time Multimodal Interaction with…</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Walkthrough — ReFAct: Empowering Multimodal Web Agents with Visual and Context Focusing]]></title>
            <link>https://mengliuz.medium.com/paper-walkthrough-refact-empowering-multimodal-web-agents-with-visual-and-context-focusing-185d115c0496?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/185d115c0496</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[multimodal]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Sun, 21 Jun 2026 17:00:56 GMT</pubDate>
            <atom:updated>2026-06-21T17:54:19.812Z</atom:updated>
            <content:encoded><![CDATA[<h4>From passive screenshot consumers to active visual reasoners</h4><p>The web is not a text database.</p><p>It is cluttered with images, diagrams, embedded logos, and irrelevant backgrounds — all competing for a model’s attention at once. Teaching agents to ignore noise and focus on important information is difficult.</p><p><a href="https://openaccess.thecvf.com/content/CVPR2026/papers/Wu_ReFAct_Empowering_Multimodal_Web_Agents_with_Visual_and_Context_Focusing_CVPR_2026_paper.pdf">ReFAct</a>, a CVPR 2026 paper from Ant Group, proposes an alternative approach: <em>teaching the agent to focus</em>. The proposed approach crops images to the relevant region, retrieves the information, and sends it to the local database; when the information is rich but irrelevant, the agent defocuses on it; when the information is relevant, the agent can refocus and start reasoning.</p><p>In this article, we’ll trace the full technical story — from what a web agent is, to how ReFAct’s reinforcement learning trains grounding and memory management together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*0z_Y-Q7C5_ok0J_835K6iA.jpeg" /><figcaption>Image source: pickpik.com/clouds-daylight-fjord-grass-lake-landscape-98004</figcaption></figure><h3>What Is a Web Agent?</h3><p>An agent is an AI system that takes actions in an environment to achieve a goal. In the classical sense, this means a loop: <em>observe, reason, act, observe again</em>. The ReAct paper (ICLR 2023) formalized this as the “thought-action-observation” cycle, interleaving chain-of-thought reasoning with concrete API calls.</p><p>A web agent specializes in this loop for the internet. At each step, the agent can:</p><ul><li>Issue a text search query and read snippets</li><li>Perform a reverse image search</li><li>Navigate to and parse a URL</li><li>Synthesize gathered evidence into a final answer</li></ul><p>See the following pseudo-code for illustrating the core ReAct steps:</p><pre>from dataclasses import dataclass, field<br>from typing import Optional<br><br># --- Environment tools (each returns an Observation) ---<br><br>def text_search(query: str) -&gt; str:<br>    &quot;&quot;&quot;Call Google Search API, return top-k snippets.&quot;&quot;&quot;<br>    ...<br><br>def image_search(image_url: str) -&gt; str:<br>    &quot;&quot;&quot;Call reverse image search API, return captions + source URLs.&quot;&quot;&quot;<br>    ...<br><br>def visit_url(/service/url: str, goal: str) -&gt; str:<br>    &quot;&quot;&quot;Fetch and parse a webpage, summarize toward goal.&quot;&quot;&quot;<br>    ...<br><br># --- Agent internals ---<br><br>@dataclass<br>class Step:<br>    thought: str<br>    action: str          # e.g. &quot;text_search&quot;, &quot;image_search&quot;, &quot;visit&quot;, &quot;answer&quot;<br>    action_input: dict<br>    observation: str = &quot;&quot;<br><br>@dataclass<br>class Trajectory:<br>    query: str<br>    image: Optional[bytes]<br>    history: list[Step] = field(default_factory=list)<br>    final_answer: str = &quot;&quot;<br><br># --- Core ReAct loop ---<br><br>def run_agent(query: str, image: Optional[bytes] = None) -&gt; str:<br>    traj = Trajectory(query=query, image=image)<br>    context = build_initial_context(query, image)<br><br>    for _ in range(MAX_STEPS):<br><br>        # 1. THINK + ACT: model generates the next thought and tool call<br>        thought, action, action_input = mllm.generate(context)<br><br>        # 2. EXECUTE: dispatch to the appropriate tool<br>        if action == &quot;text_search&quot;:<br>            observation = text_search(action_input[&quot;query&quot;])<br><br>        elif action == &quot;image_search&quot;:<br>            observation = image_search(action_input[&quot;image_url&quot;])<br><br>        elif action == &quot;visit&quot;:<br>            observation = visit_url(https://medium.com/%3Cbr%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20url=action_input[&quot;url&quot;],%3Cbr%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20goal=action_input[&quot;goal&quot;]%3Cbr%3E)<br><br>        elif action == &quot;answer&quot;:<br>            traj.final_answer = action_input[&quot;answer&quot;]<br>            break<br><br>        # 3. OBSERVE: append step to history, extend context<br>        step = Step(thought, action, action_input, observation)<br>        traj.history.append(step)<br>        context = update_context(context, step)<br><br>    return traj.final_answer</pre><p>The key property is <em>iterative retrieval</em>: instead of answering based on internal knowledge alone, the agent keeps searching until it has sufficient evidence. This allows it to answer questions that no static model could, because the facts may have changed or were never seen during training.</p><h3>LLMs vs. MLLMs: What Happens When Agents Meet Vision?</h3><p>A Large Language Model (LLM) processes tokens. Everything — questions, retrieved text, tool outputs — is serialized into a flat sequence of text tokens. This is well-suited to text-centric web search: <a href="https://arxiv.org/abs/2503.09516">Search-R1</a>, <a href="https://arxiv.org/abs/2503.05592">R1-Searcher</a>, and <a href="https://arxiv.org/abs/2504.03160">DeepResearcher</a> all operate in this paradigm with strong results.</p><p>A Multimodal Large Language Model (MLLM) additionally accepts visual inputs. A visual encoder (typically CLIP or SigLIP) maps an image into a sequence of visual tokens, which are then concatenated with text tokens and processed by the language model backbone. The MLLM can therefore reason jointly over images and text.</p><p>The critical difference between the two paradigms can be summarized as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxSKpy1OyUUVS8oO4MwkdQ.png" /><figcaption>Comparing LLM agents and MLLM agents. Provided by Author.</figcaption></figure><p>We can see that MLLM agents face different challenges than traditional LLM agents and are affected by perceptual quality and noise.</p><h3>From LLM Agents to MLLM Web Agents</h3><p>Early text-centric agents like Search-R1 pass only text into the model at each reasoning step. When vision is added, the naive extension is to encode the <em>entire</em> image — the full screenshot, the complete search result page — into visual tokens and append them to the context. This is what MMSearch-R1 and early WebWatcher do.</p><p>The problem is that full-image encoding is indiscriminate. Consider the example from the ReFAct paper: you ask, “<em>Who designed the building in this picture?</em>” The image contains a historical tower in the foreground, as well as unrelated buildings visible through a window in the background. A full-image encoder represents all of these equally. The model may fixate on the wrong structure, issue the wrong search query, and reach a completely wrong answer — what the paper calls a false factual basis.</p><p>Two types of noise plague MLLM web agents:</p><ul><li><strong>Visual noise</strong>: <em>irrelevant background elements in images (e.g., surrounding buildings, cluttered textures) that shift the model’s attention away from the target entity</em></li><li><strong>Retrieval noise</strong>: <em>non-essential webpage elements (advertisements, navigation bars, boilerplate text) that dilute critical information in the context</em></li></ul><p>Standard MLLMs employ a passive perception mechanism: the entire image is encoded regardless of what is task-relevant. In the controlled settings of standard VQA benchmarks, where target objects are large and salient, this works fine. In real web environments, where targets may occupy less than 5% of the image, it fails.</p><h3>Knowledge Graph-Based Agentic Representation</h3><p>To train an agent that handles these challenges, you need data — specifically, questions that <em>require</em> targeted visual retrieval to answer. This is where knowledge graphs enter the picture, and ReFAct’s approach sits within a lineage worth tracing.</p><h4>WebSailor: Random Walks on Wikipedia</h4><p>The <a href="https://arxiv.org/abs/2507.02592">WebSailor</a> paper introduced the idea of constructing training data via a knowledge graph built from Wikipedia hyperlinks. Starting from a seed Wikipedia page as the root entity, the method recursively traverses outgoing links to build an entity tree. Random walks on this graph yield subgraphs that encode multi-hop reasoning chains. From each subgraph, a QA pair is generated. To increase difficulty, entity names are replaced with partial, ambiguous descriptions — forcing the model to infer via synthesis rather than direct lookup.</p><p>This “random walk on a knowledge graph → subgraph sampling → QA generation” pipeline became the foundational recipe for training deep research agents.</p><h4>WebWatcher: Visual Grounding over a Text Graph</h4><p><a href="https://arxiv.org/abs/2508.05748">WebWatcher</a> adapted WebSailor’s graph construction to the multimodal setting. The pipeline remains text-first: start from Wikipedia, build the hyperlink graph, and sample subgraphs to generate QA pairs. Then, a QA-to-VQA conversion step replaces the explicit entity name in the question with a visual reference (“<em>the entity shown in the image</em>”), retrieves a real image of that entity, and pairs the two. The result is a VQA benchmark — BrowseComp-VL — where answering requires both visual recognition and multi-hop web retrieval.</p><h4>ReFAct: A Two-Level Image-Centric Knowledge Graph</h4><p>Instead of starting from text and attaching images later, ReFAct starts from an image and builds outward:</p><p><strong>Phase I — Image-Knowledge Graph Construction</strong>. Given an image, a vision-language model (Qwen3-VL-235B) detects candidate entities—logos, landmarks, and objects — and generates a visual description for each. After verification, these become the Grounded Entities and then, via text search, expand into Retrieved Entities into a knowledge graph.</p><p><strong>Phase II — Subgraph Sampling and QA Generation</strong>. There are two levels of questions. For Level 1 questions, a single Grounded Entity is sampled, and the LLM is prompted to generate a question that anchors to the entity’s <em>visual location in the image</em> (e.g., “the small logo in the upper-left corner”). For Level 2 questions, multiple Grounded Entities are involved, requiring cross-entity relational reasoning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWR6U1LzdSJGNAIWFgEnBQ.png" /><figcaption>Two levels of questions. Image source from <a href="https://openaccess.thecvf.com/content/CVPR2026/papers/Wu_ReFAct_Empowering_Multimodal_Web_Agents_with_Visual_and_Context_Focusing_CVPR_2026_paper.pdf">original paper</a>.</figcaption></figure><h3>Visual Focusing and Memory Focusing: How ReFAct Represents Trajectories</h3><p>ReFAct’s framework introduces two complementary mechanisms under the umbrella concept of active focusing. Both are expressed as explicit tool calls within the agent’s action trajectory.</p><h4>Visual Focusing: Grounding as an Action</h4><p>Instead of using the full image as a reverse-image search query, ReFAct allows the agent to call a Ground action:</p><blockquote>&lt;img_search&gt;{“bbox_2d”: [204, 460, 473, 733]}&lt;/img_search&gt;</blockquote><p>The agent predicts a bounding box <em>[x₁, y₁, x₂, y₂]</em> in image coordinates, and the environment returns the cropped region <em>I[bbox]</em> for downstream retrieval. Crucially, the bounding box is predicted <em>by the model itself</em>, not delegated to a separate object detector. This means the grounding capability is jointly optimized with the agent’s reasoning during training — the model learns when cropping is necessary and where to crop, purely from the environmental reward signal.</p><h4>Memory Focusing: Defocus and Refocus</h4><p>As the agent collects search results over many steps, the context window fills with lengthy webpage text. Irrelevant articles, navigation text, and duplicate information crowd out the critical evidence. ReFAct introduces a dual-memory system:</p><ul><li><strong>Active working memory <em>H_t</em></strong>: the live context window, kept short and high-signal</li><li><strong>External memory <em>M_t</em></strong>: an unlimited store for offloaded content</li></ul><p>Two tools govern the flow between them:</p><ul><li>Defocus: when the agent encounters dense but currently non-critical content (e.g., a full article from a search result), it compresses the content to a concise summary with a unique ID and stores the <strong>raw text in the</strong> <strong>external memory</strong> <em>M_t</em>. Only the summary and ID remain in the active working memory <em>H_t</em>.</li><li>Refocus(id): when the agent later determines that a previously defocused document is needed again, it retrieves the <strong>original raw text from the external memory <em>M_t</em></strong> by ID.</li></ul><p>This avoids the “context rot” failure mode — where increasing context length degrades reasoning quality — while also preserving the ability to revisit earlier evidence without ambiguous fuzzy retrieval.</p><p>A complete ReFAct trajectory therefore, has the following structure:</p><blockquote>τ = (q, I₀, …, rₜ, <strong>Ground(bbox), ImgSearch(I_crop)</strong>,</blockquote><blockquote>…, rₜ₊ₖ, <strong>Refocus(id)</strong>, rₜ₊ₖ₊₁, Answer)</blockquote><p>where <em>r_t</em> represents the model’s reasoning step (thought) at time <em>t</em>. The trajectory interleaves standard web actions with internal focusing operations. The trajectory is optimized through GRPO.</p><h3>Results and What They Mean</h3><p>The following illustrates how the web agents perform tool calls and reasoning in real time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yyaAPBXiu1F_1YmCCoWqpA.png" /><figcaption>Web Agent illustration. Image source from <a href="https://openaccess.thecvf.com/content/CVPR2026/papers/Wu_ReFAct_Empowering_Multimodal_Web_Agents_with_Visual_and_Context_Focusing_CVPR_2026_paper.pdf">original paper</a>.</figcaption></figure><p>The quantitative results are also impressive — the proposed ReFAct-7B outperforms state-of-the-art research works and commercial models by a large margin on the proposed GroundedVQA dataset, while only dropping the average performance by 1% comparing to Gemini-2.5-flash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkGEjQBKu1T99u0D7xCXMw.png" /><figcaption>ReFAct: benchmark. Image source from <a href="https://openaccess.thecvf.com/content/CVPR2026/papers/Wu_ReFAct_Empowering_Multimodal_Web_Agents_with_Visual_and_Context_Focusing_CVPR_2026_paper.pdf">original paper</a>.</figcaption></figure><h3>References</h3><ul><li>Wu R, Zhang S, Tang X, Zhang R, Liu Y, Jiang T, Xu W, Li Y. ReFAct: Empowering Multimodal Web Agents with Visual and Context Focusing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition 2026 (pp. 14990–14999).</li><li>Li K, Zhang Z, Yin H, Zhang L, Ou L, Wu J, Yin W, Li B, Tao Z, Wang X, Shen W. Websailor: Navigating super-human reasoning for web agent. arXiv preprint arXiv:2507.02592. 2025 Jul 3.</li><li>Geng X, Xia P, Zhang Z, Wang X, Wang Q, Ding R, Wang C, Wu J, Zhao Y, Li K, Jiang Y. Webwatcher: Breaking new frontier of vision-language deep research agent. arXiv preprint arXiv:2508.05748. 2025 Aug 7.</li><li>Wu J, Deng Z, Li W, Liu Y, You B, Li B, Ma Z, Liu Z. Mmsearch-r1: Incentivizing LMMs to search. arXiv preprint arXiv:2506.20670. 2025 Jun 25.</li><li>Shao Z, Wang P, Zhu Q, Xu R, Song J, Bi X, Zhang H, Zhang M, Li YK, Wu Y, Guo D. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300. 2024 Feb 5.</li><li>Yao S, Zhao J, Yu D, Du N, Shafran I, Narasimhan K, Cao Y. React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629. 2022 Oct 6.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=185d115c0496" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Explaining Tongyi DeepResearch]]></title>
            <link>https://pub.towardsai.net/explaining-tongyi-deepresearch-58e1767d795c?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/58e1767d795c</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Thu, 25 Sep 2025 14:02:02 GMT</pubDate>
            <atom:updated>2025-10-11T18:53:45.548Z</atom:updated>
            <content:encoded><![CDATA[<h4>Toward the Era of Synthesized Data Training</h4><p><em>What will the future of LLM training be like?</em></p><p>Last week, Alibaba Tonyi Lab released its agentic research model, Tongyi <a href="https://github.com/Alibaba-NLP/DeepResearch">DeepResearch</a>, which outperformed OpenAI o3 and DeepResearch <a href="https://github.com/Alibaba-NLP/DeepResearch/blob/main/assets/performance.png">on various tasks</a>. Moreover, Tongyi DeepResearch only has <a href="https://huggingface.co/Alibaba-NLP/Tongyi-DeepResearch-30B-A3B">30B parameters in total, with 3B activated per token</a>, while its open-source rival - the <a href="https://huggingface.co/deepseek-ai/DeepSeek-V3.1">DeepSeek v3.1</a> has 671B parameters, and Kimi Researcher (based on Kimi v2) has <a href="https://moonshotai.github.io/Kimi-K2/">1T parameters</a>. We can’t help but ask, how did Tongyi DeepResearch achieve that?</p><p>It turns out not to be magic. Extending the basic ReAct reasoning paradigm to the Iterative Deep Research Paradigm, the model <strong>fully utilized synthetic trajectory data for training purposes</strong>. Besides the <a href="https://tongyi-agent.github.io/blog/introducing-tongyi-deep-research/">official blog</a>, the synthetic and training technologies are outlined in the following research papers:</p><ul><li><a href="https://arxiv.org/abs/2509.13310"><strong>AgentFounder</strong></a> for model pretraining — synthesizing first and higher-order action data for continual pretraining</li><li><a href="https://arxiv.org/abs/2509.13305"><strong>WebSailor-V2</strong></a> and <a href="https://arxiv.org/abs/2507.15061"><strong>WebShaper</strong></a> for post-training — using random walk for QA knowledge graph dataset creation, and layer-wise expansion-based information seeking strategy for improving data quality, for SFT and GRPO-based RL.</li></ul><p>We’ll explain these strategies in detail in the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iBuqD0atULJ5IVZP75EI1w.jpeg" /><figcaption>Image Source: <a href="https://www.pexels.com/photo/leaves-hang-on-rope-1389460/">https://www.pexels.com/photo/leaves-hang-on-rope-1389460/</a></figcaption></figure><h4><strong>AgentFounder — Agentic Continual Pretraining</strong></h4><p>The AgentFounder training schema proposed in the paper “<a href="https://arxiv.org/abs/2509.13310">Scaling Agents via Continual Pre-training</a>” involves two stages: i) Stage I pretraining with 32K context length, and ii) Stage II with 128K context length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zaSskpy8p_a2Qi3L36L3w.png" /><figcaption>Agentic Pretraining Schema. Image source: <a href="https://arxiv.org/pdf/2509.13310">https://arxiv.org/pdf/2509.13310</a></figcaption></figure><p>To create the corresponding agentic data, two different synthesis methods were involved: a) first-order action synthesis (FAS) with planning action and reasoning action; b) higher-order action synthesis (HAS) for multi-decision action synthesis.</p><p><strong>First-order action synthesis</strong>. According to the original paper, different from traditional “wiki-style” knowledge representation, such as “Paris is the capital of France”, the knowledge is anchored by “entity” France, e.g., (“France”: “Tourist arrivals in France reached 4,222 thousand in June 2025”), to form a diverse QA set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xORkqfKZ8Eq4iBCdOVj3zA.png" /><figcaption>From Entity-Anchored Open-World Memory phase to Multi-style QA synthesis phase. Image source: <a href="https://arxiv.org/pdf/2509.13310">https://arxiv.org/pdf/2509.13310</a></figcaption></figure><p><strong>Higher-order action synthesis. </strong>Instead of using the original “plain” reasoning/action trajectory data, a new reasoning/action candidate set is scaled (created) for each step by LLMs so as to help explore different decision possibilities, without changing the final binary decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5CSuNDRuZYfEuY-yN3iGGw.png" /><figcaption>Image source: <a href="https://arxiv.org/pdf/2509.13310">https://arxiv.org/pdf/2509.13310</a></figcaption></figure><h4>WebSailor-V2 — Creating Knowledge Graph for SFT and RL</h4><p>The <a href="https://arxiv.org/pdf/2507.02592">original WebSailor paper</a> proposed a three-level web-scraping method, which progressively built the knowledge graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91BoO43VAY3zga07N3wEaA.png" /><figcaption>Image source: <a href="https://arxiv.org/pdf/2507.02592">https://arxiv.org/pdf/2507.02592</a></figcaption></figure><p>The WebSailor v2 further creates cyclic graphs to introduce information interconnectivity and then uses random walks for subgraph extraction.</p><p><strong>Post Training — SFT Cold Start + RL with GRPO</strong>. The QA data generated using the pruned knowledge graph will eventually be utilized in the post-training stages, in both the SFT and RL stages.</p><p>The reinforcement learning algorithm is <a href="https://arxiv.org/pdf/2402.03300">GRPO</a>, which DeepSeekMath proposed for improving the PPO by replacing the value model with group scores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZeHaodMIfbsKldVKgeMNg.png" /><figcaption>Difference between PPO and GRPO. Image source: <a href="https://arxiv.org/pdf/2402.03300">https://arxiv.org/pdf/2402.03300</a></figcaption></figure><h4>WebShaper — A Formalization-driven Paradigm for Improving QA Quality</h4><p>Since the WebSailor v2 first retrieves the knowledge graph from the web and then generates the QA dataset (<strong>Information-driven</strong>), there could be an inconsistency between the knowledge graph and the final reasoning dataset. To prevent this from happening, the WebShaper paper proposed a “knowledge projection” operation and used set theory to control the structure of the newly generated QA set (<strong>Formalization-driven</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vui-pH75pAuxoEsWduG7zw.png" /><figcaption>Difference between the core ideas of WebSailor v2 and WebShaper. Image source: <a href="https://arxiv.org/pdf/2507.15061">https://arxiv.org/pdf/2507.15061</a></figcaption></figure><p><strong>First</strong>, to achieve knowledge/reasoning consistency, WebShaper proposed projecting entities based on certain relationships onto a subdomain using union and intersection operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v0LGXKghCRLKWQUhmWtQcw.png" /><figcaption>Image source: <a href="https://arxiv.org/pdf/2507.15061">https://arxiv.org/pdf/2507.15061</a></figcaption></figure><p>Second, starting from a seed question, a “Layer-wise” structure is created by a sequence of Agentic expansions (composed of union and intersection mentioned above), which eliminates the redundancy and reasoning shortcut issues during QA creation.</p><h4>ReAct and IterResearch Inference Paradigm</h4><p>So, how do we integrate the above-created synthetic dataset for agentic inference purposes? Tongyi DeepResearch supports two paradigms: ReAct and IterResearch (or heavy mode).</p><p><strong>ReAct</strong> is the paradigm <a href="https://arxiv.org/pdf/2210.03629">proposed in ICLR’23</a>, which follows the “thought-action-observation” cycle as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41jXvdIGYiHgwTWOm-0I8A.png" /><figcaption>Non-ReAct mode vs ReAct mode. Image source: <a href="https://arxiv.org/pdf/2210.03629">https://arxiv.org/pdf/2210.03629</a></figcaption></figure><p><strong>IterResearch</strong> employs a more complex paradigm, which creates a new workspace with a central report that includes noise prevention and quality checks. If a tool call is required, it returns the corresponding tool response from preset environments, along with the predicted action for iteration.</p><h4>Final Results and Takeaways</h4><p>How well does the Tongyi DeepResearch perform? The following is their official benchmark results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xyBNehzxmbK449k_" /><figcaption>Official benchmark released by Tongyi Lab. Image source: <a href="https://tongyi-agent.github.io/blog/introducing-tongyi-deep-research/">https://tongyi-agent.github.io/blog/introducing-tongyi-deep-research/</a></figcaption></figure><p>The Tongyi DeepResearch model outperforms OpenAI DeepResearch by 6.3% on the <a href="https://agi.safe.ai/">Humanity’s Last Exam dataset</a>, a multimodal benchmarking dataset comprising frontier knowledge from mathematics, physics, social science, and other fields. However, the Tongyi DeepResearch lags on the <a href="https://openai.com/index/browsecomp/">BrowseComp dataset</a>, which “require persistently navigating the internet in search of hard-to-find, entangled information”. This might be because the Tongyi model has a small base of only 30B and only supports a context length of 128k.</p><p>But this shows promise. With a small to medium-sized base, the Tongyi DeepResearch model shows great potential for scaling with synthetic trajectory data. <strong>It may reveal that we’re facing a completely different era of new training paradigms for synthetic data</strong>.</p><h4>References</h4><ul><li>Blog post, “Tongyi DeepResearch: A New Era of Open-Source AI Researchers”, <a href="https://tongyi-agent.github.io/blog/introducing-tongyi-deep-research/">https://tongyi-agent.github.io/blog/introducing-tongyi-deep-research/</a></li><li>Blog post, “Kimi K2: Open Agentic Intelligence”, <a href="https://moonshotai.github.io/Kimi-K2/">https://moonshotai.github.io/Kimi-K2/</a></li><li>Model card, “DeepSeek-V3.1-Terminus”, <a href="https://huggingface.co/deepseek-ai/DeepSeek-V3.1-Terminus">https://huggingface.co/deepseek-ai/DeepSeek-V3.1-Terminus</a></li><li>Tao Z, Wu J, Yin W, Zhang J, Li B, Shen H, Li K, Zhang L, Wang X, Jiang Y, Xie P. Webshaper: Agentically data synthesizing via information-seeking formalization. arXiv preprint arXiv:2507.15061. 2025 Jul 20.</li><li>Li K, Zhang Z, Yin H, Ye R, Zhao Y, Zhang L, Ou L, Zhang D, Wu X, Wu J, Wang X. WebSailor-V2: Bridging the Chasm to Proprietary Agents via Synthetic Data and Scalable Reinforcement Learning. arXiv preprint arXiv:2509.13305. 2025 Sep 16.</li><li>Su L, Zhang Z, Li G, Chen Z, Wang C, Song M, Wang X, Li K, Wu J, Chen X, Qiao Z. Scaling Agents via Continual Pre-training. arXiv preprint arXiv:2509.13310. 2025 Sep 16.</li><li>Li K, Zhang Z, Yin H, Zhang L, Ou L, Wu J, Yin W, Li B, Tao Z, Wang X, Shen W. WebSailor: Navigating Super-human Reasoning for Web Agent. arXiv preprint arXiv:2507.02592. 2025 Jul 3.</li><li>Shao Z, Wang P, Zhu Q, Xu R, Song J, Bi X, Zhang H, Zhang M, Li YK, Wu Y, Guo D. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300. 2024 Feb 5.</li><li>Phan L, Gatti A, Han Z, Li N, Hu J, Zhang H, Zhang CB, Shaaban M, Ling J, Shi S, Choi M. Humanity’s last exam. arXiv preprint arXiv:2501.14249. 2025 Jan 24.</li><li>Wei J, Sun Z, Papay S, McKinney S, Han J, Fulford I, Chung HW, Passos AT, Fedus W, Glaese A. Browsecomp: A simple yet challenging benchmark for browsing agents. arXiv preprint arXiv:2504.12516. 2025 Apr 16.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58e1767d795c" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/explaining-tongyi-deepresearch-58e1767d795c">Explaining Tongyi DeepResearch</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Engineering 201: Describing “Measurable Impact” from an IC’s Perspective]]></title>
            <link>https://mengliuz.medium.com/ml-engineering-201-describing-measuable-impact-from-an-ics-perspective-ac25889fbf5e?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac25889fbf5e</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Mon, 31 Mar 2025 08:04:26 GMT</pubDate>
            <atom:updated>2025-03-31T08:11:17.552Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use the SWOP(S) method to measure your impact</h4><p>Why impact?</p><p>I heard much about the word “impact” in my MLE career from recruiters, hiring managers, principal MLEs, and product managers. But the meaning of the word always stayed vague. As a principle-based thinker, a vague terminology never worked for me because I either need an accurate definition or a deeper reason for generating that definition for better understanding and interpretation.</p><p>After moving across different types of organizations as an individual contributor (IC), ranging from smaller companies of a few hundred people to larger companies of a few thousand people to giant organizations, I eventually realized the word “impact” sounds so vague because that word means different things under different scenarios and contexts. <strong>Everybody discusses impact based on their level, technical background, business understanding and the type of companies they belong to.</strong></p><p>Does that mean it’s not possible to clearly define impact? I still think we can. For example, a nice <a href="https://medium.com/@jordan.l.edmunds/what-is-impact-for-a-software-engineer-6640b2811ad3">Medium article</a> described the <strong>impact equation as “Quantity * Quality * Importance”</strong>, which is super inspiring. From another perspective, Ryan Peterman proposed to leverage the <a href="https://www.developing.dev/p/scope-not-titles"><strong>concept of “Scope”</strong></a> in his Developing Dev blog and gave a list of different scopes for different IC levels, mainly focusing on a more specific goal for promotion in FAANG companies. Besides, reading <a href="https://www.reddit.com/r/SoftwareEngineering/comments/14kihnp/how_do_you_measure_the_business_impact_of_your/">Reddit discussions</a> about measuring business impact/contribution <strong>using accurate numbers</strong> is fun. The Pragmatic Engineer blog further narrowed the terminology and defined impact as “<strong>customer satisfaction scores</strong>” (which is too FANNG-toned for me to agree upon).</p><p>In this article, I propose a new definition to measure the impact simply from a 4-YOE IC’s perspective. I call this technique <strong>SWOP(S)</strong>: <strong>S</strong>olution, <strong>W</strong>ho, <strong>O</strong>utcome, <strong>P</strong>rinciple, and <strong>S</strong>cope (optional). The method has nothing to do with promotion, so be careful how it’s used. But if you struggle to embed impact-thinking in your day-to-day work, it will help gauge your tasks and align with team goals well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzeyEkFZL9d44zWWasQ6dg.jpeg" /><figcaption>Image source: <a href="https://pxhere.com/en/photo/1377020">https://pxhere.com/en/photo/1377020</a></figcaption></figure><p>Let’s get it a little bit deeper — Why SWOP(S)?</p><p>The reason we talk about SWOP(S) is simple: <strong>impact cannot be measured alone without the core work itself (solution), the people being impacted (who), the metrics being measured (outcome), and technical maturity being shown (principle). And when you’re advancing to the staff level, you’re thinking about the project duration and people involved, and that’s where the scope comes into place.</strong></p><p><strong>Solution</strong>. Whether it’s a deliberate hotfix with a dozen lines of code, a heavy feature with many hours of model training, or a well-written document comparing all training schemas and acceleration techniques, it’s essential to show that something has been done. <strong>That’s the foundation of the impact.</strong></p><p><strong>Who</strong>. But you don’t work simply for the work. To make an impact, your work cannot be “a task given by the manager.” You have to find out the stakeholders, talk to them, and ask why doing that work would make them happy. At the beginning of my career, I was nervous asking that question as I was afraid of being ignored or turned down. But then I realized that people will never get angry at me if I ask them how to help make them happy. <strong>This question is so important as it’s the goal of the impact.</strong></p><p><strong>Outcome</strong>. Now we know who we’re trying to please or impress, and we want to work hard, but how do we measure whether our work made stakeholders happy, since happiness is subjective? That’s why we need to specify deliverables like a report with certain content or goals like improving numbers on a dashboard. Eventually, when all the work is done, we’ll use the report or the dashboard number increase as the measurable outcome. <strong>That is the score of the impact</strong>.</p><p><strong>Principle</strong>. But how sustainable is the impact? We can make a lot of hotfixes and claim we improved the outcomes by a few <strong>percentages each time, but that’s not a good approach in the long run and will decrease our technical credibility within and across teams (and even worse if you’re thinking about hopping for promotion in a few years). </strong>And that’s where the principles come into play. Sometimes, it’s essential to work on a feature or a technical debt that generates lower impact scores but reinforces sound software principles by having cleaner code or sound machine learning principles by designing better architectures. <strong>This is primarily a team-level impact if you cherish your engineer reputation and a functional-level impact if the company has a good engineering culture. If you want impact for a promotion, remember, it’s the sound principles that can make your career path longer and steadier; don’t trade it for a short-term promotion opportunity.</strong></p><p><strong>Scope</strong>. As mentioned in <a href="https://www.developing.dev/p/faang-career-ladder-mid-level-l4">The Developing Dev</a> blog, scope is not that important for ICs at the senior level but will gradually become more and more important as you rise to higher levels. You start to think about the team’s quarterly goals, the number of people in your own team and sister teams, their strengths and your strengths, and how much you can work together to make a larger impact. <strong>That is the vision of the impact</strong>.</p><p>Now that we have defined SWOP, the question is how to use it in different scenarios and how to understand the measurement.</p><p><strong>Scenario number one</strong>: <em>Your manager walks into your cube and asks you to deal with a Jira ticket. You ask for more information and discover that the stakeholder is your sister-team engineer (W), who wants to improve a dashboard number. You listen to his/her requests and do your research, and propose different solutions for their pros and cons (A is simple but pragmatic, or B is for long-term sustainability). You mutually agree on a smaller scope by using A (P), finish the work by pushing a hotfix (S), and see the dashboard number rise by X% (O).</em></p><p><strong>Impact</strong>: <strong>You made a cross-team impact by implementing solution S for team W, improved score O by X%, and demoed the </strong><a href="https://www.geeksforgeeks.org/basic-principles-of-good-software-engineering-approach/"><strong>KISS principle</strong></a><strong>.</strong></p><p><strong>Scenario number two</strong>: <em>Your teammate (W) complains about a job failing during model training in front of the coffee machine, and you offer some help. You dig into the code and realize there is a deeper dependency issue. You push a PR (S) and approach other colleagues and ask if there are other similar issues. Eventually, you collect a few upstream and downstream cases and persuade your colleagues to adopt a new package (O) for cleaner and more stable code (P).</em></p><p><strong>Impact</strong>: <strong>You made a team-level impact by implementing solution S for teammate W, introduced a new package, and demoed the </strong><a href="https://www.geeksforgeeks.org/basic-principles-of-good-software-engineering-approach/"><strong>SOLID principle</strong></a>.</p><p><strong>Scenario number three</strong>: <em>You’re writing your quarterly goals to improve the model further. But after talking to your customers (W), they only vaguely mention that the model performance (O) needs to be improved but don’t pinpoint the area for improvement. You reflect on the project&#39;s progress for the last few quarters and realize it’s time to get the higher-hanging fruits. So you dig into the latest research (P), conduct POCs, make presentations to your teammates first and get their interests (S), and then pitch it to your manager. You get the approval to proceed, assign the tasks to different teammates (S), aggregate the results, brainstorm, improve the model (P) and iterate for a few cycles (S). Eventually, you release a new model version (S) and bring up the model performance in production (O) and properly acknowledge your teammates’ work (S).</em></p><p><strong>Impact</strong>. You made a cross-team impact by implementing solution S for customer W and improved the model performance. Most importantly, you show great leadership (even without a title), leading a multi-member team on a long-term, vaguely-defined project and contributing significantly to your team’s quarterly goal — which <strong>broadly expands the scope of the impact</strong>.</p><p>As a summary, the SWOP(S) model can help you explore the understanding of impact under different scenarios by understanding your customer, your teammates, your goals, and your strengths. Hopefully, this will make your MLE career path smoother and longer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac25889fbf5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sparse Transformers]]></title>
            <link>https://aiadvances.org/sparse-transformers-d46463e0a9a6?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/d46463e0a9a6</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 13:24:05 GMT</pubDate>
            <atom:updated>2025-03-01T13:24:05.029Z</atom:updated>
            <content:encoded><![CDATA[<h4>From naive sparse attention to Kimi’s ultra-long context model and DeepSeek’s NSA</h4><blockquote>What prevents us from reaching the real Artificial General Intelligence (AGI)?</blockquote><p>There are many roadblocks, and long-context computation is one of them. The reason is simple: modern LLMs and foundation models are mainly built based on the transformer model, and <strong>the transformer’s self-attention has quadratic computational cost regarding context length</strong>, which makes scaling to the long-context (&gt; 32k) and ultra-long context length (&gt;128k) difficult.</p><p>There have been many different approaches to solving the quadratic computation cost problems, e.g., converting the attention to <a href="https://arxiv.org/abs/2307.08621">linear format</a>, leveraging the <a href="https://arxiv.org/pdf/2312.00752">selective state model</a>, converting softmax attention to <a href="https://arxiv.org/pdf/2405.13956">RNN style</a> and performing parallel computation.</p><p>In this article, we discuss sparse attention. Introduced by OpenAI in 2019, the sparse attention design started with a <a href="https://arxiv.org/abs/1904.10509">block-wise style</a> and a <a href="https://arxiv.org/abs/2004.05150">sliding-window style</a> and then gradually evolved to a <a href="https://arxiv.org/abs/2303.08810">top-k selection style</a> over the past years. We focus on the latest models: DeepSeek’s Native Sparse Attention (NSA) and Kimi’s MOBA model. NSA combines the top-k selection and sliding-window with an extra compression branch and reached an almost 11x performance increase during the decoding stage at a 64k context length. While it’s less known to the public, the MOBA model extended the sequence to an extraordinary 10m length and reached almost 10x performance increase compared to the FlashAttention implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDw09BATEVaPiVkTlxYdlw.jpeg" /><figcaption>Image source: <a href="https://pxhere.com/en/photo/885751">https://pxhere.com/en/photo/885751</a></figcaption></figure><h4>Fundamentals — Vanilla Self-Attention</h4><p>When we talk about self-attention, we usually talk about the scaled dot product self-attention in the vanilla transformer model. In the figure below, Q represents the query matrix, K represents the key matrix, and V represents the value matrix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*2a7n6UpGUPFhSAJhnutyzA.png" /><figcaption>Scaled dot-product self-attention in the vanilla transformer paper. Image source: <a href="https://arxiv.org/pdf/1706.03762">https://arxiv.org/pdf/1706.03762</a></figcaption></figure><p>In the original paper, the vanilla transformer only worked with a sequence length 512. However, one of the challenges modern transformer-based LLMs face is working with <a href="https://github.com/NVIDIA/RULER">sequence lengths up to 128k and even longer</a>. Scaling is complicated since self-attention has a computational complexity of O(N²) (N is the sequence length).</p><h4>Sparse Transformer with Block-wise Self-attention — A Naive Approach</h4><p>To address the quadratic computation cost issue, a naive approach was proposed by OpenAI in 2019, converting the <a href="https://arxiv.org/pdf/1904.10509">vanilla self-attention into the sparse format</a>.</p><p>The idea is simple: In the original self-attention, the attention head (we only assume the case of having a single attention head) attends to the whole sequence (e.g., query i attends to all token j: j ≤ i, which is shown as the left attention matrix below). In the sparse attention design, the single attention head is split into multiple independent sparse head, where each head attends to only a block of the tokens (e.g., query i on head k attends to a block of tokens j: j≤ i &amp; j in block_k, which is shown as the right attention matrix below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*IujEyzS8m09hFJ4O56GblQ.png" /><figcaption>Full attention (left) vs sparse attention (right) for autoregressive modelling. Image source: <a href="https://arxiv.org/pdf/1904.10509">https://arxiv.org/pdf/1904.10509</a></figcaption></figure><p>The equation for the sparse attention could be written in the following format, where S_i is the set of token indices for sparse head i.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*i-QzrruCudsUyTCJYl5xvw.png" /><figcaption>Sparse attention representation. Equation source: <a href="https://arxiv.org/pdf/1904.10509">https://arxiv.org/pdf/1904.10509</a></figcaption></figure><p>However, in the original paper, the experiments only involved using two sparse heads, which leads to a limited computational complexity reduction to O(N log N).</p><h4>Longformer — Sliding Window Sparse Attention</h4><p>A natural alternative to the sparse block-wise attention is the sliding window. Published in 2020, the Longformer model proposed the sliding window-based sparse attention with variations of dilated window and added global attention. With the fastest implementation, the Longformer could reach an almost linear scaling up to a 16k context length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxMV4AFqDvuMqAFFq7Ss6A.png" /><figcaption>Longformer sliding-window sparse attention. Image source: <a href="https://arxiv.org/pdf/2004.05150">https://arxiv.org/pdf/2004.05150</a></figcaption></figure><h4>BiFormer — Vision Transformer with Routing Sparse Attention</h4><p>To explore the sparsity of self-attention fully, a CVPR’23 paper proposed BiFormer. This ViT-based model applies top-k gating on the adjacency matrix formed naturally by the patch-wise queries and keys in the Vision Transformer.</p><p>Specifically, an input image of size H*W (if it’s multi-channel images, the channel is C) is split into S*S patches, and then the adjacency matrix A formed by the query Q and key K is gated by the top-k connection I. The new sparse key K_g and value V_g are calculated using the sparse connection I, and the final sparse attention score is computed using the sparse key and value matrices:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*vrdXCTCU9tzNxjVYWjvqkw.png" /><figcaption>Sparse self-attention routed by top-k gating. Equation source: <a href="https://arxiv.org/pdf/2303.08810">https://arxiv.org/pdf/2303.08810</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*VCwHQ65BFSiYOzXdKP556w.png" /><figcaption>The full routed attention pipeline. Image source: <a href="https://arxiv.org/pdf/2303.08810">https://arxiv.org/pdf/2303.08810</a></figcaption></figure><p>The BiFormer was shown to reach a computation complexity of only O(N^(4/3)), which vastly reduced the original quadratic computation while outperforming SOTA ViT models on the ImageNet dataset.</p><h4>MOBA — The Mixture of Block Attention</h4><p>The idea of MOBA is very similar to the BiFormer: to break a sequence of length N into n small blocks and to generate keys and values for each block, then routing the query to different groups of blocks and calculating the attention scores locally. The difference is that MOBA uses the mean pooling of the blocked keys to calculate the top-k gating instead of the full affinity matrix, which further saves computational cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*0S0-BmeDAaQE6q1JLWxrYw.png" /><figcaption>A running example of the Moba Mixture of Attention architecture with two queries. Image source: <a href="https://arxiv.org/pdf/2502.13189">https://arxiv.org/pdf/2502.13189</a></figcaption></figure><p>The routing mechanism is implemented through top-k gating — the similarities between each query token and all blocks are measured, and only the top-k blocks are selected for calculating the final MOBA self-attention:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*9vJnt06dUVGXL7tJfURXDg.png" /><figcaption>MoBA self-attention, where I indicates the selected blocks. Equation source: <a href="https://arxiv.org/pdf/2502.13189">https://arxiv.org/pdf/2502.13189</a></figcaption></figure><h4>DeepSeek — Native Sparse Attention (NSA)</h4><p>But can the different formats of sparsity be combined? DeepSeek’s latest paper proposed a solution called Native Sparse Attention, combining the top-k attention selection with sliding window attention while further reducing the computation cost by compressing the sequence blocks during the top-k selection stage.</p><p><strong>Token compression</strong>. The sequence is first broken down into blocks, and each block is mapped onto the lower dimensional space by an MLP (\phi) with intra-block positional encoding for key and value representation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*TyN-1olLGGHj7LNjckgE3w.png" /><figcaption>Compressed key representation. Equation source: <a href="https://arxiv.org/pdf/2502.11089">https://arxiv.org/pdf/2502.11089</a></figcaption></figure><p><strong>Token selection</strong>. Using the original query and compressed keys, the attention score can be used to score the importance of different blocks and select the top-k blocks with the highest scores. And the chosen keys and values are concatenated before calculating the self-attention scores.</p><p><strong>Sliding window attention</strong>. Besides the compression and selection branches, the NSA has a third branch, using a sliding window to focus on local context while enforcing sparsity.</p><p>The full NSA architecture is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DeT0yfbZurMIqdz-q9C5Zw.png" /><figcaption>The full native sparse attention architecture. Image source: <a href="https://arxiv.org/pdf/2502.11089">https://arxiv.org/pdf/2502.11089</a></figcaption></figure><p><strong>Flash-attention-based hardware-aligned design</strong>. For the compression and sliding window attention branches, the computation can be converted to flash-attention computation directly, as these operations are close to the original self-attention computation. However, there is no ready solution for the selection attention branch. The authors proposed the following loops for utilizing the SRAM and HBM efficiently:</p><ul><li>Inner loop on SRAM — load all queries in each GQA group simultaneously and key/value block sequentially to compute the top-k selection.</li><li>Outer loop on HBM — once the selection is done, the output will be passed on to the HBM for the next computation step.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*eNj1EIWNJgTcSOdo3__1_A.png" /><figcaption>FlashAttention desisn of the selection attention branch. Image source: <a href="https://arxiv.org/pdf/2502.11089">https://arxiv.org/pdf/2502.11089</a></figcaption></figure><h4>Conclusion</h4><p>There is no direct comparison between the MOBA and the DeepSeek NSA models since both papers were published almost simultaneously. However, we can still see the unique strength of each algorithm.</p><p>The combination with FlashAttention makes it super fast for NSA, reaching almost 11X speed-up in the decoding stage with a 64k context length, with even a higher performance than the full attention baseline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TXtwBn210mw8hQHLwO_lLw.png" /><figcaption>NSA performance and speedup. Image source: <a href="https://arxiv.org/pdf/2502.11089">https://arxiv.org/pdf/2502.11089</a></figcaption></figure><p>For MOBA, it scaled astonishingly to 10m context length and reached up to 10X speed up compared to FlashAttention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTrtxQMDXaSJKi3ExyH13A.png" /><figcaption>MOBA vs flash attention. Image source: <a href="https://arxiv.org/pdf/2502.13189">https://arxiv.org/pdf/2502.13189</a></figcaption></figure><p>NSA or MOBA, we don’t know which model is better yet. But we can know, with an extraordinary performance on long context sequences, that the sparse attention LLMs are getting us closer to the AGI era.</p><h4>References</h4><ul><li>HuggingFace Blog, “Mixture of Experts Explained”. Link: <a href="https://huggingface.co/blog/moe">https://huggingface.co/blog/moe</a></li><li>Lu E et al., “MoBA: Mixture of Block Attention for Long-Context LLMs.” arXiv preprint 2025.</li><li>Yuan J. “Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention.” arXiv preprint 2025.</li><li>Feng L et al., “Attention as an RNN.” arXiv preprint 2024.</li><li>Hsieh CP et al., “RULER: What’s the Real Context Size of Your Long-Context Language Models?.” arXiv preprint, 2024 Apr.</li><li>Gu A et al., “Mamba: Linear-time sequence modeling with selective state spaces.” arXiv preprint 2023 Dec.</li><li>Sun Y et al., “Retentive network: A successor to transformer for large language models.” arXiv preprint 2023.</li><li>Zhu L et al., “Biformer: Vision transformer with bi-level routing attention.” CVPR 2023.</li><li>Beltagy I et al., “Longformer: The long-document transformer.” arXiv preprint 2020.</li><li>Beltagy I et al., “Longformer: The long-document transformer.” arXiv preprint 2020.</li><li>Child R et al. “Generating long sequences with sparse transformers”. arXiv preprint 2019.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d46463e0a9a6" width="1" height="1" alt=""><hr><p><a href="https://aiadvances.org/sparse-transformers-d46463e0a9a6">Sparse Transformers</a> was originally published in <a href="https://aiadvances.org/">AI Advances</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Year in Writing]]></title>
            <link>https://mengliuz.medium.com/a-year-in-writing-856681810aa4?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/856681810aa4</guid>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Sun, 09 Feb 2025 04:33:17 GMT</pubDate>
            <atom:updated>2025-02-09T04:33:17.739Z</atom:updated>
            <content:encoded><![CDATA[<h4>A personal reflection on my 2024 journey in writing blogs</h4><p>2024 was such a pivot year for me.</p><p>I started to write consistently on Medium.</p><p>In the past few years, I have blogged a few times annually about small side projects and papers that I found interesting. But I never felt the urge to consistently write on anything or any topic. Having read many personal and technical blogs previously, I always felt jealous that people could stick to a few subjects and keep writing on and on for years and eventually become the top experts in the field. I wished I could do that myself, but I never knew how.</p><p>Last year, everything changed. There was so much confusion in my career and personal life that I got mentally paralyzed. I could not think about anything except sitting down every week and randomly picking a burning topic, a paper I was reading, a bug that haunted me for XXX days, and starting to write.</p><p>At first, it was daunting. Don’t laugh; writing can be daunting. Writing can be incredibly daunting when you’re not “given” a topic to write about. When I started writing more frequently on free issues, I felt like a student preparing for exams but realized there was no textbook for guidance. I grabbed every topic that came into my mind. However, that devastation made me highly obsessed with the chosen topic — sometimes, I found myself writing till midnight on a Sunday night just because I felt obliged to finish that topic and start a new one.</p><p>It felt sick.</p><p>And I got lost again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsdM0hOWuBeW8JH8Uz0wnQ.jpeg" /><figcaption>Image source: <a href="https://pxhere.com/en/photo/1689500">https://pxhere.com/en/photo/1689500</a></figcaption></figure><p>But things started to change.</p><p>Coincidentally, I started talking to people I never thought I would talk to. At first, it was even more daunting than writing blogs. But once connected, they began to share deep emotional feelings, personal experiences, career insights, and even their dreams with me. I got mind-blown. It was the first time I realized that there is another world of people in which they could clearly describe their life goals, career goals, likes and dislikes, and how they tactically build their careers to live with what they like.</p><p>Looking back at my blog articles, I suddenly knew what was wrong. I wrote a lot, not because I truly loved the topics but because I had so much anxiety. I was so anxious because I didn’t know what I truly wanted. And when I asked myself what I truly wanted, the answer is, —</p><p>I didn’t know. Or I thought I knew what I wanted —</p><p>Until the moment I started to write.</p><p>So I started to interview people.</p><p>I started to interview people on a variety of topics. Their career goals, plans for the next few years, life and professional tips. <strong>Most importantly, I interviewed people about what they were genuinely passionate about.</strong> A girl told me she enjoyed connecting dots for large-scale projects, even as an undergraduate student, before becoming a PM. Another girl told me that she learnt A/B testing through textbooks and successfully applied that in her internship, motivating her to become a professional data scientist. An engineer said to me that she enjoyed being an IC rather than a manager, and her goal was to work in large companies to work with the top brains. Another engineer told me that he thought machine learning was the future, and in the next few months, he read and watched every machine learning book and course available.</p><p>It was mind-blowing.</p><p>It was the first time I vividly understood that passion is not what you claim. <strong>Your true love is</strong> <strong>what you think and work on daily, and your reading and writing reflect your thoughts and work</strong>. That understanding helped me shift my attention to a combination of ML engineering best practices like mixed precision training and cutting-edge research topics like (multi-modal) LLM — the former is what I’ve been working on for years in the past, the latter is what I desired to work on for the next few years.</p><p>And most important of all, I started to enjoy writing. I no longer find myself writing on a Sunday night out of anxiety but start to scatter the writing load over a week or even a month, just a few paragraphs per day. Once I understood my passion, I began to have better planning and patience, as that comes with true love. I no longer have to anxiously think of a new topic, but new issues come to me. Now, I can tell why I’m reading a specific paper and how to use what I learnt to go forward.</p><h4>Conclusion.</h4><p>The conclusion is — I’ve even learnt to write a conclusion to my articles! 😂</p><p>The year of writing in 2024 has been fruitful and inspiring. So, my best wishes to everyone is to keep writing! Not only writing for content and recognition but for self-understanding and dream-achieving.</p><p>And I’m sure, 2025 will be another great year in writing :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=856681810aa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inside DeepSeek V3]]></title>
            <link>https://aiadvances.org/inside-deepseek-v3-80283167673b?source=rss-6db175d93233------2</link>
            <guid isPermaLink="false">https://medium.com/p/80283167673b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Mengliu Zhao]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 23:51:40 GMT</pubDate>
            <atom:updated>2025-02-05T23:51:40.479Z</atom:updated>
            <content:encoded><![CDATA[<h4>A high-level overview of the technologies used in the DeepSeek v3 model</h4><p>The name DeekSeek has swept the internet over the past few weeks.</p><p>Published in Jan 2024, the first generation of the DeepSeek model series, the <a href="https://arxiv.org/pdf/2401.06066">DeepSeek MoE</a>, gained quite some attention by improving the MoE framework over the <a href="https://arxiv.org/abs/2006.16668">GShared model</a>. A few months later, DeepSeek v2 was published, announcing a performance comparison to the previous generation while reducing the training cost almost by half and the KV cache by more than 90%, using its novel <strong>Multi-head Latent Attention and Load-balancing Auxiliary loss mechanism</strong>. At the end of the year, DeepSeek released its v3 model, outperforming state-of-the-art commercial and open-source LLMs on multiple benchmarks like multi-task language understanding, question and answering, math, coding, etc., while maintaining a <strong>historically low training cost</strong>.</p><p>But how was it possible? The <a href="https://arxiv.org/abs/2001.08361">OpenAI scaling law</a> back in 2020 claimed that <em>a better model performance requires more model parameters and a larger dataset</em>, which all points to larger training costs. Achieving good model performance with extremely low training costs has always been seen as an impossible task.</p><p>In this article, we’ll walk through the core technologies in the DeepSeek v3 model to see how they achieved the <em>mission impossible</em>. Specifically, the leading technologies DeepSeek v3 used include the following:</p><ul><li><strong>Multi-head latent attention </strong>— which projects the attention to a lower dimensional space to save parameters</li><li><strong>Load-balancing auxiliary loss for the MoE architecture — </strong>which reinforces the MoE performance while saving parameters</li><li><strong>Multi-token prediction for training</strong> — which improves training performance given the fact the model parameters have been reduced</li><li><strong>Fine-grained 8-bit quantization for training</strong> — which essentially reduced the GPU memory and increased the training speed without hurting the performance</li><li><strong>The dual-pipe mechanism for parallelization</strong> — parallelizing the communication and computation for the transformer layer dispatch and combination in the forward and backward procedure.</li></ul><p>In the conclusion section, we’ll compare model performance on benchmark datasets and training costs of DeepSeek v3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hekq0WS7PrcwRHlRH5Iaqg.jpeg" /><figcaption>Image source: <a href="https://pxhere.com/en/photo/1610586">https://pxhere.com/en/photo/1610586</a></figcaption></figure><h4>Base Transformer Blocks</h4><p>Like most state-of-the-art LLM architectures, the DeepSeek v3 uses pre-normalized (which means the layer normalizations are before the self-attention and the FFN) transformer blocks with <a href="https://arxiv.org/abs/2104.09864">RoPE</a> for positional encoding. Each &lt;norm, attention, norm, FFN&gt; stack is counted as one transformer block, and the whole architecture contains L transformer blocks in total (L=61 for DeepSeek v3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*wm7f5M13RP8CxH9Vm-LHjw.png" /><figcaption>Transformer blocks with pre-norm. Image source: <a href="https://arxiv.org/pdf/2501.12948">https://arxiv.org/pdf/2501.12948</a></figcaption></figure><h4>Multi-head Latent Attention</h4><p>To save computation time, DeepSeek V3 proposes to use <strong>multi-head latent attention</strong> (MLA) instead of the classic multi-head attention (MHA) proposed in vanilla transformers.</p><p>The key difference is that the input sequence for MLA is first projected into the latent spaces for query, key and values before applying RoPE and computing the self-attention. To overcome the issue that RoPE is inefficient in inferencing in the lower dimensional space, a decoupled rotated key and query copy are maintained separately and concatenated to the latent vectors. A more detailed description of the decoupled RoPE strategy can be found in the <a href="https://arxiv.org/pdf/2405.04434">DeepSeek v2 report</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJK9L8UIVrThci2JdQhKlQ.png" /><figcaption>Left: multi-head attention in the vanilla transformer. Image source: <a href="https://arxiv.org/pdf/1706.03762">https://arxiv.org/pdf/1706.03762</a>. Right: multi-head latent attention in DeepSeek. Image source: <a href="https://arxiv.org/html/2412.19437v1">https://arxiv.org/html/2412.19437v1</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5yzx871Lju8ACTa9tFtTQ.png" /><figcaption>Comparison between MLA and different variants of MHA. Image source: <a href="https://arxiv.org/html/2405.04434v4">https://arxiv.org/html/2405.04434v4</a></figcaption></figure><h4>Auxiliary-loss-free Load Balancing for Mixture of Expert (MoE)</h4><p>Since the vanilla transformer model&#39;s feedforward networks (FFN) are computationally expensive, many approaches have tried to use a Mixture of Experts (an expert is a smaller model) to reduce the cost. The MoE architecture used by DeepSeek is a combination of shared experts and routed experts — the shared experts are always activated, where only the top-k routed experts are selected for each token; thus, the computation cost can be vastly reduced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*-gWgWOMczp-OLCVh8blu2g.png" /><figcaption>DeepSeek MoE with routed and shared experts. Image source: <a href="https://arxiv.org/html/2412.19437v1">https://arxiv.org/html/2412.19437v1</a></figcaption></figure><p>However, one issue with the top-k selection is the load balancing issue which might cause routing collapse (collapse refers to “always produces large weights for the same few experts”, See <a href="https://openreview.net/pdf?id=B1ckMDqlg">Shazeer’s 2017 ICLR work</a>). A classical method uses auxiliary losses to resolve the routing collapse issue, which further causes computational inefficiency issues.</p><p>To resolve this, DeepSeek uses an extra Expert Bias term, monitoring the expert load and updating the bias during training. Specifically, if the corresponding expert is overloaded, the bias term is decreased by a hyper-parameter (called bias update speed) during the update; if the expert is underloaded, then the bias term is increased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*O9PL22Nd8ODAQF95U040Ag.png" /><figcaption>Auxiliary-loss free training with expert bias term update. Image source: <a href="https://arxiv.org/pdf/2408.15664">https://arxiv.org/pdf/2408.15664</a></figcaption></figure><h4>Multi-token Prediction (MTP)</h4><p>Most state-of-the-art LLMs are autoregressive models, which model the prediction of the current token (single token) based on past seen tokens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/0*fz5Si3F_gJnk_9qX.png" /><figcaption>Equation source: <a href="https://www.arxiv.org/pdf/2408.11039">https://www.arxiv.org/pdf/2408.11039</a></figcaption></figure><p>Slightly different, the <strong>multi-token prediction</strong> mechanism keeps the autoregressive prediction as the “main model” while using extra autoregressive MTP models with shared embedding and output head layers. The input of each k-step MTP is the sequential data k-steps from the current token. The output hidden states from step k-1 are concatenated to step-k after the input embedding layer to ensure a complete causal chain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_OWL34NRLB2rpX-oeqLg7w.png" /><figcaption>MTP loss beside the original LM loss for training. Equation source: <a href="https://arxiv.org/html/2412.19437v1">https://arxiv.org/html/2412.19437v1</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/1*sxtoJoQq8p6LDH5uyo0Swg.png" /></figure><p><strong>Inference</strong>. Note that the MTP module is only used to improve training performance. During the inference stage, only the original main module is used.</p><h4>Low-precision Training with Fine-grained FP8 Quantization</h4><p>In PyTorch, the default <a href="https://pytorch.org/docs/stable/generated/torch.set_default_dtype.html">floating point precision is float32</a>, often called full-precision in the literature. To <a href="https://pytorch.org/blog/what-every-user-should-know-about-mixed-precision-training-in-pytorch/#:~:text=Peak%20float16%20matrix%20multiplication%20and,float32%20performance%20on%20A100%20GPUs.">save GPU memory, bandwidth, and computation time</a>, the float16 type is frequently used by leveraging tensor cores in Nvidia’s newer generation of architectures and is called half-precision. Half-precision can be directly used during inference but needs to be carefully calibrated (e.g., using <a href="https://pytorch.org/tutorials/recipes/recipes/amp_recipe.html">auto-mixed precision</a>) during training to ensure training convergence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lXWru8rfDSlw7l92X9kdUA.png" /><figcaption>A comparison between different computation precision. Image by author.</figcaption></figure><p>For further reducing cost, quantization and extreme techniques like FP8 (8-bit floating point) and FP4 can be further used during inference time. However, limited work has been done using FP8, as the quantization could lead to instability during the training stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*VzZqTMNlE6jfhAn1tm4TkQ.png" /><figcaption>The absolute maximum values of activations during FP8-based LLM training. Left: The activation value is relatively small at the beginning of the training stage. Right: after training with 200B tokens, activation outliers with large values occur. Image source: <a href="https://arxiv.org/pdf/2409.12517">https://arxiv.org/pdf/2409.12517</a></figcaption></figure><p>Two significant techniques were proposed to address the overflowing and underflowing issues in FP8 computation: a) accumulation precision with the FP32 register and b) fine-grained quantization.</p><p><strong>Accumulation Precision.</strong> During multiplication computation, the result range can quickly surpass the FP8 floating precision, so a higher precision intermediate data type is often needed for “accumulation” purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*foW7FF6oCHmFqr6Q4edoeQ.png" /><figcaption>Precision accumulation for DeepSeek V3. The top rectangle illustrates the process of two MMA (matrix multiplication accumulation) computations on tensor cores, where low precision accumulation (14bits with Nvidia H800 GPU) is used. Once the accumulation exceeds a certain threshold N_C, the accumulation will be copied to FP32 registers on CUDA cores (rectangle below). IMage sourece: <a href="https://arxiv.org/html/2412.19437v1">https://arxiv.org/html/2412.19437v1</a></figcaption></figure><p><strong>Fine-grained (tile-wise and block-wise) quantization</strong>. To address the activation outlier issue, DeepSeek V3 groups activation to 1*128 tiles and weights to 128*128 blocks and then scales the maximal absolute value on each tile/block to the maximal representable value of FP8 accordingly. Previous works have attempted using different FP8 formats (E5M2–5 bits for exponent and 2 bits for mantissa, E4M3–4 bits for exponent and 3 bits for mantissa) for gradient backpropagation and forward. The fine-grained quantization can reduce the activation outlier issue and ensure the use of a consistent representation on both the forward and backward steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*lQuU1ZvzuxbyFb7sm5c0KA.png" /><figcaption>Granular scaling on tile/block basis. Image source: <a href="https://arxiv.org/html/2412.19437v1">https://arxiv.org/html/2412.19437v1</a></figcaption></figure><p>The entire mixed precision training pipeline with FP8 could be summarized as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cLQTZXCsO21F13TTRXpqyg.png" /><figcaption>The full mixed precision training pipeline with FP8. Image source: <a href="https://arxiv.org/abs/2412.19437">https://arxiv.org/abs/2412.19437</a></figcaption></figure><h4>Dual-Pipe for Parallelization</h4><p>DeepSeek v3 combines several existing parallelization paradigms for accelerating the computation, e.g., 16-way pipeline parallelism, 64-way expert parallelism, and Zero-1 data parallelism. However, to address the heavy communication overhead, DeepSeek v3 proposes a dual-pipe paradigm, which breaks the dispatching and combination operations in the original MoE design into overlapping computation chunks in the forward and backward process.</p><p>What are the <em>dispatching and combination in the MoE computation</em>? This mechanism was first proposed in the DeepSeek MoE paper, which balances the load of experts before the computation (all2all dispatching) and groups the weights from devices once the calculation is done (all2all combination). However, the dispatch and combination across different nodes would trigger heavy communication overhead, making the computation inefficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmqrj--vO-7oRy8B6TDeKQ.png" /><figcaption>The single pipe mechanism for the original DeepSeek MoE paper with dispatching and weight combination. Image source: <a href="https://arxiv.org/pdf/2006.16668">https://arxiv.org/pdf/2006.16668</a></figcaption></figure><p>To overcome the communication overhead, DeepSeek v3 further proposes the Dual-pipe mechanism, which divides the forward and backward processes into &lt;attention, all2all dispatch, FFN, all2all combine&gt; components and seamlessly aligns them to hide the dispatch, combine, and pipeline parallelization (PP) communication:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*836SeLOHNctDFS8kusumtg.png" /><figcaption>Re-arrange the computation order so minimize the communication. Image source: <a href="https://arxiv.org/html/2412.19437v1#S1">https://arxiv.org/html/2412.19437v1#S1</a></figcaption></figure><h4>Conclusion — Performance and Training Cost</h4><p>Now, let’s have a look at the DeepSeek v3 performance. From the following figure, we can see that the DeepSeek v3 (almost) outperforms all state-of-the-art LLM models on multi-task language understanding (MMLU), general purpose question and answer (GPQA), competition-level mathematics (MATH 500), system optimization (AIME), competition coding (Codeforces), and solving real-world software issue (SWE-bench).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PCtSZEvme_3VvroQ_L7_PQ.png" /><figcaption>DeepSeek v3 performance on benchmark tasks. Image source: <a href="https://arxiv.org/html/2412.19437v1#S1">https://arxiv.org/html/2412.19437v1#S1</a></figcaption></figure><p>Good performance, that’s pretty cool, isn’t it? However, what makes DeepSeek v3 stand out is the training cost. The GPT-4 claims to have used 56 million GPU hours (a GPU hour means the hour spent on an A100-equivalent machine) with 1.8T parameters, while <a href="https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_3/">Llama 3.3</a> spent 7 million GPU hours training 70B parameters. DeepSeek v3 shows a comparable performance while reducing the GPU hours to only 2.8 million. Considering the technical difference between A100 and H800 (e.g., H800 has 2x CUDA and 5x Tensor cores but lower NVLink bandwidth), the up-to-90% training hour saving is still very impressive. It not only proves the effectiveness of using MoE architecture but also leads to new paths like quantized low-bit training, latent-space attention computation, and the original parallelization paradigm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g78h_VXWNnNaYwajsLJoAw.png" /><figcaption>GPU hours comparison between DeepSeek and other models. Image by author.</figcaption></figure><h4>References</h4><ul><li>Liu et al., “Deepseek-v3 technical report.” arXiv preprint, 2024.</li><li>Liu et al. “Deepseek-v2: A strong, economical, and efficient mixture-of-experts language model.” arXiv preprint, 2024.</li><li>Dai et al., “Deepseekmoe: Towards ultimate expert specialization in mixture-of-experts language models.” arXiv preprint 2024.</li><li>Fishman et al., “Scaling FP8 training to trillion-token LLMs”, arXiv preprint, 2024</li><li>Wang et al., “Auxiliary-loss-free load balancing strategy for mixture-of-experts.” arXiv preprint, 2024.</li><li>Lepikhin et al. “Gshard: Scaling giant models with conditional computation and automatic sharding.” arXiv preprint 2020.</li><li>Su et al. “Roformer: Enhanced transformer with rotary position embedding.” Neurocomputing 2024.</li><li>Kaplan et al. “Scaling laws for neural language models.” arXiv preprint 2020.</li><li>Shazier et al., “Outrageously large neural networks: The sparsely-gated mixture-of-experts layer.” ICLR 2017.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80283167673b" width="1" height="1" alt=""><hr><p><a href="https://aiadvances.org/inside-deepseek-v3-80283167673b">Inside DeepSeek V3</a> was originally published in <a href="https://aiadvances.org/">AI Advances</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>