AgRefactor Automates HLS Code Refactoring with Self-Evolving Agents.

Yang Zou, Zijian Ding, Yizhou Sun, Jason Cong· July 1, 2026 View original

Summary

AgRefactor is a multi-agent, LLM-based workflow that automates the refactoring of software into High-Level Synthesis (HLS)-compatible programs. It uses a self-evolving memory system and integrates automated tools to improve efficiency and scalability for complex real-world benchmarks.

This paper introduces AgRefactor, an innovative multi-agent system powered by Large Language Models (LLMs) designed to automate the challenging process of refactoring software into High-Level Synthesis (HLS)-compatible code. HLS is crucial for accelerating the path from software concepts to silicon, but converting real-world software often faces hurdles due to restrictive language support and the inherent differences between software and hardware programming paradigms. Existing automated and LLM-based refactoring methods have limitations in flexibility, scalability, and computational cost. AgRefactor addresses these issues by incorporating a self-evolving memory system that continuously accumulates and retrieves both factual and strategic knowledge across various tasks, significantly enhancing its robustness and efficiency when encountering new programs. To further optimize cost and scalability, the system intelligently integrates automated refactoring tools, allowing agents to judiciously balance LLM-driven code rewrites with more efficient tool-based transformations. Evaluated on 9 out of 11 complex real-world benchmarks, which are substantially larger than those typically studied, AgRefactor demonstrated performance that either matched or surpassed state-of-the-art automated refactoring tools and strong LLM-based baselines. Furthermore, its agentic performance optimization led to a 6.51x geometric mean speedup over leading pragma tuning tools and a 1.20x speedup over optimized open-source designs, all while using less than 20% additional resources. The system is fully automated and has been open-sourced, offering a significant advancement for hardware design and optimization.

Why it matters

For hardware engineers and software developers working with FPGAs or custom silicon, AgRefactor offers a powerful tool to bridge the software-hardware gap, drastically reducing the manual effort and expertise required for HLS conversion and optimization. This can accelerate product development cycles and improve hardware performance.

How to implement this in your domain

  1. 1Download and experiment with the open-sourced AgRefactor for HLS projects.
  2. 2Integrate AgRefactor into existing hardware design workflows for automated code conversion.
  3. 3Train engineering teams on leveraging multi-agent LLM systems for hardware-software co-design.
  4. 4Benchmark AgRefactor's performance on internal, proprietary HLS conversion tasks.
  5. 5Contribute to the open-source project to tailor it to specific industry needs.

Who benefits

SemiconductorElectronics ManufacturingAutomotiveAerospaceTelecommunications

Key takeaways

  • AgRefactor automates HLS code refactoring using a multi-agent LLM workflow.
  • It features a self-evolving memory system for improved robustness and efficiency.
  • The system integrates automated tools to balance LLM rewrites with efficient transformations.
  • AgRefactor significantly outperforms or matches state-of-the-art tools on complex benchmarks.

Original post by Yang Zou, Zijian Ding, Yizhou Sun, Jason Cong

"arXiv:2606.30949v1 Announce Type: new Abstract: High-Level Synthesis (HLS) provides a fast path from concepts to silicon, but converting real-world software into synthesizable HLS code remains challenging due to restrictive language support and the gap between software and hardwa…"

View on X

Originally posted by Yang Zou, Zijian Ding, Yizhou Sun, Jason Cong on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses

More in AI Engineering & DevTools

AI ResearchAI Engineering & DevTools

Philosophical Foundations for Explainable AI in Healthcare Explored

This paper critically reviews the intersection of philosophy of science and explainable AI (XAI) in health sciences, examining what constitutes an adequate medical explanation. It identifies causality, trust, and epistemic adequacy as central axes for designing robust XAI systems in clinical decision-making.

Martina Mattioli, Marcello PelilloJul 1, 2026
AI ResearchAI Engineering & DevTools

New Metric Improves LLM Reinforcement Learning with Verifiable Rewards.

This research introduces the Relative Surprisal Index (RSI), an information-theoretic metric for adaptive token selection in Reinforcement Learning with Verifiable Rewards (RLVR) for LLMs. RSI-S, an entropy-adaptive filtering method based on RSI, improves reasoning accuracy by 2-3 percentage points by retaining tokens within a stable surprisal interval.

Outongyi Lv, Yanzhao Zheng, Yuanwei Zhang, Zhenghao Huang, Xingjun Wang, Baohua Dong, Hangcheng Zhu, Yingda ChenJul 1, 2026
AI Engineering & DevToolsAI Research

New ACE Module Boosts LLM Agent Context Management

Researchers introduce ACE (Adaptive Context Elasticizer), a plug-and-play module that dynamically manages historical information for LLM-based agents. ACE maintains a lossless message layer and adaptively orchestrates context, significantly improving performance across various agent frameworks without architectural changes.

Ning Liao, Zihao Long, Xiaoxing Wang, Xue Yang, Yaoming Wang, Ziyuan Zhuang, Xunliang Cai, Rongxiang Weng, Junchi YanJul 1, 2026