Towards Long-Horizon Tasks

Introducing Z.ai and GLM's Origins

The speaker introduces himself as head of Z.ai (formerly Zhipu AI), explaining the company's rebrand around the domain z.ai and his role connecting research and marketing. He recounts the company's history since 2020, including the original GLM paper from 2021, its connection to Moonshot AI founder Zhilin Yang, and highlights GLM 5.1's coding performance on par with Opus 4.6 using Claude Code as the harness.

What Are Long Horizon Tasks?

The speaker introduces the session's main topic—long horizon tasks—noting how labs like Gemini, Claude Opus, and Kimi are all discussing this capability. He explains that long horizon capabilities let agents work autonomously overnight, survive interruptions, and still achieve goals, and describes how this shift has even changed hackathon formats to 48-hour overnight events where agents complete tasks while participants sleep.

Subjective vs. Objective Goals in Long Horizon Tasks

The speaker distinguishes between subjective goals (like building a beautiful website, judged qualitatively) and objective goals (like optimizing a CUDA kernel, measured numerically). He explains how Z.ai evaluates subjective tasks using vision models and computer-use agents to check whether requirements like '50 functional apps' are truly fulfilled, noting that model capability greatly affects success on such open-ended goals.

Tips for Achieving Long Horizon Goals with Weaker Models

The speaker offers practical strategies for accomplishing long horizon tasks even with models lacking native long horizon capability, emphasizing the use of checklists, step-by-step verification, reflection, and memory persistence. He explains that harnesses are needed to externally manage knowledge and evaluation since models can't integrate all context internally.

METER's Time-Based Framework and Its Limitations

The speaker discusses METER's definition of long horizon tasks based on how long a human would take to complete them, using benchmarks like MATH and SWE-bench as examples. He critiques this time-based approach, arguing that AI inference speed (citing chips like Cerebras and Groq) makes human-time comparisons unreliable, and that measuring by tokens or turns may better reflect agent capability than elapsed time.

Redefining Objective Goals: Depth Over Time

The speaker argues that overly specific numeric targets (like '30x speedup') are the wrong way to frame objective goals, proposing instead that tasks should be framed broadly, such as 'optimize as much as possible.' He introduces the idea that 'depth means more than time,' illustrating this with Z.ai's vector database optimization showcase, which improved QPS from 6.5k to 21.5k over 600 runs through varied strategies and many failures, showing that true long horizon capability comes from learning through repeated failure and reflection.

Comparing Model Performance on CUDA Kernel Optimization

The speaker compares Claude Opus 4.6, GLM 5.1, Opus 4.5, and GLM 5 on CUDA kernel optimization tasks, showing that older models plateau after around 800 runs while newer models like Opus 4.6 and GLM 5.1 continue improving and surpass previous versions of themselves. This demonstrates that true long horizon capability means continually exceeding one's own past performance limits, not just running longer.

Three Misconceptions About Training Long Horizon Models

The speaker outlines three common misconceptions in training long horizon models: that larger context windows solve the problem (GLM 5.1 is only 200k context yet outperforms million-token models), that explicit planning prompts guarantee success (models often stop early claiming false completion), and that longer runs always mean stronger models (token efficiency matters more than sheer run count).

Training Approach: Frontier Suite and Realistic Task Categories

The speaker explains Z.ai's approach to training long horizon models by finding realistic tasks and building robust evaluations, introducing their 'Frontier Suite' dataset with three task categories: implementation, research, and performance (optimization). He emphasizes that the real challenge in training isn't data availability but identifying meaningful, well-defined tasks that reflect real-world needs.

Closing Remarks and Upcoming Model Announcements

The speaker wraps up by inviting attendees to connect with him via social media for further discussion on research and services, and teases an upcoming model release expected to impress the open source industry. He reiterates that despite downplaying context window importance, Z.ai will still improve context size alongside long horizon capabilities in future models.

Okay. Thanks, Sean. That's the best advertisement I've ever heard of ZAI and GLM. So as you can see I put our model name and our company name here, so it's not relevant right? The ZAI and GLM, why you are not called g.ai, but like G dot AI belongs to Google, so as Google is one of the sponsors, we'll not use G.

AI as our company name. So first today we're talking about long horizon tasks, we're not talking about GLM. So if you want to talk about like open source, IMIT license or Chinese labs, you can reach out to me after the session. But today we are share our understanding of long horizon task as a generic terms.

So first something about our company, actually we bought this domain zdot.ai, so that's the reason why we changed our company name to this one, it cost like more than a million of dollars, like super expensive. And the founder of this lab, he gave me the domain, so I become the head of ZDoA actually.

So now I'm in charge of this chatbot agents, model release, research exploration. So also I cover a lot of research because currently a lot of people are bluffing their new ideas, try to differentiate like who's who's real, who's not real. So that's one of my job. And also I connect the researchers and the marketing team, so inside ZLEA we don't have marketing team.

It's fantastic because we believe, yeah believe that the builder needs to market himself and model. And also we have good organizations like artificial analysis, so we use their bar charts and no need to talk about our models. But frankly speaking Zeta AI is one of the first global companies to explore large language model.

So we start this large language model exploration back in 2020. And in 2021, we have our first paper called GLM. So GLM actually stands for general language model. Yeah at the same time with GPT-two. And as you can see I've labeled two people here, first is Jilin Yang who is the founder of Moonshot AI.

So if you have heard of Kimi, Kimi two point five, Kimi two point six, Zhi Lin is the founder of Moonshot of Kimi and he is one of the author of GOM, but he is the student of the founder of ZDoll AI, so actually it's very interesting style like open and anthropic. So Julian, the the founder of Kimi, wrote the paper of GRM that led the company and created Kimi.

Yeah. And he's students of the founder of ZDogg And also about the model, that's the last I think the last page of GOM. So we are very good at coding energetic task. So GOM 5.1 the model released in March is on par with OPUS 4.6 in coding and we use Clock Code as the harness.

So if you will say or ask which harness is the best coding agent for using GLM, so I still recommend using Clockcode. So Clockcode is a harness for almost all Chinese labs or Chinese model like Kimi K 2.6 or Deepsea v four because I think we need to focus on one thing, the model itself.

So we use other harness as the main coding agent for us. Okay so that's all for GOM and now we are moving to long horizon task. So how many of you have heard of long horizon tasks or long running tasks? Yes. All the labs here are talking about this kind of stuff like Geon 5.1 long horizon, Cloud Opus 4.7 long running task, and also Kimi long horizon.

All happened in April. So what actually it is, we will spend like near twenty minutes covering this topic. First, just to start from some simple stuff, long horizons capabilities are very useful. Because before long horizon task, you can only do the things yourself, but with the development of Open Claw together with Opus 4.5, Opus 4.6, your agents can use agents.

So you can go to sleep and let let your agents finish all the task for you. That's the first thing. And the second is inside OpenCLR or other autonomous agents sometimes you get interruptions because you need to grasp new news, new information and sometimes it went wrong you need to give new instructions.

So long horizon task or long horizon capabilities will make sure that your agents do can finish the goal. You when you set a goal and you you get interrupted, your agents and your model can survive that interruptions. And it also changed our way to see our meetups and hackathons and workshops. So as a model lab, we no longer host three hour hackathon. Our hackathon become forty eight hours a week or so because we want to utilize the night to let all the participants explore this model. For example, seeing our first forty eight hour hackathon, seven people spend their night, let their agents operate on their own, and they they finally win because their agents can do task during night. So I need to assign all the tasks to it before I go to sleep.

So that's a an enemy showing that maybe in the in the next era like people assign tasks daily and all the agents finish all the tasks during night. So what are long horizon tasks? We have we haven't explained it. So there are different methodologies or different types of long horizon task.

So first one is subjective goal. So with subjective goal if I want to build a website, there's no judgment. So I I can say it's beautiful, it's ugly, it meets my requirements, it doesn't meet my requirements. So there's no single metric to optimize. And the second type is objective goal. So if I want to optimize a CUDA kernel, or I want to speed up something inference or KV cache.

So there's some explicit numeric objective, such as speed and latency that can make the model best optimized for. So with subject to goal, here's a prompt example prompt and we also have a video talking about this. For example, we let the model build a beautiful website or a web based Linux replica and we require it to have 50 fully functional apps. But it doesn't matter like which 50 apps they are, so I need to judge it by myself.

And inside ZDollar AI, we are doing a lot of auto eval development. So for this type of thing, it's hard to use numbers to assess the process, but we began to use agents, vision models or other capabilities try to explore all the things. So when people are talking about computer use, you rarely see like people really use computer use to finish task.

But inside evaluation process, there are already lots of people using computer use try to click into the every app and check a status to see whether the full requirements has been fulfilled. So that's the first example of a subjective goal. And even there's a goal, so different models can behave differently.

If you are using an OPUS 4.8 or a GPT-five point five, may achieve that goal. But if you are using smaller models or local models sometimes you cannot help. So what can you do if you you actually want to do a long horizon task by using a model that doesn't have long horizon capabilities?

There are some tips for you. So the core ideas is to use checklist, to use verification in the every step, to let the model reflect and think back and continuously put all the things back into the memory. So if the model cannot handle it, you need to use harness. The reason why we need harness is that model cannot integrate all the things, all the knowledge into itself.

So you need to automatically incorporate all the checklist, all the evaluation process, the verifications into the process. And also there's a organization called METER, it has its own interpretation of long horizon tasks. So their understanding is that the task for humans is highly correlated with the capabilities of long horizon task.

So the time needed to complete the task for humans with appropriate expertise will decide whether that problem is a long horizon task or not. So as you can see there's a like dataset called math, it's quite simple. Maybe currently all the models can handle it 100%, but there are also very tough problems like sweep bench, live code bench, etc. So these these benchmarks or these tasks may cause people about one hour or two hours to finish the task.

So here are some examples. For example, find the script it cost people three second and when you want to optimize a CUDA kernel it cost you eight hours. Yeah but the reason why post it is not because it's very useless, is because it has some flaws.

It might not be ideal for task with objective goals. Here's some reason because first time is not a good measurement for AI behavior. Because as a human like we can't handle it in one hour, two hour, but with AI the inference speed may matter a lot. For example, there's a new like architecture incorporate all the model weights inside the chip, and the inference speed can be more than 16,000 TPS per user and also you have CIRBAs, Grok, these super fast chips. So using these chips and inference, the time doesn't matter. Yeah you can use a single model, the model can finish the task within ten seconds or cost you like more than two hours. Speed doesn't matter that much, maybe tokens or maybe runs turns means more for agents.

And another thing is the task in meter are too specific. For example, so the task is let the model optimize a CUDA kernel by 30 x. So why not two x? Why not like 100 x? So that thing highly depends on the outcome. You want to optimize 2x maybe an engineer only spend ten seconds to figure out a way.

But if you want to optimize 100x, so maybe cost them a year or ten years or they cannot finish it. So for task, actually we think it in a broader way, so it's not let it optimize in a single like digits or numbers, but to think it as a broader topic.

For example, optimize a CUDA kernel as much as possible, whether your model can make it. So that's very important. So my understanding for task with objective goals, I think it in this way, depth means more than time. So your model, your agents needs to find meaningful improvements, needs to continuously improve itself. Here is one of our best like showcase for this idea. So we also let the model optimize a vector database.

From the beginning, it only increase it to like 6.5 ks QPS. But after 600 runs increase from 6.5 ks to 21.5 ks. There are all different strategies to optimize it. And if you understand what's going on here, so actually these strategies are completely different. So cut over or even even they use some like model training skills to optimize for a kernel or a vector database. For example, quantized routing and pruning.

So use different ways to handle different things. And an important stuff you can see here is that there are many failures. All the crosses there means failures. So to achieve a goal, you can fail actually, and you can fail 100 times. But the long horizon capability actually means that even if you continuously fail 100 times, you can figure out a way to learn from these failures, to reflect, to think about new strategies, or you use searches, use all your knowledge to solve the the problem in the end.

So here is a comparison for a CUDA kernel optimizations. So we compare Cloud Opus 4.6, GEM 5.1, Opus 4.5 and GEM five. So what long actually means is that it can goes deeper. For previous models like Opus 4.5 and GLM five, it actually stops there. So when it goes above 800 runs, it can no longer improve that much. So the progress stops.

But for OPUS 4.6, GLM 5.1 and current new OPUS, it can completely improve itself and surpass the last version of itself. So that's the key idea of long horizon. So long doesn't mean time or run, it mean whether you can exceed yourself, exceed the last version of yourself to reach the limit.

And as a model lab, we find it very hard to train such a model, because there are some misconceptions. First is that people think that a large context window makes things quite easy. But GRN 5.1 is actually a 200 ks model, But there are a lot of 1,000,000 context window model that cannot solve these questions, because currently we have harness.

To solve a problem we don't have to make that context that long, because our harness can make us remember the goal, can make us reflect. So the core idea is that whether your model can reflect and like can think like a human, can find all the flaws, can replan when things goes wrong. So all the things need to be made in a very solid way, not just pure context window.

And the second misconception is that people think that if I write a prompt and let the model plan before it act, it can solve all the questions. But frankly speaking nobody like ever achieve, right? So the model doesn't follow your instruction and they often forget all the things you let it know.

And when we want to optimize for something, it actually stopped in the very early phase and told you that I have fixed it, I have optimized it. It will stop quick quite early. So that's the second misconception. And the third misconception is the longer the stronger. So even if AI can optimize for 800 rounds, 1,000 rounds, it doesn't mean that model is more powerful.

Because today we care more about token efficiency. Why not like finish in three rounds, like instead of 800 runs. Right? So to improve the model, maybe in the future we are not letting model to optimize for so many runs, we just need to let it improve maybe in five runs or 10 runs, that's enough. So we're we're trying to make it more efficient.

So how we train the model? I think these two are very important. First to find as many realistic task as possible and to get a robust evaluations. So here's an example is called Frontier Suite. Yeah everyone knows suite, but here's a new dataset called Frontier Suite.

We have something like that. It's super interesting and I think the categories of all the all the questions are quite meaningful. So there are three type of questions or tasks. So first one is implementation. They say that they can actually put all the things into the implementation because if you want to build something is actually an implementation.

For example creating website and a database something like that. And the second type is research. So research is very important because currently people are working on AI for science. So if you want to analyze the research and use long horizon capabilities to solve research problems, you'd better look at these type of questions, how they define the task and how they evaluate.

And the third one is performance, actually stands for optimization. So there are a lot of optimizations there, people can learn from it, and with these problems you can foresee the future. So training model I think it's not that hard because you can have human labeled data, you can use synthetic data, but what's most important is whether you can find meaningful task, whether you can define the task people need and try to find the right answer for these tasks. So that's all for today's sharing and feel free to connect and talk about more research progress or like other type of services. I'm also covering services.

So here's my axe and linking and we are about to have new models coming soon, so stay tuned. That will be I think the next model like will impress the whole open source industry, so it'll be fantastic. And even if I said told you that that context window might not that be important, we will improve a lot in context size.

So still a good way to improve the long horizon capabilities. So stay tuned. Thanks all. Thanks for listening. Yeah.

Z.AI

GLM-5.1

Towards Long-Horizon Tasks

Zixuan Li

Just type z.ai into your browser

Screenshot of a web interface for an AI assistant named Z. It features a main heading "Hi, Z" and an instruction to "Interact with z.ai and explore the boundless creative world". Below this is a message input field, buttons for "Full-Stack" and "Long-running Tasks", and navigation tabs for "long-running task", "Website", and "Product". The lower part of the screen displays previews of three web pages: a "CSS Effects Library", a "Welcome to Z Shop" e-commerce site, and a gallery of various images.

GLM: General Language Model Pretraining with Autoregressive Blank Infilling

Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, Jie Tang

Founder of Moonshot AI (Kimi); Founder of Z.ai

[Submitted on 18 Mar 2021 (v1), last revised 17 Mar 2022 (this version, v2)]

GLM specializes in coding and agentic tasks

Artificial Analysis Coding Agent Index

Composite average pass@1 across SWE-Bench-Pro-Hard-AA, Terminal-Bench v2, and SWE-Atlas-QnA. Higher is better

  • 60: Codex GPT-5.5 (Medium)
  • 60: Claude Code Opus 4.7 (Medium)
  • 53: Claude Code GLM-5.1
  • 51: Claude Code Opus 4.6 (Medium)
  • 50: Claude Code Kimi K2.6
  • 50: Claude Code DeepSeek V4 Pro (High)
  • 49: Claude Code Sonnet 4.6 (Medium)
A bar chart showing the Artificial Analysis Coding Agent Index scores for various AI models. The chart compares Codex GPT-5.5 (60), Claude Code Opus 4.7 (60), Claude Code GLM-5.1 (53), Claude Code Opus 4.6 (51), Claude Code Kimi K2.6 (50), Claude Code DeepSeek V4 Pro (50), and Claude Code Sonnet 4.6 (49).

Have you heard of Long-Horizon/Running?

  • GLM-5.1
    Z.ai @Zai.org · Apr 8
    Introducing GLM-5.1: The Next Level of Open Source
    - Built for Long-Horizon Tasks: Runs autonomously for 8 hours, refining strategies through thousands of iterations.
  • Claude Opus 4.7
    Claude @claudedeai · Apr 16
    Introducing Claude Opus 4.7, our most capable Opus model yet.
    It handles long-running tasks with more rigor, follows instructions more precisely, and verifies its own outputs before reporting back.
  • Kimi K2.6
    Kimi.ai @Kimi_Moonshot · Apr 21
    Kimi K2.6 demonstrates strong long-horizon coding in complex engineering tasks:
Screenshots of social media posts (likely X/Twitter) from Z.ai, Claude, and Kimi.ai, each with their respective logos and user handles, describing features of GLM-5.1, Claude Opus 4.7, and Kimi K2.6.

"Long-Horizon" capabilities are useful

Go from finishing a single turn to finishing a project over hours or days

An illustration shows a cartoon character, shaped like the letter Z, with a thought bubble saying "Build a habit-tracker app." This character then proceeds through a timeline. The first step shows a clock labeled "hour 1" with a checkmark. The second step shows a calendar labeled "day 1" with a checkmark. The third step shows a calendar with the number 3 labeled "day 3" also with a checkmark. Following this, an "APP PROJECT" board is shown, with columns for "IDEA", "BUILD", and "TEST". Each column has a checkmark below it. Under "TEST", there is a smartphone screen displaying a "Habits" app interface. Finally, the Z character appears again, sparkling, indicating successful completion of the project.

"Long-Horizon" capabilities are useful

Can handle tasks where context must survive interruptions and replanning

A diagram illustrates a "long-horizon" task flow. A character shaped like the letter 'Z' with a smiling face is running, representing a task in progress. An arrow points from 'Z' to a 'pause' symbol, which is labeled "interruption!". From the 'pause' symbol, an arrow goes to a 'phone call' symbol, also labeled "interruption!". From the 'phone call' symbol, an arrow leads to a 'checkmark' symbol surrounded by sparkles, indicating completion. Below the main flow, a rectangular box labeled "context" with a smiling face is depicted, resembling a toaster. It has tabs on top labeled "code", "plans", "tests", and "notes". Dashed arrows point from the 'pause' symbol and the 'phone call' symbol down to the "context" box, indicating that context is stored during interruptions. A solid arrow labeled "replan" loops from the "context" box back to the point before the 'pause' symbol, suggesting that replanning based on context can restart the task. Dashed arrows also go from the "context" box to the 'pause' symbol and the 'checkmark' symbol, indicating context can be used to resume or complete the task.

The moment I realized Long-Horizon capabilities matter

In our first 48-hour hackathon:

"If your model can run for 8 hours, I need to assign all the tasks to it before I go to sleep."

A diagram illustrating a workflow. On the left, an icon of a person sleeping in a bed with "Zzz" above it. An arrow points from the text "You" towards the sleeping person. Below "You", the text "Your agents" is shown. An arrow points from "Your agents" towards the right, leading to an icon of three people sitting at a table with speech bubbles above them, representing collaboration or work.

So, what are Long-Horizon tasks?

Two types of “Long-Horizon” tasks

Subjective goal:
No single metric to optimize. What counts as “good” depends on completeness, visual polish, and interaction quality.

Objective goal:
Explicit numeric objectives, such as speed, that the model can benchmark against

Example of a subjective goal

prompt: Build a web-based Linux replica with 50+ fully functional apps.

A stylized window, possibly representing a browser or command-line interface, shows an example prompt.

Subjective goal: Replicate an OS

Cumulative coding time: 8h | 50+ app completed

A silver laptop displays a dark blue operating system interface with numerous app icons arranged in a grid.

How can humans help during the process?

  • Goal drift: Use checklists; ask it to reread the goal every few steps
  • Error accumulation: Force verification after each meaningful step
  • Inability to pivot: Ask it to evaluate whether to continue, revise, or abandon the current plan

METR's interpretation: the time needed to complete the task for humans with appropriate expertise

AI time horizons are increasing in many domains

  • Task length (at 50% success rate): 4 hrs, 1 hr, 15 min, 4 min, 1 min, 15 sec, 4 sec, 1 sec
  • Model release date: 2020, 2022, 2024, 2026

Graph lines represent: METR-HRS (Original Time Horizons), MATH, RLBench, WebArena, OSWorld, Tesla FSD, GPQA Diamond, Mock AIME, LiveCodeBench, SWE-bench Verified.

CC-BY

metr.org

A line graph titled "AI time horizons are increasing in many domains". The y-axis, labeled "Task length (at 50% success rate)", is on a logarithmic scale from 1 second to 4 hours. The x-axis, labeled "Model release date", ranges from 2019/2020 to 2026. Multiple colored lines represent different AI benchmarks or tasks, generally showing an upward trend in task length over time, indicating increasing AI capabilities. A prominent green line labeled "METR-HRS (Original Time Horizons)" shows a consistent growth trend, accompanied by a shaded confidence interval. Other notable lines include MATH, RLBench, WebArena, OSWorld, Tesla FSD, GPQA Diamond, Mock AIME, LiveCodeBench, and SWE-bench Verified, each plotted to show their progress over time relative to task length.

METR's interpretation: the time needed to complete the task for humans with appropriate expertise

FamilyLengthDescription
find_shell_script3 secondsMultiple choice: "Which file is a shell script?" Choices: "run.sh", "run.txt", "run.py", "run.md"
wikipedia_research1 minuteResearch simple factual information from Wikipedia and provide accurate answers to straightforward questions.
oxdna_simple9 minutesDetect and fix a bug in the input files for a molecular dynamics simulation using the oxDNA package.
munge_data56 minutesWrite a Python script to transform JSON data from one format to another by inferring the conversion rules from provided example files.
cuda_backtesting8 hoursSpeed up a Python backtesting tool for trade executions by implementing custom CUDA kernels while preserving all functionality, aiming for a 30x performance improvement.

Might not be ideal for tasks with objective goals

Time is not a good measurement for AI behavior

A bar chart titled "Tokens Per Second Per User" compares the performance of several hardware platforms. From left to right, the bars represent: Nvidia H200 with 230 tokens/sec, Nvidia B200 with 353 tokens/sec, Groq with 594 tokens/sec, SambaNova with 932 tokens/sec, Cerebras with 1981 tokens/sec, and Taalas HC1 with a significantly higher 16960 tokens/sec.

"Tasks" in METR are too specific

cuda_backtesting

8 hours

Highly depends on the outcome

Speed up a Python backtesting tool for trade executions by implementing custom CUDA kernels while preserving all functionality, aiming for a 30x performance improvement.

2x, 100x?

For tasks with objective goals, depth means more

Keep finding meaningful improvements

Approximate Nearest Neighbor Search Optimization

  • No improvement
  • Improved Debug Run
  • New Best QPS
  • Recall < 95%
  • Frontier

IVF Cutover

  • IVF transition from full sequence scan to cluster-based scan
  • Vector compression use FQB, reducing per-vector bandwidth from 512B to 256B

6.4k QPS

Optimizing a Vector Database

A line graph titled "Approximate Nearest Neighbor Search Optimization" shows Queries Per Second (QPS) on the Y-axis against Optimization Iteration on the X-axis. Data points are plotted and color-coded according to a legend indicating "No improvement", "Improved Debug Run", "New Best QPS", "Recall < 95%", and "Frontier". A significant increase in QPS is observed around 80-100 optimization iterations, labeled "IVF Cutover".

Approximate Nearest Neighbor Search Optimization

  • No Improvement
  • Improved Debug Run
  • New Best QPS
  • Recall < 95%
  • Frontier

IVF Cutover

  • IVF transition: from full sequence scan to cluster-based scan
  • Vector compression: use f16, reducing per-vector bandwidth from 512B to 256B

Nested Parallelism Removed

  • Parallelism redesign: per-query single-thread + outer concurrency, removing nested parallelism
  • Execution tightening: lower scheduling overhead and improved cache locality

Budget Trim

  • Candidate budget tuning: reduce Phase 1 output
  • Cost control: lower Phase 2 rerank workload

Two-stage Search

  • Two-stage pipeline: u8 prescore (coarse) + f16 rerank (accurate)
  • Candidate reduction: only a small shortlist proceeds to Phase 2

Two-level Routing

  • Hierarchical routing: introduce super-clusters for coarse-to-fine routing
  • Search space reduction: only expand top N_SUPER_PROBE=33 regions

u8 Routing + Probe

  • Quantized routing: centroid and super-centroid scoring via u8 + VNNI
  • Parameter compensation: slightly increase N_PROBE to recover recall

Early Pruning

  • Cluster pruning: skip low-quality clusters before Phase 1 scanning
  • Work elimination: avoid unnecessary vector scoring and memory access

A line graph titled "Approximate Nearest Neighbor Search Optimization" showing QPS (Queries Per Second) on the y-axis (ranging from 0 to 25,000) against Optimization Iteration on the x-axis (ranging from 0 to 600, with total iterations 655).

Data points are plotted indicating different run types: grey for no improvement, yellow for improved debug run, green for new best QPS, and red crosses for recall less than 95%. A blue line, labeled "Frontier", connects the highest QPS achieved at each stage.

Several key optimization milestones are annotated on the graph:

  • At approximately 75 iterations, "IVF Cutover" resulted in 6.4k QPS.
  • Around 170 iterations, "Nested Parallelism Removed" led to 10.4k QPS.
  • Around 250 iterations, "Two-stage Search" achieved 13.4k QPS.
  • Around 320 iterations, "Two-level Routing" reached 18.4k QPS.
  • Around 350 iterations, "Budget Trim" shows 15.5k QPS.
  • Around 470 iterations, "u8 Routing + Probe" achieved 20.3k QPS.
  • Around 570 iterations, "Early Pruning" contributed to a peak of 21.5k QPS.

The graph illustrates a continuous and significant improvement in QPS over 655 optimization iterations, reaching a maximum of 21.5k QPS.

KernelBench Level 3: Agentic ML Workload Optimization

  • Claude Opus 4.6
  • GLM-5.1
  • Claude Opus 4.5
  • GLM-5
A line graph titled "Speedup (geometric mean)" showing performance over "Tool-use Turns." The Y-axis represents speedup from 1x to 4x, and the X-axis represents tool-use turns from 0 to 1200. Four lines track the speedup for different models: Claude Opus 4.6 (green, reaching 4.2x), GLM-5.1 (blue, reaching 3.6x), Claude Opus 4.5 (brown, reaching 2.8x), and GLM-5 (pink, reaching 2.6x). An annotation "Progress stops" with arrows points to the section where the brown and pink lines flatten out around 800-900 tool-use turns. Two dashed horizontal lines are labeled "torch.compile (max-autotune) 1.49x" and "torch.compile (default) 1.15x" at the bottom of the graph.

Training is hard

Misconception 1:

A large context window makes things quite easy

Misconception 2:

An upfront comprehensive plan makes a task long-horizon capable

Misconception 3:

The longer, the stronger

How to train the model: Realistic tasks + Robust evaluations

Introducing FrontierSWE, an ultra-long horizon coding benchmark.

We test agents on some of the hardest technical tasks like optimizing a video rendering library or training a model to predict the quantum properties of molecules.

Despite having 20 hours, they rarely succeed

For Example

FrontierSWE

Benchmarking software engineering skill at the edge of human ability.

READ BLOG

Leaderboard

MODEL TASK CONFORMANCE IMPLEMENTATION PERFORMANCE DESIGN
GPT-5.4 Codex 2.08 73% 1.20 2.63 1.50
Claude Opus 4.6 Claude Code 2.17 71% 2.00 2.33 2.00
Gemini 3.1 Pro Gemini CLI 3.08 48% 3.20 2.94 3.25
Owen3.6-Plus Owen Code 3.72 32% 4.70 3.17 3.75
Kimi K2.5 Kimi CLI 3.94 20% 3.90 3.72 4.50

Screenshot of the FrontierSWE website, which features a leaderboard comparing different AI models' performance on software engineering tasks. The interface is dark-themed and includes a table with model names, task descriptions, and performance metrics for conformance, implementation, performance, and design.

Implementation

  • PostgreSQL 18 on SQLite
  • Wan 2.1 on MAX/Mojo
  • Git to Zig

Research

  • FrogsGame Post-Training
  • PCQM4Mv2 Molecular Gap Prediction
  • Optimizer Design

Performance

  • libexpat to x86-64 Assembly
  • FFmpeg libswscale Re-implementation
  • Pyright Type Checking Optimization

Follow me on X

Posts, but no profile

https://x.com/yi_teng_cai

Connect on LinkedIn

Profile, but no posts

https://www.linkedin.com/in/yitengcai/
Two QR codes are displayed. The left QR code links to an X (formerly Twitter) profile. The right QR code links to a LinkedIn profile.

People

  • Zhilin Yang

Technologies & Tools

  • Cerebras
  • Claude Code
  • DeepSeek V4
  • GLM
  • GLM 5.1
  • GPT-2
  • Groq
  • Kimi K2.6
  • KV cache
  • Opus 4.6

Standards & Specs

  • Frontier Suite
  • LiveCodeBench
  • MATH dataset
  • SWE-bench

Concepts & Methods

  • computer use
  • context window
  • CUDA kernel optimization
  • long horizon tasks
  • token efficiency
  • vector database optimization

Organisations & Products

  • Artificial Analysis
  • Kimi
  • METR
  • Moonshot AI
  • Z.ai