Grafy News
Try Grafy free

New Paper2Frame system implements research algorithms into frameworks

Researchers have introduced Paper2Frame, a system that allows AI coding agents to implement research papers directly into existing software frameworks.

Illustration for the news story: New Paper2Frame system implements research algorithms into frameworksSource: Grafy Research Lab

Researchers have developed a new framework-conditioned approach that enables AI coding agents to translate research papers into working code that fits directly into established software environments. This method, called Paper2Frame, addresses a significant bottleneck in machine learning research where existing automated tools often produce isolated, standalone code repositories that are difficult to integrate with the shared frameworks researchers actually use for evaluation.

Why is paper-to-code integration difficult?

Currently, most AI systems designed to turn research papers into code generate a completely independent repository for every new algorithm. According to the researchers Sungmin Kang, Seok-Ju Hahn, Zhengzhong Tu, and Kibaek Kim, this creates a maintenance and comparison problem. Because each generated repository has its own unique file structure, training loops, and data loading processes, it is hard for researchers to run different algorithms under the same consistent settings.

To use a shared framework, a new algorithm must be implemented by reusing existing base components and placing new, algorithm-specific behaviors at specific "extension points" without altering the framework's core code. Standard coding agents often struggle with this because they try to learn the paper and the framework simultaneously while writing code. This "direct generation" approach frequently results in the agent bypassing the framework's runner or accidentally modifying the core code, which breaks the system's integrity.

How does the Paper2Frame workflow work?

Paper2Frame solves this by decomposing the process into distinct, sequential steps. Instead of writing code immediately, the system first creates a "framework map" using a map agent. This agent reads the framework's source code to identify extension points, reusable components, and how the execution is driven. To ensure accuracy, the agent also builds a "walking skeleton," which is a minimal program that runs end-to-end to verify the map's findings.

Separately, a coding agent reads the research paper to create an algorithm description that outlines its key operations and states. The system then integrates the framework map and the algorithm description into a comprehensive plan. This plan assigns every operation and state from the paper to a specific location within the framework. Finally, the agent implements the code based on this pre-defined plan. By separating the reading of the paper from the reading of the framework, the agents can maintain high detail without losing context.

How effective is the Paper2Frame system?

To test the system, the researchers focused on the field of federated learning (FL). This field is particularly challenging because algorithms are complex, with computations and states distributed across clients, servers, and communication rounds. The researchers analyzed 861 FL papers from major machine learning venues between 2019 and 2025, noting that only a small fraction of those that released code actually built upon an actively maintained framework.

In experiments involving 12 papers and three different frameworks—APPFL, Flower, and NVIDIA FLARE—the results were significant. Using three different models, the researchers found that 94% to 100% of Paper2Frame implementations ran successfully. The implementations achieved algorithm accuracy scores between 0.92 and 0.99 and framework faithfulness scores between 0.83 and 0.89. When compared to the official reference code for seven papers, Paper2Frame's implementations remained within 3.1% of the original final accuracy.

What is FrameJudge?

To evaluate these implementations, the authors also introduced FrameJudge, an automated grading system. Unlike simple pass/fail tests, FrameJudge evaluates code based on three distinct measures: whether the code runs successfully, how accurately it implements the algorithm described in the paper, and how faithfully it adheres to the existing framework's structure.

A criteria model generates an algorithm checklist from the paper and a framework-integrity rubric from the source code. A separate grading model then inspects the generated code and its execution trace against these criteria. During validation, FrameJudge was able to detect 29 out of 30 intentionally planted defects in otherwise correct implementations, demonstrating its ability to provide reliable, high-granularity feedback on agent-generated code.

Applying these concepts in Grafy

While Paper2Frame is a specialized research framework, the underlying principle of using agents to bridge the gap between complex documentation and executable code is central to modern development workflows. For developers looking to experiment with complex code structures or integrate different logic modules, Grafy Code provides an AI coding studio environment designed to handle package installation and code execution. Researchers can use such environments to test how different algorithmic logic might interact with existing libraries or to prototype the "walking skeletons" described in the Paper2Frame methodology.

Frequently asked questions

What problem does Paper2Frame solve?

Paper2Frame solves the problem of AI agents generating standalone code that cannot be easily integrated into existing research frameworks. It prevents agents from creating redundant training loops or accidentally modifying core framework code by using an explicit planning stage that maps algorithm components to specific framework extension points before any code is written.

How does FrameJudge evaluate code?

FrameJudge evaluates code using three separate metrics: run success, algorithm accuracy, and framework faithfulness. It uses a criteria model to build checklists from the research paper and the framework source, and then a grading model checks the code and its execution traces against those specific rules to ensure the implementation is both correct and well-integrated.

What was the accuracy of Paper2Frame compared to official code?

In experimental tests, the implementations produced by Paper2Frame were highly accurate, reaching a final accuracy within 3.1% of the official reference code. This demonstrates that the system can successfully replicate the results of published research algorithms while correctly adhering to the architectural requirements of established software frameworks.


Source: Grafy Research Lab — Paper2Frame: Framework-Conditioned Paper-to-Code Generation with Coding Agents