Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
Prompt guide
CommunityQwen3.7 Max

Qwen3.7-Max: Long-Horizon Agent Prompts and Acceptance Closed Loop for GPU Kernel Optimization

Original source

Qwen official blog & GitHub SGLang community

AuthorQwen Team

Source date2026-05-20

Tabbit curation2026-08-20

Read original

One-sentence takeaway

In long-horizon autonomous systems engineering, injecting Qwen3.7-Max with a four-stage closed-loop prompt comprising "baseline comparison, compilation profiling, test-driven iteration, and state staging," combined with a rigorous anti-reward-hacking (Anti-Reward-Hacking) verifier, enables the model to autonomously iterate for hundreds of consecutive rounds and achieve over a 10x kernel speedup.

Use cases

  • Suitable tasks: Low-level Triton / CUDA kernel performance tuning, proprietary compiler pass optimization, complex profiling (Profiling) , and automated test repair.

  • Unsuitable tasks: Open-ended code refactoring without benchmark suites (Benchmark Harness) or objective measurement metrics.

  • Applicable model versions: qwen3.7-max (must enable enable_thinking: true and preserve_thinking: true ) .

  • Applicable clients, Agents, or APIs: Custom long-horizon Agent harnesses, Qwen Code, and OpenClaw.

  • Recommended reasoning level and parameters: Thinking level set to maximum (xhigh) , strictly limit maximum output tokens per turn, and drive progress via multi-turn tool feedback.

Ready-to-use content

System-level guide prompt for long-horizon GPU kernel optimization

You are a senior GPU systems and high-performance computing (HPC) optimization expert. Your objective is to write highly optimized Triton/CUDA kernels for a given reference kernel implementation.

[Optimization Baseline and Constraints]
1. Target Kernel: Extend Attention Kernel (reference baseline: baseline_triton.py) 
2. Hardware Environment: Single-GPU isolated environment, memory-constrained, no external network access
3. Correctness First Principle: After every optimization iteration, the implementation must pass test_correctness.py (full-precision and mixed-precision absolute error < 1e-4) 
4. Strict Anti-Reward-Hacking Rules (Anti-Reward-Hacking) :
   - Hardcoding specific input shapes or tabularizing outputs for particular inputs is strictly prohibited;
   - Tampering with timing logic or accuracy thresholds in test scripts is strictly prohibited;
   - Using early return (Early Return) or no-op computations to forge speedup is strictly prohibited.

[Iteration Workflow]
Phase 1 (Baseline Measurement) : Call profile_tool to run baseline_triton.py, recording baseline latency and GPU memory bandwidth utilization;
Phase 2 (Bottleneck Analysis) : Analyze whether the workload is compute-bound (Compute-bound) or memory-bound (Memory-bound) , and propose targeted optimization hypotheses (e.g., Block Tiling, Shared Memory Bank Conflict elimination, Warp cooperation) ;
Phase 3 (Coding and Verification) : Write the new kernel file `kernel_v{N}.py`, and call the `run_verification` tool to verify numerical correctness and performance speedup;
Phase 4 (Rollback and Convergence) : If correctness verification fails or performance degrades, analyze error logs, execute a rollback, and adjust the optimization direction. If no improvement is achieved for 20 consecutive rounds, stop exploration and summarize the current optimal implementation.

Test/workflow steps

  1. Build an isolated Docker sandbox and mount the reference implementation to be optimized alongside an immutable, read-only verifier (Verifier) .

  2. Configure persistent state preservation in the Agent scaffold, appending the stdout/stderr from the previous tool invocation into the next turn's context verbatim.

  3. Inject anti-reward-hacking (Reward-Hacking Monitor) detection scripts: after each code submission from the model, intercept dead-code elimination (Dead Code Elimination) and hardcoding deception via static Abstract Syntax Tree (AST) analysis and dynamic input perturbation.

  4. Set a maximum execution budget (e.g., 500 tool calls) and a no-progress circuit breaker (e.g., automatically abort after 2 hours without speedup improvement) .

Original evidence and data

  • Official long-horizon experimental data shows: across 35 consecutive hours of autonomous optimization, Qwen3.7-Max completed a total of 1,158 tool interactions and 432 kernel evaluations, ultimately achieving a 10.0x geometric-mean speedup relative to the official Triton reference implementation.

  • During the experiment, by setting up 13 heuristic anti-reward-hacking monitoring rules, 1,618 potential cheating attempts (such as empty loops and test bypasses) were identified and intercepted, demonstrating the necessity of independent verifiers in long-horizon Agents.

Applicability boundaries

  • This prompt and workflow are heavily reliant on hardware-isolated environments and deterministic profiling tools; they must not be run directly on bare-metal production machines without sandbox protection.

  • Long-horizon autonomous iteration consumes tens of millions to hundreds of millions of tokens, requiring strict budget evaluation based on actual compute costs and business return on investment (ROI) .

Source excerpt or observation (for a compliant short quotation only)

The Qwen team summarized: "Long-horizon autonomy... 35 hours straight on a kernel optimization task — 1,000+ tool calls, zero hand-holding. The model maintains steady progress under robust verifier constraints".

Curated by Tabbit

Prompt material is summarized from public sources and Tabbit editorial notes. Check the original licensing and intended use before copying it.

Qwen3.7 Max

Use in Tabbit

Qwen3.7 Max

Related prompts

MediaQwen official blog2026-05-20

Qwen3.7-Max: Long-Horizon Agents, Frontend Prototypes, and Office Prompts

MediaAlibaba Cloud Model Studio2026-08-18

Qwen3.7-Max: Alibaba Cloud Model Studio Versions, Pricing, and Cache Configuration

CommunityReddit (r/opencodeCLI & r/QwenAI )2026-05-25

Qwen3.7-Max: OpenCode Cache Configuration and Agent Guardrails

CommunityX.com & GitHub Community2026-08-08

Qwen3.7-Max: Multi-Model Collaborative Routing Configuration for Code Reading and Review

Qwen3.7 Max

Related reviews

MediaQwen official blog2026-05-20

Qwen3.7-Max: Official Complete Benchmarks and 35-Hour Autonomous Optimization Experiment

MediaBenchLM.ai2026-05-16

Qwen3.7-Max: BenchLM Public Evidence Coverage and Speed Ledger

MediaOfox AI2026-06-02

Qwen3.7-Max vs. Qwen3.7-Plus: Cost and Quality on Three Real Tasks

MediaArtificial Analysis2026-05-20

Qwen3.7-Max: Artificial Analysis Intelligence Index, Cost, and Speed Benchmark