acceptodds
Under review as a conference paper at ICLR 2027

Compaction-Aware Reinforcement Learning for Ascend Triton Kernel Generation

Abstract

Automatically generating high-performance kernels with LLM-based agents promises substantial gains in development efficiency, but two obstacles remain. First, while increasing multi-turn interaction with execution environments is crucial for refining generation quality, continuous context accumulation rapidly exceeds the model's effective context window. Second, training long-horizon tasks via GRPO inherently incurs sparse rewards due to its reliance on terminal outcome evaluation, severely hindering step-level credit assignment; To address these obstacles, we propose ATRL (Ascend Triton Reinforcement Learning), a post-training method that refines GRPO into a compaction-aware, segment-level objective for long-horizon kernel generation. We also design a lightweight agent harness providing cascaded compilation, correctness, and profiling feedback, alongside an Ascend-specific knowledge base injected during agentic RL training and evaluation to compensate for the base model's missing platform expertise. Evaluations on NPUKernelBench and KernelBench, both executed on Ascend hardware, show that ATRL consistently surpasses all baselines, including GRPO, in both correctness and speedup.

Primary area:
reinforcement learning
Keywords:
Agentic RL, Kernel Generation

Reviews

Among:
Shape:
1234this paper, Bottom 25%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.75 over 4 reviews, above 25% of the others.
Reviewer_h85vOpenReview ↗
Rating
1
Confidence
3
Informativeness
3
Presentation
2
Soundness
2
Read review
Paper summary

The paper tackles two obstacles in LLM-agent-based kernel generation: (1) unbounded context growth across multi-turn edit–verify cycles, and (2) sparse terminal rewards in GRPO that make step-level credit assignment unreliable. The authors propose ATRL, which refines GRPO into a compaction-aware, segment-level objective. Three ingredients: (i) structured trajectory compaction that condenses history into a checkpoint when context grows too long and makes that checkpoint itself trainable; (ii) a mixed segment reward combining terminal task success with per-segment verifiable progress; and (iii) a task-relative segment advantage that normalizes across rollouts of the same task. A lightweight agent harness supplies a four-stage cascaded verifier (static analysis → compilation → correctness → benchmarking) and an on-demand Ascend knowledge base. Evaluations on KernelBench and NPUKernelBench (both on Ascend hardware) report that ATRL beats GRPO and other baselines on Pass@1 and most Fast@ metrics.

Critical strengths

(1) The problem is critical. Rather than optimizing python code, we should optimize agent behavior is an excellent call-out to the research community. (2) Serious verifier engineering. The cascaded, fail-fast verifier with integrity safeguards (hashing the frozen reference/inputs; AST-level rejection of placeholder kernels, torch-compute fallthrough, getattr evasion, precomputed lookup tables) directly confronts reward-hacking.

Critical weaknesses

I do not see the comparison between the proposed method to the SOTA cited in the paper: Dai et al. (2026); Du et al. (2026b);

Questions for authors

The benchmarks such as kernelbench and NPUKernelBench seem the wrong benchmark. The author should run something like SWE-bench with a model w or w/o modified kernel to show the latency advantage.

Reviewer_Y4fcOpenReview ↗
Rating
2
Confidence
3
Informativeness
1
Presentation
2
Soundness
1
Read review
Paper summary

This paper proposes ATRL, a reinforcement learning framework for long-horizon Ascend Triton kernel generation. It addresses growing interaction histories and coarse trajectory-level credit assignment by integrating structured context compaction with segment-level policy optimization. Long trajectories are divided at compaction boundaries, where the model generates checkpoints that preserve relevant execution state and support continued interaction. Checkpoint generation is included in the training objective. Each segment receives a reward combining the terminal task outcome with verifiable progress between its boundary states, and advantages are normalized across segments from rollouts of the same task. The framework also incorporates an agent harness providing compilation, correctness, and profiling feedback, together with an Ascend-specific knowledge base. Experiments using Qwen3.6-35B on KernelBench and NPUKernelBench, both evaluated on Ascend hardware, report consistent improvements in functional correctness over GRPO, while speedup gains vary across benchmark levels. Harness ablations further demonstrate the contribution of the execution framework and domain-specific guidance.

Critical strengths
  • Integrating structured context compaction into RL training is an interesting idea for managing growing interaction histories and preserving relevant state during long-horizon agent execution.

  • Combining trainable structured checkpoints with segment-level rewards offers a promising approach to context management and credit assignment in long-horizon agents.

  • The reported results show consistent improvements in functional correctness over GRPO on both KernelBench and NPUKernelBench.

Critical weaknesses
  • The task-specific motivation is insufficiently developed. The paper focuses on RL training for long-horizon agents, with targeted improvements in compaction-aware training and segment-level credit assignment. However, it provides limited background on the distinctive characteristics and challenges of Ascend Triton kernel generation. The connection between these task-specific challenges and the proposed method should be made clearer.
  • Figure 1 does not clearly convey the central learning mechanism. The figure primarily illustrates an agent interaction loop without clearly showing how trajectory-level and incremental rewards relate to the interactions and training process. The extensive detail devoted to supporting components makes the central contribution less prominent.
  • The experimental coverage and dataset suitability require clarification. Several entries in Table 1 are marked as unevaluated, but the reasons for omitting these evaluations are not provided. The paper should also explain why cuda-llm is suitable for training models to generate Ascend Triton kernels.
  • The presentation of Table 3 and the description of the harness need improvement. The font size in Table 3 is disproportionately large. The architecture and key features of the proposed harness also need to be explained more clearly.

Overall, my main concern is that the central research problem is not sufficiently well defined. The paper should clarify whether its primary objective is to address general challenges in long-horizon agent RL or challenges specific to Ascend Triton kernel generation, and explain how the proposed method addresses that objective.

Questions for authors
  1. What is the main challenges for Ascend Triton Kernel Generation task?
  2. What is the central focus of the paper? It remains unclear whether the primary goal is to improve RL training for long-horizon agents or to address challenges specific to Ascend Triton kernel generation.
  3. What is the specific contribution to Ascend kernel generation? Given that the training data are drawn from cuda-llm, which aspects of the proposed approach are specifically designed for Ascend, and how do they address the challenges of generating kernels for this platform?
  4. What advantages does the proposed lightweight harness offer? How does its design and functionality differ from existing agent harnesses such as OpenCode and Codex, and what makes it particularly suitable for this task?
Reviewer_UXckOpenReview ↗
Rating
2
Confidence
4
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper studies automatic generation of Triton kernels for Ascend NPUs. Multi-turn interaction can push the context past the window limit, and GRPO assigns a single score only at the end of a trajectory, so intermediate steps receive no supervision. The authors propose ATRL. When the context exceeds the limit, the model writes a structured checkpoint that replaces the history. Checkpoints split each trajectory into segments, and each segment's reward combines the final outcome with the net progress made within that segment. The authors also build an agent harness that includes cascaded verification and an Ascend knowledge base. Experiments on KernelBench and NPUKernelBench compare ATRL against the untuned model, SFT, Dr.Kernel, and GRPO. ATRL improves correctness, while its speedup gains vary across difficulty levels.

Critical strengths
  1. Both the harness and the verifier involve substantial engineering work, and their design is reasonable. The harness alone has a sizable effect: enabling only the harness raises the frozen model's Pass@1 on KernelBench Level 1 from 49 to 71 (Table 3a).

  2. Checkpoints are included in the training loss rather than serving only as an inference-time compression mechanism, so the model can learn how to write them. Compression is triggered only after verification, so every segment boundary falls on a state with a verification result. This gives the segment-level reward a sound basis. The approach is not specific to kernel generation.

Critical weaknesses
  1. On KernelBench, the gain from training is unclear. Comparing Table 1 with Table 3, the frozen model with the harness reaches a Pass@1 of 71 and a Fast@1 of 32 on Level 1, while full ATRL reaches 73 and 23. ATRL solves only two more problems, and its Fast@1 actually drops. The paper claims its contribution lies in the training method, yet the harness accounts for most of the performance on this benchmark, and the current data cannot isolate the effect of the segment-level reward. As it stands, the data do not support the claimed contribution of the training method.
Questions for authors

Clarifications

  1. In Table 1, GRPO reaches a Pass@1 of 66 and a Fast@1 of 26 on KernelBench Level 1. Both are lower than those of the untrained frozen model with only the harness in Table 3 (71 and 32). The same pattern holds on NPUKernelBench (9 vs. 16 on Level 1 and 6 vs. 13 on Level 2). Could the authors clarify whether GRPO, ATRL, and the harness configuration in Table 3 use the same evaluation setup? If they do, how do the authors explain GRPO performing worse after training than the untrained model? If they do not, are the comparisons among methods in Table 1 fair?

Suggestions

  1. Table 3 suggests that the harness contributes far more than training does. Would the authors consider reorganizing the paper around the harness and verifier and ablating them? For example, they could separate knowledge-base retrieval from cascaded verification feedback to show which component drives the gains.

  2. If the authors keep the training method as the main contribution, I suggest a more detailed analysis of how training improves the model. For example, they could analyze which harness capabilities are learned by the model, and report the mixed segment-reward ablation that Section 5.3 mentions but Table 3 omits.

Reviewer_xVYLOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes ATRL, a compaction-aware reinforcement learning framework for long-horizon Ascend Triton kernel generation. The method addresses two challenges in multi-turn kernel optimization: continuously growing interaction contexts and sparse credit assignment under outcome-based reinforcement learning.

ATRL introduces structured trajectory compaction to preserve important execution history through checkpoints. It further develops a segment-level policy optimization objective that combines terminal rewards with intermediate progress measured at segment boundaries. The framework also incorporates a lightweight agent harness with cascaded verification, correctness-gated optimization, and an Ascend-specific knowledge base.

Experiments on KernelBench and NPUKernelBench demonstrate substantial improvements in kernel correctness over GRPO, particularly on more challenging tasks. However, improvements in execution speedup are less consistent across benchmark levels.

Critical strengths
  1. Practical and well-motivated problem formulation. The paper addresses relevant challenges in long-horizon agentic kernel generation. Integrating structured context management with executable verification feedback is a reasonable approach to improving agent reliability. The Ascend-specific harness, including correctness-gated optimization and hardware profiling, provides a useful engineering framework for generating kernels on a less commonly studied hardware platform.
  2. Encouraging empirical improvements in kernel correctness. ATRL achieves substantial Pass@1 improvements over GRPO on challenging benchmarks. For example, on KernelBench Level 2, Pass@1 increases from 19% to 35%, while on Level 3 it increases from 2/50 to 10/50. Similar improvements are reported on NPUKernelBench. These results suggest that the overall system is effective, particularly on difficult kernel-generation tasks.
Critical weaknesses
  1. Insufficient ablation studies to establish the contribution of the proposed RL algorithm.

My main concern is that the reported improvements cannot be clearly attributed to the compaction-aware RL objective.

Although Section 5.3 explicitly mentions an ablation of the mixed segment reward, Table 3 only presents comparisons with and without the agent harness. There is no direct ablation isolating structured compaction, segment-level rewards, or task-relative segment advantages.

More importantly, Table 3 reports that the untrained Qwen3.6-35B model with the proposed harness already achieves 71% and 34% Pass@1 on KernelBench Levels 1 and 2, respectively, compared with 73% and 35% for ATRL in Table 1. Although the exact comparability of these experiments requires clarification, these results raise the possibility that much of the improvement comes from the harness rather than the proposed RL formulation.

A controlled comparison using identical harnesses, knowledge bases, and inference budgets is essential to substantiate the main algorithmic contribution.

  1. Limited empirical evidence for the claimed benefits of compaction-aware credit assignment.

The paper motivates its method through context overflow and insufficient intermediate credit assignment. However, it does not provide quantitative analysis of the proposed compaction mechanism.

In particular, the paper does not report how frequently compaction occurs, how many segments are produced per trajectory, how much context is saved, or how checkpoint generation affects execution cost and downstream performance.

This is important because, for trajectories without compaction, Equation 5 reduces to the original terminal reward, leaving no additional segment-level credit signal. The effectiveness of the proposed optimization therefore depends on how frequently meaningful segment boundaries occur.

Furthermore, although correctness improves considerably, performance optimization remains less convincing. On KernelBench Level 1, ATRL achieves lower Fast@1 and [email protected] than GRPO, while both methods obtain zero Fast@1 on Level 3. The claimed benefits for high-performance kernel generation should therefore be interpreted more cautiously.

Questions for authors

Q1. Contribution of the individual components.

Could the authors provide a controlled ablation comparing GRPO with the same agent harness and knowledge base, GRPO with structured compaction, and the full ATRL objective with mixed segment rewards?

In particular, how much improvement can be attributed specifically to the proposed segment-level credit assignment rather than the execution environment?

Q2. Effectiveness and frequency of trajectory compaction.

What fraction of training and evaluation trajectories actually trigger compaction, and how many segments are typically generated per trajectory?

Could the authors report context-token savings, compaction overhead, and performance changes with and without compaction? This evidence seems central to validating the motivation of the paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.